/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
!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(e,t){"use strict";var i=[],n=Object.getPrototypeOf,o=i.slice,a=i.flat?function(e){return i.flat.call(e)}:function(e){return i.concat.apply([],e)},s=i.push,r=i.indexOf,l={},c=l.toString,d=l.hasOwnProperty,u=d.toString,p=u.call(Object),h={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},g=function(e){return null!=e&&e===e.window},v=e.document,f={type:!0,src:!0,nonce:!0,noModule:!0};function C(e,t,i){var n,o,a=(i=i||v).createElement("script");if(a.text=e,t)for(n in f)(o=t[n]||t.getAttribute&&t.getAttribute(n))&&a.setAttribute(n,o);i.head.appendChild(a).parentNode.removeChild(a)}function S(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var y="3.6.0",b=function(e,t){return new b.fn.init(e,t)};function k(e){var t=!!e&&"length"in e&&e.length,i=S(e);return!m(e)&&!g(e)&&("array"===i||0===t||"number"==typeof t&&0<t&&t-1 in e)}b.fn=b.prototype={jquery:y,constructor:b,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return b.each(this,e)},map:function(e){return this.pushStack(b.map(this,function(t,i){return e.call(t,i,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(b.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(b.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(0<=i&&i<t?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:i.sort,splice:i.splice},b.extend=b.fn.extend=function(){var e,t,i,n,o,a,s=arguments[0]||{},r=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[r]||{},r++),"object"==typeof s||m(s)||(s={}),r===l&&(s=this,r--);r<l;r++)if(null!=(e=arguments[r]))for(t in e)n=e[t],"__proto__"!==t&&s!==n&&(c&&n&&(b.isPlainObject(n)||(o=Array.isArray(n)))?(i=s[t],a=o&&!Array.isArray(i)?[]:o||b.isPlainObject(i)?i:{},o=!1,s[t]=b.extend(c,a,n)):void 0!==n&&(s[t]=n));return s},b.extend({expando:"jQuery"+(y+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,i;return!(!e||"[object Object]"!==c.call(e)||(t=n(e))&&("function"!=typeof(i=d.call(t,"constructor")&&t.constructor)||u.call(i)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,i){C(e,{nonce:t&&t.nonce},i)},each:function(e,t){var i,n=0;if(k(e))for(i=e.length;n<i&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e},makeArray:function(e,t){var i=t||[];return null!=e&&(k(Object(e))?b.merge(i,"string"==typeof e?[e]:e):s.call(i,e)),i},inArray:function(e,t,i){return null==t?-1:r.call(t,e,i)},merge:function(e,t){for(var i=+t.length,n=0,o=e.length;n<i;n++)e[o++]=t[n];return e.length=o,e},grep:function(e,t,i){for(var n=[],o=0,a=e.length,s=!i;o<a;o++)!t(e[o],o)!==s&&n.push(e[o]);return n},map:function(e,t,i){var n,o,s=0,r=[];if(k(e))for(n=e.length;s<n;s++)null!=(o=t(e[s],s,i))&&r.push(o);else for(s in e)null!=(o=t(e[s],s,i))&&r.push(o);return a(r)},guid:1,support:h}),"function"==typeof Symbol&&(b.fn[Symbol.iterator]=i[Symbol.iterator]),b.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});var _=function(e){var t,i,n,o,a,s,r,l,c,d,u,p,h,m,g,v,f,C,S,y="sizzle"+1*new Date,b=e.document,k=0,_=0,D=le(),I=le(),w=le(),P=le(),A=function(e,t){return e===t&&(u=!0),0},T={}.hasOwnProperty,x=[],F=x.pop,$=x.push,O=x.push,M=x.slice,B=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},E="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",N="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",U="\\["+L+"*("+N+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",R=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",W=new RegExp(L+"+","g"),G=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),V=new RegExp("^"+L+"*,"+L+"*"),H=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),j=new RegExp(L+"|>"),Y=new RegExp(R),q=new RegExp("^"+N+"$"),z={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+E+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,Z=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),ie=function(e,t){var i="0x"+e.slice(1)-65536;return t||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},ne=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ae=function(){p()},se=ye(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{O.apply(x=M.call(b.childNodes),b.childNodes),x[b.childNodes.length].nodeType}catch(t){O={apply:x.length?function(e,t){$.apply(e,M.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}function re(e,t,n,o){var a,r,c,d,u,m,f,C=t&&t.ownerDocument,b=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==b&&9!==b&&11!==b)return n;if(!o&&(p(t),t=t||h,g)){if(11!==b&&(u=K.exec(e)))if(a=u[1]){if(9===b){if(!(c=t.getElementById(a)))return n;if(c.id===a)return n.push(c),n}else if(C&&(c=C.getElementById(a))&&S(t,c)&&c.id===a)return n.push(c),n}else{if(u[2])return O.apply(n,t.getElementsByTagName(e)),n;if((a=u[3])&&i.getElementsByClassName&&t.getElementsByClassName)return O.apply(n,t.getElementsByClassName(a)),n}if(i.qsa&&!P[e+" "]&&(!v||!v.test(e))&&(1!==b||"object"!==t.nodeName.toLowerCase())){if(f=e,C=t,1===b&&(j.test(e)||H.test(e))){for((C=ee.test(e)&&fe(t.parentNode)||t)===t&&i.scope||((d=t.getAttribute("id"))?d=d.replace(ne,oe):t.setAttribute("id",d=y)),r=(m=s(e)).length;r--;)m[r]=(d?"#"+d:":scope")+" "+Se(m[r]);f=m.join(",")}try{return O.apply(n,C.querySelectorAll(f)),n}catch(t){P(e,!0)}finally{d===y&&t.removeAttribute("id")}}}return l(e.replace(G,"$1"),t,n,o)}function le(){var e=[];return function t(i,o){return e.push(i+" ")>n.cacheLength&&delete t[e.shift()],t[i+" "]=o}}function ce(e){return e[y]=!0,e}function de(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var i=e.split("|"),o=i.length;o--;)n.attrHandle[i[o]]=t}function pe(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function he(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function me(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&se(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return ce(function(t){return t=+t,ce(function(i,n){for(var o,a=e([],i.length,t),s=a.length;s--;)i[o=a[s]]&&(i[o]=!(n[o]=i[o]))})})}function fe(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in i=re.support={},a=re.isXML=function(e){var t=e&&e.namespaceURI,i=e&&(e.ownerDocument||e).documentElement;return!X.test(t||i&&i.nodeName||"HTML")},p=re.setDocument=function(e){var t,o,s=e?e.ownerDocument||e:b;return s!=h&&9===s.nodeType&&s.documentElement&&(m=(h=s).documentElement,g=!a(h),b!=h&&(o=h.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ae,!1):o.attachEvent&&o.attachEvent("onunload",ae)),i.scope=de(function(e){return m.appendChild(e).appendChild(h.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),i.attributes=de(function(e){return e.className="i",!e.getAttribute("className")}),i.getElementsByTagName=de(function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length}),i.getElementsByClassName=Q.test(h.getElementsByClassName),i.getById=de(function(e){return m.appendChild(e).id=y,!h.getElementsByName||!h.getElementsByName(y).length}),i.getById?(n.filter.ID=function(e){var t=e.replace(te,ie);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var i=t.getElementById(e);return i?[i]:[]}}):(n.filter.ID=function(e){var t=e.replace(te,ie);return function(e){var i=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var i,n,o,a=t.getElementById(e);if(a){if((i=a.getAttributeNode("id"))&&i.value===e)return[a];for(o=t.getElementsByName(e),n=0;a=o[n++];)if((i=a.getAttributeNode("id"))&&i.value===e)return[a]}return[]}}),n.find.TAG=i.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):i.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,n=[],o=0,a=t.getElementsByTagName(e);if("*"===e){for(;i=a[o++];)1===i.nodeType&&n.push(i);return n}return a},n.find.CLASS=i.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},f=[],v=[],(i.qsa=Q.test(h.querySelectorAll))&&(de(function(e){var t;m.appendChild(e).innerHTML="<a id='"+y+"'></a><select id='"+y+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+L+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+L+"*(?:value|"+E+")"),e.querySelectorAll("[id~="+y+"-]").length||v.push("~="),(t=h.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+y+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),de(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+L+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),m.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(i.matchesSelector=Q.test(C=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&de(function(e){i.disconnectedMatch=C.call(e,"*"),C.call(e,"[s!='']:x"),f.push("!=",R)}),v=v.length&&new RegExp(v.join("|")),f=f.length&&new RegExp(f.join("|")),t=Q.test(m.compareDocumentPosition),S=t||Q.test(m.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!i.sortDetached&&t.compareDocumentPosition(e)===n?e==h||e.ownerDocument==b&&S(b,e)?-1:t==h||t.ownerDocument==b&&S(b,t)?1:d?B(d,e)-B(d,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var i,n=0,o=e.parentNode,a=t.parentNode,s=[e],r=[t];if(!o||!a)return e==h?-1:t==h?1:o?-1:a?1:d?B(d,e)-B(d,t):0;if(o===a)return pe(e,t);for(i=e;i=i.parentNode;)s.unshift(i);for(i=t;i=i.parentNode;)r.unshift(i);for(;s[n]===r[n];)n++;return n?pe(s[n],r[n]):s[n]==b?-1:r[n]==b?1:0}),h},re.matches=function(e,t){return re(e,null,null,t)},re.matchesSelector=function(e,t){if(p(e),i.matchesSelector&&g&&!P[t+" "]&&(!f||!f.test(t))&&(!v||!v.test(t)))try{var n=C.call(e,t);if(n||i.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){P(t,!0)}return 0<re(t,h,null,[e]).length},re.contains=function(e,t){return(e.ownerDocument||e)!=h&&p(e),S(e,t)},re.attr=function(e,t){(e.ownerDocument||e)!=h&&p(e);var o=n.attrHandle[t.toLowerCase()],a=o&&T.call(n.attrHandle,t.toLowerCase())?o(e,t,!g):void 0;return void 0!==a?a:i.attributes||!g?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},re.escape=function(e){return(e+"").replace(ne,oe)},re.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},re.uniqueSort=function(e){var t,n=[],o=0,a=0;if(u=!i.detectDuplicates,d=!i.sortStable&&e.slice(0),e.sort(A),u){for(;t=e[a++];)t===e[a]&&(o=n.push(a));for(;o--;)e.splice(n[o],1)}return d=null,e},o=re.getText=function(e){var t,i="",n=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=o(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[n++];)i+=o(t);return i},(n=re.selectors={cacheLength:50,createPseudo:ce,match:z,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(te,ie),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ie),"~="===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]||re.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]&&re.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return z.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&Y.test(i)&&(t=s(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ie).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=D[e+" "];return t||(t=new RegExp("(^|"+L+")"+e+"("+L+"|$)"))&&D(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,i){return function(n){var o=re.attr(n,e);return null==o?"!="===t:!t||(o+="","="===t?o===i:"!="===t?o!==i:"^="===t?i&&0===o.indexOf(i):"*="===t?i&&-1<o.indexOf(i):"$="===t?i&&o.slice(-i.length)===i:"~="===t?-1<(" "+o.replace(W," ")+" ").indexOf(i):"|="===t&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,i,n,o){var a="nth"!==e.slice(0,3),s="last"!==e.slice(-4),r="of-type"===t;return 1===n&&0===o?function(e){return!!e.parentNode}:function(t,i,l){var c,d,u,p,h,m,g=a!==s?"nextSibling":"previousSibling",v=t.parentNode,f=r&&t.nodeName.toLowerCase(),C=!l&&!r,S=!1;if(v){if(a){for(;g;){for(p=t;p=p[g];)if(r?p.nodeName.toLowerCase()===f:1===p.nodeType)return!1;m=g="only"===e&&!m&&"nextSibling"}return!0}if(m=[s?v.firstChild:v.lastChild],s&&C){for(S=(h=(c=(d=(u=(p=v)[y]||(p[y]={}))[p.uniqueID]||(u[p.uniqueID]={}))[e]||[])[0]===k&&c[1])&&c[2],p=h&&v.childNodes[h];p=++h&&p&&p[g]||(S=h=0)||m.pop();)if(1===p.nodeType&&++S&&p===t){d[e]=[k,h,S];break}}else if(C&&(S=h=(c=(d=(u=(p=t)[y]||(p[y]={}))[p.uniqueID]||(u[p.uniqueID]={}))[e]||[])[0]===k&&c[1]),!1===S)for(;(p=++h&&p&&p[g]||(S=h=0)||m.pop())&&((r?p.nodeName.toLowerCase()!==f:1!==p.nodeType)||!++S||(C&&((d=(u=p[y]||(p[y]={}))[p.uniqueID]||(u[p.uniqueID]={}))[e]=[k,S]),p!==t)););return(S-=o)===n||S%n==0&&0<=S/n}}},PSEUDO:function(e,t){var i,o=n.pseudos[e]||n.setFilters[e.toLowerCase()]||re.error("unsupported pseudo: "+e);return o[y]?o(t):1<o.length?(i=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?ce(function(e,i){for(var n,a=o(e,t),s=a.length;s--;)e[n=B(e,a[s])]=!(i[n]=a[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:ce(function(e){var t=[],i=[],n=r(e.replace(G,"$1"));return n[y]?ce(function(e,t,i,o){for(var a,s=n(e,null,o,[]),r=e.length;r--;)(a=s[r])&&(e[r]=!(t[r]=a))}):function(e,o,a){return t[0]=e,n(t,null,a,i),t[0]=null,!i.pop()}}),has:ce(function(e){return function(t){return 0<re(e,t).length}}),contains:ce(function(e){return e=e.replace(te,ie),function(t){return-1<(t.textContent||o(t)).indexOf(e)}}),lang:ce(function(e){return q.test(e||"")||re.error("unsupported lang: "+e),e=e.replace(te,ie).toLowerCase(),function(t){var i;do{if(i=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!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!n.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,i){return[i<0?i+t:i]}),even:ve(function(e,t){for(var i=0;i<t;i+=2)e.push(i);return e}),odd:ve(function(e,t){for(var i=1;i<t;i+=2)e.push(i);return e}),lt:ve(function(e,t,i){for(var n=i<0?i+t:t<i?t:i;0<=--n;)e.push(n);return e}),gt:ve(function(e,t,i){for(var n=i<0?i+t:i;++n<t;)e.push(n);return e})}}).pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[t]=he(t);for(t in{submit:!0,reset:!0})n.pseudos[t]=me(t);function Ce(){}function Se(e){for(var t=0,i=e.length,n="";t<i;t++)n+=e[t].value;return n}function ye(e,t,i){var n=t.dir,o=t.next,a=o||n,s=i&&"parentNode"===a,r=_++;return t.first?function(t,i,o){for(;t=t[n];)if(1===t.nodeType||s)return e(t,i,o);return!1}:function(t,i,l){var c,d,u,p=[k,r];if(l){for(;t=t[n];)if((1===t.nodeType||s)&&e(t,i,l))return!0}else for(;t=t[n];)if(1===t.nodeType||s)if(d=(u=t[y]||(t[y]={}))[t.uniqueID]||(u[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[n]||t;else{if((c=d[a])&&c[0]===k&&c[1]===r)return p[2]=c[2];if((d[a]=p)[2]=e(t,i,l))return!0}return!1}}function be(e){return 1<e.length?function(t,i,n){for(var o=e.length;o--;)if(!e[o](t,i,n))return!1;return!0}:e[0]}function ke(e,t,i,n,o){for(var a,s=[],r=0,l=e.length,c=null!=t;r<l;r++)(a=e[r])&&(i&&!i(a,n,o)||(s.push(a),c&&t.push(r)));return s}function _e(e,t,i,n,o,a){return n&&!n[y]&&(n=_e(n)),o&&!o[y]&&(o=_e(o,a)),ce(function(a,s,r,l){var c,d,u,p=[],h=[],m=s.length,g=a||function(e,t,i){for(var n=0,o=t.length;n<o;n++)re(e,t[n],i);return i}(t||"*",r.nodeType?[r]:r,[]),v=!e||!a&&t?g:ke(g,p,e,r,l),f=i?o||(a?e:m||n)?[]:s:v;if(i&&i(v,f,r,l),n)for(c=ke(f,h),n(c,[],r,l),d=c.length;d--;)(u=c[d])&&(f[h[d]]=!(v[h[d]]=u));if(a){if(o||e){if(o){for(c=[],d=f.length;d--;)(u=f[d])&&c.push(v[d]=u);o(null,f=[],c,l)}for(d=f.length;d--;)(u=f[d])&&-1<(c=o?B(a,u):p[d])&&(a[c]=!(s[c]=u))}}else f=ke(f===s?f.splice(m,f.length):f),o?o(null,s,f,l):O.apply(s,f)})}function De(e){for(var t,i,o,a=e.length,s=n.relative[e[0].type],r=s||n.relative[" "],l=s?1:0,d=ye(function(e){return e===t},r,!0),u=ye(function(e){return-1<B(t,e)},r,!0),p=[function(e,i,n){var o=!s&&(n||i!==c)||((t=i).nodeType?d(e,i,n):u(e,i,n));return t=null,o}];l<a;l++)if(i=n.relative[e[l].type])p=[ye(be(p),i)];else{if((i=n.filter[e[l].type].apply(null,e[l].matches))[y]){for(o=++l;o<a&&!n.relative[e[o].type];o++);return _e(1<l&&be(p),1<l&&Se(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(G,"$1"),i,l<o&&De(e.slice(l,o)),o<a&&De(e=e.slice(o)),o<a&&Se(e))}p.push(i)}return be(p)}return Ce.prototype=n.filters=n.pseudos,n.setFilters=new Ce,s=re.tokenize=function(e,t){var i,o,a,s,r,l,c,d=I[e+" "];if(d)return t?0:d.slice(0);for(r=e,l=[],c=n.preFilter;r;){for(s in i&&!(o=V.exec(r))||(o&&(r=r.slice(o[0].length)||r),l.push(a=[])),i=!1,(o=H.exec(r))&&(i=o.shift(),a.push({value:i,type:o[0].replace(G," ")}),r=r.slice(i.length)),n.filter)!(o=z[s].exec(r))||c[s]&&!(o=c[s](o))||(i=o.shift(),a.push({value:i,type:s,matches:o}),r=r.slice(i.length));if(!i)break}return t?r.length:r?re.error(e):I(e,l).slice(0)},r=re.compile=function(e,t){var i,o,a,r,l,d,u=[],m=[],v=w[e+" "];if(!v){for(t||(t=s(e)),i=t.length;i--;)(v=De(t[i]))[y]?u.push(v):m.push(v);(v=w(e,(o=m,r=0<(a=u).length,l=0<o.length,d=function(e,t,i,s,d){var u,m,v,f=0,C="0",S=e&&[],y=[],b=c,_=e||l&&n.find.TAG("*",d),D=k+=null==b?1:Math.random()||.1,I=_.length;for(d&&(c=t==h||t||d);C!==I&&null!=(u=_[C]);C++){if(l&&u){for(m=0,t||u.ownerDocument==h||(p(u),i=!g);v=o[m++];)if(v(u,t||h,i)){s.push(u);break}d&&(k=D)}r&&((u=!v&&u)&&f--,e&&S.push(u))}if(f+=C,r&&C!==f){for(m=0;v=a[m++];)v(S,y,t,i);if(e){if(0<f)for(;C--;)S[C]||y[C]||(y[C]=F.call(s));y=ke(y)}O.apply(s,y),d&&!e&&0<y.length&&1<f+a.length&&re.uniqueSort(s)}return d&&(k=D,c=b),S},r?ce(d):d))).selector=e}return v},l=re.select=function(e,t,i,o){var a,l,c,d,u,p="function"==typeof e&&e,h=!o&&s(e=p.selector||e);if(i=i||[],1===h.length){if(2<(l=h[0]=h[0].slice(0)).length&&"ID"===(c=l[0]).type&&9===t.nodeType&&g&&n.relative[l[1].type]){if(!(t=(n.find.ID(c.matches[0].replace(te,ie),t)||[])[0]))return i;p&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(a=z.needsContext.test(e)?0:l.length;a--&&(c=l[a],!n.relative[d=c.type]);)if((u=n.find[d])&&(o=u(c.matches[0].replace(te,ie),ee.test(l[0].type)&&fe(t.parentNode)||t))){if(l.splice(a,1),!(e=o.length&&Se(l)))return O.apply(i,o),i;break}}return(p||r(e,h))(o,t,!g,i,!t||ee.test(e)&&fe(t.parentNode)||t),i},i.sortStable=y.split("").sort(A).join("")===y,i.detectDuplicates=!!u,p(),i.sortDetached=de(function(e){return 1&e.compareDocumentPosition(h.createElement("fieldset"))}),de(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ue("type|href|height|width",function(e,t,i){if(!i)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),i.attributes&&de(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ue("value",function(e,t,i){if(!i&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),de(function(e){return null==e.getAttribute("disabled")})||ue(E,function(e,t,i){var n;if(!i)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),re}(e);b.find=_,b.expr=_.selectors,b.expr[":"]=b.expr.pseudos,b.uniqueSort=b.unique=_.uniqueSort,b.text=_.getText,b.isXMLDoc=_.isXML,b.contains=_.contains,b.escapeSelector=_.escape;var D=function(e,t,i){for(var n=[],o=void 0!==i;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&b(e).is(i))break;n.push(e)}return n},I=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},w=b.expr.match.needsContext;function P(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,t,i){return m(t)?b.grep(e,function(e,n){return!!t.call(e,n,e)!==i}):t.nodeType?b.grep(e,function(e){return e===t!==i}):"string"!=typeof t?b.grep(e,function(e){return-1<r.call(t,e)!==i}):b.filter(t,e,i)}b.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?b.find.matchesSelector(n,e)?[n]:[]:b.find.matches(e,b.grep(t,function(e){return 1===e.nodeType}))},b.fn.extend({find:function(e){var t,i,n=this.length,o=this;if("string"!=typeof e)return this.pushStack(b(e).filter(function(){for(t=0;t<n;t++)if(b.contains(o[t],this))return!0}));for(i=this.pushStack([]),t=0;t<n;t++)b.find(e,o[t],i);return 1<n?b.uniqueSort(i):i},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&&w.test(e)?b(e):e||[],!1).length}});var x,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(b.fn.init=function(e,t,i){var n,o;if(!e)return this;if(i=i||x,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:F.exec(e))||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof b?t[0]:t,b.merge(this,b.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),A.test(n[1])&&b.isPlainObject(t))for(n in t)m(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(o=v.getElementById(n[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==i.ready?i.ready(e):e(b):b.makeArray(e,this)}).prototype=b.fn,x=b(v);var $=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function M(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}b.fn.extend({has:function(e){var t=b(e,this),i=t.length;return this.filter(function(){for(var e=0;e<i;e++)if(b.contains(this,t[e]))return!0})},closest:function(e,t){var i,n=0,o=this.length,a=[],s="string"!=typeof e&&b(e);if(!w.test(e))for(;n<o;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(s?-1<s.index(i):1===i.nodeType&&b.find.matchesSelector(i,e))){a.push(i);break}return this.pushStack(1<a.length?b.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?r.call(b(e),this[0]):r.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(b.uniqueSort(b.merge(this.get(),b(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.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,i){return D(e,"parentNode",i)},next:function(e){return M(e,"nextSibling")},prev:function(e){return M(e,"previousSibling")},nextAll:function(e){return D(e,"nextSibling")},prevAll:function(e){return D(e,"previousSibling")},nextUntil:function(e,t,i){return D(e,"nextSibling",i)},prevUntil:function(e,t,i){return D(e,"previousSibling",i)},siblings:function(e){return I((e.parentNode||{}).firstChild,e)},children:function(e){return I(e.firstChild)},contents:function(e){return null!=e.contentDocument&&n(e.contentDocument)?e.contentDocument:(P(e,"template")&&(e=e.content||e),b.merge([],e.childNodes))}},function(e,t){b.fn[e]=function(i,n){var o=b.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(o=b.filter(n,o)),1<this.length&&(O[e]||b.uniqueSort(o),$.test(e)&&o.reverse()),this.pushStack(o)}});var B=/[^\x20\t\r\n\f]+/g;function E(e){return e}function L(e){throw e}function N(e,t,i,n){var o;try{e&&m(o=e.promise)?o.call(e).done(t).fail(i):e&&m(o=e.then)?o.call(e,t,i):t.apply(void 0,[e].slice(n))}catch(e){i.apply(void 0,[e])}}b.Callbacks=function(e){var t,i;e="string"==typeof e?(t=e,i={},b.each(t.match(B)||[],function(e,t){i[t]=!0}),i):b.extend({},e);var n,o,a,s,r=[],l=[],c=-1,d=function(){for(s=s||e.once,a=n=!0;l.length;c=-1)for(o=l.shift();++c<r.length;)!1===r[c].apply(o[0],o[1])&&e.stopOnFalse&&(c=r.length,o=!1);e.memory||(o=!1),n=!1,s&&(r=o?[]:"")},u={add:function(){return r&&(o&&!n&&(c=r.length-1,l.push(o)),function t(i){b.each(i,function(i,n){m(n)?e.unique&&u.has(n)||r.push(n):n&&n.length&&"string"!==S(n)&&t(n)})}(arguments),o&&!n&&d()),this},remove:function(){return b.each(arguments,function(e,t){for(var i;-1<(i=b.inArray(t,r,i));)r.splice(i,1),i<=c&&c--}),this},has:function(e){return e?-1<b.inArray(e,r):0<r.length},empty:function(){return r&&(r=[]),this},disable:function(){return s=l=[],r=o="",this},disabled:function(){return!r},lock:function(){return s=l=[],o||n||(r=o=""),this},locked:function(){return!!s},fireWith:function(e,t){return s||(t=[e,(t=t||[]).slice?t.slice():t],l.push(t),n||d()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!a}};return u},b.extend({Deferred:function(t){var i=[["notify","progress",b.Callbacks("memory"),b.Callbacks("memory"),2],["resolve","done",b.Callbacks("once memory"),b.Callbacks("once memory"),0,"resolved"],["reject","fail",b.Callbacks("once memory"),b.Callbacks("once memory"),1,"rejected"]],n="pending",o={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return b.Deferred(function(t){b.each(i,function(i,n){var o=m(e[n[4]])&&e[n[4]];a[n[1]](function(){var e=o&&o.apply(this,arguments);e&&m(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[n[0]+"With"](this,o?[e]:arguments)})}),e=null}).promise()},then:function(t,n,o){var a=0;function s(t,i,n,o){return function(){var r=this,l=arguments,c=function(){var e,c;if(!(t<a)){if((e=n.apply(r,l))===i.promise())throw new TypeError("Thenable self-resolution");c=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(c)?o?c.call(e,s(a,i,E,o),s(a,i,L,o)):(a++,c.call(e,s(a,i,E,o),s(a,i,L,o),s(a,i,E,i.notifyWith))):(n!==E&&(r=void 0,l=[e]),(o||i.resolveWith)(r,l))}},d=o?c:function(){try{c()}catch(e){b.Deferred.exceptionHook&&b.Deferred.exceptionHook(e,d.stackTrace),a<=t+1&&(n!==L&&(r=void 0,l=[e]),i.rejectWith(r,l))}};t?d():(b.Deferred.getStackHook&&(d.stackTrace=b.Deferred.getStackHook()),e.setTimeout(d))}}return b.Deferred(function(e){i[0][3].add(s(0,e,m(o)?o:E,e.notifyWith)),i[1][3].add(s(0,e,m(t)?t:E)),i[2][3].add(s(0,e,m(n)?n:L))}).promise()},promise:function(e){return null!=e?b.extend(e,o):o}},a={};return b.each(i,function(e,t){var s=t[2],r=t[5];o[t[1]]=s.add,r&&s.add(function(){n=r},i[3-e][2].disable,i[3-e][3].disable,i[0][2].lock,i[0][3].lock),s.add(t[3].fire),a[t[0]]=function(){return a[t[0]+"With"](this===a?void 0:this,arguments),this},a[t[0]+"With"]=s.fireWith}),o.promise(a),t&&t.call(a,a),a},when:function(e){var t=arguments.length,i=t,n=Array(i),a=o.call(arguments),s=b.Deferred(),r=function(e){return function(i){n[e]=this,a[e]=1<arguments.length?o.call(arguments):i,--t||s.resolveWith(n,a)}};if(t<=1&&(N(e,s.done(r(i)).resolve,s.reject,!t),"pending"===s.state()||m(a[i]&&a[i].then)))return s.then();for(;i--;)N(a[i],r(i),s.reject);return s.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;b.Deferred.exceptionHook=function(t,i){e.console&&e.console.warn&&t&&U.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,i)},b.readyException=function(t){e.setTimeout(function(){throw t})};var R=b.Deferred();function W(){v.removeEventListener("DOMContentLoaded",W),e.removeEventListener("load",W),b.ready()}b.fn.ready=function(e){return R.then(e).catch(function(e){b.readyException(e)}),this},b.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--b.readyWait:b.isReady)||(b.isReady=!0)!==e&&0<--b.readyWait||R.resolveWith(v,[b])}}),b.ready.then=R.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?e.setTimeout(b.ready):(v.addEventListener("DOMContentLoaded",W),e.addEventListener("load",W));var G=function(e,t,i,n,o,a,s){var r=0,l=e.length,c=null==i;if("object"===S(i))for(r in o=!0,i)G(e,t,r,i[r],!0,a,s);else if(void 0!==n&&(o=!0,m(n)||(s=!0),c&&(s?(t.call(e,n),t=null):(c=t,t=function(e,t,i){return c.call(b(e),i)})),t))for(;r<l;r++)t(e[r],i,s?n:n.call(e[r],r,t(e[r],i)));return o?e:c?t.call(e):l?t(e[0],i):a},V=/^-ms-/,H=/-([a-z])/g;function j(e,t){return t.toUpperCase()}function Y(e){return e.replace(V,"ms-").replace(H,j)}var q=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function z(){this.expando=b.expando+z.uid++}z.uid=1,z.prototype={cache:function(e){var t=e[this.expando];return t||(t={},q(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,i){var n,o=this.cache(e);if("string"==typeof t)o[Y(t)]=i;else for(n in t)o[Y(n)]=t[n];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][Y(t)]},access:function(e,t,i){return void 0===t||t&&"string"==typeof t&&void 0===i?this.get(e,t):(this.set(e,t,i),void 0!==i?i:t)},remove:function(e,t){var i,n=e[this.expando];if(void 0!==n){if(void 0!==t){i=(t=Array.isArray(t)?t.map(Y):(t=Y(t))in n?[t]:t.match(B)||[]).length;for(;i--;)delete n[t[i]]}(void 0===t||b.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!b.isEmptyObject(t)}};var X=new z,Z=new z,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;function K(e,t,i){var n,o;if(void 0===i&&1===e.nodeType)if(n="data-"+t.replace(Q,"-$&").toLowerCase(),"string"==typeof(i=e.getAttribute(n))){try{i="true"===(o=i)||"false"!==o&&("null"===o?null:o===+o+""?+o:J.test(o)?JSON.parse(o):o)}catch(e){}Z.set(e,t,i)}else i=void 0;return i}b.extend({hasData:function(e){return Z.hasData(e)||X.hasData(e)},data:function(e,t,i){return Z.access(e,t,i)},removeData:function(e,t){Z.remove(e,t)},_data:function(e,t,i){return X.access(e,t,i)},_removeData:function(e,t){X.remove(e,t)}}),b.fn.extend({data:function(e,t){var i,n,o,a=this[0],s=a&&a.attributes;if(void 0===e){if(this.length&&(o=Z.get(a),1===a.nodeType&&!X.get(a,"hasDataAttrs"))){for(i=s.length;i--;)s[i]&&0===(n=s[i].name).indexOf("data-")&&(n=Y(n.slice(5)),K(a,n,o[n]));X.set(a,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each(function(){Z.set(this,e)}):G(this,function(t){var i;if(a&&void 0===t)return void 0!==(i=Z.get(a,e))||void 0!==(i=K(a,e))?i:void 0;this.each(function(){Z.set(this,e,t)})},null,t,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Z.remove(this,e)})}}),b.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=X.get(e,t),i&&(!n||Array.isArray(i)?n=X.access(e,t,b.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=b.queue(e,t),n=i.length,o=i.shift(),a=b._queueHooks(e,t);"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===t&&i.unshift("inprogress"),delete a.stop,o.call(e,function(){b.dequeue(e,t)},a)),!n&&a&&a.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return X.get(e,i)||X.access(e,i,{empty:b.Callbacks("once memory").add(function(){X.remove(e,[t+"queue",i])})})}}),b.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length<i?b.queue(this[0],e):void 0===t?this:this.each(function(){var i=b.queue(this,e,t);b._queueHooks(this,e),"fx"===e&&"inprogress"!==i[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,o=b.Deferred(),a=this,s=this.length,r=function(){--n||o.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";s--;)(i=X.get(a[s],e+"queueHooks"))&&i.empty&&(n++,i.empty.add(r));return r(),o.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ie=["Top","Right","Bottom","Left"],ne=v.documentElement,oe=function(e){return b.contains(e.ownerDocument,e)},ae={composed:!0};ne.getRootNode&&(oe=function(e){return b.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===b.css(e,"display")};function re(e,t,i,n){var o,a,s=20,r=n?function(){return n.cur()}:function(){return b.css(e,t,"")},l=r(),c=i&&i[3]||(b.cssNumber[t]?"":"px"),d=e.nodeType&&(b.cssNumber[t]||"px"!==c&&+l)&&te.exec(b.css(e,t));if(d&&d[3]!==c){for(l/=2,c=c||d[3],d=+l||1;s--;)b.style(e,t,d+c),(1-a)*(1-(a=r()/l||.5))<=0&&(s=0),d/=a;d*=2,b.style(e,t,d+c),i=i||[]}return i&&(d=+d||+l||0,o=i[1]?d+(i[1]+1)*i[2]:+i[2],n&&(n.unit=c,n.start=d,n.end=o)),o}var le={};function ce(e,t){for(var i,n,o,a,s,r,l,c=[],d=0,u=e.length;d<u;d++)(n=e[d]).style&&(i=n.style.display,t?("none"===i&&(c[d]=X.get(n,"display")||null,c[d]||(n.style.display="")),""===n.style.display&&se(n)&&(c[d]=(l=s=a=void 0,s=(o=n).ownerDocument,r=o.nodeName,(l=le[r])||(a=s.body.appendChild(s.createElement(r)),l=b.css(a,"display"),a.parentNode.removeChild(a),"none"===l&&(l="block"),le[r]=l)))):"none"!==i&&(c[d]="none",X.set(n,"display",i)));for(d=0;d<u;d++)null!=c[d]&&(e[d].style.display=c[d]);return e}b.fn.extend({show:function(){return ce(this,!0)},hide:function(){return ce(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?b(this).show():b(this).hide()})}});var de,ue,pe=/^(?:checkbox|radio)$/i,he=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,me=/^$|^module$|\/(?:java|ecma)script/i;de=v.createDocumentFragment().appendChild(v.createElement("div")),(ue=v.createElement("input")).setAttribute("type","radio"),ue.setAttribute("checked","checked"),ue.setAttribute("name","t"),de.appendChild(ue),h.checkClone=de.cloneNode(!0).cloneNode(!0).lastChild.checked,de.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!de.cloneNode(!0).lastChild.defaultValue,de.innerHTML="<option></option>",h.option=!!de.lastChild;var ge={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 ve(e,t){var i;return i=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&P(e,t)?b.merge([e],i):i}function fe(e,t){for(var i=0,n=e.length;i<n;i++)X.set(e[i],"globalEval",!t||X.get(t[i],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,h.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var Ce=/<|&#?\w+;/;function Se(e,t,i,n,o){for(var a,s,r,l,c,d,u=t.createDocumentFragment(),p=[],h=0,m=e.length;h<m;h++)if((a=e[h])||0===a)if("object"===S(a))b.merge(p,a.nodeType?[a]:a);else if(Ce.test(a)){for(s=s||u.appendChild(t.createElement("div")),r=(he.exec(a)||["",""])[1].toLowerCase(),l=ge[r]||ge._default,s.innerHTML=l[1]+b.htmlPrefilter(a)+l[2],d=l[0];d--;)s=s.lastChild;b.merge(p,s.childNodes),(s=u.firstChild).textContent=""}else p.push(t.createTextNode(a));for(u.textContent="",h=0;a=p[h++];)if(n&&-1<b.inArray(a,n))o&&o.push(a);else if(c=oe(a),s=ve(u.appendChild(a),"script"),c&&fe(s),i)for(d=0;a=s[d++];)me.test(a.type||"")&&i.push(a);return u}var ye=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function ke(){return!1}function _e(e,t){return e===function(){try{return v.activeElement}catch(e){}}()==("focus"===t)}function De(e,t,i,n,o,a){var s,r;if("object"==typeof t){for(r in"string"!=typeof i&&(n=n||i,i=void 0),t)De(e,r,i,n,t[r],a);return e}if(null==n&&null==o?(o=i,n=i=void 0):null==o&&("string"==typeof i?(o=n,n=void 0):(o=n,n=i,i=void 0)),!1===o)o=ke;else if(!o)return e;return 1===a&&(s=o,(o=function(e){return b().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=b.guid++)),e.each(function(){b.event.add(this,t,o,n,i)})}function Ie(e,t,i){i?(X.set(e,t,!1),b.event.add(e,t,{namespace:!1,handler:function(e){var n,a,s=X.get(this,t);if(1&e.isTrigger&&this[t]){if(s.length)(b.event.special[t]||{}).delegateType&&e.stopPropagation();else if(s=o.call(arguments),X.set(this,t,s),n=i(this,t),this[t](),s!==(a=X.get(this,t))||n?X.set(this,t,!1):a={},s!==a)return e.stopImmediatePropagation(),e.preventDefault(),a&&a.value}else s.length&&(X.set(this,t,{value:b.event.trigger(b.extend(s[0],b.Event.prototype),s.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===X.get(e,t)&&b.event.add(e,t,be)}b.event={global:{},add:function(e,t,i,n,o){var a,s,r,l,c,d,u,p,h,m,g,v=X.get(e);if(q(e))for(i.handler&&(i=(a=i).handler,o=a.selector),o&&b.find.matchesSelector(ne,o),i.guid||(i.guid=b.guid++),(l=v.events)||(l=v.events=Object.create(null)),(s=v.handle)||(s=v.handle=function(t){return void 0!==b&&b.event.triggered!==t.type?b.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(B)||[""]).length;c--;)h=g=(r=ye.exec(t[c])||[])[1],m=(r[2]||"").split(".").sort(),h&&(u=b.event.special[h]||{},h=(o?u.delegateType:u.bindType)||h,u=b.event.special[h]||{},d=b.extend({type:h,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&b.expr.match.needsContext.test(o),namespace:m.join(".")},a),(p=l[h])||((p=l[h]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,n,m,s)||e.addEventListener&&e.addEventListener(h,s)),u.add&&(u.add.call(e,d),d.handler.guid||(d.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,d):p.push(d),b.event.global[h]=!0)},remove:function(e,t,i,n,o){var a,s,r,l,c,d,u,p,h,m,g,v=X.hasData(e)&&X.get(e);if(v&&(l=v.events)){for(c=(t=(t||"").match(B)||[""]).length;c--;)if(h=g=(r=ye.exec(t[c])||[])[1],m=(r[2]||"").split(".").sort(),h){for(u=b.event.special[h]||{},p=l[h=(n?u.delegateType:u.bindType)||h]||[],r=r[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=a=p.length;a--;)d=p[a],!o&&g!==d.origType||i&&i.guid!==d.guid||r&&!r.test(d.namespace)||n&&n!==d.selector&&("**"!==n||!d.selector)||(p.splice(a,1),d.selector&&p.delegateCount--,u.remove&&u.remove.call(e,d));s&&!p.length&&(u.teardown&&!1!==u.teardown.call(e,m,v.handle)||b.removeEvent(e,h,v.handle),delete l[h])}else for(h in l)b.event.remove(e,h+t[c],i,n,!0);b.isEmptyObject(l)&&X.remove(e,"handle events")}},dispatch:function(e){var t,i,n,o,a,s,r=new Array(arguments.length),l=b.event.fix(e),c=(X.get(this,"events")||Object.create(null))[l.type]||[],d=b.event.special[l.type]||{};for(r[0]=l,t=1;t<arguments.length;t++)r[t]=arguments[t];if(l.delegateTarget=this,!d.preDispatch||!1!==d.preDispatch.call(this,l)){for(s=b.event.handlers.call(this,l,c),t=0;(o=s[t++])&&!l.isPropagationStopped();)for(l.currentTarget=o.elem,i=0;(a=o.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==a.namespace&&!l.rnamespace.test(a.namespace)||(l.handleObj=a,l.data=a.data,void 0!==(n=((b.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,r))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return d.postDispatch&&d.postDispatch.call(this,l),l.result}},handlers:function(e,t){var i,n,o,a,s,r=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&1<=e.button))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(a=[],s={},i=0;i<l;i++)void 0===s[o=(n=t[i]).selector+" "]&&(s[o]=n.needsContext?-1<b(o,this).index(c):b.find(o,this,null,[c]).length),s[o]&&a.push(n);a.length&&r.push({elem:c,handlers:a})}return c=this,l<t.length&&r.push({elem:c,handlers:t.slice(l)}),r},addProp:function(e,t){Object.defineProperty(b.Event.prototype,e,{enumerable:!0,configurable:!0,get:m(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[b.expando]?e:new b.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&P(t,"input")&&Ie(t,"click",be),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&P(t,"input")&&Ie(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&P(t,"input")&&X.get(t,"click")||P(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},b.removeEvent=function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i)},b.Event=function(e,t){if(!(this instanceof b.Event))return new b.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:ke,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&&b.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[b.expando]=!0},b.Event.prototype={constructor:b.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},b.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},b.event.addProp),b.each({focus:"focusin",blur:"focusout"},function(e,t){b.event.special[e]={setup:function(){return Ie(this,e,_e),!1},trigger:function(){return Ie(this,e),!0},_default:function(){return!0},delegateType:t}}),b.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=e.relatedTarget,o=e.handleObj;return n&&(n===this||b.contains(this,n))||(e.type=o.origType,i=o.handler.apply(this,arguments),e.type=t),i}}}),b.fn.extend({on:function(e,t,i,n){return De(this,e,t,i,n)},one:function(e,t,i,n){return De(this,e,t,i,n,1)},off:function(e,t,i){var n,o;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,b(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(i=t,t=void 0),!1===i&&(i=ke),this.each(function(){b.event.remove(this,e,i,t)})}});var we=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Te(e,t){return P(e,"table")&&P(11!==t.nodeType?t:t.firstChild,"tr")&&b(e).children("tbody")[0]||e}function xe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Fe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function $e(e,t){var i,n,o,a,s,r;if(1===t.nodeType){if(X.hasData(e)&&(r=X.get(e).events))for(o in X.remove(t,"handle events"),r)for(i=0,n=r[o].length;i<n;i++)b.event.add(t,o,r[o][i]);Z.hasData(e)&&(a=Z.access(e),s=b.extend({},a),Z.set(t,s))}}function Oe(e,t,i,n){t=a(t);var o,s,r,l,c,d,u=0,p=e.length,g=p-1,v=t[0],f=m(v);if(f||1<p&&"string"==typeof v&&!h.checkClone&&Pe.test(v))return e.each(function(o){var a=e.eq(o);f&&(t[0]=v.call(this,o,a.html())),Oe(a,t,i,n)});if(p&&(s=(o=Se(t,e[0].ownerDocument,!1,e,n)).firstChild,1===o.childNodes.length&&(o=s),s||n)){for(l=(r=b.map(ve(o,"script"),xe)).length;u<p;u++)c=o,u!==g&&(c=b.clone(c,!0,!0),l&&b.merge(r,ve(c,"script"))),i.call(e[u],c,u);if(l)for(d=r[r.length-1].ownerDocument,b.map(r,Fe),u=0;u<l;u++)c=r[u],me.test(c.type||"")&&!X.access(c,"globalEval")&&b.contains(d,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?b._evalUrl&&!c.noModule&&b._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},d):C(c.textContent.replace(Ae,""),c,d))}return e}function Me(e,t,i){for(var n,o=t?b.filter(t,e):e,a=0;null!=(n=o[a]);a++)i||1!==n.nodeType||b.cleanData(ve(n)),n.parentNode&&(i&&oe(n)&&fe(ve(n,"script")),n.parentNode.removeChild(n));return e}b.extend({htmlPrefilter:function(e){return e},clone:function(e,t,i){var n,o,a,s,r,l,c,d=e.cloneNode(!0),u=oe(e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(s=ve(d),n=0,o=(a=ve(e)).length;n<o;n++)r=a[n],"input"===(c=(l=s[n]).nodeName.toLowerCase())&&pe.test(r.type)?l.checked=r.checked:"input"!==c&&"textarea"!==c||(l.defaultValue=r.defaultValue);if(t)if(i)for(a=a||ve(e),s=s||ve(d),n=0,o=a.length;n<o;n++)$e(a[n],s[n]);else $e(e,d);return 0<(s=ve(d,"script")).length&&fe(s,!u&&ve(e,"script")),d},cleanData:function(e){for(var t,i,n,o=b.event.special,a=0;void 0!==(i=e[a]);a++)if(q(i)){if(t=i[X.expando]){if(t.events)for(n in t.events)o[n]?b.event.remove(i,n):b.removeEvent(i,n,t.handle);i[X.expando]=void 0}i[Z.expando]&&(i[Z.expando]=void 0)}}}),b.fn.extend({detach:function(e){return Me(this,e,!0)},remove:function(e){return Me(this,e)},text:function(e){return G(this,function(e){return void 0===e?b.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 Oe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Te(this,e).appendChild(e)})},prepend:function(){return Oe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Te(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Oe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Oe(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&&(b.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return G(this,function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!we.test(e)&&!ge[(he.exec(e)||["",""])[1].toLowerCase()]){e=b.htmlPrefilter(e);try{for(;i<n;i++)1===(t=this[i]||{}).nodeType&&(b.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Oe(this,arguments,function(t){var i=this.parentNode;b.inArray(this,e)<0&&(b.cleanData(ve(this)),i&&i.replaceChild(t,this))},e)}}),b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){for(var i,n=[],o=b(e),a=o.length-1,r=0;r<=a;r++)i=r===a?this:this.clone(!0),b(o[r])[t](i),s.apply(n,i.get());return this.pushStack(n)}});var Be=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ee=function(t){var i=t.ownerDocument.defaultView;return i&&i.opener||(i=e),i.getComputedStyle(t)},Le=function(e,t,i){var n,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in n=i.call(e),t)e.style[o]=a[o];return n},Ne=new RegExp(ie.join("|"),"i");function Ue(e,t,i){var n,o,a,s,r=e.style;return(i=i||Ee(e))&&(""!==(s=i.getPropertyValue(t)||i[t])||oe(e)||(s=b.style(e,t)),!h.pixelBoxStyles()&&Be.test(s)&&Ne.test(t)&&(n=r.width,o=r.minWidth,a=r.maxWidth,r.minWidth=r.maxWidth=r.width=s,s=i.width,r.width=n,r.minWidth=o,r.maxWidth=a)),void 0!==s?s+"":s}function Re(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(d){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",d.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(c).appendChild(d);var t=e.getComputedStyle(d);n="1%"!==t.top,l=12===i(t.marginLeft),d.style.right="60%",s=36===i(t.right),o=36===i(t.width),d.style.position="absolute",a=12===i(d.offsetWidth/3),ne.removeChild(c),d=null}}function i(e){return Math.round(parseFloat(e))}var n,o,a,s,r,l,c=v.createElement("div"),d=v.createElement("div");d.style&&(d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===d.style.backgroundClip,b.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),a},reliableTrDimensions:function(){var t,i,n,o;return null==r&&(t=v.createElement("table"),i=v.createElement("tr"),n=v.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",i.style.cssText="border:1px solid",i.style.height="1px",n.style.height="9px",n.style.display="block",ne.appendChild(t).appendChild(i).appendChild(n),o=e.getComputedStyle(i),r=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===i.offsetHeight,ne.removeChild(t)),r}}))}();var We=["Webkit","Moz","ms"],Ge=v.createElement("div").style,Ve={};function He(e){return b.cssProps[e]||Ve[e]||(e in Ge?e:Ve[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),i=We.length;i--;)if((e=We[i]+t)in Ge)return e}(e)||e)}var je=/^(none|table(?!-c[ea]).+)/,Ye=/^--/,qe={position:"absolute",visibility:"hidden",display:"block"},ze={letterSpacing:"0",fontWeight:"400"};function Xe(e,t,i){var n=te.exec(t);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):t}function Ze(e,t,i,n,o,a){var s="width"===t?1:0,r=0,l=0;if(i===(n?"border":"content"))return 0;for(;s<4;s+=2)"margin"===i&&(l+=b.css(e,i+ie[s],!0,o)),n?("content"===i&&(l-=b.css(e,"padding"+ie[s],!0,o)),"margin"!==i&&(l-=b.css(e,"border"+ie[s]+"Width",!0,o))):(l+=b.css(e,"padding"+ie[s],!0,o),"padding"!==i?l+=b.css(e,"border"+ie[s]+"Width",!0,o):r+=b.css(e,"border"+ie[s]+"Width",!0,o));return!n&&0<=a&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-a-l-r-.5))||0),l}function Je(e,t,i){var n=Ee(e),o=(!h.boxSizingReliable()||i)&&"border-box"===b.css(e,"boxSizing",!1,n),a=o,s=Ue(e,t,n),r="offset"+t[0].toUpperCase()+t.slice(1);if(Be.test(s)){if(!i)return s;s="auto"}return(!h.boxSizingReliable()&&o||!h.reliableTrDimensions()&&P(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===b.css(e,"display",!1,n))&&e.getClientRects().length&&(o="border-box"===b.css(e,"boxSizing",!1,n),(a=r in e)&&(s=e[r])),(s=parseFloat(s)||0)+Ze(e,t,i||(o?"border":"content"),a,n,s)+"px"}function Qe(e,t,i,n,o){return new Qe.prototype.init(e,t,i,n,o)}b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=Ue(e,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!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,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,r=Y(t),l=Ye.test(t),c=e.style;if(l||(t=He(r)),s=b.cssHooks[t]||b.cssHooks[r],void 0===i)return s&&"get"in s&&void 0!==(o=s.get(e,!1,n))?o:c[t];"string"==(a=typeof i)&&(o=te.exec(i))&&o[1]&&(i=re(e,t,o),a="number"),null!=i&&i==i&&("number"!==a||l||(i+=o&&o[3]||(b.cssNumber[r]?"":"px")),h.clearCloneStyle||""!==i||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(i=s.set(e,i,n))||(l?c.setProperty(t,i):c[t]=i))}},css:function(e,t,i,n){var o,a,s,r=Y(t);return Ye.test(t)||(t=He(r)),(s=b.cssHooks[t]||b.cssHooks[r])&&"get"in s&&(o=s.get(e,!0,i)),void 0===o&&(o=Ue(e,t,n)),"normal"===o&&t in ze&&(o=ze[t]),""===i||i?(a=parseFloat(o),!0===i||isFinite(a)?a||0:o):o}}),b.each(["height","width"],function(e,t){b.cssHooks[t]={get:function(e,i,n){if(i)return!je.test(b.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,t,n):Le(e,qe,function(){return Je(e,t,n)})},set:function(e,i,n){var o,a=Ee(e),s=!h.scrollboxSize()&&"absolute"===a.position,r=(s||n)&&"border-box"===b.css(e,"boxSizing",!1,a),l=n?Ze(e,t,n,r,a):0;return r&&s&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(a[t])-Ze(e,t,"border",!1,a)-.5)),l&&(o=te.exec(i))&&"px"!==(o[3]||"px")&&(e.style[t]=i,i=b.css(e,t)),Xe(0,i,l)}}}),b.cssHooks.marginLeft=Re(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ue(e,"marginLeft"))||e.getBoundingClientRect().left-Le(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(i){for(var n=0,o={},a="string"==typeof i?i.split(" "):[i];n<4;n++)o[e+ie[n]+t]=a[n]||a[n-2]||a[0];return o}},"margin"!==e&&(b.cssHooks[e+t].set=Xe)}),b.fn.extend({css:function(e,t){return G(this,function(e,t,i){var n,o,a={},s=0;if(Array.isArray(t)){for(n=Ee(e),o=t.length;s<o;s++)a[t[s]]=b.css(e,t[s],!1,n);return a}return void 0!==i?b.style(e,t,i):b.css(e,t)},e,t,1<arguments.length)}}),((b.Tween=Qe).prototype={constructor:Qe,init:function(e,t,i,n,o,a){this.elem=e,this.prop=i,this.easing=o||b.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=a||(b.cssNumber[i]?"":"px")},cur:function(){var e=Qe.propHooks[this.prop];return e&&e.get?e.get(this):Qe.propHooks._default.get(this)},run:function(e){var t,i=Qe.propHooks[this.prop];return this.options.duration?this.pos=t=b.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),i&&i.set?i.set(this):Qe.propHooks._default.set(this),this}}).init.prototype=Qe.prototype,(Qe.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=b.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):1!==e.elem.nodeType||!b.cssHooks[e.prop]&&null==e.elem.style[He(e.prop)]?e.elem[e.prop]=e.now:b.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},b.fx=Qe.prototype.init,b.fx.step={};var Ke,et,tt,it,nt=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){et&&(!1===v.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,b.fx.interval),b.fx.tick())}function st(){return e.setTimeout(function(){Ke=void 0}),Ke=Date.now()}function rt(e,t){var i,n=0,o={height:e};for(t=t?1:0;n<4;n+=2-t)o["margin"+(i=ie[n])]=o["padding"+i]=e;return t&&(o.opacity=o.width=e),o}function lt(e,t,i){for(var n,o=(ct.tweeners[t]||[]).concat(ct.tweeners["*"]),a=0,s=o.length;a<s;a++)if(n=o[a].call(i,t,e))return n}function ct(e,t,i){var n,o,a=0,s=ct.prefilters.length,r=b.Deferred().always(function(){delete l.elem}),l=function(){if(o)return!1;for(var t=Ke||st(),i=Math.max(0,c.startTime+c.duration-t),n=1-(i/c.duration||0),a=0,s=c.tweens.length;a<s;a++)c.tweens[a].run(n);return r.notifyWith(e,[c,n,i]),n<1&&s?i:(s||r.notifyWith(e,[c,1,0]),r.resolveWith(e,[c]),!1)},c=r.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{},easing:b.easing._default},i),originalProperties:t,originalOptions:i,startTime:Ke||st(),duration:i.duration,tweens:[],createTween:function(t,i){var n=b.Tween(e,c.opts,t,i,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(n),n},stop:function(t){var i=0,n=t?c.tweens.length:0;if(o)return this;for(o=!0;i<n;i++)c.tweens[i].run(1);return t?(r.notifyWith(e,[c,1,0]),r.resolveWith(e,[c,t])):r.rejectWith(e,[c,t]),this}}),d=c.props;for(function(e,t){var i,n,o,a,s;for(i in e)if(o=t[n=Y(i)],a=e[i],Array.isArray(a)&&(o=a[1],a=e[i]=a[0]),i!==n&&(e[n]=a,delete e[i]),(s=b.cssHooks[n])&&"expand"in s)for(i in a=s.expand(a),delete e[n],a)i in e||(e[i]=a[i],t[i]=o);else t[n]=o}(d,c.opts.specialEasing);a<s;a++)if(n=ct.prefilters[a].call(c,e,d,c.opts))return m(n.stop)&&(b._queueHooks(c.elem,c.opts.queue).stop=n.stop.bind(n)),n;return b.map(d,lt,c),m(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),b.fx.timer(b.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}b.Animation=b.extend(ct,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);return re(i.elem,e,te.exec(t),i),i}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(B);for(var i,n=0,o=e.length;n<o;n++)i=e[n],ct.tweeners[i]=ct.tweeners[i]||[],ct.tweeners[i].unshift(t)},prefilters:[function(e,t,i){var n,o,a,s,r,l,c,d,u="width"in t||"height"in t,p=this,h={},m=e.style,g=e.nodeType&&se(e),v=X.get(e,"fxshow");for(n in i.queue||(null==(s=b._queueHooks(e,"fx")).unqueued&&(s.unqueued=0,r=s.empty.fire,s.empty.fire=function(){s.unqueued||r()}),s.unqueued++,p.always(function(){p.always(function(){s.unqueued--,b.queue(e,"fx").length||s.empty.fire()})})),t)if(o=t[n],nt.test(o)){if(delete t[n],a=a||"toggle"===o,o===(g?"hide":"show")){if("show"!==o||!v||void 0===v[n])continue;g=!0}h[n]=v&&v[n]||b.style(e,n)}if((l=!b.isEmptyObject(t))||!b.isEmptyObject(h))for(n in u&&1===e.nodeType&&(i.overflow=[m.overflow,m.overflowX,m.overflowY],null==(c=v&&v.display)&&(c=X.get(e,"display")),"none"===(d=b.css(e,"display"))&&(c?d=c:(ce([e],!0),c=e.style.display||c,d=b.css(e,"display"),ce([e]))),("inline"===d||"inline-block"===d&&null!=c)&&"none"===b.css(e,"float")&&(l||(p.done(function(){m.display=c}),null==c&&(d=m.display,c="none"===d?"":d)),m.display="inline-block")),i.overflow&&(m.overflow="hidden",p.always(function(){m.overflow=i.overflow[0],m.overflowX=i.overflow[1],m.overflowY=i.overflow[2]})),l=!1,h)l||(v?"hidden"in v&&(g=v.hidden):v=X.access(e,"fxshow",{display:c}),a&&(v.hidden=!g),g&&ce([e],!0),p.done(function(){for(n in g||ce([e]),X.remove(e,"fxshow"),h)b.style(e,n,h[n])})),l=lt(g?v[n]:0,n,p),n in v||(v[n]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?ct.prefilters.unshift(e):ct.prefilters.push(e)}}),b.speed=function(e,t,i){var n=e&&"object"==typeof e?b.extend({},e):{complete:i||!i&&t||m(e)&&e,duration:e,easing:i&&t||t&&!m(t)&&t};return b.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in b.fx.speeds?n.duration=b.fx.speeds[n.duration]:n.duration=b.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){m(n.old)&&n.old.call(this),n.queue&&b.dequeue(this,n.queue)},n},b.fn.extend({fadeTo:function(e,t,i,n){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var o=b.isEmptyObject(e),a=b.speed(t,i,n),s=function(){var t=ct(this,b.extend({},e),a);(o||X.get(this,"finish"))&&t.stop(!0)};return s.finish=s,o||!1===a.queue?this.each(s):this.queue(a.queue,s)},stop:function(e,t,i){var n=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,o=null!=e&&e+"queueHooks",a=b.timers,s=X.get(this);if(o)s[o]&&s[o].stop&&n(s[o]);else for(o in s)s[o]&&s[o].stop&&ot.test(o)&&n(s[o]);for(o=a.length;o--;)a[o].elem!==this||null!=e&&a[o].queue!==e||(a[o].anim.stop(i),t=!1,a.splice(o,1));!t&&i||b.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,i=X.get(this),n=i[e+"queue"],o=i[e+"queueHooks"],a=b.timers,s=n?n.length:0;for(i.finish=!0,b.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;t<s;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish})}}),b.each(["toggle","show","hide"],function(e,t){var i=b.fn[t];b.fn[t]=function(e,n,o){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(rt(t,!0),e,n,o)}}),b.each({slideDown:rt("show"),slideUp:rt("hide"),slideToggle:rt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}}),b.timers=[],b.fx.tick=function(){var e,t=0,i=b.timers;for(Ke=Date.now();t<i.length;t++)(e=i[t])()||i[t]!==e||i.splice(t--,1);i.length||b.fx.stop(),Ke=void 0},b.fx.timer=function(e){b.timers.push(e),b.fx.start()},b.fx.interval=13,b.fx.start=function(){et||(et=!0,at())},b.fx.stop=function(){et=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fn.delay=function(t,i){return t=b.fx&&b.fx.speeds[t]||t,i=i||"fx",this.queue(i,function(i,n){var o=e.setTimeout(i,t);n.stop=function(){e.clearTimeout(o)}})},tt=v.createElement("input"),it=v.createElement("select").appendChild(v.createElement("option")),tt.type="checkbox",h.checkOn=""!==tt.value,h.optSelected=it.selected,(tt=v.createElement("input")).value="t",tt.type="radio",h.radioValue="t"===tt.value;var dt,ut=b.expr.attrHandle;b.fn.extend({attr:function(e,t){return G(this,b.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})}}),b.extend({attr:function(e,t,i){var n,o,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?b.prop(e,t,i):(1===a&&b.isXMLDoc(e)||(o=b.attrHooks[t.toLowerCase()]||(b.expr.match.bool.test(t)?dt:void 0)),void 0!==i?null===i?void b.removeAttr(e,t):o&&"set"in o&&void 0!==(n=o.set(e,i,t))?n:(e.setAttribute(t,i+""),i):o&&"get"in o&&null!==(n=o.get(e,t))?n:null==(n=b.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&P(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n=0,o=t&&t.match(B);if(o&&1===e.nodeType)for(;i=o[n++];)e.removeAttribute(i)}}),dt={set:function(e,t,i){return!1===t?b.removeAttr(e,i):e.setAttribute(i,i),i}},b.each(b.expr.match.bool.source.match(/\w+/g),function(e,t){var i=ut[t]||b.find.attr;ut[t]=function(e,t,n){var o,a,s=t.toLowerCase();return n||(a=ut[s],ut[s]=o,o=null!=i(e,t,n)?s:null,ut[s]=a),o}});var pt=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;function mt(e){return(e.match(B)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(B)||[]}b.fn.extend({prop:function(e,t){return G(this,b.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[b.propFix[e]||e]})}}),b.extend({prop:function(e,t,i){var n,o,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&b.isXMLDoc(e)||(t=b.propFix[t]||t,o=b.propHooks[t]),void 0!==i?o&&"set"in o&&void 0!==(n=o.set(e,i,t))?n:e[t]=i:o&&"get"in o&&null!==(n=o.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=b.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),h.optSelected||(b.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)}}),b.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){b.propFix[this.toLowerCase()]=this}),b.fn.extend({addClass:function(e){var t,i,n,o,a,s,r,l=0;if(m(e))return this.each(function(t){b(this).addClass(e.call(this,t,gt(this)))});if((t=vt(e)).length)for(;i=this[l++];)if(o=gt(i),n=1===i.nodeType&&" "+mt(o)+" "){for(s=0;a=t[s++];)n.indexOf(" "+a+" ")<0&&(n+=a+" ");o!==(r=mt(n))&&i.setAttribute("class",r)}return this},removeClass:function(e){var t,i,n,o,a,s,r,l=0;if(m(e))return this.each(function(t){b(this).removeClass(e.call(this,t,gt(this)))});if(!arguments.length)return this.attr("class","");if((t=vt(e)).length)for(;i=this[l++];)if(o=gt(i),n=1===i.nodeType&&" "+mt(o)+" "){for(s=0;a=t[s++];)for(;-1<n.indexOf(" "+a+" ");)n=n.replace(" "+a+" "," ");o!==(r=mt(n))&&i.setAttribute("class",r)}return this},toggleClass:function(e,t){var i=typeof e,n="string"===i||Array.isArray(e);return"boolean"==typeof t&&n?t?this.addClass(e):this.removeClass(e):m(e)?this.each(function(i){b(this).toggleClass(e.call(this,i,gt(this),t),t)}):this.each(function(){var t,o,a,s;if(n)for(o=0,a=b(this),s=vt(e);t=s[o++];)a.hasClass(t)?a.removeClass(t):a.addClass(t);else void 0!==e&&"boolean"!==i||((t=gt(this))&&X.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":X.get(this,"__className__")||""))})},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&-1<(" "+mt(gt(i))+" ").indexOf(t))return!0;return!1}});var ft=/\r/g;b.fn.extend({val:function(e){var t,i,n,o=this[0];return arguments.length?(n=m(e),this.each(function(i){var o;1===this.nodeType&&(null==(o=n?e.call(this,i,b(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),(t=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))})):o?(t=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(i=t.get(o,"value"))?i:"string"==typeof(i=o.value)?i.replace(ft,""):null==i?"":i:void 0}}),b.extend({valHooks:{option:{get:function(e){var t=b.find.attr(e,"value");return null!=t?t:mt(b.text(e))}},select:{get:function(e){var t,i,n,o=e.options,a=e.selectedIndex,s="select-one"===e.type,r=s?null:[],l=s?a+1:o.length;for(n=a<0?l:s?a:0;n<l;n++)if(((i=o[n]).selected||n===a)&&!i.disabled&&(!i.parentNode.disabled||!P(i.parentNode,"optgroup"))){if(t=b(i).val(),s)return t;r.push(t)}return r},set:function(e,t){for(var i,n,o=e.options,a=b.makeArray(t),s=o.length;s--;)((n=o[s]).selected=-1<b.inArray(b.valHooks.option.get(n),a))&&(i=!0);return i||(e.selectedIndex=-1),a}}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<b.inArray(b(e).val(),t)}},h.checkOn||(b.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var Ct=/^(?:focusinfocus|focusoutblur)$/,St=function(e){e.stopPropagation()};b.extend(b.event,{trigger:function(t,i,n,o){var a,s,r,l,c,u,p,h,f=[n||v],C=d.call(t,"type")?t.type:t,S=d.call(t,"namespace")?t.namespace.split("."):[];if(s=h=r=n=n||v,3!==n.nodeType&&8!==n.nodeType&&!Ct.test(C+b.event.triggered)&&(-1<C.indexOf(".")&&(C=(S=C.split(".")).shift(),S.sort()),c=C.indexOf(":")<0&&"on"+C,(t=t[b.expando]?t:new b.Event(C,"object"==typeof t&&t)).isTrigger=o?2:3,t.namespace=S.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+S.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),i=null==i?[t]:b.makeArray(i,[t]),p=b.event.special[C]||{},o||!p.trigger||!1!==p.trigger.apply(n,i))){if(!o&&!p.noBubble&&!g(n)){for(l=p.delegateType||C,Ct.test(l+C)||(s=s.parentNode);s;s=s.parentNode)f.push(s),r=s;r===(n.ownerDocument||v)&&f.push(r.defaultView||r.parentWindow||e)}for(a=0;(s=f[a++])&&!t.isPropagationStopped();)h=s,t.type=1<a?l:p.bindType||C,(u=(X.get(s,"events")||Object.create(null))[t.type]&&X.get(s,"handle"))&&u.apply(s,i),(u=c&&s[c])&&u.apply&&q(s)&&(t.result=u.apply(s,i),!1===t.result&&t.preventDefault());return t.type=C,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(f.pop(),i)||!q(n)||c&&m(n[C])&&!g(n)&&((r=n[c])&&(n[c]=null),b.event.triggered=C,t.isPropagationStopped()&&h.addEventListener(C,St),n[C](),t.isPropagationStopped()&&h.removeEventListener(C,St),b.event.triggered=void 0,r&&(n[c]=r)),t.result}},simulate:function(e,t,i){var n=b.extend(new b.Event,i,{type:e,isSimulated:!0});b.event.trigger(n,null,t)}}),b.fn.extend({trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];if(i)return b.event.trigger(e,t,i,!0)}}),h.focusin||b.each({focus:"focusin",blur:"focusout"},function(e,t){var i=function(e){b.event.simulate(t,e.target,b.event.fix(e))};b.event.special[t]={setup:function(){var n=this.ownerDocument||this.document||this,o=X.access(n,t);o||n.addEventListener(e,i,!0),X.access(n,t,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,o=X.access(n,t)-1;o?X.access(n,t,o):(n.removeEventListener(e,i,!0),X.remove(n,t))}}});var yt=e.location,bt={guid:Date.now()},kt=/\?/;b.parseXML=function(t){var i,n;if(!t||"string"!=typeof t)return null;try{i=(new e.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=i&&i.getElementsByTagName("parsererror")[0],i&&!n||b.error("Invalid XML: "+(n?b.map(n.childNodes,function(e){return e.textContent}).join("\n"):t)),i};var _t=/\[\]$/,Dt=/\r?\n/g,It=/^(?:submit|button|image|reset|file)$/i,wt=/^(?:input|select|textarea|keygen)/i;function Pt(e,t,i,n){var o;if(Array.isArray(t))b.each(t,function(t,o){i||_t.test(e)?n(e,o):Pt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,i,n)});else if(i||"object"!==S(t))n(e,t);else for(o in t)Pt(e+"["+o+"]",t[o],i,n)}b.param=function(e,t){var i,n=[],o=function(e,t){var i=m(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==i?"":i)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(i in e)Pt(i,e[i],t,o);return n.join("&")},b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&wt.test(this.nodeName)&&!It.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var i=b(this).val();return null==i?null:Array.isArray(i)?b.map(i,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:i.replace(Dt,"\r\n")}}).get()}});var At=/%20/g,Tt=/#.*$/,xt=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,$t=/^(?:GET|HEAD)$/,Ot=/^\/\//,Mt={},Bt={},Et="*/".concat("*"),Lt=v.createElement("a");function Nt(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,o=0,a=t.toLowerCase().match(B)||[];if(m(i))for(;n=a[o++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function Ut(e,t,i,n){var o={},a=e===Bt;function s(r){var l;return o[r]=!0,b.each(e[r]||[],function(e,r){var c=r(t,i,n);return"string"!=typeof c||a||o[c]?a?!(l=c):void 0:(t.dataTypes.unshift(c),s(c),!1)}),l}return s(t.dataTypes[0])||!o["*"]&&s("*")}function Rt(e,t){var i,n,o=b.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((o[i]?e:n||(n={}))[i]=t[i]);return n&&b.extend(!0,e,n),e}Lt.href=yt.href,b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(yt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Et,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":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Rt(Rt(e,b.ajaxSettings),t):Rt(b.ajaxSettings,e)},ajaxPrefilter:Nt(Mt),ajaxTransport:Nt(Bt),ajax:function(t,i){"object"==typeof t&&(i=t,t=void 0),i=i||{};var n,o,a,s,r,l,c,d,u,p,h=b.ajaxSetup({},i),m=h.context||h,g=h.context&&(m.nodeType||m.jquery)?b(m):b.event,f=b.Deferred(),C=b.Callbacks("once memory"),S=h.statusCode||{},y={},k={},_="canceled",D={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=Ft.exec(a);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=k[e.toLowerCase()]=k[e.toLowerCase()]||e,y[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)D.always(e[D.status]);else for(t in e)S[t]=[S[t],e[t]];return this},abort:function(e){var t=e||_;return n&&n.abort(t),I(0,t),this}};if(f.promise(D),h.url=((t||h.url||yt.href)+"").replace(Ot,yt.protocol+"//"),h.type=i.method||i.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(B)||[""],null==h.crossDomain){l=v.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Lt.protocol+"//"+Lt.host!=l.protocol+"//"+l.host}catch(t){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=b.param(h.data,h.traditional)),Ut(Mt,h,i,D),c)return D;for(u in(d=b.event&&h.global)&&0==b.active++&&b.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!$t.test(h.type),o=h.url.replace(Tt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(At,"+")):(p=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(xt,"$1"),p=(kt.test(o)?"&":"?")+"_="+bt.guid+++p),h.url=o+p),h.ifModified&&(b.lastModified[o]&&D.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&D.setRequestHeader("If-None-Match",b.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||i.contentType)&&D.setRequestHeader("Content-Type",h.contentType),D.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Et+"; q=0.01":""):h.accepts["*"]),h.headers)D.setRequestHeader(u,h.headers[u]);if(h.beforeSend&&(!1===h.beforeSend.call(m,D,h)||c))return D.abort();if(_="abort",C.add(h.complete),D.done(h.success),D.fail(h.error),n=Ut(Bt,h,i,D)){if(D.readyState=1,d&&g.trigger("ajaxSend",[D,h]),c)return D;h.async&&0<h.timeout&&(r=e.setTimeout(function(){D.abort("timeout")},h.timeout));try{c=!1,n.send(y,I)}catch(t){if(c)throw t;I(-1,t)}}else I(-1,"No Transport");function I(t,i,s,l){var u,p,v,y,k,_=i;c||(c=!0,r&&e.clearTimeout(r),n=void 0,a=l||"",D.readyState=0<t?4:0,u=200<=t&&t<300||304===t,s&&(y=function(e,t,i){for(var n,o,a,s,r=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(o in r)if(r[o]&&r[o].test(n)){l.unshift(o);break}if(l[0]in i)a=l[0];else{for(o in i){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}if(a)return a!==l[0]&&l.unshift(a),i[a]}(h,D,s)),!u&&-1<b.inArray("script",h.dataTypes)&&b.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),y=function(e,t,i,n){var o,a,s,r,l,c={},d=e.dataTypes.slice();if(d[1])for(s in e.converters)c[s.toLowerCase()]=e.converters[s];for(a=d.shift();a;)if(e.responseFields[a]&&(i[e.responseFields[a]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=d.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(s=c[l+" "+a]||c["* "+a]))for(o in c)if((r=o.split(" "))[1]===a&&(s=c[l+" "+r[0]]||c["* "+r[0]])){!0===s?s=c[o]:!0!==c[o]&&(a=r[0],d.unshift(r[1]));break}if(!0!==s)if(s&&e.throws)t=s(t);else try{t=s(t)}catch(e){return{state:"parsererror",error:s?e:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}(h,y,D,u),u?(h.ifModified&&((k=D.getResponseHeader("Last-Modified"))&&(b.lastModified[o]=k),(k=D.getResponseHeader("etag"))&&(b.etag[o]=k)),204===t||"HEAD"===h.type?_="nocontent":304===t?_="notmodified":(_=y.state,p=y.data,u=!(v=y.error))):(v=_,!t&&_||(_="error",t<0&&(t=0))),D.status=t,D.statusText=(i||_)+"",u?f.resolveWith(m,[p,_,D]):f.rejectWith(m,[D,_,v]),D.statusCode(S),S=void 0,d&&g.trigger(u?"ajaxSuccess":"ajaxError",[D,h,u?p:v]),C.fireWith(m,[D,_]),d&&(g.trigger("ajaxComplete",[D,h]),--b.active||b.event.trigger("ajaxStop")))}return D},getJSON:function(e,t,i){return b.get(e,t,i,"json")},getScript:function(e,t){return b.get(e,void 0,t,"script")}}),b.each(["get","post"],function(e,t){b[t]=function(e,i,n,o){return m(i)&&(o=o||n,n=i,i=void 0),b.ajax(b.extend({url:e,type:t,dataType:o,data:i,success:n},b.isPlainObject(e)&&e))}}),b.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),b._evalUrl=function(e,t,i){return b.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){b.globalEval(e,t,i)}})},b.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=b(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return m(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=m(e);return this.each(function(i){b(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){b(this).replaceWith(this.childNodes)}),this}}),b.expr.pseudos.hidden=function(e){return!b.expr.pseudos.visible(e)},b.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},b.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Gt=b.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,b.ajaxTransport(function(t){var i,n;if(h.cors||Gt&&!t.crossDomain)return{send:function(o,a){var s,r=t.xhr();if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)r[s]=t.xhrFields[s];for(s in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)r.setRequestHeader(s,o[s]);i=function(e){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?a(0,"error"):a(r.status,r.statusText):a(Wt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=r.ontimeout=i("error"),void 0!==r.onabort?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&e.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(t.hasContent&&t.data||null)}catch(o){if(i)throw o}},abort:function(){i&&i()}}}),b.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),b.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 b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),b.ajaxTransport("script",function(e){var t,i;if(e.crossDomain||e.scriptAttrs)return{send:function(n,o){t=b("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",i=function(e){t.remove(),i=null,e&&o("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){i&&i()}}});var Vt,Ht=[],jt=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ht.pop()||b.expando+"_"+bt.guid++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(t,i,n){var o,a,s,r=!1!==t.jsonp&&(jt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&jt.test(t.data)&&"data");if(r||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=m(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,r?t[r]=t[r].replace(jt,"$1"+o):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},t.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},n.always(function(){void 0===a?b(e).removeProp(o):e[o]=a,t[o]&&(t.jsonpCallback=i.jsonpCallback,Ht.push(o)),s&&m(a)&&a(s[0]),s=a=void 0}),"script"}),h.createHTMLDocument=((Vt=v.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),b.parseHTML=function(e,t,i){return"string"!=typeof e?[]:("boolean"==typeof t&&(i=t,t=!1),t||(h.createHTMLDocument?((n=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(n)):t=v),a=!i&&[],(o=A.exec(e))?[t.createElement(o[1])]:(o=Se([e],t,a),a&&a.length&&b(a).remove(),b.merge([],o.childNodes)));var n,o,a},b.fn.load=function(e,t,i){var n,o,a,s=this,r=e.indexOf(" ");return-1<r&&(n=mt(e.slice(r)),e=e.slice(0,r)),m(t)?(i=t,t=void 0):t&&"object"==typeof t&&(o="POST"),0<s.length&&b.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done(function(e){a=arguments,s.html(n?b("<div>").append(b.parseHTML(e)).find(n):e)}).always(i&&function(e,t){s.each(function(){i.apply(this,a||[e.responseText,t,e])})}),this},b.expr.pseudos.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length},b.offset={setOffset:function(e,t,i){var n,o,a,s,r,l,c=b.css(e,"position"),d=b(e),u={};"static"===c&&(e.style.position="relative"),r=d.offset(),a=b.css(e,"top"),l=b.css(e,"left"),("absolute"===c||"fixed"===c)&&-1<(a+l).indexOf("auto")?(s=(n=d.position()).top,o=n.left):(s=parseFloat(a)||0,o=parseFloat(l)||0),m(t)&&(t=t.call(e,i,b.extend({},r))),null!=t.top&&(u.top=t.top-r.top+s),null!=t.left&&(u.left=t.left-r.left+o),"using"in t?t.using.call(e,u):d.css(u)}},b.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){b.offset.setOffset(this,e,t)});var t,i,n=this[0];return n?n.getClientRects().length?(t=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:t.top+i.pageYOffset,left:t.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,i,n=this[0],o={top:0,left:0};if("fixed"===b.css(n,"position"))t=n.getBoundingClientRect();else{for(t=this.offset(),i=n.ownerDocument,e=n.offsetParent||i.documentElement;e&&(e===i.body||e===i.documentElement)&&"static"===b.css(e,"position");)e=e.parentNode;e&&e!==n&&1===e.nodeType&&((o=b(e).offset()).top+=b.css(e,"borderTopWidth",!0),o.left+=b.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-b.css(n,"marginTop",!0),left:t.left-o.left-b.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===b.css(e,"position");)e=e.offsetParent;return e||ne})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var i="pageYOffset"===t;b.fn[e]=function(n){return G(this,function(e,n,o){var a;if(g(e)?a=e:9===e.nodeType&&(a=e.defaultView),void 0===o)return a?a[t]:e[n];a?a.scrollTo(i?a.pageXOffset:o,i?o:a.pageYOffset):e[n]=o},e,n,arguments.length)}}),b.each(["top","left"],function(e,t){b.cssHooks[t]=Re(h.pixelPosition,function(e,i){if(i)return i=Ue(e,t),Be.test(i)?b(e).position()[t]+"px":i})}),b.each({Height:"height",Width:"width"},function(e,t){b.each({padding:"inner"+e,content:t,"":"outer"+e},function(i,n){b.fn[n]=function(o,a){var s=arguments.length&&(i||"boolean"!=typeof o),r=i||(!0===o||!0===a?"margin":"border");return G(this,function(t,i,o){var a;return g(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(a=t.documentElement,Math.max(t.body["scroll"+e],a["scroll"+e],t.body["offset"+e],a["offset"+e],a["client"+e])):void 0===o?b.css(t,i,r):b.style(t,i,o,r)},t,s?o:void 0,s)}})}),b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.fn.extend({bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),b.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,t){b.fn[t]=function(e,i){return 0<arguments.length?this.on(t,null,e,i):this.trigger(t)}});var Yt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;b.proxy=function(e,t){var i,n,a;if("string"==typeof t&&(i=e[t],t=e,e=i),m(e))return n=o.call(arguments,2),(a=function(){return e.apply(t||this,n.concat(o.call(arguments)))}).guid=e.guid=e.guid||b.guid++,a},b.holdReady=function(e){e?b.readyWait++:b.ready(!0)},b.isArray=Array.isArray,b.parseJSON=JSON.parse,b.nodeName=P,b.isFunction=m,b.isWindow=g,b.camelCase=Y,b.type=S,b.now=Date.now,b.isNumeric=function(e){var t=b.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},b.trim=function(e){return null==e?"":(e+"").replace(Yt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return b});var qt=e.jQuery,zt=e.$;return b.noConflict=function(t){return e.$===b&&(e.$=zt),t&&e.jQuery===b&&(e.jQuery=qt),b},void 0===t&&(e.jQuery=e.$=b),b}),function(e){function t(t,i,n,o){var a={data:o||0===o||!1===o?o:i?i.data:{},_wrap:i?i._wrap:null,tmpl:null,parent:i||null,nodes:[],calls:l,nest:c,wrap:d,html:u,update:p};return t&&e.extend(a,t,{nodes:[],parent:i}),n&&(a.tmpl=n,a._ctnt=a._ctnt||a.tmpl(e,a),a.key=++y,(k.length?C:f)[y]=a),a}function i(t,o,a){var s,l=a?e.map(a,function(e){return"string"==typeof e?t.key?e.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+g+'="'+t.key+'" $2'):e:i(e,t,e._ctnt)}):t;return o?l:((l=l.join("")).replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(t,i,o,a){r(s=e(o).get()),i&&(s=n(i).concat(s)),a&&(s=s.concat(n(a)))}),s||n(l))}function n(t){var i=document.createElement("div");return i.innerHTML=t,e.makeArray(i.childNodes)}function o(t){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+e.trim(t).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(t,i,n,o,a,r,l){var c,d,u,p=e.tmpl.tag[n];if(!p)throw"Unknown template tag: "+n;return c=p._default||[],r&&!/\w$/.test(a)&&(a+=r,r=""),a?(a=s(a),l=l?","+s(l)+")":r?")":"",d=r?a.indexOf(".")>-1?a+s(r):"("+a+").call($item"+l:a,u=r?d:"(typeof("+a+")==='function'?("+a+").call($item):("+a+"))"):u=d=c.$1||"null",o=s(o),"');"+p[i?"close":"open"].split("$notnull_1").join(a?"typeof("+a+")!=='undefined' && ("+a+")!=null":"true").split("$1a").join(u).split("$1").join(d).split("$2").join(o||c.$2||"")+"__.push('"})+"');}return __;")}function a(t,n){t._wrap=i(t,!0,e.isArray(n)?n:[v.test(n)?n:e(n).html()]).join("")}function s(e){return e?e.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function r(i){function n(i){function n(e){s=l[e+=r]=l[e]||t(s,f[s.parent.key+r]||s.parent)}var o,a,s,c,d=i;if(c=i.getAttribute(g)){for(;d.parentNode&&1===(d=d.parentNode).nodeType&&!(o=d.getAttribute(g)););o!==c&&(d=d.parentNode?11===d.nodeType?0:d.getAttribute(g)||0:0,(s=f[c])||((s=t(s=C[c],f[d]||C[d])).key=++y,f[y]=s),b&&n(c)),i.removeAttribute(g)}else b&&(s=e.data(i,"tmplItem"))&&(n(s.key),f[s.key]=s,d=(d=e.data(i.parentNode,"tmplItem"))?d.key:0);if(s){for(a=s;a&&a.key!=d;)a.nodes.push(i),a=a.parent;delete s._ctnt,delete s._wrap,e.data(i,"tmplItem",s)}}for(var o,a,s,r="_"+b,l={},c=0,d=i.length;c<d;c++)if(1===(o=i[c]).nodeType){for(s=(a=o.getElementsByTagName("*")).length-1;s>=0;s--)n(a[s]);n(o)}}function l(e,t,i,n){if(!e)return k.pop();k.push({_:e,tmpl:t,item:this,data:i,options:n})}function c(t,i,n){return e.tmpl(e.template(t),i,n,this)}function d(t,i){var n=t.options||{};return n.wrapped=i,e.tmpl(e.template(t.tmpl),t.data,n,t.item)}function u(t,i){var n=this._wrap;return e.map(e(e.isArray(n)?n.join(""):n).filter(t||"*"),function(e){return i?e.innerText||e.textContent:e.outerHTML||function(e){var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e)})}function p(){var t=this.nodes;e.tmpl(null,null,null,this).insertBefore(t[0]),e(t).hide(),e(t).remove()}var h,m=e.fn.domManip,g="_tmplitem",v=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,f={},C={},S={key:0,data:{}},y=0,b=0,k=[];e.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,i){e.fn[t]=function(n){var o,a,s,r,l=[],c=e(n),d=1===this.length&&this[0].parentNode;if(h=f||{},d&&11===d.nodeType&&1===d.childNodes.length&&1===c.length)c[i](this[0]),l=this;else{for(a=0,s=c.length;a<s;a++)b=a,o=(a>0?this.clone(!0):this).get(),e(c[a])[i](o),l=l.concat(o);b=0,l=this.pushStack(l,t,c.selector)}return r=h,h=null,e.tmpl.complete(r),l}}),e.fn.extend({tmpl:function(t,i,n){return e.tmpl(this[0],t,i,n)},tmplItem:function(){return e.tmplItem(this[0])},template:function(t){return e.template(t,this[0])},domManip:function(t,i,n){if(t[0]&&e.isArray(t[0])){for(var o,a=e.makeArray(arguments),s=t[0],r=s.length,l=0;l<r&&!(o=e.data(s[l++],"tmplItem")););o&&b&&(a[2]=function(t){e.tmpl.afterManip(this,t,n)}),m.apply(this,a)}else m.apply(this,arguments);return b=0,h||e.tmpl.complete(f),this}}),e.extend({tmpl:function(n,o,s,r){var l,c=!r;if(c)r=S,n=e.template[n]||e.template(null,n),C={};else if(!n)return n=r.tmpl,f[r.key]=r,r.nodes=[],r.wrapped&&a(r,r.wrapped),e(i(r,null,r.tmpl(e,r)));return n?("function"==typeof o&&(o=o.call(r||{})),s&&s.wrapped&&a(s,s.wrapped),l=e.isArray(o)?e.map(o,function(e){return e?t(s,r,n,e):null}):[t(s,r,n,o)],c?e(i(r,null,l)):l):[]},tmplItem:function(t){var i;for(t instanceof e&&(t=t[0]);t&&1===t.nodeType&&!(i=e.data(t,"tmplItem"))&&(t=t.parentNode););return i||S},template:function(t,i){return i?("string"==typeof i?i=o(i):i instanceof e&&(i=i[0]||{}),i.nodeType&&(i=e.data(i,"tmpl")||e.data(i,"tmpl",o(i.innerHTML))),"string"==typeof t?e.template[t]=i:i):t?"string"!=typeof t?e.template(null,t):e.template[t]||e.template(null,v.test(t)?t:e(t)):null},encode:function(e){return(""+e).split("<").join("&lt;").split(">").join("&gt;").split('"').join("&#34;").split("'").join("&#39;")}}),e.extend(e.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},if:{open:"if(($notnull_1) && $1a){",close:"}"},else:{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(){f={}},afterManip:function(t,i,n){var o=11===i.nodeType?e.makeArray(i.childNodes):1===i.nodeType?[i]:[];n.call(t,i),r(o),b++}})}(jQuery),"undefined"==typeof _FBBDP&&(_FBBDP={}),_FBBDP.BusinessID=0,_FBBDP.ShopOwnerID=0,_FBBDP.LoginUserEmail="",_FBBDP.LoginUserImage="",_FBBDP.BusinessName="#ddFBBusinessName",_FBBDP.FacebookPopup="#divFbOAuthPopup",_FBBDP.BtnFBoauthContinue="#btnFBoauthContinue",_FBBDP.BtnFBoauthAuthorize="#btnFBoauthAuthorize",_FBBDP.DivFbOAuthPopupContent="#divFbOAuthPopupContent",_FBBDP.DivFbOAuthPopupContentAuthorize="#divFbOAuthPopupContentAuthorize",_FBBDP.Scope_Configuration="configure_page_transactions",_FBBDP.FBE_Scope_Configuration="manage_business_extension",_FBBDP.BusinessName="#ddFBBusinessName",_FBBDP.lblFboAuthBusinessName="#lblFBoAuthBusinessName",_FBBDP.spnFbAuthorizeUserEmail="#fbAuthorizeUserEmail",_FBBDP.dvFbUserImage=".divFBUserImage",_FBBDP.dvFbloginUserInitials=".fbloginUserIntials",_FBBDP.isFromLoginPage=!1,_FBBDP.IsPartnerAccessAuthorizeVal=!1,_FBBDP.dvAuthorize="#dvAuthorize",_FBBDP.dvDeAuthorize="#dvDeAuthorize",_FBBDP.Encryption="",_FBBDP.objBDPData=null,_FBBDP.fbuserloginid=0,_FBBDP.isBDPConfig=!1,_FBBDP.StringisNullOrUndefineOrBlank=function(e){return void 0===e||null==e||""==e||null==e},_FBBDP.FBoAuthPageLoad=function(e,t,i,n){$FacebookLoader(function(){if(ShowLoadingPanelLogin(!1),_FBBDP.StringisNullOrUndefineOrBlank(n)||(_FBBDP.isFromLoginPage=!0,$(_FBBDP.FacebookPopup).removeClass("modal fade"),$(".stepLogin1").addClass("slide1"),$(".stepLogin2").addClass("slide2"),$(".stepLogin4").addClass("slide4"),$(".stepLogin5").addClass("slide5")),_FBBDP.ShopOwnerID=e,("/oauth/fb/home"==window.location.pathname||"/oauth/fb"==window.location.pathname)&&null!=FBoAuthredirect_uri&&""!=FBoAuthredirect_uri&&"undefined"!=typeof FBoAuthredirect_uri&&(navigator.userAgent.indexOf("FBAN")>-1||navigator.userAgent.indexOf("FBAV")>-1))return vagaro.alert({message:"Facebook integration cannot be authorized from a mobile device. Please use a web browser on your computer to complete the authorization. Thank you!",title:"Alert",callback:function(){window.close()}}),!1;"true"==i?_FBBDP.BindBusinessList():(_FBBDP.BusinessID=t,_FBBDP.GoToNextStepPopup(!0)),centerModal($(_FBBDP.FacebookPopup))})},_FBBDP.FBDeoAuth=function(e,t,i){var n;n=_FBBDP.FBE_Scope_Configuration,FB.api("/me","GET",{fields:"id,name"},function(e){""==i||null==i||0==i||i==e.id?""!=e.id&&null!=e.id&&"undefined"!=e.id?FB.api("/"+e.id+"/permissions/"+n,"DELETE",function(t){t&&!t.error?(response_message="Faceboook DeAuthorise is success.",Mode="success"):(response_message=t.error.message,Mode="warning");var i={objRequest:{businessId:_FBBDP.BusinessID,shopOwnerId:_FBBDP.ShopOwnerID,fbuserId:e.id,isdeauthorise:!0,issuccess:!t.error,fbresponse:response_message,isBDPConfig:"False"==_FBBDP.IsFBEoAuthLive}};_FBBDP.ajax("SetBusinessDeAuthorizeForFacebookBDP",i,_FBBDP.GetBusinessDeAuth_Success,_FBBDP.GetBusinessDeAuth_Fail)}):(0==_FBBDP.BusinessID&&(_FBBDP.BusinessID=BusinessID),response_message=e.error.message,_FBBDP.GetBusinessDeAuth_Fail(),_FBBDP.isFromFBIntegrationPage()&&(GetOrUpdateBusinessLastModifiedDetails(29,!1),_FBBDP.IsPartnerAccessAuthorize(_FBBDP.BusinessID)),ShowLoadingPanelLogin(!1)):response_message="You are not authorised person."})};var response_message="",Mode="";_FBBDP.FBDeoAuthPageLoad=function(e,t){if(ShowLoadingPanelLogin(!0),_FBBDP.ShopOwnerID=e,_FBBDP.BusinessID=t,navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1||navigator.userAgent.toLowerCase().indexOf("android")>-1){var i={objRequest:{businessId:_FBBDP.BusinessID,shopOwnerId:_FBBDP.ShopOwnerID,fbuserId:-1,isdeauthorise:!0,issuccess:!0,fbresponse:"From iPhone,Tablet",isBDPConfig:"False"==_FBBDP.IsFBEoAuthLive}};_FBBDP.ajax("SetBusinessDeAuthorizeForFacebookBDP",i,_FBBDP.GetBusinessDeAuth_Success,_FBBDP.GetBusinessDeAuth_Fail)}ShowLoadingPanelLogin(!1),$FacebookLoader(function(){FBAPP.funcLogin(function(i){i?(_FBBDP.FBDeoAuth(e,t,_FBBDP.fbuserloginid),_FBBDP.fbuserloginid=0):ShowLoadingPanelLogin(!1)})})},_FBBDP.GetBusinessDeAuth_Success=function(){ShowLoadingPanelLogin(!1),"success"==Mode&&ShowHideDoneMessageCommon("Faceboook DeAuthorise is success."),"warning"==Mode&&ShowHideWarningMessageCommon(response_message),"failed"==Mode&&ShowHideFailedMessageCommon("Facebook response failed, "+response_message),_FBBDP.isFromFBIntegrationPage()&&(GetOrUpdateBusinessLastModifiedDetails(29,!1),0==_FBBDP.BusinessID&&(_FBBDP.BusinessID=BusinessID),_FBBDP.IsPartnerAccessAuthorize(_FBBDP.BusinessID))},_FBBDP.GetBusinessDeAuth_Fail=function(){ShowLoadingPanelLogin(!1),ShowHideFailedMessageCommon(response_message)},_FBBDP.HideFBoAuthPopup=function(){window.location.href.toLocaleLowerCase().indexOf("merchants/settings/premiumfeature/integration/facebook")>0?$(_FBBDP.FacebookPopup).modal("hide"):location.href="/"},_FBBDP.BindBusinessList=function(){ShowLoadingPanelLogin(!0);var e={objRequest:{shopOwnerID:_FBBDP.ShopOwnerID}};_FBBDP.ajax("GetBusinessListForFacebookBDP",e,_FBBDP.GetBusinessList_Success,_FBBDP.GetBusinessList_Failure)},_FBBDP.GetBusinessList_Success=function(e){if(null!=e&&e.length>0){for(var t=0;t<=e.length-1;t++){var i=new Option(e[t].businessName,e[t].businessID,false,false);$(_FBBDP.BusinessName).append($(i))}1==e.length?(1!=_FBBDP.isFromLoginPage&&$(_FBBDP.FacebookPopup).modal("show"),_FBBDP.GoToNextStepPopup(!0)):1==_FBBDP.isFromLoginPage?$(_FBBDP.FacebookPopup).show():$(_FBBDP.FacebookPopup).modal("show")}else $(_FBBDP.FacebookPopup).modal("hide");ShowLoadingPanelLogin(!1)},_FBBDP.GetBusinessList_Failure=function(e){ShowLoadingPanelLogin(!1)},_FBBDP.GoToNextStepPopup=function(e){1==e&&(1==_FBBDP.isFromLoginPage&&$(".stepLogin5").addClass("slide5"),$(_FBBDP.DivFbOAuthPopupContent).hide(),$(_FBBDP.BtnFBoauthContinue).hide(),$(_FBBDP.DivFbOAuthPopupContentAuthorize).show(),setTimeout(function(){centerModal($(_FBBDP.FacebookPopup))}),$(_FBBDP.BtnFBoauthAuthorize).show(),$(_FBBDP.spnFbAuthorizeUserEmail).text(_FBBDP.LoginUserEmail),window.location.href.toLocaleLowerCase().indexOf("merchants/settings/premiumfeature/integration/facebook")>0?($(_FBBDP.dvFbUserImage).css("background-image",$("#spnLoginUserImage").css("background-image")),$(_FBBDP.dvFbloginUserInitials).text($("#spnLoginUserImage").text()),$(_FBBDP.lblFboAuthBusinessName).text(GetBusinessName()),"none"!=$("#divUserPhoto").css("background-image")&&"none"!=$(".divFBUserImage").css("background-image")||$(".fbintialsnames").css("display","block"),$(_FBBDP.FacebookPopup).modal("show")):("none"!=$("#divUserPhoto").css("background-image")?($(_FBBDP.dvFbUserImage).css("background-image",$("#divUserPhoto").css("background-image")),$(".loginUserIntials").length>1?$(_FBBDP.dvFbloginUserInitials).text($(".loginUserIntials")[0].innerText):$(_FBBDP.dvFbloginUserInitials).text($(".loginUserIntials").text())):($(".fbintialsnames").css("display","block"),$(_FBBDP.dvFbUserImage).css("background-image","none"),$(".loginUserIntials").length>1?$(_FBBDP.dvFbloginUserInitials).text($(".loginUserIntials")[0].innerText):$(_FBBDP.dvFbloginUserInitials).text($(".loginUserIntials").text())),$(_FBBDP.lblFboAuthBusinessName).text($(_FBBDP.BusinessName+" option:selected").text()),_FBBDP.BusinessID=$(_FBBDP.BusinessName+" option:selected").val()),"False"==_FBBDP.IsFBEoAuthLive&&_FBBDP.GetBusinessEncryptedValue())},_FBBDP.GetBusinessEncryptedValue=function(){var e={objRequest:{shopOwnerID:_FBBDP.ShopOwnerID,businessID:_FBBDP.BusinessID},IsBusinessToken:!0};_FBBDP.ajax("getfacebookencrypted",e,_FBBDP.GetBusinessEncrypted_Success,_FBBDP.GetBusinessList_CallBack)},_FBBDP.GetBusinessEncrypted_Success=function(e){_FBBDP.Encryption=e},_FBBDP.FBOauthAuthorize=function(){setTimeout(function(){_FBBDP.SetBusinessAuthorizeForFacebookBDP()},500),ShowLoadingPanelLogin(!0)},_FBBDP.SetBusinessAuthorizeForFacebookBDP=function(){var e={objRequest:{businessId:_FBBDP.BusinessID,shopOwnerId:_FBBDP.ShopOwnerID}};_FBBDP.ajax("SetBusinessAuthorizeForFacebookBDP",e,_FBBDP.GetSuccess_CallBack,_FBBDP.GetBusinessList_CallBack,null,null,!0)},_FBBDP.GetSuccess_CallBack=function(e){if(_FBBDP.objBDPData=e,!_FBBDP.StringisNullOrUndefineOrBlank(_FBBDP.objBDPData))if("/oauth/fb/home"!=window.location.pathname&&"/oauth/fb"!=window.location.pathname||null==FBoAuthredirect_uri||""==FBoAuthredirect_uri||"undefined"==typeof FBoAuthredirect_uri)_FBBDP.openFBLoginPopup();else if(FBoAuthredirect_uri=decodeURIComponent(FBoAuthredirect_uri),/https?:\/\/(www\.|m\.|l\.)?(svcscm\.\d{4}\.od\.)?(facebook|instagram|whatsapp)\.com(\/.*)?/.test(FBoAuthredirect_uri)){var t="",i="";i=FBoAuthredirect_uri.indexOf("?")>0?"&":"?",t="False"==_FBBDP.IsFBEoAuthLive?FBoAuthredirect_uri+i+'extras={app_access_headers:\'{"X-USER-ACCESS-TOKEN": "'+_FBBDP.Encryption+"\"}',repeat:false}":FBoAuthredirect_uri+i+'extras={"setup":{"external_business_id":"'+_FBBDP.objBDPData.business_token+'","timezone":"'+_FBBDP.objBDPData.business_time_zone+'","currency":"'+_FBBDP.objBDPData.currency+'","business_vertical":"SERVICES"},"business_config":{"business":{"name":"'+encodeURIComponent(_FBBDP.objBDPData.business_name)+'"},"page_cta":{"enabled":true,"cta_button_text":"'+_FBBDP.objBDPData.cta_button_text+'","cta_button_url":"'+_FBBDP.objBDPData.cta_button_url+'","below_button_text":"Powered by Vagaro"},"page_card": {"enabled":true,"see_all_text":"'+_FBBDP.objBDPData.see_all_text+'","see_all_url":"'+_FBBDP.objBDPData.see_all_url+'","cta_button_text":"Book"},"ig_cta":{"enabled":true,"cta_button_text":"'+_FBBDP.objBDPData.cta_button_text+'","cta_button_url":"'+_FBBDP.objBDPData.cta_button_url+'"}},"repeat":false}',window.location.href=t}else _FBBDP.openFBLoginPopup();_FBBDP.isFromFBIntegrationPage()&&GetOrUpdateBusinessLastModifiedDetails(29,!1)},_FBBDP.GetBusinessList_CallBack=function(e){_FBBDP.isFromFBIntegrationPage()&&GetOrUpdateBusinessLastModifiedDetails(29,!1),ShowLoadingPanelLogin(!1)},_FBBDP.openFBLoginPopup=function(){ShowLoadingPanelLogin(!1),$FacebookLoader(function(){"False"==_FBBDP.IsFBEoAuthLive?(FBAPP.objBDPEncryption=_FBBDP.Encryption,FBAPP.IsFBEoAuthLive=!1):(FBAPP.objBDPEncryption=_FBBDP.objBDPData,FBAPP.IsFBEoAuthLive=!0),FBAPP.funcRequestPagesAppForFBBDP(function(e){console.log("Response 1-"+JSON.stringify(e)),void 0!==e&&null!=e&&e.length>0?(console.log("Response 2-"+JSON.stringify(e)),FB.api("/me","GET",{fields:"id,name"},function(e){var t=e.id;_FBBDP.GetAuthorizedSuccess(!0,t),FBAPP.objBDPEncryption=null})):ShowLoadingPanelLogin(!1)})})},_FBBDP.GetAuthorizedSuccess=function(e,t){var i={objRequest:{shopOwnerID:_FBBDP.ShopOwnerID,businessID:_FBBDP.BusinessID,fbUserLoginID:t,access_token:"True"==_FBBDP.IsFBEoAuthLive?FBAPI.accessToken:""},isAuthorize:e};_FBBDP.ajax("SetBusinessPartnerAccessAuthorizeRequest",i,_FBBDP.PartnerAccessAuthorizeRequest_Success,_FBBDP.GetBusinessList_CallBack)},_FBBDP.PartnerAccessAuthorizeRequest_Success=function(){if("True"==_FBBDP.IsFBEoAuthLive&&_FBBDP.UpdateFacebookInventory(),window.location.href.toLocaleLowerCase().indexOf("oauth/fb")>0&&($(_FBBDP.FacebookPopup).modal("hide"),window.location.href="/ShopOwner/ChooseBusiness.aspx?RedirectPageURL=/merchants/settings/premiumfeature/integration/facebook"),window.location.href.toLocaleLowerCase().indexOf("choosebusiness.aspx")>0)return ShowHideDoneMessageCommon("Faceboook authorized is successfull"),$(_FBBDP.FacebookPopup).modal("hide"),ShowLoadingPanelLogin(!1),!1;if(_FBBDP.isFromFBIntegrationPage())return GetOrUpdateBusinessLastModifiedDetails(29,!1),0==_FBBDP.BusinessID&&(_FBBDP.BusinessID=BusinessID),_FBBDP.IsPartnerAccessAuthorize(_FBBDP.BusinessID),ShowHideDoneMessageCommon("Faceboook authorized is successfull"),$(_FBBDP.FacebookPopup).modal("hide"),ShowLoadingPanelLogin(!1),!1;$(window).width();ShowLoadingPanelLogin(!1)},_FBBDP.UpdateFacebookInventory=function(){var e={objRequest:{businessId:_FBBDP.BusinessID,access_token:FBAPI.accessToken,business_token:_FBBDP.objBDPData.business_token,shopOwnerId:_FBBDP.ShopOwnerID}};_FBBDP.ajax("UploadFBEBusinessData",e,_FBBDP.UpdateFacebookInventory_Success,_FBBDP.UpdateFacebookInventory_Fail)},_FBBDP.UpdateFacebookInventory_Success=function(e){ShowLoadingPanelLogin(!1)},_FBBDP.UpdateFacebookInventory_Fail=function(){ShowHideFailedMessageCommon("Something went wrong. Please try again"),ShowLoadingPanelLogin(!1)},_FBBDP.isFromFBIntegrationPage=function(){return window.location.href.toLocaleLowerCase().indexOf("merchants/settings/premiumfeature/integration/facebook")>0},_FBBDP.IsPartnerAccessAuthorize=function(e){var t={objRequest:{businessId:e,shopOwnerId:_FBBDP.ShopOwnerID}};_FBBDP.ajax("IsPartnerAccessAuthorize",t,_FBBDP.IsPartnerAccessAuthorize_CallBack,_FBBDP.GetBusinessList_CallBack)},_FBBDP.IsPartnerAccessAuthorize_CallBack=function(e){_FBBDP.StringisNullOrUndefineOrBlank(e)||(_FBBDP.IsPartnerAccessAuthorizeVal=e.isAuthorize,_FBBDP.isBDPConfig=e.isBDPConfig,_FBBDP.fbuserloginid=e.fbUserLoginID,_FBBDP.IsPartnerAccessAuthorizeVal?($(_FBBDP.dvAuthorize).hide(),$(_FBBDP.dvDeAuthorize).show()):($(_FBBDP.dvAuthorize).show(),$(_FBBDP.dvDeAuthorize).hide()))},_FBBDP.ajax=function(e,t,i,n,o,a,s){var r=new vagaro.ajax;r.datamodel.Token=e,r.datamodel.data=t,r.datamodel.callback=i,r.datamodel.Error=n,0==s&&(r.datamodel.async=!1),void 0!==a&&1==a&&(r.datamodel.ErrorMessage=_invoice.Empty),o?r.PostQue():r.Post()},vagaroFBExtensions={},vagaroFBExtensions.isFBExtensions=!1,vagaroFBExtensions.isExtensions_FB_iOS=!1,vagaroFBExtensions.isExtensions_FB_Android=!1,vagaroFBExtensions.isExtensions_Insta_iOS=!1,vagaroFBExtensions.isExtensions_Insta_Android=!1,vagaroFBExtensions.isExtensions_Mobile=!1,function(e,t){"use strict";var i=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase();vagaroFBExtensions.isFBExtensions=/fbextensions/i.test(i)||/instagram/i.test(i)||!1;if(0==vagaroFBExtensions.isFBExtensions){if("true"!=function(e){var t=window.location.href;e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i&&i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):""}("ig_ix").toLowerCase())return;vagaroFBExtensions.isFBExtensions=!0,vagaroFBExtensions.isExtensions_Mobile=e("#mobile-check").is(":visible")}vagaroFBExtensions.isExtensions_FB_iOS=vagaroFBExtensions.isFBExtensions&&/fbios/i.test(i)||!1,vagaroFBExtensions.isExtensions_FB_Android=vagaroFBExtensions.isFBExtensions&&/fb_iab/i.test(i)||!1,vagaroFBExtensions.isExtensions_Insta_iOS=vagaroFBExtensions.isFBExtensions&&/instagram/i.test(i)&&(/iphone/i.test(i)||/ios|ipad|ipod|itouch/i.test(i))||!1,vagaroFBExtensions.isExtensions_Insta_Android=vagaroFBExtensions.isFBExtensions&&/instagram/i.test(i)&&/android/i.test(i)||!1,vagaroFBExtensions.isExtensions_Android_Mobile=vagaroFBExtensions.isFBExtensions&&/android/i.test(i)&&e("#mobile-check").is(":visible"),vagaroFBExtensions.isExtensions_iOS_Mobile=vagaroFBExtensions.isFBExtensions&&(/iphone/i.test(i)||/ios|ipad|ipod|itouch/i.test(i))&&e("#mobile-check").is(":visible"),vagaroFBExtensions.isExtensions_Mobile=vagaroFBExtensions.isFBExtensions&&e("#mobile-check").is(":visible");var n,o="script",a="facebook-ixsdk",s=t.getElementsByTagName(o)[0];if(!t.getElementById(a)){(n=t.createElement(o)).id=a,n.src="https://connect.facebook.net/en_US/platform.Extensions.js",s.parentNode.insertBefore(n,s),-1!==e.inArray(location.host,["trunk.vagaro.com","p.vagaro.com","vagarodev17.vagaro.com","vagarodev16.vagaro.com","vagarodev.vagaro.com"])&&localStorage.setItem("com.facebook.fbextensions.debug_mode","102379999909139");var r={};vagaroFBExtensions.getUserDetail=function(t,i){r={};var n,o=e.Deferred();return(n=e.Deferred(),function e(){"undefined"!=typeof FBExtensions?n.resolve():setTimeout(function(){e()},1e3)}(),n.promise()).then(function(){var n;(n=e.Deferred(),FBExtensions.getUserID(function(e){r.psid=e.psid,n.resolve(r)},function(e,t){n.reject(e,t)}),e.when(n).promise()).then(function(n){(function(t,i){var n=e.Deferred();return FBExtensions.requestFormFields(function(e){r.user_name=e.fields.user_name.value,r.user_email=e.fields.user_email.value,r.user_phone=e.fields.user_phone.value,r.user_street=e.fields.user_street.value,r.user_city=e.fields.user_city.value,r.user_state=e.fields.user_state.value,r.user_country=e.fields.user_country.value,r.user_zipcode=e.fields.user_zipcode.value,r.user_address=e.fields.user_address.value,n.resolve(r)},function(e,t){n.reject(e,t)},{fields:[{id:"user_name",label:"Name",autocomplete:"name"},{id:"user_email",label:"Email",autocomplete:"email"},{id:"user_phone",label:"Phone number",autocomplete:"tel"},{id:"user_street",label:"Street",autocomplete:"address-line1"},{id:"user_city",label:"City",autocomplete:"address-level2"},{id:"user_state",label:"State",autocomplete:"address-level1"},{id:"user_country",label:"Country",autocomplete:"country-name"},{id:"user_zipcode",label:"Zipcode",autocomplete:"postal-code"},{id:"user_address",label:"Address",autocomplete:"street-address"}],business_name:t,terms_url:i}),n.promise()})(t,i).then(function(e){o.resolve(r),vagaroFBExtensions.data=r},function(e,t){console.log("requestFormFields-errorCode",e),console.log("requestFormFields-errorMessage",t),o.reject(e,t)})},function(e,t){console.log("getUserID-errorCode",e),console.log("getUserID-errorMessage",t),o.reject(e,t)})}),o.promise()}}}(jQuery,document,window);var cAppID,cChannelURL,CommonFromPage="",CommonFromPageForShopDetail="",sFromPage="",IsVagaroDefaultMaster=!1,blNeedstoRedirect="",sUserName="",sPassword="",GLogintype=0,FBGoogleAppleUserID="",isFromForms=!1,appleSignInData="",_gender={Female:0,Male:1,NonBinary:2,Optional:3},userccattemptdata={},isSignUpFromCustomerAPP=!1,isFromAppAutoSignIn=!1,isAmplitudeEventLog=!1,ApiURLEnumWBCheckout={getcartcount:(ApiPath="websiteapi/homepage/")+"getcartcount_wb",getwidgetuserdetails:ApiPath+"getwidgetuserdetails"};function LogOutFromFB(){FBAPP.funcLogout()}var timeout,QueryStringValue="",RedirectPages={MyAccountManagementMasterURl:"/myaccount/",DefaultPage:"/",ChangeBussinessSOPage:"/ShopOwner/ChooseBusiness.aspx",ThankYouPage:"/Users/ThankYou.aspx",FBOauthHome:"/oauth/fb/home",FBOauthLogin:"/oauth/fb",MyLikedStyles:"/photos/my-liked-styles",CustomerDefaultPage:"/myaccount/profile"},RedirectUserType={Customer:"1",ServiceProvider:"2",ShopAdmin:"4",ShopOwnerServiceProvider:"5"},_redirectTo={model:{IsCustomerApp:"",UserType:"0",smallMedia:"0",ReturnUrl:"",RedirectPageURL:"",Type:"",redirect_uri:""}},JSAdjustEventToken={app_launch_eventtoken:"2id34i",live_stream_class_joined_eventtoken:"kc0pbs",book_service_completed_eventtoken:"x169tw",request_service_completed_eventtoken:"tkefoi",marketplace_login_completed_eventtoken:"ml21u5",marketplace_signup_completed_eventtoken:"66jk7q",class_booking_completed_eventtoken:"qrwhm8",add_to_cart_eventtoken:"kgy2fi",product_purchased_completed_eventtoken:"t0i4z2",class_booking_requested_eventtoken:"1ect6c",gift_card_purchase_completed_eventtoken:"i4dswc",membership_purchase_completed_eventtoken:"hn11mn",package_purchase_completed_eventtoken:"etim0e"},JSAdjustEventName={app_launch:"app_launch",live_stream_class_joined:"live_stream_class_joined",book_service_completed:"book_service_completed",request_service_completed:"request_service_completed",marketplace_login_completed:"marketplace_login_completed",marketplace_signup_completed:"marketplace_signup_completed",class_booking_completed:"class_booking_completed",add_to_cart:"add_to_cart",product_purchased_completed:"product_purchase_completed",class_booking_requested:"class_booking_requested",gift_card_purchase_completed:"gift_card_purchase_completed",membership_purchase_completed:"membership_purchase_complete",package_purchase_completed:"package_purchase_completed"};function setBuilderVariables(e,t){var i,n=!1;if("Builder"!=(u="undefined"!=typeof WebsiteBuilderType?WebsiteBuilderType:$("#hdnWebsiteBuilderType").val())&&"LogoutfromBuilder"!=u||(n=!0),void 0===t&&e.split("|").length>=2&&(t=e.split("|")[1],FullUserName=e.split("|")[0]),e.split("|").length>15&&(i=e.split("|")[16],EncUidHash=e.split("|")[17],connectEncUid=e.split("|")[18],csEncUid=e.split("|")[19]),1==n){var o="";void 0!==WBBusinessID&&null!=WBBusinessID&&(o=WBBusinessID)}var a=e.split("|")[4],s=a.substring(a.lastIndexOf("/")+1),r="";(null==s||""==s||s.indexOf("user-male-img_155_new.png")>=0||s.indexOf("user-female-img_155.jpg")>=0)&&(r=FindInitials(FullUserName,"SP"),a="");var l=e.split("|")[5],c=(e.split("|")[6],getCookie("vPowerV2")),d={EncUid:i,UName:FullUserName,UImage:a,IVal:r,UEmail:l,LoginCookie:c,EncUidHash:EncUidHash,cEncUid:connectEncUid,csEncUid:csEncUid};if(setWBCookie("WebsiteBuilder",JSON.stringify(d)),1==n&&window.self!=window.top){var u="undefined"!=typeof WebsiteBuilderType?WebsiteBuilderType:$("#hdnWebsiteBuilderType").val(),p="undefined"!=typeof WebsiteBuilderEvent?WebsiteBuilderEvent:$("#hdnWebsiteBuilderEvent").val();if("Builder"==u||"LogoutfromBuilder"==u){var h=getQueryStringData("Data");"DealBookNow"!=p&&"WBBusinessServices"!=p&&"WBBusinessClasses"!=p&&"StaffServiceBook"!=p&&"StaffClassBook"!=p&&"ServiceBook"!=p&&(iframeParent="");var m=new vagaro.ajax;return m.datamodel.Token=ApiURLEnumWBCheckout.getcartcount,m.datamodel.IsNewVagaroAPI=!0,m.datamodel.callback=function(e){wbc._postMessage('{"eventType": "'+p+'", "ResponseData": '+JSON.stringify(d)+',"RequestData": "'+h+'","cartCount": "'+e+'"}')},m.datamodel.data={businessID:o,loginUserID:t},m.datamodel.Error=function(e){},m.Post(),"undefined"!=typeof WebsiteBuilderType||"WBBusinessServices"==p||"WBBusinessClasses"==p||"StaffServiceBook"==p||"StaffClassBook"==p||"ServiceBook"==p}}return!1}function widgetEncUserID(e){try{e.split("|").length>15&&(e.split("|")[16],EncUidHash=e.split("|")[17],connectEncUid=e.split("|")[18],csEncUid=e.split("|")[19]);var t={eventName:"CustomerLogin",timestamp:(new Date).getTime(),data:{customerId:""}};if("undefined"!=typeof staticEncryptUserID&&null!==staticEncryptUserID&&"VjyaDUqIaJ9ZTvKEP9kn6g=="===staticEncryptUserID){if(UserID&&parseInt(UserID)>0){var i=csEncUid;staticEncryptUserID=i,t.data.customerId=staticEncryptUserID}}else UserID&&parseInt(UserID)>0&&(t.data.customerId="undefined"!=typeof staticEncryptUserID&&null!==staticEncryptUserID?staticEncryptUserID:"");void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication?wbc._postMessage('{"eventType": "MysiteSendEventMessage","message": '+JSON.stringify(t)+"}"):"undefined"!=typeof $Interframe&&$Interframe.sendEventMessage(t)}catch(e){}}function LoginRedirectTo(){_redirectTo.model.smallMedia=$(window).width()>=768?"1":"0",String.isNullOrUndefineOrBlank($("#hdnLoginQueryString").val())||(QueryStringValue=$("#hdnLoginQueryString").val());var e=getQueryStringData("ReturnUrl"),t=getQueryStringData("RedirectPageURL"),i=getQueryStringData("Type"),n=getQueryStringData("redirect_uri");if(null!=e&&void 0!==e&&""!=e&&!e.toLowerCase().includes(RedirectPages.MyAccountManagementMasterURl.toLowerCase())&&_redirectTo.model.UserType==RedirectUserType.Customer){var o=RedirectPages.MyLikedStyles;e.toLowerCase().includes("/cl/")||e.toLowerCase().includes(o)||e.toLowerCase().includes("/paylatersignup/")||(e="")}ShowLoader(!0),void 0!==e&&null!=e&&""!=e?location.href=e:vgAppicationType==objApplicationType.CustomerApp||_redirectTo.model.UserType==RedirectUserType.Customer?location.href=RedirectPages.DefaultPage:void 0!==t&&null!=t&&""!=t&&"1"==_redirectTo.model.smallMedia?location.href=null!=i&&void 0!==i&&""!=i&&"FromConnect"!=i?RedirectPages.ChangeBussinessSOPage+"?RedirectPageURL="+t+NaN+i:RedirectPages.ChangeBussinessSOPage+"?RedirectPageURL="+t:_redirectTo.model.UserType!=RedirectUserType.ShopAdmin&&_redirectTo.model.UserType!=RedirectUserType.ServiceProvider&&_redirectTo.model.UserType!=RedirectUserType.ShopOwnerServiceProvider||"1"!=_redirectTo.model.smallMedia||window.location.pathname.toString().toLowerCase()==RedirectPages.FBOauthLogin?_redirectTo.model.UserType!=RedirectUserType.ShopOwnerServiceProvider&&_redirectTo.model.UserType!=RedirectUserType.ServiceProvider||window.location.pathname.toString().toLowerCase()!=RedirectPages.FBOauthLogin?location.href=RedirectPages.DefaultPage:location.href=void 0!==n&&null!=n&&""!=n?RedirectPages.FBOauthHome+"?redirect_uri="+QueryStringValue.substr(QueryStringValue.substring(QueryStringValue.indexOf("?")).split("=")[0].length+1):RedirectPages.FBOauthHome:location.href=RedirectPages.ChangeBussinessSOPage}function readParamFromQueryString(e,t){try{var i=e||"",n=i.indexOf("?");n>=0&&(i=i.substring(n+1));for(var o,a=i.split("&"),s=0;s<a.length;s+=1){var r=(a[s]||"").split("=");r[0]===t&&(o=r[1])}return void 0!==o&&null!=o&&""!=o?decodeURIComponent(o):""}catch(e){return""}}function getQueryStringData(e){try{var t=readParamFromQueryString(QueryStringValue,e);return""==t&&(t=window.location&&window.location.search?readParamFromQueryString(window.location.search.substring(1),e):""),t}catch(e){return""}}function getQueryStringData_Wb(e){for(var t,i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("&"),n=0;n<i.length;n+=1){var o=(i[n]||"").split("=");if(o[0]===e)if(o.length>2)for(n=1;n<o.length;n++)t?t+="="+o[n]:t=o[n];else t=o[1]}return void 0!==t&&null!=t&&""!=t?decodeURIComponent(t):""}function listner(e){if(null!=e&&"undefined"!=e&&null!=e.data&&"undefined"!=e.data){if(void 0===e.data)return;var t="";if(void 0!==e.originalEvent&&void 0!==e.originalEvent.data)try{t=JSON.parse(e.data||e.originalEvent.data)}catch(e){}else try{t=JSON.parse(e.data)}catch(e){}switch(t.eventType){case"LoginFromForms":if(isFromForms=!0,0==$(".lazy-img").is(":visible")&&$(".lazy-img").lazyload({event:"lazyload",effect:"fadeIn"}).trigger("lazyload"),"undefined"!=typeof UserID&&null!=UserID&&""!=UserID&&UserID>0){var i={};i=null!=$("#hdnStrUserIdV2").val()&&void 0!==$("#hdnStrUserIdV2").val()&&""!=$("#hdnStrUserIdV2").val()?{LoginUserID:UserID,UserName:FullUserName,EncUserID:$("#hdnStrUserIdV2").val()}:{LoginUserID:UserID,UserName:FullUserName},window.parent.postMessage('{"eventType": "SendLoginData", "data": '+JSON.stringify(i)+"}","*")}else window.parent.postMessage('{"eventType": "ShowLoginPopup"}',"*"),showCommonLoginPopup("FromForms"),setTimeout(function(){$("#divLoginNew").css("display","block"),$("#divLoginNew").addClass("in")},1e3);break;case"SignUpFromForms":ShowSignupPage();break;case"addClassInVagaroBodyFromForms":$("html").addClass(t.data);break;case"SendBusinessData":var n=t.data;setTimeout(function(){$("#hdnBusinessID").val(n.businessId),$("#hdnBusinessGroupID").val(n.busGroupId);try{void 0!==n.busIsFormWidget&&null!=n.busIsFormWidget&&"true"==n.busIsFormWidget.toLowerCase()&&(isWidget="true",w_type=_common.WidgetTypeEnum.Embedded,SignUp_FromPage.value="FromForms")}catch(e){}},1e3);break;case"filledContractForm":onFilledContractForm();break;case"getrentcontractheightcallback":getrentcontractheightcallback(t);break;case"addStyle":addStyle(t.style,t.parentID,t.businessID,t.cookieobject);break;case"modalPosition":modalTop=t.modalTop,modalHeight=t.modalHeight,getCenterPoint=t.getCenterPoint,viewportHeightW=t.viewportHeightW,scrollPositionW=t.scrollPositionW}}}function GetDetailMore(){if("undefined"!=typeof isWindowsApp&&isWindowsApp){try{window.external.notify("facebooklogin")}catch(e){}ShowLoadingPanelLogin(!0)}else ShowLoadingPanelLogin(!0),FBAPP.funcLogin(function(e){if(e){var t=_gender.Female;"undefined"!=FBAPI.gender&&null!=FBAPI.gender||(t=_gender.Optional);var i="";"male"==FBAPI.gender&&(t=_gender.Male),i="undefined"==FBAPI.email||null==FBAPI.email?"":FBAPI.email;try{"undefined"!=typeof LoginHeader_NeedstoRedirect&&null!=LoginHeader_NeedstoRedirect&&(blNeedstoRedirect=LoginHeader_NeedstoRedirect)}catch(e){}signin(FBAPI.firstName,FBAPI.lastName,t,null,i+"|~|"+FBAPI.accessToken,FBAPI.userID,null,3,!1,!0,null,null,null,"")}else{var n={get_message:function(){return"Unable to log in with Facebook"}};CallFailed(n)}})}function FBloginForApp(e,t,i,n,o){ShowLoadingPanelLogin(!0);var a=_gender.Female,s="";void 0!==n&&"undefined"!=n&&null!=n||(a=_gender.Optional),"male"==n&&(a=_gender.Male),s="undefined"==i||null==i?"":i;try{"undefined"!=typeof LoginHeader_NeedstoRedirect&&null!=LoginHeader_NeedstoRedirect&&(blNeedstoRedirect=LoginHeader_NeedstoRedirect)}catch(e){}signin(e,t,a,null,s,o,null,3,!1,!0,null,null,null,"")}function fnLoginP(){ShowLoadingPanelLogin(!0),sUserName=SignUp_UserName.value,sPassword=SignUp_Password.value,""==SignUp_CCSwipe.value&&parseFloat(_EndKeyboardSpeed)<parseFloat(.05)&&""==SignUp_Password_EmailExist.value&&""==SignUp_UserName_EmailExist.textContent&&(SignUp_CCSwipe.value=sPassword);var e=SignUp_chkRemember.checked;try{"undefined"!=typeof LoginHeader_NeedstoRedirect&&null!=LoginHeader_NeedstoRedirect&&(blNeedstoRedirect=LoginHeader_NeedstoRedirect)}catch(e){}var t=SignUp_CCSwipe.value;SignUp_CCSwipe.value="";var i=1,n=!0;""!=t&&(i=2,""==(sUserName=sUserName.replace("%",""))&&(n=!1)),""==sUserName&&(SignUp_UserName.className="signininput errorInput",n=!1),""==sPassword&&1==i&&(SignUp_Password.className="signininput errorInput",n=!1);0!=n?signin(null,null,null,sUserName,"","",t,i,e,!0,EncPV(sPassword),getek(),getei(),""):ShowLoadingPanelLogin(!1)}function signin(e,t,i,n,o,a,s,r,l,c,d,u,p,h){GLogintype=r,FBGoogleAppleUserID=a,"False"!=recaptch.isCapAllowtoShow()&&recaptch.isCapShown()?(gCapchareponce=null==c_responce?"":c_responce,captchtype="Google"):(gCapchareponce="",captchtype="");var m="";if("undefined"!=typeof Vsecure){if(0==Vsecure.isValid("errorInput"))return void ShowLoadingPanelLogin(!1);m=Vsecure.getC()}h=m;var g="";try{g="undefined"!=typeof localStorage&&void 0!==localStorage.getItem("atCode")&&null!=localStorage.getItem("atCode")?localStorage.getItem("atCode"):""}catch(e){}var v='"fNam" : '+_securelogin.getJsonVal(e);v+=', "lNam" : '+_securelogin.getJsonVal(t),v+=', "gendr" : '+_securelogin.getJsonVal(i),v+=', "uNam" :'+_securelogin.getJsonVal(n),v+=', "email" : '+_securelogin.getJsonVal(o),v+=', "fbUserID" : '+_securelogin.getJsonVal(a),v+=null!=r&&null!=r&&5===r?', "sCardID" :'+_securelogin.getJsonVal("applelogin"):', "sCardID" :'+_securelogin.getJsonVal(s),v+=', "lType" :'+_securelogin.getJsonVal(r),v+=', "bRem" :'+_securelogin.getJsonVal(l),v+=', "bUpdateFTime" : '+_securelogin.getJsonVal(c),v+=', "pwrd" : '+_securelogin.getJsonVal(d),v+=', "ky" : '+_securelogin.getJsonVal(u),v+=', "ki" : '+_securelogin.getJsonVal(p),v+=', "cap" : '+_securelogin.getJsonVal(h),v+=', "gCapcha" : '+_securelogin.getJsonVal(gCapchareponce),v+=', "ctype" : '+_securelogin.getJsonVal(captchtype);var f="Unknown";try{-1!=navigator.appVersion.indexOf("Win")?f="Windows":-1!=navigator.appVersion.indexOf("Mac")?f="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?f="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(f="Linux"),v+=', "operatingSystem" : '+_securelogin.getJsonVal(f);var C=new Date,S=C.getFullYear()+"-"+("0"+(C.getMonth()+1)).slice(-2)+"-"+("0"+C.getDate()).slice(-2)+" "+("0"+C.getHours()).slice(-2)+":"+("0"+C.getMinutes()).slice(-2)+":"+("0"+C.getSeconds()).slice(-2);v+=', "clientDate" : '+_securelogin.getJsonVal(S)}catch(e){v+=', "operatingSystem" : '+_securelogin.getJsonVal(f),v+=', "clientDate" : ""'}if(v+=', "wsUserid" : 0',v+=', "bid" : 0',Vsecure.model.ltype=r,"undefined"!=typeof vgAppicationType&&1==vgAppicationType)void 0===r||null==r||5!==r||1!=IsIOSBrandedApp&&"true"!=IsIOSBrandedApp||(dInfoValue=""),String.isNullOrUndefineOrBlank(dInfoValue)?(v+=', "vid" : ""',v+=', "fpID" : ""'):(v+=', "vid" : "'+dInfoValue+'"',v+=', "fpID" : "'+dInfoValue+'"'),v+=',"atCode": ""',v+=', "isFromCookieLessWidget" : false',v+=', "ssoId" : ""',v+=', "acctkn" : ""',CallWebServicehed("MySampleService.asmx/SignIn",v,CallSuccessLoginCtrl,CallFailed);else if(v+=',"atCode":'+_securelogin.getJsonVal(g),8===r)v+=', "vid" : ""',v+=', "fpID" : ""',v+=', "isFromCookieLessWidget" : false',v+=', "ssoId" : ""',v+=', "acctkn" : ""',CallWebServicehed("MySampleService.asmx/SignIn",v,CallSuccessLoginCtrl,CallFailed);else kickOff(v)}function HideLogin(){$("#dvSignupNew").hide(),"undefined"!=typeof SignUp_ModalPopupLoginHide&&SignUp_ModalPopupLoginHide(),ShowLoadingPanelLogin(!1),"undefined"!=typeof TwoStepAuth&&TwoStepAuth.switchToStep1()}function CallSuccessLoginCtrl(e){_IsProcessing=!1;var t=!1;if(null!=e.d){if(null!=e.d)try{"string"==typeof e.d&&((e=JSON.parse(e.d)||e.d)&&null!=e.IsPolicyAck&&(t=e.IsPolicyAck),e&&"d"in e&&(e=e.d))}catch(t){e=e.d}if(null!=e&&e.indexOf("widget-")>-1){var i=e.split("|");if(i.length>0){var n=i.findIndex(function(e,t){if(e.toLowerCase().indexOf("widget-")>-1)return!0});if(n>-1){widgetcookievalue=i[n],widgetcookievalue=widgetcookievalue.replace("widget-","");try{var o={Key:"vdsid"};o.Value=widgetcookievalue,"undefined"!=typeof $Interframe&&void 0!==$Interframe.setStoratevalueintoParent&&$Interframe.setStoratevalueintoParent(o)}catch(e){}i.splice(n,1),e=i.join("|")}}}if(appleSignInData="",void 0!==e&&null!=e&&"-15"==e)return ShowLoadingPanelLogin(!1),void("undefined"!=typeof bootbox?vagaro.alert({message:"Your account is temporary locked out for security reason. Kindly check your email.",title:"Alert",callback:function(){_login.IsResponceLoginpage()}}):alert("Your account is temporary locked out for security reason. Kindly check your email."));if(null!=e&&null!=e&&""!=e.toString().trim()&&e.toString().indexOf("-13|")>-1&&(appleSignInData=e,e="-13"),"-9"!=e)if("-6"!=e&&"-5"!=e){if(""==e)return ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alertsmall({message:"Invalid UserName or Password",title:"Alert",callback:function(){"undefined"!=typeof SignUp_Password&&null!=SignUp_Password&&(SignUp_Password.value="",setTimeout(function(){SignUp_Password.focus()},10))}}):(alert("Invalid UserName or Password"),"undefined"!=typeof SignUp_Password&&null!=SignUp_Password&&(SignUp_Password.value="",SignUp_Password.focus())),"False"!=recaptch.isCapAllowtoShow()&&"undefined"!=typeof recaptch&&recaptch.showHideCap("False"),void("undefined"!=typeof Vsecure&&Vsecure.loadIfrm());if("undefined"!=typeof Vsecure&&Vsecure.showHideCap(!1),"-1"==e)return ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alert("There is some problem while swiping the card.Please swipe it again!"):alert("There is some problem while swiping the card.Please swipe it again!"),void(SignUp_CCSwipe.value="");if("-2"==e)return ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alert("Invalid Username or Card Swipe"):alert("Invalid Username or Card Swipe"),SignUp_CCSwipe.value="",void(SignUp_Password.value="");if("-3"==e)return ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alert("Something went wrong. Please try again!"):alert("Something went wrong. Please try again!"),void(SignUp_CCSwipe.value="");if("-4"!=e){if("-7"==e||"-8"==e)return ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?"-7"==e?vagaro.alert("There is some problem with Facebook Login. Please try again."):vagaro.alert("There is some problem with Google Login. Please try again."):"-7"==e?alert("There is some problem with Facebook Login. Please try again."):alert("There is some problem with Google Login. Please try again."),void(SignUp_CCSwipe.value="");if("-13"==e)return ShowLoadingPanelLogin(!1),resetCotrolForAppleFNameLName(),void ShowFnameLnameControlForAppleLogin(!1);if("-16"!=e){if("-17"==e)return ShowLoadingPanelLogin(!1),clearAlexaCookie("_vgamzn"),clearAlexaCookie("_vggoogle"),void("undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar&&showLogin("yes"));"undefined"!=typeof _common&&_common.CloseToggelmobileMenu(),_securelogin.Show2StepAuth(e,t)}else{ShowLoadingPanelLogin(!1);a="Invalid username or password";_securelogin.showAlert(a,function(){})}}else{ShowLoadingPanelLogin(!1);var a="Something went wrong. Please try again!";_securelogin.showAlert(a,function(){"undefined"!=typeof SignUp_Password&&null!=SignUp_Password&&(SignUp_Password.value="",setTimeout(function(){SignUp_Password.focus()},10))})}}else{if(ShowLoadingPanelLogin(!1),1==vgAppicationType&&"-6"==e)return void CallbackforMobileApp(0,0,"","",0,"6");if(IsShowCapcha="True","undefined"!=typeof Vsecure&&(Vsecure.loadIfrm(),Vsecure.showHideCap(!0)),"False"!=recaptch.isCapAllowtoShow()&&"undefined"!=typeof recaptch&&window.location.pathname.toString().toLowerCase()!=RedirectPages.FBOauthLogin&&(frmsignupnew.updateVsecure(),0==("undefined"!=typeof vgAppicationType&&1==vgAppicationType)?(recaptch.showHideCap("True"),recaptch.reset()):IsShowCapcha="False",c_responce=null,"undefined"!=typeof bootbox?vagaro.alertsmall({message:"Invalid UserName or Password",title:"Alert",callback:function(){"-6"==e?"undefined"!=typeof SignUp_Password&&null!=SignUp_Password&&(SignUp_Password.value="",setTimeout(function(){SignUp_Password.focus()},10)):_login.IsResponceLoginpage()}}):alert("Invalid UserName or Password"),_login.IsResponceLoginpage()),"-6"==e){ShowLoadingPanelLogin(!1);var a="Invalid captcha code. Please try again.";_securelogin.showAlert(a,function(){"undefined"!=typeof SignUp_Password&&null!=SignUp_Password&&(SignUp_Password.value="",setTimeout(function(){SignUp_Password.focus()},10))}),"False"!=recaptch.isCapAllowtoShow()&&"undefined"!=typeof recaptch&&(recaptch.showHideCap("True"),recaptch.reset(),c_responce=null)}}else"undefined"!=typeof bootbox&&null!=bootbox?(ShowLoadingPanelLogin(!1),bootbox.alert({className:"vagaro-midium-popup",message:_twoFactor.FailOTPMessage(),title:"Error Code: XJ140"})):ShowLoadingPanelLogin(!0)}else ShowLoadingPanelLogin(!1)}function RedirectTwoStepAuth(e,t){if(void 0!==e&&null!=e&&e.length>10&&null!=e[10]){if(userccattemptdata.IsEmailPhoneVerified=e[10],userccattemptdata.EmailId=e[5],userccattemptdata.PhoneNo=e[6],userccattemptdata.isEmailPhoneVerified=e[10],userccattemptdata.FullName=e[0],userccattemptdata.UserID=e[3],userccattemptdata.IsTwoStepForSP=("2"==e[1]||"5"==e[1])&&"0"!=e[7],userccattemptdata.CountryID=void 0!==e[11]&&""!=e[11]?e[11]:"",userccattemptdata.IsNewBusiness=void 0!==e[12]&&"1"==e[12],userccattemptdata.UserType=void 0!==e[7]?e[7]:"1",isEmailPhoneVerified=e[10],$("#pnlCCSwipe").hide(),$("#hdnTwoFactorVerified").val(isEmailPhoneVerified),$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&0==userccattemptdata.IsTwoStepForSP)twoStepEmail={},twoStepEmail.emailid=$.trim(userccattemptdata.EmailId),twoStepEmail.phone=$.trim(userccattemptdata.PhoneNo.replace(/([()-\s])+/g,"")),twoStepEmail.fullname=userccattemptdata.FullName,twoStepEmail.CountryID=void 0!==e[11]&&""!=e[11]?e[11]:"",twoStepEmail.IP=$("#hdnIPAddress").val(),twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Email,twoStepEmail.UserType=userccattemptdata.UserType,_twoFactor.Model.IsPolicyAck=t,_twoFactor.Model.UserType=twoStepEmail.UserType,_twoFactor.Model.UserID=e[3],_twoFactor.LoadTwoFactorControlForInput(twoStepEmail);else if($("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailAndPhone||3!=isEmailPhoneVerified&&userccattemptdata.IsTwoStepForSP){var i=1==isEmailPhoneVerified?_twoFactor.AuthCodeReceiveMode.Cell:_twoFactor.AuthCodeReceiveMode.Email;ShowLoadingPanelLogin(!0),twoStepEmail={},twoStepEmail.emailid=$.trim(userccattemptdata.EmailId),twoStepEmail.phone=$.trim(userccattemptdata.PhoneNo.replace(/([()-\s])+/g,"")),twoStepEmail.fullname=userccattemptdata.FullName,twoStepEmail.CountryID=void 0!==e[11]&&""!=e[11]?e[11]:$("#ddlcountry option:selected").val(),twoStepEmail.IP=$("#hdnIPAddress").val(),twoStepEmail.AuthenticationMode=i,twoStepEmail.UserType=userccattemptdata.UserType,_twoFactor.Model.IsPolicyAck=t,_twoFactor.Model.UserType=twoStepEmail.UserType,_twoFactor.Model.UserID=e[3],_twoFactor.LoadTwoFactorControlForInput(twoStepEmail)}}else _securelogin.AfterSuccessfullLogin()}function BookingAfterLogin(e,t,i){var n=new vagaro.ajax;n.datamodel.Token="GetOnlineBookStatus",n.datamodel.data=[e,t],n.datamodel.ErrorMessage="",n.datamodel.callback=function(e){e.IsBlockBook?(IsBlockBook=e.IsBlockBook.toString(),"BookAppointment"==i||"BookWaitlistAppointment"==i?_shopdetail.HideShowDisableBookMessageForApps(!0):"EventAddToCart1"!=i&&"EventAddToCart2"!=i&&"EventAddToCart3"!=i||(_shopdetail.ShowHideClassPopup(!1),_shopdetail.HideShowDisableBookMessageForClass(!0))):"BookAppointment"==i?(_shopdetail.CheckCustomerExists(),CheckAvailablePromotions(!0)):"BookWaitlistAppointment"==i?_vgWaitlist.ShowWaitlistPopup():"EventAddToCart1"!=i&&"EventAddToCart2"!=i&&"EventAddToCart3"!=i||(_shopdetail.setBookTextOnLoginlogout(!0),"EventAddToCart1"==i?_vgClassSessionSelection.AddToEventCart(1):"EventAddToCart2"==i?_vgClassSessionSelection.AddToEventCart(2):"EventAddToCart3"==i&&_vgClassSessionSelection.AddToEventCart(3))},n.Post()}function SendAdjustDataMobileApp(e,t,i){CallbackforMobileApp(0,0,"","","0","47|~|"+('{\\"eventName\\":\\"'+e+'\\",\\"eventToken\\":\\"'+t+'\\",\\"userid\\":\\"'+i+'\\"}'))}function chkMultiLocParameter(){"undefined"!=typeof isFromMultiLocation&&null!=isFromMultiLocation||(isFromMultiLocation=!1),"undefined"!=typeof b_themeID&&null!=b_themeID||(b_themeID=0),"undefined"!=typeof MultiLocBusinessID&&null!=MultiLocBusinessID||(MultiLocBusinessID=0)}window.addEventListener("message",listner,!1),_securelogin={model:{},Show2StepAuth:function(e,t){var i=e.split("|");if(this.model.ReturnValue=e,"2"!=i[1]&&"5"!=i[1]?(_redirectTo.model.UserType=i[7],$("#hdnUserType").val(i[7])):($("#hdnUserType").val(i[8]),_redirectTo.model.UserType=i[8]),"2"!=i[1]&&"5"!=i[1]||"0"==i[7]||!(i.length>10)||null!=i[10]&&""!=i[10])i.length>10&&null!=i[10]&&""!=i[10]&&void 0!==$("#hdnEmailAndCell2FScreen").val()&&null!=$("#hdnEmailAndCell2FScreen").val()&&""!=$("#hdnEmailAndCell2FScreen").val()&&$("#hdnEmailAndCell2FScreen").val()>_twoFactor.EmailAndCell2FScreen.None?RedirectTwoStepAuth(i,t):t&&8!=GLogintype?(o="",void 0!==sFromPage&&null!=sFromPage&&("ScreenLock"==sFromPage?TwoStepAuth.init("screenlock-privacypolicy",i[5],i[6],i[7],void 0,void 0,void 0,n,t,_redirectTo.model.UserType,i[3]):TwoStepAuth.init("privacypolicy",i[5],i[6],i[7],void 0,void 0,void 0,n,t,_redirectTo.model.UserType,i[3]))):this.AfterSuccessfullLogin();else{if("undefined"!=typeof vgAppicationType&&(vgAppicationType==objApplicationType.CheckinApp||vgAppicationType==objApplicationType.CustomerApp)&&"5"==i[1]&&1==isFromAppAutoSignIn){if(!$("#divLoginNew").is(":visible"))return callbacktomobile=e,void showLogin("yes",!0);isFromAppAutoSignIn=!1}var n=void 0!==i[11]&&""!=i[11]?i[11]:1,o="signupNew";"LoginPage"!=SignUp_FromPage.value&&"CMSMaster"!=SignUp_FromPage.value&&"ScreenLock"!=SignUp_FromPage.value&&"Login"!=SignUp_FromPage.value||(o=SignUp_FromPage.value),TwoStepAuth.init(o,i[5],i[6],i[7],void 0,void 0,void 0,n,t,i[8],i[3]),ShowLoadingPanelLogin(!1),openPopupVerification()}if("undefined"!=typeof isWindowsApp&&isWindowsApp)try{var a="login|"+sUserName+"|"+sPassword;window.external.notify(a)}catch(e){}},AfterSuccessfullLogin:function(){ReturnValue=this.model.ReturnValue,setCookie("loginTypeValue",GLogintype),_vgParseatkn(ReturnValue),getCookie("isSignupValue");var e=getCookie("isLoginValue"),t=getCookie("appleLoginSource");if(1==GLogintype&&null==e?(setCookie("isLoginValue",!1),setCookie("isSignupValue",!0)):1==GLogintype&&e&&(setCookie("isLoginValue",!0),setCookie("isSignupValue",!1)),5==t?(setCookie("isLoginValue",!0),setCookie("isSignupValue",!1)):6==t&&(setCookie("isLoginValue",!1),setCookie("isSignupValue",!0)),"undefined"!=typeof vgAppicationType&&1==vgAppicationType){var i=0;if(ReturnValue.split("|").length>=6?i=ReturnValue.split("|")[3]:parseInt(ReturnValue.split("|")[1])>0&&(i=ReturnValue.split("|")[1]),0==("undefined"!=typeof isOldVersionCustomerApp&&isOldVersionCustomerApp)){var n=ReturnValue.split("|"),o=n.length>1&&"4"==n[1],a=n.length>0?n[0]:"",s=n.length>4?n[4]:"",r=n.length>5?n[5]:"";(!baIsUndefine(IsBrandedApp)&&1==IsBrandedApp&&"2"!=n[1]||"undefined"!=typeof IsNewVersionCustomerAppForFbGoogleLogin&&null!=IsNewVersionCustomerAppForFbGoogleLogin&&""!==IsNewVersionCustomerAppForFbGoogleLogin&&null!=IsNewVersionCustomerAppForFbGoogleLogin&&1==IsNewVersionCustomerAppForFbGoogleLogin&&"2"!=n[1])&&(n.length>8&&(sUserName=n[8]),n.length>9&&(sPassword=n[9])),ReturnValue.split("|").length<5?sUserName=ReturnValue.split("|")[3]:n.length>8&&"2"!=n[1]&&(sUserName=n[8]),CallbackforMobileApp(0,0,"","","0",'5|~|{\\"username\\":\\"'+sUserName+'\\", \\"password\\":\\"'+sPassword.replace('"',"|~~|")+'\\", \\"UserID\\":'+i+', \\"LoginType\\":'+GLogintype+', \\"isFirstTimeCustomer\\":'+o+', \\"fullName\\":\\"'+a+'\\", \\"userEmailId\\":\\"'+r+'\\", \\"userImage\\":\\"'+s+'\\", \\"SocialUserID\\":\\"'+FBGoogleAppleUserID+'\\"}'),"undefined"!=typeof _home&&void 0!==_home.GetOutStandingReviewAndInvoiceCnt&&_home.GetOutStandingReviewAndInvoiceCnt(1)}else if(baIsUndefine(IsBrandedApp)||1!=IsBrandedApp||(sUserName=n.length>8?n[8]:"",sPassword=n.length>9?n[9]:""),ReturnValue.split("|").length<5?sUserName=ReturnValue.split("|")[3]:ReturnValue.split("|").length>8&&"2"!=ReturnValue.split("|")[1]&&(sUserName=ReturnValue.split("|")[8]),CallbackforMobileApp(0,0,"","","0","5|~|{ 'username':'"+sUserName+"', 'password':'"+sPassword.replace('"',"|~~|")+"' , 'UserID':"+i+" , 'LoginType':"+GLogintype+" , 'SocialUserID':"+FBGoogleAppleUserID+"}"),"undefined"!=typeof _home&&void 0!==_home.GetOutStandingReviewAndInvoiceCnt&&_home.GetOutStandingReviewAndInvoiceCnt(1),"undefined"!=typeof SignUp_FromPage&&"loginpage"==SignUp_FromPage.value.toLowerCase())return;isSignUpFromCustomerAPP||1!=GLogintype?5==GLogintype&&(ReturnValue.split("|").length>=12&&"NewAppleSignUp"==ReturnValue.split("|")[11]?SendAdjustDataMobileApp(JSAdjustEventName.marketplace_signup_completed,window.parent.JSAdjustEventToken.marketplace_signup_completed_eventtoken,i):SendAdjustDataMobileApp(JSAdjustEventName.marketplace_login_completed,JSAdjustEventToken.marketplace_login_completed_eventtoken,i)):SendAdjustDataMobileApp(JSAdjustEventName.marketplace_login_completed,JSAdjustEventToken.marketplace_login_completed_eventtoken,i),isSignUpFromCustomerAPP=!1}if("undefined"!=typeof Vsecure&&Vsecure.showHideCap(!1),"undefined"!=typeof recaptch&&(recaptch.showHideCap("False"),IsShowCapcha="False"),ReturnValue.split("|").length>=6){loggedInUserId=ReturnValue.split("|")[3],""!=ReturnValue.split("|")[0]?(UserNameArray=ReturnValue.split("|")[0],UserName=UserNameArray.split(" ")[0]+" "+(UserNameArray.split(" ")[1].length>1?UserNameArray.split(" ")[1].substring(0,1):UserNameArray.split(" ")[1])):UserName="",FullUserName=UserNameArray,$(".loginUserIntials").html(FindInitials(FullUserName,"SP")),$("#divBusinessfrom").length>0&&$("#divBusinessfrom").html("From :"+FullUserName),$("#dvUsername").html(UserName),UserID=loggedInUserId,UserEmail=ReturnValue.split("|")[5],void 0!==ReturnValue.split("|")[6]?UserCellNo=ReturnValue.split("|")[6]:UserCellNo="",$("#userImage").attr("src",ReturnValue.split("|")[4]);try{if(vgAppicationType==objApplicationType.CheckinApp&&void 0!==$("#CheckinImgUserProfile")){var l=ReturnValue.split("|")[4];""!=l?l.indexOf("user-female-img_155.jpg")>=0||l.indexOf("user-male-img_155.png")>=0?$("#CheckinImgUserProfile").html(FindInitials(FullUserName,"SP")):$("#CheckinImgUserProfile").addClass("lazy").css("background-image","url('"+ReturnValue.split("|")[4]+"')").lazyload():$("#CheckinImgUserProfile").html(FindInitials(FullUserName,"SP"))}}catch(e){}if("undefined"!=typeof _home){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType||(_home.CommonLogin(!0,UserName,ReturnValue.split("|")[4]),"undefined"!=typeof _siteBuilderDetail&&_home.GetOutStandingReviewAndInvoiceCnt(1)),"/"==tabSegment&&"2steps"!=this.model.ReturnValue.split("|")[9]&&(0==this.IsLoginRedirect()||$(window).width()<768)){_home.loadFavoriteBusinesses(),_home.loadUpComingAppointments(),_home.GetOutStandingReviewAndInvoiceCnt(1);try{"undefined"!=typeof _common&&void 0!==_common.FeaturedBusinessTooltip&&_common.FeaturedBusinessTooltip("login")}catch(e){}}if(void 0!==AfterBeforeLoginLiveStream){var c=!0;"4"==ReturnValue.split("|")[1]?c=!1:"1"==ReturnValue.split("|")[1]?("yes"==blNeedstoRedirect||"undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar)&&$(window).width()>=768&&(c=!1):"2"==ReturnValue.split("|")[1]&&ReturnValue.split("|").length>=8&&"6"!=ReturnValue.split("|")[8]&&("yes"==blNeedstoRedirect||"undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar)&&$(window).width()>=768&&(c=!1),1==c&&void 0!==AfterBeforeLoginLiveStream&&(void 0!==sFromPage&&"LiveStreamEventAddToCart"==sFromPage||AfterBeforeLoginLiveStream())}}try{"undefined"!=typeof _shopdetail&&null!=_shopdetail&&"function"==typeof _shopdetail.SetGoogleMapDirection&&_shopdetail.SetGoogleMapDirection()}catch(e){}}"undefined"!=typeof _common&&null!==_common&&"function"==typeof _common.GetLoginPlatformDetails&&"ScreenLock"!=sFromPage&&(isAmplitudeEventLog||(_common.GetLoginPlatformDetails(ReturnValue,sFromPage),isAmplitudeEventLog=!0)),ShowLoadingPanelLogin(!0),"undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CheckinApp||8!=GLogintype&&(sFromPage="undefined"!=typeof SignUp_FromPage?SignUp_FromPage.value:"");try{if(void 0!==GLogintype&&null!=GLogintype&&8==GLogintype&&"function"==typeof IsExistsAlxCookie&&IsExistsAlxCookie()&&"undefined"!=typeof redirectMyAccountPage&&null!=redirectMyAccountPage&&""!=redirectMyAccountPage)return void(window.location.href=redirectMyAccountPage)}catch(e){}if("LoginPage"!=sFromPage&&"ScreenLock"!=sFromPage&&HideSignup(),"HomePage"==sFromPage||"DefaultMaster"==sFromPage||"CMSMaster"==sFromPage||"ScreenLock"==sFromPage||"LoginPage"==sFromPage||"Login"==sFromPage||"CustomerMessagePage"==sFromPage){if("ShopDetail"==CommonFromPageForShopDetail&&"0"==ReturnValue.split("|")[1])try{"false"==IsWidget&&"false"==isCustomWebsite&&"false"==isFacebook&&ShowFavorites(),$Page.bookText(null)}catch(e){}this.DoLoginSuccess(),"CustomerMessagePage"==sFromPage&&("undefined"!=typeof _siteBuilderDetail&&void 0===_siteBuilderDetail.loginUserId||null==_siteBuilderDetail.loginUserId||""==_siteBuilderDetail.loginUserId||"0"==_siteBuilderDetail.loginUserId)&&(_siteBuilderDetail.loginUserId=UserID,localStorage.setItem("openCustomMessage","true"),location.reload())}else if("BookAppointment"==sFromPage||"BookWaitlistAppointment"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&BookingAfterLogin(businessID,UserID,sFromPage);else if("SubmitReview"==sFromPage)this.DoLoginSuccess(),this.IsLoginRedirect();else if("GiftCertificate"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&_siteBuilderDetail.createGC($("#hdnGCID").val());else if("Products"===sFromPage)this.DoLoginSuccess(),this.IsLoginRedirect();else if("ShoppingcartPopup"===sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&(0==_siteBuilderDetail.InvetoryID&&""!=_siteBuilderDetail.encInvetoryId?($("#divProductPreviewpageOnline").show(),$("#divProductListSection").hide()):($("#divShoppingcartpopup").modal("show"),_siteBuilderDetail.AddToCart(_siteBuilderDetail.InvetoryID,_siteBuilderDetail.loginQty,_siteBuilderDetail.loginTotalQuantity,1,"",_siteBuilderDetail.encInvetoryId)));else if("ReviewUC"==sFromPage)this.DoLoginSuccess(),_siteBuilderDetail.OpenReviewPopup();else if("WordPress"==sFromPage)$ManageWordPress.onLogin();else if("Zendesk"==sFromPage)$ZendeskLogin.onLogin();else if("LiveStreamEventBookmark"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&ManagaBusinessBookmark(objLiveStreamEventBookmark.obj);else if("LiveStreamEventAddToCartFromPopup"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&AddEventFromPublic();else if("LiveStreamEventAddToCart"==sFromPage){this.DoLoginSuccess(),0==this.IsLoginRedirect()&&ClassSignupPublic(objLiveStreamSignupPublic.appID,objLiveStreamSignupPublic.busID,!0);try{window.history.go(-1)}catch(e){}}else if("EventAddToCart1"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&BookingAfterLogin(businessID,UserID,"EventAddToCart1");else if("EventAddToCart2"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&BookingAfterLogin(businessID,UserID,"EventAddToCart2");else if("EventAddToCart3"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&BookingAfterLogin(businessID,UserID,"EventAddToCart3");else if("ClassSignup"==sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&BookingAfterLogin(businessID,UserID,"ClassSignup");else if("MembershipAddToCart"===sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&_onlineCheckout.MembershipAddToCart(objMembershipAddToCart);else if("GiftCertificateAddToCart"===sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&_onlineCheckout.GiftCertificateAddToCart(objGiftCertificateAddToCart);else if("ServiceAddToCart"===sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&_onlineCheckout.ServiceAddToCart(objServiceAddToCart);else if("ShoppingCartIconClick"===sFromPage)this.DoLoginSuccess(),0==this.IsLoginRedirect()&&($(objShoppingCartIconClick).attr("data-isbypass","true"),ShoppingCartIconClick(objShoppingCartIconClick));else if("CustomPackageAddToCart"===sFromPage)this.DoLoginSuccess();else if("FromForms"===sFromPage){this.DoLoginSuccess(),"undefined"==typeof loggedInUserId&&ReturnValue.split("|").length>=2&&(loggedInUserId=ReturnValue.split("|")[1],FullUserName=ReturnValue.split("|")[0]);var d="0";try{var u=ReturnValue.split("|");u.length>19&&void 0!==u[19]&&null!==u[19]&&""!==u[19].toString().trim()&&(d=u[19].toString().trim())}catch(e){console.error("Error extracting encUserID:",e),d="0"}var p={LoginUserID:loggedInUserId,UserName:FullUserName,EncUserID:d};window.parent.postMessage('{"eventType": "SendLoginData", "data": '+JSON.stringify(p)+"}","*")}else if("Invoice"===sFromPage)this.DoLoginSuccess();else if("ProviderLiveStream"===sFromPage){if(this.DoLoginSuccess(),0==this.IsLoginRedirect()){var h=[];h.push(_vgLiveStream.Init(ReturnValue.split("|")[3])),Promise.all(h).then(function(){console.log("sucess")},function(){console.log("failed")})}}else if("CustomerLiveStream"===sFromPage){if(this.DoLoginSuccess(),0==this.IsLoginRedirect()){var m=[];m.push(_vgLiveStream.Init(ReturnValue.split("|")[3])),Promise.all(m).then(function(){console.log("sucess")},function(){console.log("failed")})}}else clearlogincontrols(),ShowLoadingPanelLogin(!1);void 0!==$(".myaccount-link")&&0==$("#openlnkCalendar .caret").is(":visible")&&$(".myaccount-link").show(),0==this.IsLoginRedirect()&&void 0!==callBackLoginToHome&&"function"==typeof callBackLoginToHome&&callBackLoginToHome(!0)},DoLoginSuccess:function(){ReturnValue=this.model.ReturnValue,null!=ReturnValue.d&&(ReturnValue=ReturnValue.d);var e=ReturnValue.split("|");if("undefined"==typeof isWidget&&(isWidget="false",isCustomWebsite="false",isFacebook="false"),"Invoice"==sFromPage&&(location.href=location.href),(void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication||"undefined"!=typeof isWidget&&null!=isWidget&&"true"==isWidget.toLowerCase())&&widgetEncUserID(ReturnValue),window.self!=window.top){var t="undefined"!=typeof WebsiteBuilderType?WebsiteBuilderType:$("#hdnWebsiteBuilderType").val();if(("Builder"==t||"LogoutfromBuilder"==t)&&setBuilderVariables(ReturnValue,loggedInUserId))return!0}try{window.self==window.top&&("undefined"!=typeof vgAppicationType&&null!=vgAppicationType&&1==vgAppicationType||void 0!==e&&null!=e&&e.length>15&&setBuilderVariables(ReturnValue,loggedInUserId))}catch(e){}if("LoginPage"==sFromPage||"Login"==sFromPage){if("4"==e[1]||"5"==e[1])if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof isOldVersionCustomerApp&&isOldVersionCustomerApp)void 0!==_shopdetail.activeTabName&&"book-now"==_shopdetail.activeTabName.toLowerCase()||CallbackforMobileApp(0,0,"","",0,"7");else{setCookie("IsFirstTimeUser",!0);var i=getQueryStringData("ReturnUrl").toLowerCase();i.indexOf("paylatersignup")>0&&(i=(i=getQueryStringData("ReturnUrl").toLowerCase().split("?"))[0]),null==getQueryStringData("ReturnUrl")||void 0===getQueryStringData("ReturnUrl")||"/paylatersignup/invite"!=i&&"/myaccount/paymentmethods"!=getQueryStringData("ReturnUrl")?location.href=RedirectToPublicAccManagement:LoginRedirectTo()}else{try{"undefined"!=typeof localStorage&&"object"==typeof localStorage&&localStorage.setItem("atCode",ReturnValue.split("|")[13])}catch(e){}SetUserAuthCodeToken(ReturnValue,function(){if($(window).width(),!("5"!=e[7]&&"2"!=e[7]||String.isNullOrUndefineOrBlank(window.location.pathname)||"/oauth/fb"!=window.location.pathname.toString().toLowerCase()))return _FBBDP.LoginUserEmail=UserEmail,_FBBDP.FBoAuthPageLoad(e[3],0,"true",1),$("#divFbOAuthPopup .close").hide(),!0;LoginRedirectTo()})}return!0}if("4"!=e[1]&&"5"!=e[1]||"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue)if("3"==e[1])"undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&"false"==isWidget?$("#lnkCalender").show():$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),ShowLoadingPanelLogin(!1);else if("1"==e[1]&&"false"==isWidget){if("undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&"false"==isWidget?$("#lnkCalender").show():$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),"yes"==blNeedstoRedirect||"undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType)return;try{"undefined"!=typeof localStorage&&"object"==typeof localStorage&&localStorage.setItem("atCode",ReturnValue.split("|")[13])}catch(e){}return void SetUserAuthCodeToken(ReturnValue,function(){$(window).width()>=768&&(location.href=RedirectChangeBussinessSOPage)})}ShowLoadingPanelLogin(!1)}else if("2"==e[1])if("6"==e[8])"undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&"false"==isWidget?$("#lnkCalender").show():$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),ShowLoadingPanelLogin(!1);else{if("undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&"false"==isWidget?$("#lnkCalender").show():$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),"yes"==blNeedstoRedirect||"undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar&&("undefined"==typeof isWidget||"false"==isWidget.toLowerCase())){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType)return;try{"undefined"!=typeof localStorage&&"object"==typeof localStorage&&localStorage.setItem("atCode",ReturnValue.split("|")[13])}catch(e){}return void SetUserAuthCodeToken(ReturnValue,function(){$(window).width()>=768&&(location.href=RedirectChangeBussinessSOPage)})}ShowLoadingPanelLogin(!1)}else ShowLoadingPanelLogin(!1);else"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof isOldVersionCustomerApp&&isOldVersionCustomerApp?void 0!==_shopdetail.activeTabName&&"book-now"==_shopdetail.activeTabName.toLowerCase()||CallbackforMobileApp(0,0,"","",0,"7"):"undefined"!=typeof vgAppicationType&&vgAppicationType!=objApplicationType.CheckinApp&&"ProviderLiveStream"!=sFromPage&&"CustomerLiveStream"!=sFromPage&&"CustomerMessagePage"!=sFromPage&&"BookAppointment"!=sFromPage&&"ClassSignup"!=sFromPage&&(setCookie("IsFirstTimeUser",!0),"false"==isWidget&&"false"==isFacebook?location.href=RedirectToPublicAccManagement:(chkMultiLocParameter(),153758==_shopdetail.businessID?location.href="/us04/myaccount/profile?IsPopup="+IsPopup+"&IsBusinessWidgetPage="+isWidget+"&IsFacebookPage="+isFacebook+"&BusinessID="+_shopdetail.businessID+"&b_themeID="+b_themeID+"&IsFromMultiLocation="+isFromMultiLocation+"&MultiLocBusinessID="+MultiLocBusinessID:location.href="/myaccount/profile?IsPopup="+IsPopup+"&IsBusinessWidgetPage="+isWidget+"&IsFacebookPage="+isFacebook+"&BusinessID="+_shopdetail.businessID+"&b_themeID="+b_themeID+"&IsFromMultiLocation="+isFromMultiLocation+"&MultiLocBusinessID="+MultiLocBusinessID));return"ScreenLock"!=sFromPage&&("undefined"!=typeof LoginHeader_divLogin&&(LoginHeader_divLogin.style.display="none",LoginHeader_ddLogout.style.display="",LoginHeader_lblLoginName.innerHTML="<strong>Welcome,</strong> "+e[0]),4==e.length&&(""!=ReturnValue.split("|")[0]?(UserNameArray=ReturnValue.split("|")[0],UserName=UserNameArray.split(" ")[0]+" "+(UserNameArray.split(" ")[1].length>1?UserNameArray.split(" ")[1].substring(0,1):UserNameArray.split(" ")[1])):UserName="",FullUserName=UserNameArray,$("#dvUsername").html(UserName),$(".loginUserIntials").html(FindInitials(FullUserName,"SP")),UserID=e[1],UserName=e[0],UserEmail=e[3],"undefined"!=typeof _home&&("undefined"!=typeof vgAppicationType&&1==vgAppicationType||_home.CommonLogin(!0,UserName,"https://vagaro.azureedge.net/static-content/Images/user-male-img_155_new!1.png"))),"Login"==sFromPage&&LoginRedirectTo()),HideLogin(),"undefined"!=typeof hdnLogin&&""!=hdnLogin.value&&LoginRedirectTo(),"undefined"!=typeof $Page&&"function"==typeof $Page.getHandler&&$Page.getHandler().afterLogin(),!0},IsLoginRedirect:function(){var e=this.model.ReturnValue;null!=e.d&&(e=e.d);var t=e.split("|");if("4"!=t[1]&&"5"!=t[1]||"ProviderLiveStream"==sFromPage||"CustomerLiveStream"==sFromPage||"BookAppointment"==sFromPage||"ClassSignup"==sFromPage||"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue)return"1"==t[1]&&("undefined"==typeof isWidget||"false"==isWidget)&&("yes"==blNeedstoRedirect||"undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar)||"undefined"!=typeof hdnLogin&&""!=hdnLogin.value;if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){if(void 0!==_shopdetail.activeTabName&&"book-now"==_shopdetail.activeTabName.toLowerCase())return!1}else if("undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CheckinApp)return!1;return!0},showAlert:function(e,t){"undefined"==typeof bootbox?(alert(e),"function"==typeof t&&t()):vagaro.alertsmall({message:e,title:"Alert",callback:t})},getJsonVal:function(e){return null==e?"null":'"'+e+'"'},isLocalhost:function(){return window.location.hostname.indexOf("localhost")>=0}};var WidgetParamsdata="";if(location.href.toLowerCase().indexOf("onlinechoosebusiness.aspx")&&"undefined"!=typeof isWidget&&"True"==isWidget){var formAction=$("#aspnetForm").attr("action"),queryString=formAction.split("?")[1],urlParams=new URLSearchParams(queryString);void 0!==urlParams&&null!=urlParams&&""!=urlParams&&(WidgetParamsdata="?"+urlParams)}var lgsuccess_new='<div id="dvloginsuccess" style="display: none" class="loginlink">';lgsuccess_new+="</div>";var lgsuccess='<div id="dvloginsuccess" style="display: none" class="loginlink EmbeddedWidgetLoginlink">';lgsuccess+="</div>";var menuItem='<div class="mobile-dropdown-link header">';function injecthtml(){var e=menuItem,t=document.getElementById("dvlogindropdown"),i=lgsuccess;"undefined"!=t&&null!=t&&""!=t?t.innerHTML=e:"undefined"!=i&&null!=i&&""!=t&&(i.innerHTML=e);var n=$("#mobile-menu").find("#dvlogindropdown");n.length>0&&(n.html(e),n.find("a").each(function(){$(this).removeClass("profile-dropdown-links w-dropdown-link w-hidden-main").addClass("mobile-dropdown-link")}),n.find(".loginlink, .mobile-dropdown-link").show());var o=document.getElementById("divbusinesslogin"),a=lgsuccess_new;"undefined"!=o&&null!=o&&""!=o?o.innerHTML=e:"undefined"!=a&&null!=a&&""!=o&&(a.innerHTML=e)}function DoLoginSuccess(e){null!=e.d&&(e=e.d);if(""==e)return ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alert("Invalid Username or Password"):alert("Invalid Username or Password"),SignUp_CCSwipe.value="",!1;if("-1"==e)ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alert("There is some problem while swiping the card.Please swipe it again!"):alert("There is some problem while swiping the card.Please swipe it again!"),SignUp_CCSwipe.value="";else if("-2"==e)ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alert("Invalid Username or Card Swipe"):alert("Invalid Username or Card Swipe"),SignUp_CCSwipe.value="";else if("-3"==e)ShowLoadingPanelLogin(!1),"undefined"!=typeof bootbox?vagaro.alert("Something went wrong. Please try again!"):alert("Something went wrong. Please try again!"),SignUp_CCSwipe.value="";else{var t=e.split("|");"undefined"==typeof isWidget&&(isWidget="false",isCustomWebsite="false",isFacebook="false");try{"undefined"!=typeof localStorage&&"object"==typeof localStorage&&localStorage.setItem("atCode",e.split("|")[13])}catch(e){}SetUserAuthCodeToken(e,function(){if("LoginPage"==sFromPage||"Login"==sFromPage){if("4"==t[1]||"5"==t[1])"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof isOldVersionCustomerApp&&isOldVersionCustomerApp?void 0!==_shopdetail.activeTabName&&"book-now"==_shopdetail.activeTabName.toLowerCase()||CallbackforMobileApp(0,0,"","",0,"7"):(setCookie("IsFirstTimeUser",!0),location.href=RedirectToPublicAccManagement);else{if(!($(window).width()>=768))return location.href="/",!1;LoginRedirectTo()}return!0}if("4"!=t[1]&&"5"!=t[1]||"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue)if("3"==t[1])"undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&$("#lnkCalender").show(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),ShowLoadingPanelLogin(!1);else if("1"==t[1]&&"false"==isWidget)if("undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&0==isWidget?$("#lnkCalender").show():$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),"yes"==blNeedstoRedirect||"undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar){if("undefined"!=typeof RedirectToCalendar&&(RedirectToCalendar="no"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType)return;if($(window).width()>=768)return void("Login"==sFromPage?LoginRedirectTo():location.href=RedirectChangeBussinessSOPage)}else ShowLoadingPanelLogin(!1);else if("2"==t[1])if("6"==t[8])"undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&"false"==isWidget?$("#lnkCalender").show():$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),ShowLoadingPanelLogin(!1);else{if("undefined"!=typeof LoginHeader_spnSOLanding?null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display=""):(null!=$("#lnkCalender")&&0==isWidget?$("#lnkCalender").show():$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","")),"yes"==blNeedstoRedirect||"undefined"!=typeof RedirectToCalendar&&"yes"==RedirectToCalendar&&("undefined"==typeof isWidget||"false"==isWidget.toLowerCase())){if("undefined"!=typeof RedirectToCalendar&&(RedirectToCalendar="no"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType)return;try{"undefined"!=typeof localStorage&&"object"==typeof localStorage&&localStorage.setItem("atCode",e.split("|")[13])}catch(e){}return void SetUserAuthCodeToken(e,function(){$(window).width()>=768&&(location.href=RedirectChangeBussinessSOPage)})}ShowLoadingPanelLogin(!1)}else ShowLoadingPanelLogin(!1);else"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof isOldVersionCustomerApp&&isOldVersionCustomerApp?void 0!==_shopdetail.activeTabName&&"book-now"==_shopdetail.activeTabName.toLowerCase()||CallbackforMobileApp(0,0,"","",0,"7"):(setCookie("IsFirstTimeUser",!0),"false"==isWidget&&"false"==isFacebook?location.href=RedirectToPublicAccManagement:(chkMultiLocParameter(),location.href="/myaccount/profile?IsPopup="+IsPopup+"&IsBusinessWidgetPage="+isWidget+"&IsFacebookPage="+isFacebook+"&BusinessID="+GetBusinessID()+"&b_themeID="+b_themeID+"&IsFromMultiLocation="+isFromMultiLocation+"&MultiLocBusinessID="+MultiLocBusinessID));return"ScreenLock"!=sFromPage&&("undefined"!=typeof LoginHeader_divLogin&&(LoginHeader_divLogin.style.display="none",LoginHeader_ddLogout.style.display="",LoginHeader_lblLoginName.innerHTML="Welcome, "+t[0]),4==t.length&&(""!=e.split("|")[0]?(UserNameArray=e.split("|")[0],UserName=UserNameArray.split(" ")[0]+" "+(UserNameArray.split(" ")[1].length>1?UserNameArray.split(" ")[1].substring(0,1):UserNameArray.split(" ")[1])):UserName="",FullUserName=UserNameArray,$("#dvUsername").html(UserName),$("#userImage").attr("src","https://vagaro.azureedge.net/static-content/Images/user-male-img_155_new.png"),UserID=t[1],UserName=t[0],UserEmail=t[3],$("#logOut").slideUp(),$("#userlogin").slideDown())),HideLogin(),null!=hdnLogin&&"undefined"!=hdnLogin&&""!=hdnLogin.value&&LoginRedirectTo(),"undefined"!=typeof $Page&&"function"==typeof $Page.getHandler&&$Page.getHandler().afterLogin(),!0})}}function LoginUserRememberMeApp(e,t){ShowLoadingPanelLogin(!0),sUserName=e,sPassword=t,signin(null,null,null,e,"","","",1,!1,!0,EncPV(t),getek(),getei(),"")}function LogoutForceFully(){CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,_onlineCheckout.CallFailed)}function fnLogout(){var e=[];"undefined"!=typeof bootbox?bootbox.confirm({title:"Logout",message:"Are you sure you want to logout?",callback:function(t){t&&(e.length>0&&(_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.ExceptionStorage),$("#lblEventCart").html("0"),_onlineCheckout.GetCartItemCount(0),"block"==$("#divEventCartDetail").css("display").toLowerCase()&&_shopdetail.ShowHideCart(!1)),"undefined"!=typeof _shopdetail&&void 0!==_shopdetail.GetRescheduleDetail&&null!=_shopdetail.GetRescheduleDetail()&&_shopdetail.ClearClassControls(!0),"undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart&&(onlineShoppingCart={}),"undefined"!=typeof onlineShoppingCartmain&&null!=onlineShoppingCartmain&&(onlineShoppingCartmain={}),void 0!==isAmplitudeEventLog&&(isAmplitudeEventLog=!1),CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed),$("#dvlogindropdown").empty(),$("#mobile-menu").children("#dvlogindropdown").empty(),$("#divbusinesslogin").empty(),$("#desktop-menu").children("#divbusinesslogin").empty(),_vgClassSessionSelection.commonProperty.spNameClass="",_vgClassSessionSelection.commonProperty.spIdClass="",void 0!==deleteKeyValue&&deleteKeyValue())}}):CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed)}function CallSuccessLogout(e){if(null!=e.d&&(e=e.d),clearCookie("isSignupValue"),clearCookie("isLoginValue"),clearCookie("loginTypeValue"),clearCookie("appleLoginSource"),clearCookie("WebsiteBuilder"),clearAlexaCookie("_vgamzn"),clearAlexaCookie("_vggoogle"),e){"undefined"!=typeof publicUserGroupID?publicUserGroupID="":"undefined"!=typeof _siteBuilderDetail&&void 0!==_siteBuilderDetail.ComponentResponse&&null!=_siteBuilderDetail.ComponentResponse&&void 0!==_siteBuilderDetail.ComponentResponse.lstUserInfo&&null!=_siteBuilderDetail.ComponentResponse.lstUserInfo&&void 0!==_siteBuilderDetail.ComponentResponse.lstUserInfo.GroupID&&null!=_siteBuilderDetail.ComponentResponse.lstUserInfo.GroupID&&(_siteBuilderDetail.ComponentResponse.lstUserInfo.GroupID=""),"undefined"==typeof _siteBuilderDetail||void 0===_siteBuilderDetail.loginUserId||null==_siteBuilderDetail.loginUserId&&""==_siteBuilderDetail.loginUserId&&"0"==_siteBuilderDetail.loginUserId||void 0===_siteBuilderDetail.IsVagaroConnectOpen||void 0===_siteBuilderDetail.HideVagaroConnectChat||(_siteBuilderDetail.loginUserId="0",_siteBuilderDetail.IsVagaroConnectOpen=!1,_siteBuilderDetail.HideVagaroConnectChat()),void 0!==IsUserGroupCheck&&(IsUserGroupCheck=!1),void 0!==shopdetailuserGroupId&&(shopdetailuserGroupId=""),"undefined"!=typeof TwoStepAuth&&TwoStepAuth.switchToStep1(),$("#divUserName").html("");try{"object"==typeof localStorage&&(localStorage.removeItem("cusList"),localStorage.removeItem("cusSynInfo"),localStorage.removeItem("ReviewPlatformData"))}catch(e){}if(clearCookie("IsFirstTimeUser"),"undefined"!=typeof LoginHeader_divLogin)LoginHeader_divLogin.style.display="",LoginHeader_ddLogout.style.display="none",LoginHeader_lblLoginName.innerHTML="",void 0!==$(".myaccount-link")&&$(".myaccount-link").hide(),null!=LoginHeader_spnSOLanding&&(LoginHeader_spnSOLanding.style.display="none");else{$("#dvUsername").html(""),UserName="",FullUserName="",$("#hdnUserName").val(""),UserID="",$("#hdnUserId").val(""),UserEmail="",$("#hdnUserEmail").val(""),UserCellNo="",null!=$("#lnkCalender")&&$("#lnkCalender").hide(),$("#lnkCalenderCustom","#userloginLinks").css("display","none"),$(".loginlink ,#divLoginDetail").hide(),$("#divLoginDetailCart").hide(),$(".lnkLogin").show(),_common.CloseToggelmobileMenu(),"undefined"!=typeof _home&&($("#scBookMarkSection").hide(),_home.ResetUpcomingAppObjDivhide(),void 0!==AfterBeforeLoginLiveStream&&AfterBeforeLoginLiveStream());try{$("#hdnUserType").val(""),UserType="","undefined"!=typeof _common&&void 0!==_common.FeaturedBusinessTooltip&&_common.FeaturedBusinessTooltip("logout")}catch(e){}}if(null!=readCookie("VagaroUID"))var t=readCookie("VagaroPWD");if(null!=t&&navigator.appName,void 0!==callBackLogout&&"function"==typeof callBackLogout&&callBackLogout(),window.location.href.indexOf("gift-certificates")>0&&_shopdetail.backClickGCGenerete(),1!=window.location.href.includes("/photos/")&&1!=window.location.href.includes("/my-liked-styles")||!$("#photos").hasClass("active")||setMylikesGalleryFilterValue(0,"aMyLikesOption_filter_0",1,0),"undefined"!=typeof isWindowsApp&&isWindowsApp)try{window.external.notify("loggedout")}catch(e){}if("undefined"!=typeof hdnLogin)if(""!=hdnLogin.value)if("logout"==hdnLogin.value){var i=$("#hdnWhereToRedirectInCaseOfNewDesign").val();""!=i&&"/login"!=i?location.href=i:""!=i&&"/login"==i?showLogin("yes",!0):""!=readCookie("promotionalurl")&&readCookie("PromotionUIDetails")?location.href="/salons/"+readCookie("promotionalurl"):location.href="/"}else LoginRedirectTo();else""!=$("#hdnWhereToRedirectInCaseOfNewDesign").val()&&"/login"==$("#hdnWhereToRedirectInCaseOfNewDesign").val()?showLogin("yes",!0):"undefined"!=typeof $Page&&"function"==typeof $Page.getHandler&&$Page.getHandler().afterLogout();try{"undefined"!=typeof _shopdetail&&null!=_shopdetail&&"function"==typeof _shopdetail.SetGoogleMapDirection&&_shopdetail.SetGoogleMapDirection()}catch(e){}if("undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget())try{widgetcookievalue="";var n={Key:"vdsid",Value:""};"undefined"!=typeof $Interframe&&void 0!==$Interframe.setStoratevalueintoParent&&$Interframe.setStoratevalueintoParent(n)}catch(e){}(window.location.href.indexOf("book-now")>0||window.location.href.indexOf("shopping-bag")>0||window.location.href.indexOf("paymentmethods")>0)&&(void 0===fnLogoutwithoutConfirm||1==fnLogoutwithoutConfirm?location.reload(!0):fnLogoutwithoutConfirm=void 0)}}function CallFailed(e){_IsProcessing=!1,ShowLoadingPanelLogin(!1),"undefined"!=typeof SignUp_CCSwipe&&null!=SignUp_CCSwipe&&(SignUp_CCSwipe.value="")}function HideSignup(){"undefined"!=typeof HideDynamicPopup&&(HideDynamicPopup("divSignUp"),$("#dvSignupNew").hide()),HideLogin()}menuItem+="<div>Account</div>",menuItem+="</div>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/profile'+WidgetParamsdata+'" id="accprofile" title="My Profile">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon profile-SlideRight" aria-hidden="true">',menuItem+='<div class="profilesidePic profilesidePicMobile"></div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">My Profile</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/familyfriends'+WidgetParamsdata+'" id="accfamilyfriends" title="Family & Friends">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf0c0;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Family & Friends</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/notification'+WidgetParamsdata+'" id="accnotification" title="Notification Settings">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf0f3;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Notification Settings</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/bookmarks'+WidgetParamsdata+'" id="accbookmarks" title="Bookmarks">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf02e;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Bookmarks</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/reviews'+WidgetParamsdata+'" id="accreviews" title="Reviews">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf044;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Reviews</div>',menuItem+='<div style="display: none" class="notification-bubble count-iconRound revcount"></div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<div class="mobile-dropdown-link header">',menuItem+="<div>Purchases</div>",menuItem+="</div>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/appointments'+WidgetParamsdata+'" id="accappointments" title="Appointments">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf133;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Appointments</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/products'+WidgetParamsdata+'" id="accproducts" title="Products">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon font-awesome-light-pro">',menuItem+='<div class="common-vagaro-icon">&#xe901;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Products</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/packages'+WidgetParamsdata+'" id="accpackages" title="Packages">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf49e;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Packages</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/memberships'+WidgetParamsdata+'" id="accmemberShips" title="Memberships">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf47f;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Memberships</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<div class="mobile-dropdown-link header">',menuItem+="<div>Payments</div>",menuItem+="</div>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/payrollhistory'+WidgetParamsdata+'" runat="server" id="accpayrollhistory" title="Payroll History">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf1da;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Payroll History</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/paymentmethods'+WidgetParamsdata+'" runat="server" id="myaccountpaymentmethods" title="Payments">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf09d;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Payment Methods</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/buynowpaylater'+WidgetParamsdata+'" id="accvpaylater" title="Buy Now, Pay Later" >',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">',menuItem+='<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="28" height="22" viewBox="0 0 3840.000000 2160.000000" preserveAspectRatio="xMidYMid meet"><g transform="translate(0.000000,2160.000000) scale(0.100000,-0.100000)" fill="currentColor" stroke="none"><path d="M18920 21087 c-3 -2 -113 -7 -245 -11 -132 -4 -251 -8 -265 -10 -14 -2 -79 -7 -145 -11 -66 -3 -140 -8 -165 -11 -25 -2 -119 -11 -210 -19 -2925 -273 -5731 -1484 -7935 -3423 -391 -345 -810 -760 -1196 -1187 -59 -65 -233 -267 -284 -330 -22 -27 -54 -65 -71 -84 -128 -149 -398 -502 -601 -787 -1493 -2093 -2398 -4609 -2573 -7154 -6 -85 -12 -180 -15 -210 -8 -101 -20 -572 -20 -790 0 -228 13 -738 19 -780 2 -14 7 -77 10 -140 23 -407 96 -1022 177 -1490 216 -1239 619 -2512 1144 -3607 l78 -163 1569 0 c1253 0 1568 3 1562 13 -4 6 -58 93 -119 192 -880 1411 -1435 2989 -1630 4630 -87 733 -101 1549 -40 2280 237 2819 1518 5451 3580 7354 1630 1505 3648 2494 5815 2851 324 53 723 101 970 115 58 4 110 8 117 10 56 18 913 26 1240 12 1541 -64 3103 -468 4503 -1163 470 -233 824 -437 1259 -728 772 -514 1502 -1148 2124 -1844 1881 -2106 2910 -4836 2881 -7642 -23 -2102 -611 -4127 -1710 -5881 -60 -95 -113 -179 -117 -186 -7 -11 277 -13 1566 -13 l1574 0 83 178 c512 1093 861 2158 1089 3322 106 543 185 1138 221 1665 5 88 12 183 15 210 8 94 20 550 20 790 0 792 -61 1529 -191 2310 -480 2884 -1845 5552 -3889 7600 -273 274 -347 345 -535 515 -1468 1325 -3220 2335 -5110 2945 -362 117 -557 172 -933 266 -721 178 -1592 319 -2257 364 -52 4 -104 8 -116 10 -12 2 -93 6 -180 10 -87 4 -170 9 -184 11 -34 6 -874 16 -880 11z"></path><path d="M19120 13713 c-586 -30 -1109 -106 -1690 -247 -1180 -285 -2413 -819 -3335 -1443 -138 -94 -405 -291 -405 -299 0 -5 1160 -2458 1165 -2462 2 -2 52 39 112 90 305 264 661 518 1028 734 166 97 570 304 737 378 535 235 1110 408 1598 481 436 65 934 72 1353 19 1047 -132 1590 -629 1564 -1429 -5 -170 -29 -271 -93 -399 -138 -275 -430 -471 -869 -581 -183 -47 -335 -70 -685 -105 -2587 -260 -4367 -876 -5391 -1868 -558 -540 -880 -1162 -988 -1907 -31 -212 -40 -367 -36 -625 10 -602 121 -1094 355 -1575 262 -536 693 -999 1231 -1320 571 -339 1267 -547 2079 -620 245 -22 727 -30 925 -16 498 37 949 141 1405 324 129 52 420 194 555 272 638 366 1196 911 1590 1551 l85 137 0 -961 0 -962 1665 0 1665 0 -3 4283 c-3 4640 1 4325 -52 4702 -177 1256 -722 2204 -1646 2866 -727 520 -1706 844 -2849 943 -322 28 -887 49 -1070 39z m2060 -7515 c0 -457 -135 -1020 -349 -1463 -301 -622 -736 -1079 -1290 -1355 -362 -180 -715 -261 -1137 -261 -218 0 -289 5 -464 32 -667 104 -1075 432 -1176 945 -24 117 -24 380 -1 514 122 714 676 1180 1712 1439 429 107 1017 189 1555 216 69 4 135 8 148 10 12 2 138 7 280 11 141 4 258 8 260 9 1 1 106 3 232 4 l230 2 0 -103z"></path></g></svg>',menuItem+="</div>",menuItem+="</div>",menuItem+='<div class="side-nav-Text">Buy Now, Pay Later</div>',menuItem+='<div style="display: none" class="notification-bubble count-iconRound fTraCount"></div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/points'+WidgetParamsdata+'" id="accpoints" title="Points">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf005;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Points</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/gift'+WidgetParamsdata+'" id="accgift" title="Gift Cards">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf663;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Gift Cards</div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<a class="profile-dropdown-links w-dropdown-link loginlink" href="/myaccount/invoices'+WidgetParamsdata+'" id="myaccountivoices" title="Invoices">',menuItem+='<div class="d-flex">',menuItem+='<div class="side-nav-icon">',menuItem+='<div class="font-awesome-light-pro">&#xf570;</div>',menuItem+="</div>",menuItem+='<div class="side-nav-Text">Invoices</div>',menuItem+='<div style="display: none" class="notification-bubble count-iconRound invcount"></div>',menuItem+="</div>",menuItem+="</a>",menuItem+='<div class="mobile-separator hideincustomdesign"></div>';var glbRedirectPageURLForIPad="";function getCookie(e){if(void 0!==$.cookie)return $.cookie(e);var t,i,n,o=document.cookie.split(";");for(t=0;t<o.length;t++)if(i=o[t].substr(0,o[t].indexOf("=")),n=o[t].substr(o[t].indexOf("=")+1),(i=i.replace(/^\s+|\s+$/g,""))==e)return unescape(n)}function showCommonLoginPopup(e){ShowLoadingPanelLogin(!0),"ScreenLock"==(sFromPage=e)?$("body").addClass("screenlocksignin"):$("body").removeClass("screenlocksignin");var t=!1;"undefined"!=typeof callbacktomobile&&null!=callbacktomobile&&""!=callbacktomobile&&"undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CheckinApp&&("5"==callbacktomobile.split("|")[1]&&(t=!0));if("undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CheckinApp&&0==t)CallbackforMobileApp(0,0,"","",0,"2|~|3");else if(""!=$("#dvSignupNew").html()&&null!=$("#dvSignupNew").html()||"ScreenLock"==sFromPage){$("#pnlLogin").show(),$("#dvAuth").hide(),$("#dvSignupNew").show(),showCommonLoginPopupDetails(sFromPage);try{("undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.isFBExtensions&&1==vagaroFBExtensions.isFBExtensions||void 0!==_shopdetail.isFBExtensions&&"true"==_shopdetail.isFBExtensions.toLowerCase()||"undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.IsFirstTimeCustomer&&void 0!==vagaroFBExtensions.data)&&$("#divNewToVagaro").hide()}catch(e){}}else{resetCotrolForAppleFNameLName(),hideAppleFNameLNameControls(),$("#dvSignupNew").html("");var i={UserControlPath:"~/UserControls/SignupNew.ascx",PageNamePath:"~/Public.Master",isRemoveFormTag:!0};"function"==typeof CallWSJSON?CallWSJSON("CalendarWebService.asmx/LoadUserControl",JSON.stringify(i),showCommonLoginPopupSuccess_LoadUserControlCCPopup,showCommonLoginPopupFail_LoadUserControlCCPopup):CallWSJSON1("CalendarWebService.asmx/LoadUserControl",JSON.stringify(i),showCommonLoginPopupSuccess_LoadUserControlCCPopup,showCommonLoginPopupFail_LoadUserControlCCPopup)}}function showCommonLoginPopupSuccess_LoadUserControlCCPopup(e){var t=sFromPage,i=isFromForms,n=QueryStringValue;try{$("#dvSignupNew").show();var o=$("#dvSignupNew"),a=e&&void 0!==e.d&&null!=e.d?e.d:"";o.html(""),""!=a&&o.append(a)}catch(e){}sFromPage=t,CommonFromPage=t,isFromForms=i,QueryStringValue=n;try{$("#hdnLoginQueryString").length&&$("#hdnLoginQueryString").val(n)}catch(e){}showCommonLoginPopupDetails(sFromPage),1==isFromForms&&($(".sign-up-image").hide(),$("#btnBackLogin").hide(),$("#btnBackSignup").hide(),$(".login-backbtn").hide()),"ProviderLiveStream"!==sFromPage&&"CustomerLiveStream"!==sFromPage||$("#btnBackLogin").hide(),"undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.IsFirstTimeCustomer&&void 0!==vagaroFBExtensions.data&&0==vagaroFBExtensions.IsFirstTimeCustomer&&($("#txtUsernameP").val(vagaroFBExtensions.data.user_email),$("#divNewToVagaro").hide());try{("undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.isFBExtensions&&1==vagaroFBExtensions.isFBExtensions||void 0!==_shopdetail.isFBExtensions&&"true"==_shopdetail.isFBExtensions.toLowerCase())&&$("#divNewToVagaro").hide()}catch(e){}"undefined"!=typeof isBrandedAppForApproval&&1==isBrandedAppForApproval&&($("#strAppleSignInBtn").text("Sign in with Apple"),$(".sign-up-image").hide());try{if("undefined"!=typeof callbacktomobile&&null!=callbacktomobile&&""!=callbacktomobile&&"undefined"!=typeof vgAppicationType&&(vgAppicationType==objApplicationType.CheckinApp||vgAppicationType==objApplicationType.CustomerApp))"5"==callbacktomobile.split("|")[1]&&(_securelogin.Show2StepAuth(callbacktomobile),callbacktomobile=null,isFromAppAutoSignIn=!1)}catch(e){}}function showCommonLoginPopupFail_LoadUserControlCCPopup(e){ShowLoadingPanal(!1);try{var t=JSON.parse(e.responseText);vagaro.alert(t.Message)}catch(e){vagaro.alert("Something went wrong, Try Again.")}}function showCommonLoginPopupDetails(e){sFromPage=e,LoadFacebook(cAppID,cChannelURL);var t=IsCookieEnabled();0!=t&&1!=t||void 0!==_common.IsCookieLessWidget&&0!=_common.IsCookieLessWidget()?("ScreenLock"==sFromPage&&ShowLoadingPanelLogin(!0),PopupLoginShow()):showCoockiePopup(t)}function showCoockiePopup(e){if(1==IsCookieEnabled()){var t=JSON.stringify({object:"openinNewWindow",URL:window.self.location.href});return window.parent.postMessage(t,"*"),void ShowLoader(!1)}try{1==e?(_pCookieDisabled.style.display="none",_pCookieThirdPartDisabled.style.display="block"):(_pCookieDisabled.style.display="block",_pCookieThirdPartDisabled.style.display="none"),"undefined"==typeof _common?($find("modalpopupCookie").show(),ShowLoader(!1)):($("#dvCookieModal").modal("show"),ShowLoader(!1))}catch(e){}}function openloginpopup(){"undefined"!=typeof BasePage&&"Detail"==BasePage&&$("#dvRegister").removeClass("fade").modal("hide"),String.isNullOrUndefineOrBlank(sFromPage)||"Login"!=sFromPage||$(".modal-backdrop").removeClass("show"),openlogin()}function openlogin(){ShowLoader(!0),HideSignup(),$("#dvSignupNew").show(),SignUp_ModalPopupLoginShow(),ShowLoader(!1)}function openPopuplogin(){openPopupVerification(),$("#dvSignupNew").show(),SignUp_ModalPopupLoginShow()}function openPopupVerification(){$(".signup-user-found").addClass(" w-hiddenstrict"),$(".sign-in-btn-divinner").removeClass(" w-hiddenstrict"),$(".sign-in-logo-div").removeClass(" w-hiddenstrict")}function ShowFnameLnameControlForAppleLogin(e){$(".sign-in-btn-div.stepLogin1").addClass("slide1"),$(".sign-in-btn-div.stepAppleflname").addClass("slide2"),$("#divLoginStep1").addClass(" w-hiddenstrict"),$("#divAppleFLStep1").removeClass("w-hiddenstrict"),$(".stepLogin1").addClass("anileft100"),$(".loginbtncont").addClass("anileft100"),bappIsUndefine(IsBrandedApp)||1!=IsBrandedApp||($("#divAppleFLStep1 .loginfrmcontrol").show(),$("#divAppleFLStep1 .loginbtncont").show()),setTimeout(function(){$("#divAppleFLStep1").addClass("slide2")},50),1!==$("#dvRegister.modal.fade.signupmodalpopup.in").length&&1!==$("#dvRegister.modal.fade.signupmodalpopup.show").length||(null!=SignUp_FromPage&&null!=SignUp_FromPage&&null!=SignUp_FromPage.value&&null!=SignUp_FromPage.value&&"loginpage"!=SignUp_FromPage.value.toString().trim().toLowerCase()?($("#dvRegister").modal("hide"),$("#divLoginNew").modal("show")):null!=SignUp_FromPage&&null!=SignUp_FromPage&&null!=SignUp_FromPage.value&&null!=SignUp_FromPage.value&&"loginpage"==SignUp_FromPage.value.toString().trim().toLowerCase()&&(hidePopup(),setTimeout(function(){$(".sign-in-btn-div.stepLogin1").addClass("slide1"),$(".sign-in-btn-div.stepAppleflname").addClass("slide2")},50))),setTimeout(function(){var e=document.getElementById("txtFNameAppleP");void 0!==e&&null!=e&&null!=e&&$(e).attr("tabindex",1);var t=document.getElementById("txtLNameAppleP");void 0!==t&&null!=t&&null!=t&&$(t).attr("tabindex",2)},50)}function resetCotrolForAppleFNameLName(){try{var e=document.getElementById("txtFNameAppleP"),t=document.getElementById("txtLNameAppleP");null!=e&&null!=e&&null!=t&&null!=t&&(e.value="",t.value="",setTimeout(function(){$(e).removeClass("errorInput"),$(e).removeAttr("required"),$(t).removeClass("errorInput"),$(t).removeAttr("required"),document.getElementById("txtFNameAppleP-error").style.display="none",document.getElementById("txtLNameAppleP-error").style.display="none"},20),$(e).removeAttr("tabindex",1),$(t).removeAttr("tabindex",2)),$("#txtUsernameP").focus()}catch(e){console.log(e)}}function updateFNameLNameAppleLoginCallback(e,t){try{if(13==e){var i=!0,n=null;null!=appleSignInData&&null!=appleSignInData&&""!=appleSignInData.toString().trim()&&(n=appleSignInData.split("|"));var o=document.getElementById("txtFNameAppleP");$(o).attr(""),""!=o.value?($(o).removeClass("errorInput"),$(o).removeAttr("required"),document.getElementById("txtFNameAppleP-error").innerHTML="",document.getElementById("txtFNameAppleP-error").style.display="none"):(document.getElementById("txtFNameAppleP-error").style.display="block",document.getElementById("txtFNameAppleP-error").innerHTML="required.",$(o).addClass("errorInput"),$(o).attr("required","required"),i=!1);var a=document.getElementById("txtLNameAppleP");if(""!=a.value?(document.getElementById("txtLNameAppleP-error").innerHTML="",document.getElementById("txtLNameAppleP-error").style.display="none",$(a).removeClass("errorInput"),$(a).removeAttr("required")):(document.getElementById("txtLNameAppleP-error").style.display="block",document.getElementById("txtLNameAppleP-error").innerHTML="required.",$(a).addClass("errorInput"),$(a).attr("required","required"),i=!1),null!=n&&null!=n&&0!=n.length||(i=!1),i&&null!=n&&null!=n&&n.length>=5){if(null!=t&&null!=t&&""!=t.toString().trim()&&"login"==t.toString().toLowerCase())try{SetLoginValues()}catch(e){}var s=n[1],r=n[4],l=n[5];return ShowLoadingPanelLogin(!0),ShowFnameLnameControlForAppleLogin(!0),signin(o.value,a.value,3,null,s,r,"applelogin",l,!1,!0,null,"","",""),appleSignInData="",!1}}else-13==e&&(resetCotrolForAppleFNameLName(),appleSignInData="",hideAppleFNameLNameControls())}catch(e){vagaro.alert("There is some problem with Apple Login. Please try again."),resetCotrolForAppleFNameLName(),appleSignInData="",hideAppleFNameLNameControls()}return!1}function hideAppleFNameLNameControls(){$(".sign-in-btn-div.stepLogin1").removeClass("slide1"),$(".sign-in-btn-div.stepAppleflname").removeClass("slide2"),$("#divAppleFLStep1").removeClass(" slide2"),$("#divLoginStep1").removeClass(" w-hiddenstrict"),$("#divAppleFLStep1").addClass(" w-hiddenstrict"),setTimeout(function(){$(".stepLogin1").removeClass("anileft100"),$(".loginbtncont").removeClass("anileft100")},1);var e=document.getElementById("txtFNameAppleP");void 0!==e&&null!=e&&null!=e&&$(e).removeAttr("tabindex",1);var t=document.getElementById("txtLNameAppleP");void 0!==t&&null!=t&&null!=t&&$(t).removeAttr("tabindex",2),$("#txtUsernameP").focus()}function openLoginWhenExistEmail(e,t,i,n,o){openlogin(),$(".signup-user-found").removeClass(" w-hiddenstrict"),$(".sign-in-btn-divinner").addClass(" w-hiddenstrict"),$(".sign-in-logo-div").addClass(" w-hiddenstrict"),$("#errorClass").removeClass(" errorInput"),$("#errorClass-error").css("display","none"),$("#lblError").css("display","none"),$("#lblExistEmail").text(i).css("font-weight","400"),$("#lblFirstName").text(e),$("#spnuserImage").css("background-image","url('NoImage')"),$(".loginUserIntials").html(FindInitials(e+" "+t,"SP")),null==n||""==n?($("#spnuserImage").attr("data-original","NoImage"),$("#spnuserImage").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload")):($("#spnuserImage").attr("data-original",o+"200x0/"+n),$("#spnuserImage").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload"))}function ShowFP(){$("#dvSignupNew").show(),ShowForgotPwd(sFromPage)}function opensignup(){clearRegisterControls(),SignUp_ModalPopupLoginHide()}function CallFailedLogin(e){vagaro.alert(e.get_message()),ShowLoadingPanelLogin(!1)}function ShowLoadingPanelLogin(e){$("#apgLoading").length>0?ShowLoader(e):"undefined"!=typeof SignUp_Loading&&(e?$(SignUp_Loading).show():$(SignUp_Loading).hide())}function inIframe(){try{return window.self!==window.top}catch(e){return!0}}function CallWSJSON1(e,t,i,n){if("undefined"==typeof keepAlive&&$("#IsWaitforKeepALive").length>0&&void 0!==$("#IsWaitforKeepALive").val()&&"true"===$("#IsWaitforKeepALive").val().toLowerCase())setTimeout(function(){CallWSJSON1(e,t,i,n)},500);else{var o=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";"undefined"!=typeof regionId&&""!=regionId&&(o=o+regionId+"/"),e=o+"WebServices/"+e,$.ajax({type:"POST",contentType:"application/json; charset=utf-8",beforeSend:function(e){if("undefined"!=typeof keepAlive&&e.setRequestHeader("keepAlive",keepAlive),1==$("#hdnToken1").length&&void 0!==$("#hdnToken1").val()&&e.setRequestHeader("token1",$("#hdnToken1").val()),1==$("#hdnToken2").length&&void 0!==$("#hdnToken2").val()&&e.setRequestHeader("token2",$("#hdnToken2").val()),"undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget())"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&e.setRequestHeader("widgetcookievalue",widgetcookievalue);else try{void 0!==window.parent._common&&void 0!==window.parent._common.IsCookieLessWidget&&window.parent._common.IsCookieLessWidget()&&"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&e.setRequestHeader("widgetcookievalue",widgetcookievalue)}catch(e){}},url:e,data:t,dataType:"json",success:i,error:function(e,t,i){try{if(403===e.status)return alert("Your session is expired. Please reload your page."),void location.reload(!0);""!=n&&null!=n&&null!=n&&"function"==typeof n&&n(e,t,i)}catch(e){}}})}}function clearlogincontrols(e){"undefined"!=typeof SignUp_FromPage&&(SignUp_Password.value="",0!=e&&SignUp_Password.focus())}function PopupLoginShow(){if(ShowLoadingPanelLogin(!1),clearlogincontrols(0),SignUp_FromPage.value=sFromPage,"ScreenLock"==sFromPage)$(".hideinscreenlock").length&&($(".hideinscreenlock").hide(),$(".screenlock-img").show()),SignUp_ModalPopupLoginShow_ScreenLock();else{$(".hideinscreenlock").length&&($(".hideinscreenlock").show(),$(".screenlock-img").hide()),SignUp_ModalPopupLoginShow(),"undefined"!=typeof _common&&0==_common.isTouchDevice&&SignUp_UserName.focus(),SignUp_UserName.focus();var e=SignUp_chkRemember;e.checked=!1;var t=getCookie("VagaroUID");null!=t&&""!=t&&null!=t?(SignUp_UserName.value=t,SignUp_Password.focus(),null!=document.getElementById("tdCheck")&&document.getElementById("tdCheck").setAttribute("class","rtChecked"),e.checked=!0):(null!=document.getElementById("tdCheck")&&document.getElementById("tdCheck").setAttribute("class","rtUnchecked"),e.checked=!1)}}function RegisterPopUpID(){isWidPopup=SignUp_IsFromWidget.value}function IsLoginPage(){return"undefined"!=typeof Login_CCSwipe&&null!=typeof Login_CCSwipe}IsCookieEnabled=function(){if(navigator.cookieEnabled||/Safari/.test(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)&&/OS 14_/.test(navigator.userAgent)){try{if(inIframe())return document.cookie="IsCookieEnable=yes; SameSite=None; Secure",-1==document.cookie.indexOf("IsCookieEnable=")?1:2}catch(e){}return 2}return 0};var _KeyChar="48",_ZEROKeyValues="",_OldKeyVal="%",_IsProcessing=!1,_StartKeyboardSpeed="",_EndKeyboardSpeed="";function focusAtEnd(e){var t=e.value;1==IsLoginPage()?e.value="0":e.value="",e.focus(),e.value=t}function CheckWidgetSession(){if(chkMultiLocParameter(),location.href.toLowerCase().indexOf("businesswidget.aspx")>-1){if(null!=GetBusinessID()){var e='"lBusinessID" : '+GetBusinessID();return CallWebServicehed("GeneralWebService.asmx/SetWidgetSession",e,SetWidgetSessionSuccess,CallFailed),IsPopup+"&IsBusinessWidgetPage="+IsBusinessWidgetPage+"&IsFacebookPage="+IsFacebookPage+"&BusinessID="+GetBusinessID()+"&b_themeID="+b_themeID+"&IsFromMultiLocation="+isFromMultiLocation+"&MultiLocBusinessID="+MultiLocBusinessID}return""}return IsPopup+"&IsBusinessWidgetPage="+IsBusinessWidgetPage+"&IsFacebookPage="+IsFacebookPage+"&BusinessID="+GetBusinessID()+"&b_themeID="+b_themeID+"&IsFromMultiLocation="+isFromMultiLocation+"&MultiLocBusinessID="+MultiLocBusinessID}function SetWidgetSessionSuccess(e){}function are_cookies_enabled(){var e=!!navigator.cookieEnabled;return(void 0===navigator.cookieEnabled&&!e||"Microsoft Internet Explorer"==navigator.appName)&&(document.cookie="testcookie",e=-1!=document.cookie.indexOf("testcookie")),e}function LoadFacebook(e,t){}document.onkeypress=function(e){var t;"undefined"!=typeof TwoStepAuth&&TwoStepAuth.is2StepShown()||(t=window.event?window.event.keyCode:e.which,"undefined"!=typeof SignUp_Password&&(0==SignUp_Password.value.length&&(_StartKeyboardSpeed=(new Date).getTime()),1==SignUp_Password.value.length&&(_EndKeyboardSpeed=((new Date).getTime()-_StartKeyboardSpeed)/1e3)),_IsProcessing||48==parseInt(t)||(_IsProcessing=!0),"undefined"!=typeof _ReSetValue&&null!=_ReSetValue&&(_IsProcessing=!_ReSetValue),parseFloat(_EndKeyboardSpeed)>parseFloat(.05)&&(_IsProcessing=!0),_IsProcessing||parseInt(t)==parseInt(_KeyChar)&&(_ZEROKeyValues=""==_ZEROKeyValues?_KeyChar:_ZEROKeyValues+"|"+_KeyChar),37!=parseInt(t)&&2!=_ZEROKeyValues.split("|").length||("undefined"!=typeof _ReSetValue&&null!=_ReSetValue&&(_ReSetValue=!1),_IsProcessing=!0,_ZEROKeyValues="",_OldKeyVal=37==parseInt(t)?"%":"00",0==IsLoginPage()?(SignUp_CCSwipe.value=_OldKeyVal,focusAtEnd(SignUp_CCSwipe)):(Login_CCSwipe.value=_OldKeyVal,focusAtEnd(Login_CCSwipe))),13==parseInt(t)&&(_IsProcessing=!1))};var acToken,tokenType,expiresIn,user,_0x95cd=["lib","Base","prototype","mixIn","init","hasOwnProperty","apply","$super","extend","toString","WordArray","words","sigBytes","length","stringify","clamp","push","ceil","call","clone","slice","random","enc","Hex","","join","substr","Latin1","fromCharCode","charCodeAt","Utf8","Malformed UTF-8 data","parse","BufferedBlockAlgorithm","_data","_nDataBytes","string","concat","blockSize","_minBufferSize","max","min","splice","Hasher","cfg","reset","finalize","HMAC","algo","Base64","_map","charAt","indexOf","create","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=","sin","abs","MD5","_hash","floor","HmacMD5","EvpKDF","hasher","keySize","iterations","update","compute","Cipher","_xformMode","_key","encrypt","decrypt","StreamCipher","mode","_iv","_prevBlock","BlockCipherMode","Encryptor","Decryptor","_cipher","encryptBlock","decryptBlock","CBC","Pkcs7","pad","BlockCipher","iv","_ENC_XFORM_MODE","createEncryptor","createDecryptor","_mode","processBlock","padding","unpad","CipherParams","formatter","OpenSSL","format","ciphertext","salt","SerializableCipher","kdf","PasswordBasedCipher","ivSize","execute","key","AES","_nRounds","_keySchedule","_invKeySchedule"],CryptoJS=CryptoJS||function(e){var t={},i=t[_0x95cd[0]]={},n=function(){},o=i[_0x95cd[1]]={extend:function(e){n[_0x95cd[2]]=this;var t=new n;return e&&t[_0x95cd[3]](e),t[_0x95cd[5]](_0x95cd[4])||(t[_0x95cd[4]]=function(){t[_0x95cd[7]][_0x95cd[4]][_0x95cd[6]](this,arguments)}),t[_0x95cd[4]][_0x95cd[2]]=t,t[_0x95cd[7]]=this,t},create:function(){var e=this[_0x95cd[8]]();return e[_0x95cd[4]][_0x95cd[6]](e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e[_0x95cd[5]](t)&&(this[t]=e[t]);e[_0x95cd[5]](_0x95cd[9])&&(this[_0x95cd[9]]=e[_0x95cd[9]])},clone:function(){return this[_0x95cd[4]][_0x95cd[2]][_0x95cd[8]](this)}},a=i[_0x95cd[10]]=o[_0x95cd[8]]({init:function(e,t){e=this[_0x95cd[11]]=e||[],this[_0x95cd[12]]=null!=t?t:4*e[_0x95cd[13]]},toString:function(e){return(e||r)[_0x95cd[14]](this)},concat:function(e){var t=this[_0x95cd[11]],i=e[_0x95cd[11]],n=this[_0x95cd[12]];if(e=e[_0x95cd[12]],this[_0x95cd[15]](),n%4)for(var o=0;o<e;o++)t[n+o>>>2]|=(i[o>>>2]>>>24-o%4*8&255)<<24-(n+o)%4*8;else if(65535<i[_0x95cd[13]])for(o=0;o<e;o+=4)t[n+o>>>2]=i[o>>>2];else t[_0x95cd[16]][_0x95cd[6]](t,i);return this[_0x95cd[12]]+=e,this},clamp:function(){var t=this[_0x95cd[11]],i=this[_0x95cd[12]];t[i>>>2]&=4294967295<<32-i%4*8,t[_0x95cd[13]]=e[_0x95cd[17]](i/4)},clone:function(){var e=o[_0x95cd[19]][_0x95cd[18]](this);return e[_0x95cd[11]]=this[_0x95cd[11]][_0x95cd[20]](0),e},random:function(t){for(var i=[],n=0;n<t;n+=4)i[_0x95cd[16]](4294967296*e[_0x95cd[21]]()|0);return new a[_0x95cd[4]](i,t)}}),s=t[_0x95cd[22]]={},r=s[_0x95cd[23]]={stringify:function(e){var t=e[_0x95cd[11]];e=e[_0x95cd[12]];for(var i=[],n=0;n<e;n++){var o=t[n>>>2]>>>24-n%4*8&255;i[_0x95cd[16]]((o>>>4).toString(16)),i[_0x95cd[16]]((15&o).toString(16))}return i[_0x95cd[25]](_0x95cd[24])},parse:function(e){for(var t=e[_0x95cd[13]],i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e[_0x95cd[26]](n,2),16)<<24-n%8*4;return new a[_0x95cd[4]](i,t/2)}},l=s[_0x95cd[27]]={stringify:function(e){var t=e[_0x95cd[11]];e=e[_0x95cd[12]];for(var i=[],n=0;n<e;n++)i[_0x95cd[16]](String[_0x95cd[28]](t[n>>>2]>>>24-n%4*8&255));return i[_0x95cd[25]](_0x95cd[24])},parse:function(e){for(var t=e[_0x95cd[13]],i=[],n=0;n<t;n++)i[n>>>2]|=(255&e[_0x95cd[29]](n))<<24-n%4*8;return new a[_0x95cd[4]](i,t)}},c=s[_0x95cd[30]]={stringify:function(e){try{return decodeURIComponent(escape(l[_0x95cd[14]](e)))}catch(e){throw Error(_0x95cd[31])}},parse:function(e){return l[_0x95cd[32]](unescape(encodeURIComponent(e)))}},d=i[_0x95cd[33]]=o[_0x95cd[8]]({reset:function(){this[_0x95cd[34]]=new a[_0x95cd[4]],this[_0x95cd[35]]=0},_append:function(e){_0x95cd[36]==typeof e&&(e=c[_0x95cd[32]](e)),this[_0x95cd[34]][_0x95cd[37]](e),this[_0x95cd[35]]+=e[_0x95cd[12]]},_process:function(t){var i=this[_0x95cd[34]],n=i[_0x95cd[11]],o=i[_0x95cd[12]],s=this[_0x95cd[38]],r=o/(4*s);if(t=(r=t?e[_0x95cd[17]](r):e[_0x95cd[40]]((0|r)-this[_0x95cd[39]],0))*s,o=e[_0x95cd[41]](4*t,o),t){for(var l=0;l<t;l+=s)this._doProcessBlock(n,l);l=n[_0x95cd[42]](0,t),i[_0x95cd[12]]-=o}return new a[_0x95cd[4]](l,o)},clone:function(){var e=o[_0x95cd[19]][_0x95cd[18]](this);return e[_0x95cd[34]]=this[_0x95cd[34]][_0x95cd[19]](),e},_minBufferSize:0});i[_0x95cd[43]]=d[_0x95cd[8]]({cfg:o[_0x95cd[8]](),init:function(e){this[_0x95cd[44]]=this[_0x95cd[44]][_0x95cd[8]](e),this[_0x95cd[45]]()},reset:function(){d[_0x95cd[45]][_0x95cd[18]](this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e[_0x95cd[4]](i)[_0x95cd[46]](t)}},_createHmacHelper:function(e){return function(t,i){return new u[_0x95cd[47]][_0x95cd[4]](e,i)[_0x95cd[46]](t)}}});var u=t[_0x95cd[48]]={};return t}(Math);!function(){var e=CryptoJS,t=e[_0x95cd[0]][_0x95cd[10]];e[_0x95cd[22]][_0x95cd[49]]={stringify:function(e){var t=e[_0x95cd[11]],i=e[_0x95cd[12]],n=this[_0x95cd[50]];e[_0x95cd[15]](),e=[];for(var o=0;o<i;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;4>s&&o+.75*s<i;s++)e[_0x95cd[16]](n[_0x95cd[51]](a>>>6*(3-s)&63));if(t=n[_0x95cd[51]](64))for(;e[_0x95cd[13]]%4;)e[_0x95cd[16]](t);return e[_0x95cd[25]](_0x95cd[24])},parse:function(e){var i=e[_0x95cd[13]],n=this[_0x95cd[50]];(o=n[_0x95cd[51]](64))&&(-1!=(o=e[_0x95cd[52]](o))&&(i=o));for(var o=[],a=0,s=0;s<i;s++)if(s%4){var r=n[_0x95cd[52]](e[_0x95cd[51]](s-1))<<s%4*2,l=n[_0x95cd[52]](e[_0x95cd[51]](s))>>>6-s%4*2;o[a>>>2]|=(r|l)<<24-a%4*8,a++}return t[_0x95cd[53]](o,a)},_map:_0x95cd[54]}}(),function(e){function t(e,t,i,n,o,a,s){return((e=e+(t&i|~t&n)+o+s)<<a|e>>>32-a)+t}function i(e,t,i,n,o,a,s){return((e=e+(t&n|i&~n)+o+s)<<a|e>>>32-a)+t}function n(e,t,i,n,o,a,s){return((e=e+(t^i^n)+o+s)<<a|e>>>32-a)+t}function o(e,t,i,n,o,a,s){return((e=e+(i^(t|~n))+o+s)<<a|e>>>32-a)+t}for(var a=CryptoJS,s=(l=a[_0x95cd[0]])[_0x95cd[10]],r=l[_0x95cd[43]],l=a[_0x95cd[48]],c=[],d=0;64>d;d++)c[d]=4294967296*e[_0x95cd[56]](e[_0x95cd[55]](d+1))|0;l=l[_0x95cd[57]]=r[_0x95cd[8]]({_doReset:function(){this[_0x95cd[58]]=new s[_0x95cd[4]]([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,a){for(var s=0;16>s;s++){var r=e[l=a+s];e[l]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}s=this[_0x95cd[58]][_0x95cd[11]];var l=e[a+0],d=(r=e[a+1],e[a+2]),u=e[a+3],p=e[a+4],h=e[a+5],m=e[a+6],g=e[a+7],v=e[a+8],f=e[a+9],C=e[a+10],S=e[a+11],y=e[a+12],b=e[a+13],k=e[a+14],_=e[a+15],D=t(D=s[0],P=s[1],w=s[2],I=s[3],l,7,c[0]),I=t(I,D,P,w,r,12,c[1]),w=t(w,I,D,P,d,17,c[2]),P=t(P,w,I,D,u,22,c[3]);D=t(D,P,w,I,p,7,c[4]),I=t(I,D,P,w,h,12,c[5]),w=t(w,I,D,P,m,17,c[6]),P=t(P,w,I,D,g,22,c[7]),D=t(D,P,w,I,v,7,c[8]),I=t(I,D,P,w,f,12,c[9]),w=t(w,I,D,P,C,17,c[10]),P=t(P,w,I,D,S,22,c[11]),D=t(D,P,w,I,y,7,c[12]),I=t(I,D,P,w,b,12,c[13]),w=t(w,I,D,P,k,17,c[14]),D=i(D,P=t(P,w,I,D,_,22,c[15]),w,I,r,5,c[16]),I=i(I,D,P,w,m,9,c[17]),w=i(w,I,D,P,S,14,c[18]),P=i(P,w,I,D,l,20,c[19]),D=i(D,P,w,I,h,5,c[20]),I=i(I,D,P,w,C,9,c[21]),w=i(w,I,D,P,_,14,c[22]),P=i(P,w,I,D,p,20,c[23]),D=i(D,P,w,I,f,5,c[24]),I=i(I,D,P,w,k,9,c[25]),w=i(w,I,D,P,u,14,c[26]),P=i(P,w,I,D,v,20,c[27]),D=i(D,P,w,I,b,5,c[28]),I=i(I,D,P,w,d,9,c[29]),w=i(w,I,D,P,g,14,c[30]),D=n(D,P=i(P,w,I,D,y,20,c[31]),w,I,h,4,c[32]),I=n(I,D,P,w,v,11,c[33]),w=n(w,I,D,P,S,16,c[34]),P=n(P,w,I,D,k,23,c[35]),D=n(D,P,w,I,r,4,c[36]),I=n(I,D,P,w,p,11,c[37]),w=n(w,I,D,P,g,16,c[38]),P=n(P,w,I,D,C,23,c[39]),D=n(D,P,w,I,b,4,c[40]),I=n(I,D,P,w,l,11,c[41]),w=n(w,I,D,P,u,16,c[42]),P=n(P,w,I,D,m,23,c[43]),D=n(D,P,w,I,f,4,c[44]),I=n(I,D,P,w,y,11,c[45]),w=n(w,I,D,P,_,16,c[46]),D=o(D,P=n(P,w,I,D,d,23,c[47]),w,I,l,6,c[48]),I=o(I,D,P,w,g,10,c[49]),w=o(w,I,D,P,k,15,c[50]),P=o(P,w,I,D,h,21,c[51]),D=o(D,P,w,I,y,6,c[52]),I=o(I,D,P,w,u,10,c[53]),w=o(w,I,D,P,C,15,c[54]),P=o(P,w,I,D,r,21,c[55]),D=o(D,P,w,I,v,6,c[56]),I=o(I,D,P,w,_,10,c[57]),w=o(w,I,D,P,m,15,c[58]),P=o(P,w,I,D,b,21,c[59]),D=o(D,P,w,I,p,6,c[60]),I=o(I,D,P,w,S,10,c[61]),w=o(w,I,D,P,d,15,c[62]),P=o(P,w,I,D,f,21,c[63]);s[0]=s[0]+D|0,s[1]=s[1]+P|0,s[2]=s[2]+w|0,s[3]=s[3]+I|0},_doFinalize:function(){var t=this[_0x95cd[34]],i=t[_0x95cd[11]],n=8*this[_0x95cd[35]],o=8*t[_0x95cd[12]];i[o>>>5]|=128<<24-o%32;var a=e[_0x95cd[59]](n/4294967296);for(i[15+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),i[14+(o+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[_0x95cd[12]]=4*(i[_0x95cd[13]]+1),this._process(),i=(t=this[_0x95cd[58]])[_0x95cd[11]],n=0;4>n;n++)o=i[n],i[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8);return t},clone:function(){var e=r[_0x95cd[19]][_0x95cd[18]](this);return e[_0x95cd[58]]=this[_0x95cd[58]][_0x95cd[19]](),e}}),a[_0x95cd[57]]=r._createHelper(l),a[_0x95cd[60]]=r._createHmacHelper(l)}(Math),function(){var e,t=CryptoJS,i=(e=t[_0x95cd[0]])[_0x95cd[1]],n=e[_0x95cd[10]],o=(e=t[_0x95cd[48]])[_0x95cd[61]]=i[_0x95cd[8]]({cfg:i[_0x95cd[8]]({keySize:4,hasher:e[_0x95cd[57]],iterations:1}),init:function(e){this[_0x95cd[44]]=this[_0x95cd[44]][_0x95cd[8]](e)},compute:function(e,t){for(var i=(r=this[_0x95cd[44]])[_0x95cd[62]][_0x95cd[53]](),o=n[_0x95cd[53]](),a=o[_0x95cd[11]],s=r[_0x95cd[63]],r=r[_0x95cd[64]];a[_0x95cd[13]]<s;){l&&i[_0x95cd[65]](l);var l=i[_0x95cd[65]](e)[_0x95cd[46]](t);i[_0x95cd[45]]();for(var c=1;c<r;c++)l=i[_0x95cd[46]](l),i[_0x95cd[45]]();o[_0x95cd[37]](l)}return o[_0x95cd[12]]=4*s,o}});t[_0x95cd[61]]=function(e,t,i){return o[_0x95cd[53]](i)[_0x95cd[66]](e,t)}}(),CryptoJS[_0x95cd[0]][_0x95cd[67]]||function(){var e=(p=CryptoJS)[_0x95cd[0]],t=e[_0x95cd[1]],i=e[_0x95cd[10]],n=e[_0x95cd[33]],o=p[_0x95cd[22]][_0x95cd[49]],a=p[_0x95cd[48]][_0x95cd[61]],s=e[_0x95cd[67]]=n[_0x95cd[8]]({cfg:t[_0x95cd[8]](),createEncryptor:function(e,t){return this[_0x95cd[53]](this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this[_0x95cd[53]](this._DEC_XFORM_MODE,e,t)},init:function(e,t,i){this[_0x95cd[44]]=this[_0x95cd[44]][_0x95cd[8]](i),this[_0x95cd[68]]=e,this[_0x95cd[69]]=t,this[_0x95cd[45]]()},reset:function(){n[_0x95cd[45]][_0x95cd[18]](this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,i,n){return(_0x95cd[36]==typeof i?h:u)[_0x95cd[70]](e,t,i,n)},decrypt:function(t,i,n){return(_0x95cd[36]==typeof i?h:u)[_0x95cd[71]](e,t,i,n)}}}});e[_0x95cd[72]]=s[_0x95cd[8]]({_doFinalize:function(){return this._process(!0)},blockSize:1});var r=p[_0x95cd[73]]={},l=function(e,t,i){var n=this[_0x95cd[74]];n?this[_0x95cd[74]]=void 0:n=this[_0x95cd[75]];for(var o=0;o<i;o++)e[t+o]^=n[o]},c=(e[_0x95cd[76]]=t[_0x95cd[8]]({createEncryptor:function(e,t){return this[_0x95cd[77]][_0x95cd[53]](e,t)},createDecryptor:function(e,t){return this[_0x95cd[78]][_0x95cd[53]](e,t)},init:function(e,t){this[_0x95cd[79]]=e,this[_0x95cd[74]]=t}}))[_0x95cd[8]]();c[_0x95cd[77]]=c[_0x95cd[8]]({processBlock:function(e,t){var i=this[_0x95cd[79]],n=i[_0x95cd[38]];l[_0x95cd[18]](this,e,t,n),i[_0x95cd[80]](e,t),this[_0x95cd[75]]=e[_0x95cd[20]](t,t+n)}}),c[_0x95cd[78]]=c[_0x95cd[8]]({processBlock:function(e,t){var i=this[_0x95cd[79]],n=i[_0x95cd[38]],o=e[_0x95cd[20]](t,t+n);i[_0x95cd[81]](e,t),l[_0x95cd[18]](this,e,t,n),this[_0x95cd[75]]=o}}),r=r[_0x95cd[82]]=c,c=(p[_0x95cd[84]]={})[_0x95cd[83]]={pad:function(e,t){for(var n,o=(n=(n=4*t)-e[_0x95cd[12]]%n)<<24|n<<16|n<<8|n,a=[],s=0;s<n;s+=4)a[_0x95cd[16]](o);n=i[_0x95cd[53]](a,n),e[_0x95cd[37]](n)},unpad:function(e){e[_0x95cd[12]]-=255&e[_0x95cd[11]][e[_0x95cd[12]]-1>>>2]}},e[_0x95cd[85]]=s[_0x95cd[8]]({cfg:s[_0x95cd[44]][_0x95cd[8]]({mode:r,padding:c}),reset:function(){s[_0x95cd[45]][_0x95cd[18]](this);var e=(t=this[_0x95cd[44]])[_0x95cd[86]],t=t[_0x95cd[73]];if(this[_0x95cd[68]]==this[_0x95cd[87]])var i=t[_0x95cd[88]];else i=t[_0x95cd[89]],this[_0x95cd[39]]=1;this[_0x95cd[90]]=i[_0x95cd[18]](t,this,e&&e[_0x95cd[11]])},_doProcessBlock:function(e,t){this[_0x95cd[90]][_0x95cd[91]](e,t)},_doFinalize:function(){var e=this[_0x95cd[44]][_0x95cd[92]];if(this[_0x95cd[68]]==this[_0x95cd[87]]){e[_0x95cd[84]](this._data,this[_0x95cd[38]]);var t=this._process(!0)}else t=this._process(!0),e[_0x95cd[93]](t);return t},blockSize:4});var d=e[_0x95cd[94]]=t[_0x95cd[8]]({init:function(e){this[_0x95cd[3]](e)},toString:function(e){return(e||this[_0x95cd[95]])[_0x95cd[14]](this)}}),u=(r=(p[_0x95cd[97]]={})[_0x95cd[96]]={stringify:function(e){var t=e[_0x95cd[98]];return((e=e[_0x95cd[99]])?i[_0x95cd[53]]([1398893684,1701076831])[_0x95cd[37]](e)[_0x95cd[37]](t):t).toString(o)},parse:function(e){var t=(e=o[_0x95cd[32]](e))[_0x95cd[11]];if(1398893684==t[0]&&1701076831==t[1]){var n=i[_0x95cd[53]](t[_0x95cd[20]](2,4));t[_0x95cd[42]](0,4),e[_0x95cd[12]]-=16}return d[_0x95cd[53]]({ciphertext:e,salt:n})}},e[_0x95cd[100]]=t[_0x95cd[8]]({cfg:t[_0x95cd[8]]({format:r}),encrypt:function(e,t,i,n){n=this[_0x95cd[44]][_0x95cd[8]](n);var o=e[_0x95cd[88]](i,n);return t=o[_0x95cd[46]](t),o=o[_0x95cd[44]],d[_0x95cd[53]]({ciphertext:t,key:i,iv:o[_0x95cd[86]],algorithm:e,mode:o[_0x95cd[73]],padding:o[_0x95cd[92]],blockSize:e[_0x95cd[38]],formatter:n[_0x95cd[97]]})},decrypt:function(e,t,i,n){return n=this[_0x95cd[44]][_0x95cd[8]](n),t=this._parse(t,n[_0x95cd[97]]),e[_0x95cd[89]](i,n)[_0x95cd[46]](t[_0x95cd[98]])},_parse:function(e,t){return _0x95cd[36]==typeof e?t[_0x95cd[32]](e,this):e}})),p=(p[_0x95cd[101]]={})[_0x95cd[96]]={execute:function(e,t,n,o){return o||(o=i[_0x95cd[21]](8)),e=a[_0x95cd[53]]({keySize:t+n})[_0x95cd[66]](e,o),n=i[_0x95cd[53]](e[_0x95cd[11]][_0x95cd[20]](t),4*n),e[_0x95cd[12]]=4*t,d[_0x95cd[53]]({key:e,iv:n,salt:o})}},h=e[_0x95cd[102]]=u[_0x95cd[8]]({cfg:u[_0x95cd[44]][_0x95cd[8]]({kdf:p}),encrypt:function(e,t,i,n){return i=(n=this[_0x95cd[44]][_0x95cd[8]](n))[_0x95cd[101]][_0x95cd[104]](i,e[_0x95cd[63]],e[_0x95cd[103]]),n[_0x95cd[86]]=i[_0x95cd[86]],(e=u[_0x95cd[70]][_0x95cd[18]](this,e,t,i[_0x95cd[105]],n))[_0x95cd[3]](i),e},decrypt:function(e,t,i,n){return n=this[_0x95cd[44]][_0x95cd[8]](n),t=this._parse(t,n[_0x95cd[97]]),i=n[_0x95cd[101]][_0x95cd[104]](i,e[_0x95cd[63]],e[_0x95cd[103]],t[_0x95cd[99]]),n[_0x95cd[86]]=i[_0x95cd[86]],u[_0x95cd[71]][_0x95cd[18]](this,e,t,i[_0x95cd[105]],n)}})}(),function(){for(var e=CryptoJS,t=e[_0x95cd[0]][_0x95cd[85]],i=e[_0x95cd[48]],n=[],o=[],a=[],s=[],r=[],l=[],c=[],d=[],u=[],p=[],h=[],m=0;256>m;m++)h[m]=128>m?m<<1:m<<1^283;var g=0,v=0;for(m=0;256>m;m++){var f=(f=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&f^99;n[g]=f,o[f]=g;var C=h[g],S=h[C],y=h[S],b=257*h[f]^16843008*f;a[g]=b<<24|b>>>8,s[g]=b<<16|b>>>16,r[g]=b<<8|b>>>24,l[g]=b,b=16843009*y^65537*S^257*C^16843008*g,c[f]=b<<24|b>>>8,d[f]=b<<16|b>>>16,u[f]=b<<8|b>>>24,p[f]=b,g?(g=C^h[h[h[y^C]]],v^=h[h[v]]):g=v=1}var k=[0,1,2,4,8,16,32,64,128,27,54];i=i[_0x95cd[106]]=t[_0x95cd[8]]({_doReset:function(){for(var e=(i=this[_0x95cd[69]])[_0x95cd[11]],t=i[_0x95cd[12]]/4,i=4*((this[_0x95cd[107]]=t+6)+1),o=this[_0x95cd[108]]=[],a=0;a<i;a++)if(a<t)o[a]=e[a];else{var s=o[a-1];a%t?6<t&&4==a%t&&(s=n[s>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s]):(s=n[(s=s<<8|s>>>24)>>>24]<<24|n[s>>>16&255]<<16|n[s>>>8&255]<<8|n[255&s],s^=k[a/t|0]<<24),o[a]=o[a-t]^s}for(e=this[_0x95cd[109]]=[],t=0;t<i;t++)a=i-t,s=t%4?o[a]:o[a-4],e[t]=4>t||4>=a?s:c[n[s>>>24]]^d[n[s>>>16&255]]^u[n[s>>>8&255]]^p[n[255&s]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,r,l,n)},decryptBlock:function(e,t){var i=e[t+1];e[t+1]=e[t+3],e[t+3]=i,this._doCryptBlock(e,t,this._invKeySchedule,c,d,u,p,o),i=e[t+1],e[t+1]=e[t+3],e[t+3]=i},_doCryptBlock:function(e,t,i,n,o,a,s,r){for(var l=this[_0x95cd[107]],c=e[t]^i[0],d=e[t+1]^i[1],u=e[t+2]^i[2],p=e[t+3]^i[3],h=4,m=1;m<l;m++){var g=n[c>>>24]^o[d>>>16&255]^a[u>>>8&255]^s[255&p]^i[h++],v=n[d>>>24]^o[u>>>16&255]^a[p>>>8&255]^s[255&c]^i[h++],f=n[u>>>24]^o[p>>>16&255]^a[c>>>8&255]^s[255&d]^i[h++];p=n[p>>>24]^o[c>>>16&255]^a[d>>>8&255]^s[255&u]^i[h++],c=g,d=v,u=f}g=(r[c>>>24]<<24|r[d>>>16&255]<<16|r[u>>>8&255]<<8|r[255&p])^i[h++],v=(r[d>>>24]<<24|r[u>>>16&255]<<16|r[p>>>8&255]<<8|r[255&c])^i[h++],f=(r[u>>>24]<<24|r[p>>>16&255]<<16|r[c>>>8&255]<<8|r[255&d])^i[h++],p=(r[p>>>24]<<24|r[c>>>16&255]<<16|r[d>>>8&255]<<8|r[255&u])^i[h++],e[t]=g,e[t+1]=v,e[t+2]=f,e[t+3]=p},keySize:8});e[_0x95cd[106]]=t._createHelper(i)}();var DateFormatter,loggedIn=!1,OAUTHURL="https://accounts.google.com/o/oauth2/auth?",VALIDURL="https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=";function GetGoogleLogin(){if("undefined"!=typeof isWindowsApp&&isWindowsApp)try{window.external.notify("GoogleLoginClick")}catch(e){}else{var e=window.location.host+"/GoogleLogin.aspx";_securelogin.isLocalhost()&&(e="localhost:3829/GoogleLogin.aspx"),e="https:"==window.location.protocol?"https://"+e:"http://"+e;var t=OAUTHURL+"scope=https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email&client_id="+CLIENTID+"&redirect_uri="+e+"&response_type=token&approval_prompt=auto",i=window.open(t,"Googlewindow","width=800, height=700"),n=window.setInterval(function(){try{if(-1!=i.document.URL.indexOf(e)){window.clearInterval(n);var t=i.document.URL;acToken=urlReplace(t,"access_token"),tokenType=urlReplace(t,"token_type"),expiresIn=urlReplace(t,"expires_in"),i.close(),""!=acToken?(validateToken(acToken),ShowLoadingPanelLogin(!0)):ShowLoadingPanelLogin(!1)}}catch(e){}},500)}}function validateToken(e){$.ajax({url:VALIDURL+e,data:null,success:function(e){getUserInfo(),loggedIn=!0},dataType:"jsonp"})}function getUserInfo(){$.ajax({url:"https://www.googleapis.com/userinfo/v2/me?access_token="+acToken,data:null,success:function(e){user=e;var t=_gender.Female,i="";void 0!==user.gender&&"undefined"!=user.gender&&null!=user.gender||(t=_gender.Optional),"male"==user.gender&&(t=_gender.Male),i="undefined"==user.email||null==user.email?"":user.email;try{"undefined"!=typeof LoginHeader_NeedstoRedirect&&null!=LoginHeader_NeedstoRedirect&&(blNeedstoRedirect=LoginHeader_NeedstoRedirect)}catch(e){}signin(user.given_name,user.family_name,t,null,i+"|~|"+acToken,user.id+"|"+user.picture,null,4,!1,!0,null,"","","")},dataType:"jsonp"})}function GoogleLoginVariableSettingUp(e,t,i,n,o,a){ShowLoadingPanelLogin(!0);var s="";"male"==(n=_gender.Female)&&(n=_gender.Male),s="undefined"==i||null==i?"":i;try{"undefined"!=typeof LoginHeader_NeedstoRedirect&&null!=LoginHeader_NeedstoRedirect&&(blNeedstoRedirect=LoginHeader_NeedstoRedirect)}catch(e){}signin(e,t,n,null,s,o+"|"+a,null,4,!1,!0,null,"","","")}function FBloginVariableSettingforWinApp(e,t,i,n,o,a){ShowLoadingPanelLogin(!0);var s="";"undefined"!=(n=_gender.Female)&&null!=n||(n=_gender.Optional),"male"==n&&(n=_gender.Male),s="undefined"==i||null==i?"":i;try{"undefined"!=typeof LoginHeader_NeedstoRedirect&&null!=LoginHeader_NeedstoRedirect&&(blNeedstoRedirect=LoginHeader_NeedstoRedirect)}catch(e){}signin(e,t,n,null,s,o+"|"+a,null,3,!1,!0,null,"","","")}function urlReplace(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\#&]"+t+"=([^&#]*)").exec(e);return null==i?"":i[1]}function startLogoutPolling(){loggedIn=!1}function HideCookiePopUp(){"undefined"==typeof _common?$find("modalpopupCookie").hide():$("#dvCookieModal").modal("hide")}function is_numeric(e){return/^\d+$/.test(e)}function FindInitials(e,t){var i=/[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/,n=["ASS","WTF","SEX","SUK","FUK","DIE","BUM","TIT","BCH","DAM","HAH","OUT"];if(null!=e&&""!=e){var o=(e=e.replace("s+","")).split(" "),a="";if(o.length>0){for(var s=0;s<o.length;s++){var r=o[s].substr(0,1);1!=i.test(r)&&r==r.toUpperCase()&&0==is_numeric(r)&&(a+=r)}a.length<=0&&(a=e.substr(0,1))}else a=o[0].substr(0,1);return a.length>=3?(Arrcontains(n,a=a.substr(0,3))&&(a=a.substr(0,a.length-1)),n=null,"SP"==t?a.substr(0,2).toUpperCase():a.toUpperCase()):a.toUpperCase()}return e}function Arrcontains(e,t){for(var i=0;i<e.length;i++)if(e[i]===t)return!0;return!1}function SkipTwoFactoFromSignIn(){"function"==typeof CallWSJSON?CallWSJSON("MySampleService.asmx/SkipTwoFactorForSignIn","",function(e){if(void 0!==e&&null!=e&&void 0!==e.d&&null!=e.d){if("true"==e.d.split("|")[0].toLowerCase()){if(e.d.split("|").length>=2&&void 0!==setLogintkn)try{setLogintkn(e.d.split("|")[1]),(navigator.userAgent.indexOf("com.vagaro.customerios")>-1||navigator.userAgent.indexOf("com.vagaro.customerandroid")>-1)&&navigator.userAgent.toLowerCase().indexOf("brandedapp")<0&&void 0!==isNewVersionCustomerAppLogin&&isNewVersionCustomerAppLogin("529","428")&&CallbackforMobileApp(0,0,"",e.d.split("|")[1],0,"135")}catch(e){}_securelogin.AfterSuccessfullLogin()}else"undefined"!=typeof bootbox?vagaro.alert("Something went wrong. Please try again!"):alert("Something went wrong. Please try again!");ShowLoadingPanelLogin(!1)}},CallFailed):CallWSJSON1("MySampleService.asmx/SkipTwoFactorForSignIn","",function(e){if(void 0!==e&&null!=e&&void 0!==e.d&&null!=e.d){if("true"==e.d.split("|")[0].toLowerCase()){if(e.d.split("|").length>=2&&void 0!==setLogintkn)try{setLogintkn(e.d.split("|")[1]),(navigator.userAgent.indexOf("com.vagaro.customerios")>-1||navigator.userAgent.indexOf("com.vagaro.customerandroid")>-1)&&navigator.userAgent.toLowerCase().indexOf("brandedapp")<0&&void 0!==isNewVersionCustomerAppLogin&&isNewVersionCustomerAppLogin("529","428")&&CallbackforMobileApp(0,0,"",e.d.split("|")[1],0,"135")}catch(e){}_securelogin.AfterSuccessfullLogin()}else"undefined"!=typeof bootbox?vagaro.alert("Something went wrong. Please try again!"):alert("Something went wrong. Please try again!");ShowLoadingPanelLogin(!1)}},CallFailed)}function SetUserAuthCodeToken(e,t){try{if(void 0!==e&&null!=e&&""!=e&&void 0!==e.split("|")[15]&&null!=e.split("|")[15]&&""!=e.split("|")[15]&&"true"==e.split("|")[15].toString().toLowerCase()&&null!=e.split("|")[13]&&""!=e.split("|")[13]&&null!=e.split("|")[3]&&""!=e.split("|")[3]&&parseInt(e.split("|")[3])>0){ShowLoadingPanelLogin(!0);var i=e.split("|")[3].toString(),n=e.split("|")[14].toString(),o=e.split("|")[13].toString(),a=new vagaro.ajax;a.datamodel.Token="SetUserAuthCodeToken",a.datamodel.data=[i,n,o],a.datamodel.ErrorMessage="",a.datamodel.callback=function(e){void 0!==e&&null!=e&&0==e&&localStorage.removeItem("atCode"),ShowLoadingPanelLogin(!1),t()},a.datamodel.Error=function(e){ShowLoadingPanelLogin(!1),t()},a.Post()}else t()}catch(e){ShowLoadingPanelLogin(!1),t()}}function setWBCookie(e,t,i){var n=new Date;n.setTime(n.getTime()+6e4*i);var o="expires="+n.toUTCString();"undefined"!=typeof location&&void 0!==location.hostname&&(location.hostname.endsWith(".bookitall.com")||location.hostname.endsWith(".vagaro.com"))?location.hostname.endsWith(".bookitall.com")?document.cookie=e+"="+t+";"+o+";path=/;domain=.bookitall.com;secure;samesite=None":document.cookie=e+"="+t+";"+o+";path=/;domain=.vagaro.com;secure;samesite=None":document.cookie=e+"="+t+";"+o+";path=/"}function readAlexaCookie(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return null}function IsExistsAlxCookie(){var e=readAlexaCookie("_vgamzn"),t=readAlexaCookie("_vggoogle");return!isNullOrUndefineOrBlank(e)||!isNullOrUndefineOrBlank(t)}function LoginAlexaUser(){ShowLoader(!0),vagaro.ajaxCall("websiteapi/homepage/checkisuserloggedin","",CallSuccess_CheckAlexaUserLoggedIn,CallFailed_Alexa,!1,!0)}function CallSuccess_CheckAlexaUserLoggedIn(e){if(ShowLoader(!1),!e){ShowLoader(!0);var t=readAlexaCookie("_vgamzn"),i=readAlexaCookie("_vggoogle"),n="";isNullOrUndefineOrBlank(t)?isNullOrUndefineOrBlank(i)||(n=i):n=t,signin(null,null,null,n,"","","",8,!1,!0,EncPV(""),getek(),getei(),"")}}function CallFailed_Alexa(){ShowLoader(!1)}function clearAlexaCookie(e){document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"}function _vgParseatkn(e){var t=e.split("|");if(t.length>0){var i=t[t.length-1].split("$");i.length>1&&"tkn"==i[0]&&_vgsactkn(i[1])}}function _vgsactkn(e){if(!isNullOrUndefineOrBlank(e)&&void 0!==setLogintkn)try{setLogintkn(e),(navigator.userAgent.indexOf("com.vagaro.customerios")>-1||navigator.userAgent.indexOf("com.vagaro.customerandroid")>-1)&&navigator.userAgent.toLowerCase().indexOf("brandedapp")<0&&void 0!==isNewVersionCustomerAppLogin&&isNewVersionCustomerAppLogin("529","428")&&CallbackforMobileApp(0,0,"",e,0,"135")}catch(e){}}function _vggactkn(){try{for(var e="s_utkn=",t=document.cookie.split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(e))return n.substring(7,n.length)}return""}catch(e){return""}}function isNullOrUndefineOrBlank(e){return void 0===e||null==e||""==e||null==e}!function(e){_login={},_login.preUserName="",_login.preEmail="",_login.validateinput=!0,_login.tab=1,_login.IsResponceLoginpage=function(){"Login"==sFromPage&&2==_login.tab&&(e(".stepLogin1").removeClass("slide1"),e(".stepLogin2").removeClass("slide2"),_login.tab=1)},_login.getExistUserDetalis=function(){var t=e("#txtUsername").val();if(""!=e("#txtUsername").val().trim()&&0==SearchingUserNameNow){ShowLoader(!0),SearchingUserNameNow=!0;var i=new vagaro.ajax;i.datamodel.Token="getExistUserDetails",i.datamodel.data=[t],i.datamodel.callback=function(i){return SearchingUserNameNow=!1,ShowLoader(!1),e("#txtFNameAppleP").val(""),e("#txtLNameAppleP").val(""),null==i?(e(".divUserImage").css("background-image","url("+cdnimagepath+"Images/user-male-img_155_new.png"),e("#divUserNameform4").addClass("inputError"),e("#divUserNameform4 > .errortext").html("invalid username"),_login.validateinput=!1,!1):(e("#divUserNameform4").removeClass("inputError"),e("#divUserNameform4 > .errortext").html(""),e(".divUserName").html(i.EmailId),e("#txtFNameAppleP").val(i.FirstName),e("#txtLNameAppleP").val(i.LastName),""==_login.preUserName&&""==_login.preEmail&&(_login.preUserName=t,_login.preEmail=i.EmailId),e(".divUserImage").css("background-image","url('NoImage')"),e(".loginUserIntials").html(FindInitials(i.FirstName+" "+i.LastName,"SP")),null!=i.Photo?(e(".divUserImage").attr("data-original",i.CDNUrl+"200x0/"+i.Photo),e(".divUserImage").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload")):(e(".divUserImage").attr("data-original","NoImage"),e(".divUserImage").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload")),0==checkCaptch()?(_login.validateinput=!1,!1):void(0==e(".stepLogin1").hasClass("slide1")&&(e(".stepLogin1").addClass("slide1"),e(".stepLogin2").addClass("slide2"),_login.tab=2,setTimeout(function(){e(".stepLogin2 #txtPassword").focus()},1e3))))},i.datamodel.Error=function(e){ShowLoader(!1)},i.Post()}}}(jQuery,window,document),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){$.extend($.fn,{validate:function(e){if(this.length){var t=$.data(this[0],"validator");return t||(this.attr("novalidate","novalidate"),t=new $.validator(e,this[0]),$.data(this[0],"validator",t),t.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){t.settings.submitHandler&&(t.submitButton=e.target),$(e.target).hasClass("cancel")&&(t.cancelSubmit=!0),void 0!==$(e.target).attr("formnovalidate")&&(t.cancelSubmit=!0)}),this.submit(function(e){function i(){var i,n;return!t.settings.submitHandler||(t.submitButton&&(i=$("<input type='hidden'/>").attr("name",t.submitButton.name).val($(t.submitButton).val()).appendTo(t.currentForm)),n=t.settings.submitHandler.call(t,t.currentForm,e),t.submitButton&&i.remove(),void 0!==n&&n)}return t.settings.debug&&e.preventDefault(),t.cancelSubmit?(t.cancelSubmit=!1,i()):t.form()?t.pendingRequest?(t.formSubmitted=!0,!1):i():(t.focusInvalid(),!1)})),t)}e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.")},valid:function(){return this.validate().form()},removeAttrs:function(e){var t={},i=this;return $.each(e.split(/\s/),function(e,n){t[n]=i.attr(n),i.removeAttr(n)}),t},rules:function(e,t){var i,n,o,a,s,r,l=this[0];if(e)switch(n=(i=$.data($(l).closest("[data-type=validcontainer]")[0],"validator").settings).rules,o=$.validator.staticRules(l),e){case"add":$.extend(o,$.validator.normalizeRule(t)),delete o.messages,n[l.name]=o,t.messages&&(i.messages[l.name]=$.extend(i.messages[l.name],t.messages));break;case"remove":return t?(r={},$.each(t.split(/\s/),function(e,t){r[t]=o[t],delete o[t],"required"===t&&$(l).removeAttr("aria-required")}),r):(delete n[l.name],o)}return(a=$.validator.normalizeRules($.extend({},$.validator.classRules(l),$.validator.attributeRules(l),$.validator.dataRules(l),$.validator.staticRules(l)),l)).required&&(s=a.required,delete a.required,a=$.extend({required:s},a),$(l).attr("aria-required","true")),a.remote&&(s=a.remote,delete a.remote,a=$.extend(a,{remote:s})),a}}),$.extend($.expr[":"],{blank:function(e){return!$.trim(""+$(e).val())},filled:function(e){return!!$.trim(""+$(e).val())},unchecked:function(e){return!$(e).prop("checked")}}),$.validator=function(e,t){this.settings=$.extend(!0,{},$.validator.defaults,e),this.currentForm=t,this.init()},$.validator.format=function(e,t){return 1===arguments.length?function(){var t=$.makeArray(arguments);return t.unshift(e),$.validator.format.apply(this,t)}:(arguments.length>2&&t.constructor!==Array&&(t=$.makeArray(arguments).slice(1)),t.constructor!==Array&&(t=[t]),$.each(t,function(t,i){e=e.replace(new RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"errorInput",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e){this.lastActive=e,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(e)))},onfocusout:function(e){this.checkable(e)||!(e.name in this.submitted)&&this.optional(e)||this.element(e)},onkeyup:function(e,t){9===t.which&&""===this.elementValue(e)||(e.name in this.submitted||e===this.lastElement)&&this.element(e)},onclick:function(e){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(e,t,i){"radio"===e.type?this.findByName(e.name).addClass(t).removeClass(i):$(e).parent().hasClass("dropdowndiv")?$(e).parent().addClass(t).removeClass(i):$(e).addClass(t).removeClass(i)},unhighlight:function(e,t,i){"radio"===e.type?this.findByName(e.name).removeClass(t).addClass(i):$(e).parent().hasClass("dropdowndiv")?$(e).parent().removeClass(t).addClass(i):$(e).removeClass(t).addClass(i)}},setDefaults:function(e){$.extend($.validator.defaults,e)},messages:{required:"required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm),this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var e,t=this.groups={};function i(e){var t=$.data($(this[0]).closest("[data-type=validcontainer]")[0],"validator"),i="on"+e.type.replace(/^validate/,""),n=t.settings;t&&n[i]&&!this.is(n.ignore)&&n[i].call(t,this[0],e)}$.each(this.settings.groups,function(e,i){"string"==typeof i&&(i=i.split(/\s/)),$.each(i,function(i,n){t[n]=e})}),e=this.settings.rules,$.each(e,function(t,i){e[t]=$.validator.normalizeRule(i)}),$(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",i).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",i),this.settings.invalidHandler&&$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),$(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),$.extend(this.submitted,this.errorMap),this.invalid=$.extend({},this.errorMap),this.valid()||$(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(e){var t=this.clean(e),i=this.validationTargetFor(t),n=!0;return this.lastElement=i,void 0===i?delete this.invalid[t.name]:(this.prepareElement(i),this.currentElements=$(i),(n=!1!==this.check(i))?delete this.invalid[i.name]:this.invalid[i.name]=!0),$(e).attr("aria-invalid",!n),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),n},showErrors:function(e){if(e){for(var t in $.extend(this.errorMap,e),this.errorList=[],e)this.errorList.push({message:e[t],element:this.findByName(t)[0]});this.successList=$.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){$.fn.resetForm&&$(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid"),this.elements().parent().hasClass("dropdowndiv")&&this.elements().parent().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t,i=0;for(t in e)i++;return i},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(e){e.not(this.containers).text(""),this.addWrapper(e).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===$.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,t={};return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled], [readonly]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),!(this.name in t||!e.objectLength($(this).rules()))&&(t[this.name]=!0,!0)})},clean:function(e){return $(e)[0]},errors:function(){var e=this.settings.errorClass.split(" ").join(".");return $(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=$([]),this.toHide=$([]),this.currentElements=$([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(e){var t,i=$(e),n=e.type;return"radio"===n||"checkbox"===n?$("input[name='"+e.name+"']:checked").val():"number"===n&&void 0!==e.validity?!e.validity.badInput&&i.val():"string"==typeof(t=i.val())?t.replace(/\r/g,""):t},check:function(e){e=this.validationTargetFor(this.clean(e));var t,i,n,o=$(e).rules(),a=$.map(o,function(e,t){return t}).length,s=!1,r=this.elementValue(e);for(i in o){n={method:i,parameters:o[i]};try{if("dependency-mismatch"===(t=$.validator.methods[i].call(this,r,e,n.parameters))&&1===a){s=!0;continue}if(s=!1,"pending"===t)return void(this.toHide=this.toHide.not(this.errorsFor(e)));if(!t)return this.formatAndAdd(e,n),!1}catch(t){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+n.method+"' method.",t),t}}if(!s)return this.objectLength(o)&&this.successList.push(e),!0},customDataMessage:function(e,t){return $(e).data("msg"+t.charAt(0).toUpperCase()+t.substring(1).toLowerCase())||$(e).data("msg")},customMessage:function(e,t){var i=this.settings.messages[e];return i&&(i.constructor===String?i:i[t])},findDefined:function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]},defaultMessage:function(e,t){return this.findDefined(this.customMessage(e.name,t),this.customDataMessage(e,t),!this.settings.ignoreTitle&&e.title||void 0,$.validator.messages[t],"<strong>Warning: No message defined for "+e.name+"</strong>")},formatAndAdd:function(e,t){var i=this.defaultMessage(e,t.method),n=/\$?\{(\d+)\}/g;"function"==typeof i?i=i.call(this,t.parameters,e):n.test(i)&&(i=$.validator.format(i.replace(n,"{$1}"),t.parameters)),this.errorList.push({message:i,element:e,method:t.method}),this.errorMap[e.name]=i,this.submitted[e.name]=i},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t,i;for(e=0;this.errorList[e];e++)i=this.errorList[e],this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(e,t){var i,n,o,a=this.errorsFor(e),s=this.idOrName(e),r=$(e).attr("aria-describedby");a.length?(a.removeClass(this.settings.validClass).addClass(this.settings.errorClass),a.html(t)):(i=a=$("<"+this.settings.errorElement+">").attr("id",s+"-error").addClass(this.settings.errorClass).html(t||""),this.settings.wrapper&&(i=a.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(i):this.settings.errorPlacement?this.settings.errorPlacement(i,$(e)):$(e).parent().hasClass("dropdowndiv")?i.insertAfter($(e).parent()):i.insertAfter(e),a.is("label")?a.attr("for",s):0===a.parents("label[for='"+s+"']").length&&(o=a.attr("id").replace(/(:|\.|\[|\])/g,"\\$1"),r?r.match(new RegExp("\\b"+o+"\\b"))||(r+=" "+o):r=o,$(e).attr("aria-describedby",r),(n=this.groups[e.name])&&$.each(this.groups,function(e,t){t===n&&$("[name='"+e+"']",this.currentForm).attr("aria-describedby",a.attr("id"))}))),!t&&this.settings.success&&(a.text(""),"string"==typeof this.settings.success?a.addClass(this.settings.success):this.settings.success(a,e)),this.toShow=this.toShow.add(a)},errorsFor:function(e){var t=this.idOrName(e),i=$(e).attr("aria-describedby"),n="label[for='"+t+"'], label[for='"+t+"'] *";return i&&(n=n+", #"+i.replace(/\s+/g,", #")),this.errors().filter(n)},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name)),$(e).not(this.settings.ignore)[0]},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(e){return $(this.currentForm).find("[name='"+e+"']")},getLength:function(e,t){switch(t.nodeName.toLowerCase()){case"select":return $("option:selected",t).length;case"input":if(this.checkable(t))return this.findByName(t.name).filter(":checked").length}return e.length},depend:function(e,t){return!this.dependTypes[typeof e]||this.dependTypes[typeof e](e,t)},dependTypes:{boolean:function(e){return e},string:function(e,t){return!!$(e,t).length},function:function(e,t){return e(t)}},optional:function(e){var t=this.elementValue(e);return!$.validator.methods.required.call(this,t,e)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,this.pending[e.name]=!0)},stopRequest:function(e,t){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[e.name],t&&0===this.pendingRequest&&this.formSubmitted&&this.form()?($(this.currentForm).submit(),this.formSubmitted=!1):!t&&0===this.pendingRequest&&this.formSubmitted&&($(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return $.data(e,"previousValue")||$.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,t){e.constructor===String?this.classRuleSettings[e]=t:$.extend(this.classRuleSettings,e)},classRules:function(e){var t={},i=$(e).attr("class");return i&&$.each(i.split(" "),function(){this in $.validator.classRuleSettings&&$.extend(t,$.validator.classRuleSettings[this])}),t},attributeRules:function(e){var t,i,n={},o=$(e),a=e.getAttribute("type");for(t in $.validator.methods)"required"===t?(""===(i=e.getAttribute(t))&&(i=!0),i=!!i):i=o.attr(t),/min|max/.test(t)&&(null===a||/number|range|text/.test(a))&&(i=Number(i)),i||0===i?n[t]=i:a===t&&"range"!==a&&(n[t]=!0);return n.maxlength&&/-1|2147483647|524288/.test(n.maxlength)&&delete n.maxlength,n},dataRules:function(e){var t,i,n={},o=$(e);for(t in $.validator.methods)void 0!==(i=o.data("rule"+t.charAt(0).toUpperCase()+t.substring(1).toLowerCase()))&&(n[t]=i);return n},staticRules:function(e){var t={},i=$.data($(e).closest("[data-type=validcontainer]")[0],"validator");return i.settings.rules&&(t=$.validator.normalizeRule(i.settings.rules[e.name])||{}),t},normalizeRules:function(e,t){return $.each(e,function(i,n){if(!1!==n){if(n.param||n.depends){var o=!0;switch(typeof n.depends){case"string":o=!!$(n.depends,t).length;break;case"function":o=n.depends.call(t,t)}o?e[i]=void 0===n.param||n.param:delete e[i]}}else delete e[i]}),$.each(e,function(i,n){e[i]=$.isFunction(n)?n(t):n}),$.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),$.each(["rangelength","range"],function(){var t;e[this]&&($.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(t=e[this].replace(/[\[\]]/g,"").split(/[\s,]+/),e[this]=[Number(t[0]),Number(t[1])]))}),$.validator.autoCreateRanges&&(null!=e.min&&null!=e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),null!=e.minlength&&null!=e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var t={};$.each(e.split(/\s/),function(){t[this]=!0}),e=t}return e},addMethod:function(e,t,i){$.validator.methods[e]=t,$.validator.messages[e]=void 0!==i?i:$.validator.messages[e],t.length<3&&$.validator.addClassRules(e,$.validator.normalizeRule(e))},methods:{required:function(e,t,i){if(!this.depend(i,t))return"dependency-mismatch";if("select"===t.nodeName.toLowerCase()){var n=$(t).val();return n&&n.length>0}return this.checkable(t)?this.getLength(e,t)>0:$.trim(e).length>0},email:function(e,t){return this.optional(t)||/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},url:function(e,t){return this.optional(t)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},date:function(e,t){return this.optional(t)||!/Invalid|NaN/.test(new Date(e).toString())},dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(e)},number:function(e,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(e))return!1;var i,n,o=0,a=0,s=!1;if((e=e.replace(/\D/g,"")).length<13||e.length>19)return!1;for(i=e.length-1;i>=0;i--)n=e.charAt(i),a=parseInt(n,10),s&&(a*=2)>9&&(a-=9),o+=a,s=!s;return o%10==0},minlength:function(e,t,i){var n=$.isArray(e)?e.length:this.getLength(e,t);return this.optional(t)||n>=i},maxlength:function(e,t,i){var n=$.isArray(e)?e.length:this.getLength(e,t);return this.optional(t)||n<=i},rangelength:function(e,t,i){var n=$.isArray(e)?e.length:this.getLength(e,t);return this.optional(t)||n>=i[0]&&n<=i[1]},min:function(e,t,i){return this.optional(t)||e>=i},max:function(e,t,i){return this.optional(t)||e<=i},range:function(e,t,i){return this.optional(t)||e>=i[0]&&e<=i[1]},equalTo:function(e,t,i){var n=$(i);return this.settings.onfocusout&&n.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(t).valid()}),e===n.val()},remote:function(e,t,i){if(this.optional(t))return"dependency-mismatch";var n,o,a=this.previousValue(t);return this.settings.messages[t.name]||(this.settings.messages[t.name]={}),a.originalMessage=this.settings.messages[t.name].remote,this.settings.messages[t.name].remote=a.message,i="string"==typeof i&&{url:i}||i,a.old===e?a.valid:(a.old=e,n=this,this.startRequest(t),(o={})[t.name]=e,$.ajax($.extend(!0,{url:i,mode:"abort",port:"validate"+t.name,dataType:"json",data:o,context:n.currentForm,success:function(i){var o,s,r,l=!0===i||"true"===i;n.settings.messages[t.name].remote=a.originalMessage,l?(r=n.formSubmitted,n.prepareElement(t),n.formSubmitted=r,n.successList.push(t),delete n.invalid[t.name],n.showErrors()):(o={},s=i||n.defaultMessage(t,"remote"),o[t.name]=a.message=$.isFunction(s)?s(e):s,n.invalid[t.name]=!0,n.showErrors(o)),a.valid=l,n.stopRequest(t,l)}},i)),"pending")}}}),$.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var t,i={};$.ajaxPrefilter?$.ajaxPrefilter(function(e,t,n){var o=e.port;"abort"===e.mode&&(i[o]&&i[o].abort(),i[o]=n)}):(t=$.ajax,$.ajax=function(e){var n=("mode"in e?e:$.ajaxSettings).mode,o=("port"in e?e:$.ajaxSettings).port;return"abort"===n?(i[o]&&i[o].abort(),i[o]=t.apply(this,arguments),i[o]):t.apply(this,arguments)}),$.extend($.fn,{validateDelegate:function(e,t,i){return this.bind(t,function(t){var n=$(t.target);if(n.is(e))return i.apply(n,arguments)})}})}),
/*!
 * Lazy Load - jQuery plugin for lazy loading images
 *
 * Copyright (c) 2007-2015 Mika Tuupola
 *
 * Licensed under the MIT license:
 *   http://www.opensource.org/licenses/mit-license.php
 *
 * Project home:
 *   http://www.appelsiini.net/projects/lazyload
 *
 * Version:  1.9.5
 *
 */
function(e,t,i,n){var o=e(t);e.fn.lazyload=function(a){var s,r=this,l={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:t,data_attribute:"original",data_error:null,skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC",imgLoadClass:null,isShowIntials:!1,intial_selecter:null};function c(){var t=0;r.each(function(){var i=e(this);if(!l.skip_invisible||i.is(":visible"))if(e.abovethetop(this,l)||e.leftofbegin(this,l));else if(e.belowthefold(this,l)||e.rightoffold(this,l)){if(++t>l.failure_limit)return!1}else i.trigger("appear"),t=0})}return a&&(n!==a.failurelimit&&(a.failure_limit=a.failurelimit,delete a.failurelimit),n!==a.effectspeed&&(a.effect_speed=a.effectspeed,delete a.effectspeed),e.extend(l,a)),s=l.container===n||l.container===t?o:e(l.container),0===l.event.indexOf("scroll")&&s.bind(l.event,function(){return c()}),this.each(function(){var t=this,i=e(t);t.loaded=!1,i.attr("src")!==n&&!1!==i.attr("src")||i.is("img")&&i.attr("src",l.placeholder),i.one("appear",function(){if(!this.loaded){if(l.appear){var o=r.length;l.appear.call(t,o,l)}e("<img />").bind("load",function(){var o=i.attr("data-"+l.data_attribute);i.hide();try{var a=l.imgLoadClass;null!=a&&a!=n&&i.addClass(a)}catch(e){}i.is("img")?i.attr("src",o):(1==l.isShowIntials&&(i.find(l.intial_selecter).hide(),(o.indexOf("/user-male-img_155_new.png")>0||o.indexOf("/user-female-img_155.jpg")>0)&&(o="",i.find(l.intial_selecter).show())),o!=n&&""!=o&&""!=o&&null!=o?i.css("background-image","url('"+o+"')"):i.css("background-image","none")),i[l.effect](l.effect_speed),t.loaded=!0;var s=e.grep(r,function(e){return!e.loaded});if(r=e(s),l.load){var c=r.length;l.load.call(t,c,l)}}).bind("error",function(){try{if(void 0!==i.data("hidedivid")&&null!=i.data("hidedivid")&&""!=i.data("hidedivid")){var o=i.data("hidedivid");e("#"+o).hide()}}catch(e){}var a=l.data_error;if(null!=a||1==l.isShowIntials){i.hide();try{var s=l.imgLoadClass;null!=s&&s!=n&&i.addClass(s)}catch(e){}i.is("img")?i.attr("src",a):1==l.isShowIntials?(i.find(l.intial_selecter).show(),i.css("background-image","none")):a!=n&&""!=a&&""!=a&&null!=a?i.css("background-image","url('"+a+"')"):i.css("background-image","none"),i[l.effect](l.effect_speed),t.loaded=!0;var c=e.grep(r,function(e){return!e.loaded});if(r=e(c),l.load){var d=r.length;l.load.call(t,d,l)}}}).attr("src",i.attr("data-"+l.data_attribute))}}),0!==l.event.indexOf("scroll")&&i.bind(l.event,function(){t.loaded||i.trigger("appear")})}),o.bind("resize",function(){c()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&o.bind("pageshow",function(t){t.originalEvent&&t.originalEvent.persisted&&r.each(function(){e(this).trigger("appear")})}),e(i).ready(function(){c()}),this},e.belowthefold=function(i,a){return(a.container===n||a.container===t?(t.innerHeight?t.innerHeight:o.height())+o.scrollTop():e(a.container).offset().top+e(a.container).height())<=e(i).offset().top-a.threshold},e.rightoffold=function(i,a){return(a.container===n||a.container===t?o.width()+o.scrollLeft():e(a.container).offset().left+e(a.container).width())<=e(i).offset().left-a.threshold},e.abovethetop=function(i,a){return(a.container===n||a.container===t?o.scrollTop():e(a.container).offset().top)>=e(i).offset().top+a.threshold+e(i).height()},e.leftofbegin=function(i,a){return(a.container===n||a.container===t?o.scrollLeft():e(a.container).offset().left)>=e(i).offset().left+a.threshold+e(i).width()},e.inviewport=function(t,i){return!(e.rightoffold(t,i)||e.leftofbegin(t,i)||e.belowthefold(t,i)||e.abovethetop(t,i))},e.extend(e.expr[":"],{"below-the-fold":function(t){return e.belowthefold(t,{threshold:0})},"above-the-top":function(t){return!e.belowthefold(t,{threshold:0})},"right-of-screen":function(t){return e.rightoffold(t,{threshold:0})},"left-of-screen":function(t){return!e.rightoffold(t,{threshold:0})},"in-viewport":function(t){return e.inviewport(t,{threshold:0})},"above-the-fold":function(t){return!e.belowthefold(t,{threshold:0})},"right-of-fold":function(t){return e.rightoffold(t,{threshold:0})},"left-of-fold":function(t){return!e.rightoffold(t,{threshold:0})}})}(jQuery,window,document),
/*!
 * jQuery Validation Plugin v1.13.1
 *
 * http://jqueryvalidation.org/
 *
 * Copyright (c) 2014 Jörn Zaefferer
 * Released under the MIT license
 */
function(e){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate"],e):e(jQuery)}(function(e){!function(){function t(e){return e.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}e.validator.addMethod("maxWords",function(e,i,n){return this.optional(i)||t(e).match(/\b\w+\b/g).length<=n},e.validator.format("Please enter {0} words or less.")),e.validator.addMethod("minWords",function(e,i,n){return this.optional(i)||t(e).match(/\b\w+\b/g).length>=n},e.validator.format("Please enter at least {0} words.")),e.validator.addMethod("rangeWords",function(e,i,n){var o=t(e),a=/\b\w+\b/g;return this.optional(i)||o.match(a).length>=n[0]&&o.match(a).length<=n[1]},e.validator.format("Please enter between {0} and {1} words."))}(),e.validator.addMethod("accept",function(t,i,n){var o,a="string"==typeof n?n.replace(/\s/g,"").replace(/,/g,"|"):"image/*",s=this.optional(i);if(s)return s;if("file"===e(i).attr("type")&&(a=a.replace(/\*/g,".*"),i.files&&i.files.length))for(o=0;o<i.files.length;o++)if(!i.files[o].type.match(new RegExp(".?("+a+")$","i")))return!1;return!0},e.validator.format("Please enter a value with a valid mimetype.")),e.validator.addMethod("alphanumeric",function(e,t){return this.optional(t)||/^\w+$/i.test(e)},"Letters, numbers, and underscores only please"),e.validator.addMethod("bankaccountNL",function(e,t){if(this.optional(t))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(e))return!1;var i,n=e.replace(/ /g,""),o=0,a=n.length;for(i=0;i<a;i++)o+=(a-i)*n.substring(i,i+1);return o%11==0},"Please specify a valid bank account number"),e.validator.addMethod("bankorgiroaccountNL",function(t,i){return this.optional(i)||e.validator.methods.bankaccountNL.call(this,t,i)||e.validator.methods.giroaccountNL.call(this,t,i)},"Please specify a valid bank or giro account number"),e.validator.addMethod("bic",function(e,t){return this.optional(t)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(e)},"Please specify a valid BIC code"),e.validator.addMethod("cifES",function(e){"use strict";var t,i,n,o,a,s,r=[];if(!(e=e.toUpperCase()).match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(n=0;n<9;n++)r[n]=parseInt(e.charAt(n),10);for(i=r[2]+r[4]+r[6],o=1;o<8;o+=2)s=(a=(2*r[o]).toString()).charAt(1),i+=parseInt(a.charAt(0),10)+(""===s?0:parseInt(s,10));return!!/^[ABCDEFGHJNPQRSUVW]{1}/.test(e)&&(i+="",e+=t=10-parseInt(i.charAt(i.length-1),10),r[8].toString()===String.fromCharCode(64+t)||r[8].toString()===e.charAt(e.length-1))},"Please specify a valid CIF number."),e.validator.addMethod("creditcardtypes",function(e,t,i){if(/[^0-9\-]+/.test(e))return!1;e=e.replace(/\D/g,"");var n=0;return i.mastercard&&(n|=1),i.visa&&(n|=2),i.amex&&(n|=4),i.dinersclub&&(n|=8),i.enroute&&(n|=16),i.discover&&(n|=32),i.jcb&&(n|=64),i.unknown&&(n|=128),i.all&&(n=255),1&n&&/^(5[12345])/.test(e)||2&n&&/^(4)/.test(e)?16===e.length:4&n&&/^(3[47])/.test(e)?15===e.length:8&n&&/^(3(0[012345]|[68]))/.test(e)?14===e.length:16&n&&/^(2(014|149))/.test(e)?15===e.length:32&n&&/^(6011)/.test(e)||64&n&&/^(3)/.test(e)?16===e.length:64&n&&/^(2131|1800)/.test(e)?15===e.length:!!(128&n)},"Please enter a valid credit card number."),e.validator.addMethod("currency",function(e,t,i){var n,o="string"==typeof i,a=o?i:i[0],s=!!o||i[1];return a=a.replace(/,/g,""),n="^["+(a=s?a+"]":a+"]?")+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",n=new RegExp(n),this.optional(t)||n.test(e)},"Please specify a valid currency"),e.validator.addMethod("dateFA",function(e,t){return this.optional(t)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(e)},"Please enter a correct date"),e.validator.addMethod("dateITA",function(e,t){var i,n,o,a,s,r=!1;return/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(e)?(i=e.split("/"),n=parseInt(i[0],10),o=parseInt(i[1],10),a=parseInt(i[2],10),r=(s=new Date(a,o-1,n,12,0,0,0)).getUTCFullYear()===a&&s.getUTCMonth()===o-1&&s.getUTCDate()===n):r=!1,this.optional(t)||r},"Please enter a correct date"),e.validator.addMethod("dateNL",function(e,t){return this.optional(t)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(e)},"Please enter a correct date"),e.validator.addMethod("datemmm-dd-yyyy",function(e,t){return this.optional(t)||/^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\-(([0-9])|([0-2][0-9])|([3][0-1]))\-\d{4}$/.test(e)},"Please enter valid date(mmm-dd-yyyy)"),e.validator.addMethod("extension",function(e,t,i){return i="string"==typeof i?i.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(t)||e.match(new RegExp(".("+i+")$","i"))},e.validator.format("Please enter a value with a valid extension.")),e.validator.addMethod("giroaccountNL",function(e,t){return this.optional(t)||/^[0-9]{1,7}$/.test(e)},"Please specify a valid giro account number"),e.validator.addMethod("iban",function(e,t){if(this.optional(t))return!0;var i,n,o,a,s,r=e.replace(/ /g,"").toUpperCase(),l="",c=!0,d="";if(!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(r))return!1;if(void 0!==(o={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"}[r.substring(0,2)])&&!new RegExp("^[A-Z]{2}\\d{2}"+o+"$","").test(r))return!1;for(i=r.substring(4,r.length)+r.substring(0,4),a=0;a<i.length;a++)"0"!==(n=i.charAt(a))&&(c=!1),c||(l+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(n));for(s=0;s<l.length;s++)d=(""+d+l.charAt(s))%97;return 1===d},"Please specify a valid IBAN"),e.validator.addMethod("integer",function(e,t){return this.optional(t)||/^-?\d+$/.test(e)},"A positive or negative non-decimal number please"),e.validator.addMethod("ipv4",function(e,t){return this.optional(t)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(e)},"Please enter a valid IP v4 address."),e.validator.addMethod("ipv6",function(e,t){return this.optional(t)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(e)},"Please enter a valid IP v6 address."),e.validator.addMethod("lettersonly",function(e,t){return this.optional(t)||/^[a-z]+$/i.test(e)},"Letters only please"),e.validator.addMethod("letterswithbasicpunc",function(e,t){return this.optional(t)||/^[a-z\-.,()'"\s]+$/i.test(e)},"Letters or punctuation only please"),e.validator.addMethod("mobileNL",function(e,t){return this.optional(t)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(e)},"Please specify a valid mobile number"),e.validator.addMethod("mobileUK",function(e,t){return e=e.replace(/\(|\)|\s+|-/g,""),this.optional(t)||e.length>9&&e.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),e.validator.addMethod("nieES",function(e){"use strict";return!!(e=e.toUpperCase()).match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[T]{1}/.test(e)?e[8]===/^[T]{1}[A-Z0-9]{8}$/.test(e):!!/^[XYZ]{1}/.test(e)&&e[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(e.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23))},"Please specify a valid NIE number."),e.validator.addMethod("nifES",function(e){"use strict";return!!(e=e.toUpperCase()).match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(e)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(e.substring(8,0)%23)===e.charAt(8):!!/^[KLM]{1}/.test(e)&&e[8]===String.fromCharCode(64))},"Please specify a valid NIF number."),e.validator.addMethod("nowhitespace",function(e,t){return this.optional(t)||/^\S+$/i.test(e)},"No white space please"),e.validator.addMethod("pattern",function(e,t,i){return!!this.optional(t)||("string"==typeof i&&(i=new RegExp("^(?:"+i+")$")),i.test(e))},"Invalid format."),e.validator.addMethod("passwordpattern",function(e,t,i){return!!this.optional(t)||("string"==typeof i&&(i=new RegExp("^(?:"+i+")$")),i.test(e))},"Password must contain at least 9 characters, including uppercase, lowercase letters and numbers."),e.validator.addMethod("phoneNL",function(e,t){return this.optional(t)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(e)},"Please specify a valid phone number."),e.validator.addMethod("phoneUK",function(e,t){return e=e.replace(/\(|\)|\s+|-/g,""),this.optional(t)||e.length>9&&e.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),e.validator.addMethod("phoneUS",function(e,t){return e=e.replace(/\s+/g,""),this.optional(t)||e.length>9&&e.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),e.validator.addMethod("phonesUK",function(e,t){return e=e.replace(/\(|\)|\s+|-/g,""),this.optional(t)||e.length>9&&e.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),e.validator.addMethod("postalCodeCA",function(e,t){return this.optional(t)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(e)},"Please specify a valid postal code"),e.validator.addMethod("postalcodeBR",function(e,t){return this.optional(t)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(e)},"Informe um CEP válido."),e.validator.addMethod("postalcodeIT",function(e,t){return this.optional(t)||/^\d{5}$/.test(e)},"Please specify a valid postal code"),e.validator.addMethod("postalcodeNL",function(e,t){return this.optional(t)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(e)},"Please specify a valid postal code"),e.validator.addMethod("postcodeUK",function(e,t){return this.optional(t)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(e)},"Please specify a valid UK postcode"),e.validator.addMethod("require_from_group",function(t,i,n){var o=e(n[1],i.form),a=o.eq(0),s=a.data("valid_req_grp")?a.data("valid_req_grp"):e.extend({},this),r=o.filter(function(){return s.elementValue(this)}).length>=n[0];return a.data("valid_req_grp",s),e(i).data("being_validated")||(o.data("being_validated",!0),o.each(function(){s.element(this)}),o.data("being_validated",!1)),r},e.validator.format("Please fill at least {0} of these fields.")),e.validator.addMethod("skip_or_fill_minimum",function(t,i,n){var o=e(n[1],i.form),a=o.eq(0),s=a.data("valid_skip")?a.data("valid_skip"):e.extend({},this),r=o.filter(function(){return s.elementValue(this)}).length,l=0===r||r>=n[0];return a.data("valid_skip",s),e(i).data("being_validated")||(o.data("being_validated",!0),o.each(function(){s.element(this)}),o.data("being_validated",!1)),l},e.validator.format("Please either skip these fields or fill at least {0} of them.")),jQuery.validator.addMethod("stateUS",function(e,t,i){var n,o=void 0===i,a=!o&&void 0!==i.caseSensitive&&i.caseSensitive,s=!o&&void 0!==i.includeTerritories&&i.includeTerritories,r=!o&&void 0!==i.includeMilitary&&i.includeMilitary;return n=s||r?s&&r?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":s?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",n=a?new RegExp(n):new RegExp(n,"i"),this.optional(t)||n.test(e)},"Please specify a valid state"),e.validator.addMethod("strippedminlength",function(t,i,n){return e(t).text().length>=n},e.validator.format("Please enter at least {0} characters")),e.validator.addMethod("time",function(e,t){return this.optional(t)||/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/.test(e)},"Please enter a valid time, between 00:00 and 23:59"),e.validator.addMethod("time12h",function(e,t){return this.optional(t)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(e)},"Please enter a valid time in 12-hour am/pm format"),e.validator.addMethod("url2",function(e,t){return this.optional(t)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)},e.validator.messages.url),e.validator.addMethod("vinUS",function(e){if(17!==e.length)return!1;var t,i,n,o,a,s,r=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],l=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],c=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],d=0;for(t=0;t<17;t++){if(o=c[t],n=e.slice(t,t+1),8===t&&(s=n),isNaN(n)){for(i=0;i<r.length;i++)if(n.toUpperCase()===r[i]){n=l[i],n*=o,isNaN(s)&&8===i&&(s=r[i]);break}}else n*=o;d+=n}return 10===(a=d%11)&&(a="X"),a===s},"The specified vehicle identification number (VIN) is invalid."),e.validator.addMethod("zipcodeUS",function(e,t){return this.optional(t)||/^\d{5}(-\d{4})?$/.test(e)},"The specified US ZIP Code is invalid"),e.validator.addMethod("ziprange",function(e,t){return this.optional(t)||/^90[2-5]\d\{2\}-\d{4}$/.test(e)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx")}),
/*!
  * Bootstrap v4.6.0 (https://getbootstrap.com/)
  * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */
function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bootstrap={},e.jQuery,e.Popper)}(this,function(e,t,i){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),a=n(i);function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),e}function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},l.apply(this,arguments)}var c="transitionend";function d(e){return null==e?""+e:{}.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase()}function u(e){var t=this,i=!1;return o.default(this).one(p.TRANSITION_END,function(){i=!0}),setTimeout(function(){i||p.triggerTransitionEnd(t)},e),this}var p={TRANSITION_END:"bsTransitionEnd",getUID:function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},getSelectorFromElement:function(e){var t=e.getAttribute("data-target");if(!t||"#"===t){var i=e.getAttribute("href");t=i&&"#"!==i?i.trim():""}try{return document.querySelector(t)?t:null}catch(e){return null}},getTransitionDurationFromElement:function(e){if(!e)return 0;var t=o.default(e).css("transition-duration"),i=o.default(e).css("transition-delay"),n=parseFloat(t),a=parseFloat(i);return n||a?(t=t.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(t)+parseFloat(i))):0},reflow:function(e){return e.offsetHeight},triggerTransitionEnd:function(e){o.default(e).trigger(c)},supportsTransitionEnd:function(){return Boolean(c)},isElement:function(e){return(e[0]||e).nodeType},typeCheckConfig:function(e,t,i){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var o=i[n],a=t[n],s=a&&p.isElement(a)?"element":d(a);if(!new RegExp(o).test(s))throw new Error(e.toUpperCase()+': Option "'+n+'" provided type "'+s+'" but expected type "'+o+'".')}},findShadowRoot:function(e){if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){var t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?p.findShadowRoot(e.parentNode):null},jQueryDetection:function(){if(void 0===o.default)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var e=o.default.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1===e[0]&&9===e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};p.jQueryDetection(),o.default.fn.emulateTransitionEnd=u,o.default.event.special[p.TRANSITION_END]={bindType:c,delegateType:c,handle:function(e){if(o.default(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}};var h="alert",m="bs.alert",g="."+m,v=o.default.fn[h],f="close"+g,C="closed"+g,S="click"+g+".data-api",y=function(){function e(e){this._element=e}var t=e.prototype;return t.close=function(e){var t=this._element;e&&(t=this._getRootElement(e)),this._triggerCloseEvent(t).isDefaultPrevented()||this._removeElement(t)},t.dispose=function(){o.default.removeData(this._element,m),this._element=null},t._getRootElement=function(e){var t=p.getSelectorFromElement(e),i=!1;return t&&(i=document.querySelector(t)),i||(i=o.default(e).closest(".alert")[0]),i},t._triggerCloseEvent=function(e){var t=o.default.Event(f);return o.default(e).trigger(t),t},t._removeElement=function(e){var t=this;if(o.default(e).removeClass("show"),o.default(e).hasClass("fade")){var i=p.getTransitionDurationFromElement(e);o.default(e).one(p.TRANSITION_END,function(i){return t._destroyElement(e,i)}).emulateTransitionEnd(i)}else this._destroyElement(e)},t._destroyElement=function(e){o.default(e).detach().trigger(C).remove()},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this),n=i.data(m);n||(n=new e(this),i.data(m,n)),"close"===t&&n[t](this)})},e._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}}]),e}();o.default(document).on(S,'[data-dismiss="alert"]',y._handleDismiss(new y)),o.default.fn[h]=y._jQueryInterface,o.default.fn[h].Constructor=y,o.default.fn[h].noConflict=function(){return o.default.fn[h]=v,y._jQueryInterface};var b="button",k="bs.button",_="."+k,D=".data-api",I=o.default.fn[b],w="active",P='[data-toggle^="button"]',A='input:not([type="hidden"])',T=".btn",x="click"+_+D,F="focus"+_+D+" blur"+_+D,$="load"+_+D,O=function(){function e(e){this._element=e,this.shouldAvoidTriggerChange=!1}var t=e.prototype;return t.toggle=function(){var e=!0,t=!0,i=o.default(this._element).closest('[data-toggle="buttons"]')[0];if(i){var n=this._element.querySelector(A);if(n){if("radio"===n.type)if(n.checked&&this._element.classList.contains(w))e=!1;else{var a=i.querySelector(".active");a&&o.default(a).removeClass(w)}e&&("checkbox"!==n.type&&"radio"!==n.type||(n.checked=!this._element.classList.contains(w)),this.shouldAvoidTriggerChange||o.default(n).trigger("change")),n.focus(),t=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(t&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(w)),e&&o.default(this._element).toggleClass(w))},t.dispose=function(){o.default.removeData(this._element,k),this._element=null},e._jQueryInterface=function(t,i){return this.each(function(){var n=o.default(this),a=n.data(k);a||(a=new e(this),n.data(k,a)),a.shouldAvoidTriggerChange=i,"toggle"===t&&a[t]()})},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}}]),e}();o.default(document).on(x,P,function(e){var t=e.target,i=t;if(o.default(t).hasClass("btn")||(t=o.default(t).closest(T)[0]),!t||t.hasAttribute("disabled")||t.classList.contains("disabled"))e.preventDefault();else{var n=t.querySelector(A);if(n&&(n.hasAttribute("disabled")||n.classList.contains("disabled")))return void e.preventDefault();"INPUT"!==i.tagName&&"LABEL"===t.tagName||O._jQueryInterface.call(o.default(t),"toggle","INPUT"===i.tagName)}}).on(F,P,function(e){var t=o.default(e.target).closest(T)[0];o.default(t).toggleClass("focus",/^focus(in)?$/.test(e.type))}),o.default(window).on($,function(){for(var e=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),t=0,i=e.length;t<i;t++){var n=e[t],o=n.querySelector(A);o.checked||o.hasAttribute("checked")?n.classList.add(w):n.classList.remove(w)}for(var a=0,s=(e=[].slice.call(document.querySelectorAll('[data-toggle="button"]'))).length;a<s;a++){var r=e[a];"true"===r.getAttribute("aria-pressed")?r.classList.add(w):r.classList.remove(w)}}),o.default.fn[b]=O._jQueryInterface,o.default.fn[b].Constructor=O,o.default.fn[b].noConflict=function(){return o.default.fn[b]=I,O._jQueryInterface};var M="carousel",B="bs.carousel",E="."+B,L=".data-api",N=o.default.fn[M],U={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},R={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},W="next",G="prev",V="slide"+E,H="slid"+E,j="keydown"+E,Y="mouseenter"+E,q="mouseleave"+E,z="touchstart"+E,X="touchmove"+E,Z="touchend"+E,J="pointerdown"+E,Q="pointerup"+E,K="dragstart"+E,ee="load"+E+L,te="click"+E+L,ie="active",ne=".active.carousel-item",oe={TOUCH:"touch",PEN:"pen"},ae=function(){function e(e,t){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(t),this._element=e,this._indicatorsElement=this._element.querySelector(".carousel-indicators"),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var t=e.prototype;return t.next=function(){this._isSliding||this._slide(W)},t.nextWhenVisible=function(){var e=o.default(this._element);!document.hidden&&e.is(":visible")&&"hidden"!==e.css("visibility")&&this.next()},t.prev=function(){this._isSliding||this._slide(G)},t.pause=function(e){e||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(p.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},t.cycle=function(e){e||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},t.to=function(e){var t=this;this._activeElement=this._element.querySelector(ne);var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)o.default(this._element).one(H,function(){return t.to(e)});else{if(i===e)return this.pause(),void this.cycle();var n=e>i?W:G;this._slide(n,this._items[e])}},t.dispose=function(){o.default(this._element).off(E),o.default.removeData(this._element,B),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},t._getConfig=function(e){return e=l({},U,e),p.typeCheckConfig(M,e,R),e},t._handleSwipe=function(){var e=Math.abs(this.touchDeltaX);if(!(e<=40)){var t=e/this.touchDeltaX;this.touchDeltaX=0,t>0&&this.prev(),t<0&&this.next()}},t._addEventListeners=function(){var e=this;this._config.keyboard&&o.default(this._element).on(j,function(t){return e._keydown(t)}),"hover"===this._config.pause&&o.default(this._element).on(Y,function(t){return e.pause(t)}).on(q,function(t){return e.cycle(t)}),this._config.touch&&this._addTouchEventListeners()},t._addTouchEventListeners=function(){var e=this;if(this._touchSupported){var t=function(t){e._pointerEvent&&oe[t.originalEvent.pointerType.toUpperCase()]?e.touchStartX=t.originalEvent.clientX:e._pointerEvent||(e.touchStartX=t.originalEvent.touches[0].clientX)},i=function(t){e._pointerEvent&&oe[t.originalEvent.pointerType.toUpperCase()]&&(e.touchDeltaX=t.originalEvent.clientX-e.touchStartX),e._handleSwipe(),"hover"===e._config.pause&&(e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval))};o.default(this._element.querySelectorAll(".carousel-item img")).on(K,function(e){return e.preventDefault()}),this._pointerEvent?(o.default(this._element).on(J,function(e){return t(e)}),o.default(this._element).on(Q,function(e){return i(e)}),this._element.classList.add("pointer-event")):(o.default(this._element).on(z,function(e){return t(e)}),o.default(this._element).on(X,function(t){return function(t){t.originalEvent.touches&&t.originalEvent.touches.length>1?e.touchDeltaX=0:e.touchDeltaX=t.originalEvent.touches[0].clientX-e.touchStartX}(t)}),o.default(this._element).on(Z,function(e){return i(e)}))}},t._keydown=function(e){if(!/input|textarea/i.test(e.target.tagName))switch(e.which){case 37:e.preventDefault(),this.prev();break;case 39:e.preventDefault(),this.next()}},t._getItemIndex=function(e){return this._items=e&&e.parentNode?[].slice.call(e.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(e)},t._getItemByDirection=function(e,t){var i=e===W,n=e===G,o=this._getItemIndex(t),a=this._items.length-1;if((n&&0===o||i&&o===a)&&!this._config.wrap)return t;var s=(o+(e===G?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},t._triggerSlideEvent=function(e,t){var i=this._getItemIndex(e),n=this._getItemIndex(this._element.querySelector(ne)),a=o.default.Event(V,{relatedTarget:e,direction:t,from:n,to:i});return o.default(this._element).trigger(a),a},t._setActiveIndicatorElement=function(e){if(this._indicatorsElement){var t=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));o.default(t).removeClass(ie);var i=this._indicatorsElement.children[this._getItemIndex(e)];i&&o.default(i).addClass(ie)}},t._updateInterval=function(){var e=this._activeElement||this._element.querySelector(ne);if(e){var t=parseInt(e.getAttribute("data-interval"),10);t?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=t):this._config.interval=this._config.defaultInterval||this._config.interval}},t._slide=function(e,t){var i,n,a,s=this,r=this._element.querySelector(ne),l=this._getItemIndex(r),c=t||r&&this._getItemByDirection(e,r),d=this._getItemIndex(c),u=Boolean(this._interval);if(e===W?(i="carousel-item-left",n="carousel-item-next",a="left"):(i="carousel-item-right",n="carousel-item-prev",a="right"),c&&o.default(c).hasClass(ie))this._isSliding=!1;else if(!this._triggerSlideEvent(c,a).isDefaultPrevented()&&r&&c){this._isSliding=!0,u&&this.pause(),this._setActiveIndicatorElement(c),this._activeElement=c;var h=o.default.Event(H,{relatedTarget:c,direction:a,from:l,to:d});if(o.default(this._element).hasClass("slide")){o.default(c).addClass(n),p.reflow(c),o.default(r).addClass(i),o.default(c).addClass(i);var m=p.getTransitionDurationFromElement(r);o.default(r).one(p.TRANSITION_END,function(){o.default(c).removeClass(i+" "+n).addClass(ie),o.default(r).removeClass(ie+" "+n+" "+i),s._isSliding=!1,setTimeout(function(){return o.default(s._element).trigger(h)},0)}).emulateTransitionEnd(m)}else o.default(r).removeClass(ie),o.default(c).addClass(ie),this._isSliding=!1,o.default(this._element).trigger(h);u&&this.cycle()}},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this).data(B),n=l({},U,o.default(this).data());"object"==typeof t&&(n=l({},n,t));var a="string"==typeof t?t:n.slide;if(i||(i=new e(this,n),o.default(this).data(B,i)),"number"==typeof t)i.to(t);else if("string"==typeof a){if(void 0===i[a])throw new TypeError('No method named "'+a+'"');i[a]()}else n.interval&&n.ride&&(i.pause(),i.cycle())})},e._dataApiClickHandler=function(t){var i=p.getSelectorFromElement(this);if(i){var n=o.default(i)[0];if(n&&o.default(n).hasClass("carousel")){var a=l({},o.default(n).data(),o.default(this).data()),s=this.getAttribute("data-slide-to");s&&(a.interval=!1),e._jQueryInterface.call(o.default(n),a),s&&o.default(n).data(B).to(s),t.preventDefault()}}},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return U}}]),e}();o.default(document).on(te,"[data-slide], [data-slide-to]",ae._dataApiClickHandler),o.default(window).on(ee,function(){for(var e=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),t=0,i=e.length;t<i;t++){var n=o.default(e[t]);ae._jQueryInterface.call(n,n.data())}}),o.default.fn[M]=ae._jQueryInterface,o.default.fn[M].Constructor=ae,o.default.fn[M].noConflict=function(){return o.default.fn[M]=N,ae._jQueryInterface};var se="collapse",re="bs.collapse",le="."+re,ce=o.default.fn[se],de={toggle:!0,parent:""},ue={toggle:"boolean",parent:"(string|element)"},pe="show"+le,he="shown"+le,me="hide"+le,ge="hidden"+le,ve="click"+le+".data-api",fe="show",Ce="collapse",Se="collapsing",ye="collapsed",be="width",ke='[data-toggle="collapse"]',_e=function(){function e(e,t){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(t),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var i=[].slice.call(document.querySelectorAll(ke)),n=0,o=i.length;n<o;n++){var a=i[n],s=p.getSelectorFromElement(a),r=[].slice.call(document.querySelectorAll(s)).filter(function(t){return t===e});null!==s&&r.length>0&&(this._selector=s,this._triggerArray.push(a))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var t=e.prototype;return t.toggle=function(){o.default(this._element).hasClass(fe)?this.hide():this.show()},t.show=function(){var t,i,n=this;if(!this._isTransitioning&&!o.default(this._element).hasClass(fe)&&(this._parent&&0===(t=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter(function(e){return"string"==typeof n._config.parent?e.getAttribute("data-parent")===n._config.parent:e.classList.contains(Ce)})).length&&(t=null),!(t&&(i=o.default(t).not(this._selector).data(re))&&i._isTransitioning))){var a=o.default.Event(pe);if(o.default(this._element).trigger(a),!a.isDefaultPrevented()){t&&(e._jQueryInterface.call(o.default(t).not(this._selector),"hide"),i||o.default(t).data(re,null));var s=this._getDimension();o.default(this._element).removeClass(Ce).addClass(Se),this._element.style[s]=0,this._triggerArray.length&&o.default(this._triggerArray).removeClass(ye).attr("aria-expanded",!0),this.setTransitioning(!0);var r="scroll"+(s[0].toUpperCase()+s.slice(1)),l=p.getTransitionDurationFromElement(this._element);o.default(this._element).one(p.TRANSITION_END,function(){o.default(n._element).removeClass(Se).addClass(Ce+" "+fe),n._element.style[s]="",n.setTransitioning(!1),o.default(n._element).trigger(he)}).emulateTransitionEnd(l),this._element.style[s]=this._element[r]+"px"}}},t.hide=function(){var e=this;if(!this._isTransitioning&&o.default(this._element).hasClass(fe)){var t=o.default.Event(me);if(o.default(this._element).trigger(t),!t.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",p.reflow(this._element),o.default(this._element).addClass(Se).removeClass(Ce+" "+fe);var n=this._triggerArray.length;if(n>0)for(var a=0;a<n;a++){var s=this._triggerArray[a],r=p.getSelectorFromElement(s);if(null!==r)o.default([].slice.call(document.querySelectorAll(r))).hasClass(fe)||o.default(s).addClass(ye).attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[i]="";var l=p.getTransitionDurationFromElement(this._element);o.default(this._element).one(p.TRANSITION_END,function(){e.setTransitioning(!1),o.default(e._element).removeClass(Se).addClass(Ce).trigger(ge)}).emulateTransitionEnd(l)}}},t.setTransitioning=function(e){this._isTransitioning=e},t.dispose=function(){o.default.removeData(this._element,re),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},t._getConfig=function(e){return(e=l({},de,e)).toggle=Boolean(e.toggle),p.typeCheckConfig(se,e,ue),e},t._getDimension=function(){return o.default(this._element).hasClass(be)?be:"height"},t._getParent=function(){var t,i=this;p.isElement(this._config.parent)?(t=this._config.parent,void 0!==this._config.parent.jquery&&(t=this._config.parent[0])):t=document.querySelector(this._config.parent);var n='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',a=[].slice.call(t.querySelectorAll(n));return o.default(a).each(function(t,n){i._addAriaAndCollapsedClass(e._getTargetFromElement(n),[n])}),t},t._addAriaAndCollapsedClass=function(e,t){var i=o.default(e).hasClass(fe);t.length&&o.default(t).toggleClass(ye,!i).attr("aria-expanded",i)},e._getTargetFromElement=function(e){var t=p.getSelectorFromElement(e);return t?document.querySelector(t):null},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this),n=i.data(re),a=l({},de,i.data(),"object"==typeof t&&t?t:{});if(!n&&a.toggle&&"string"==typeof t&&/show|hide/.test(t)&&(a.toggle=!1),n||(n=new e(this,a),i.data(re,n)),"string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}})},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return de}}]),e}();o.default(document).on(ve,ke,function(e){"A"===e.currentTarget.tagName&&e.preventDefault();var t=o.default(this),i=p.getSelectorFromElement(this),n=[].slice.call(document.querySelectorAll(i));o.default(n).each(function(){var e=o.default(this),i=e.data(re)?"toggle":t.data();_e._jQueryInterface.call(e,i)})}),o.default.fn[se]=_e._jQueryInterface,o.default.fn[se].Constructor=_e,o.default.fn[se].noConflict=function(){return o.default.fn[se]=ce,_e._jQueryInterface};var De="dropdown",Ie="bs.dropdown",we="."+Ie,Pe=".data-api",Ae=o.default.fn[De],Te=new RegExp("38|40|27"),xe="hide"+we,Fe="hidden"+we,$e="show"+we,Oe="shown"+we,Me="click"+we,Be="click"+we+Pe,Ee="keydown"+we+Pe,Le="keyup"+we+Pe,Ne="disabled",Ue="show",Re="dropdown-menu-right",We='[data-toggle="dropdown"]',Ge=".dropdown-menu",Ve={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},He={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},je=function(){function e(e,t){this._element=e,this._popper=null,this._config=this._getConfig(t),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var t=e.prototype;return t.toggle=function(){if(!this._element.disabled&&!o.default(this._element).hasClass(Ne)){var t=o.default(this._menu).hasClass(Ue);e._clearMenus(),t||this.show(!0)}},t.show=function(t){if(void 0===t&&(t=!1),!(this._element.disabled||o.default(this._element).hasClass(Ne)||o.default(this._menu).hasClass(Ue))){var i={relatedTarget:this._element},n=o.default.Event($e,i),s=e._getParentFromElement(this._element);if(o.default(s).trigger(n),!n.isDefaultPrevented()){if(!this._inNavbar&&t){if(void 0===a.default)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");var r=this._element;"parent"===this._config.reference?r=s:p.isElement(this._config.reference)&&(r=this._config.reference,void 0!==this._config.reference.jquery&&(r=this._config.reference[0])),"scrollParent"!==this._config.boundary&&o.default(s).addClass("position-static"),this._popper=new a.default(r,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===o.default(s).closest(".navbar-nav").length&&o.default(document.body).children().on("mouseover",null,o.default.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),o.default(this._menu).toggleClass(Ue),o.default(s).toggleClass(Ue).trigger(o.default.Event(Oe,i))}}},t.hide=function(){if(!this._element.disabled&&!o.default(this._element).hasClass(Ne)&&o.default(this._menu).hasClass(Ue)){var t={relatedTarget:this._element},i=o.default.Event(xe,t),n=e._getParentFromElement(this._element);o.default(n).trigger(i),i.isDefaultPrevented()||(this._popper&&this._popper.destroy(),o.default(this._menu).toggleClass(Ue),o.default(n).toggleClass(Ue).trigger(o.default.Event(Fe,t)))}},t.dispose=function(){o.default.removeData(this._element,Ie),o.default(this._element).off(we),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},t.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},t._addEventListeners=function(){var e=this;o.default(this._element).on(Me,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},t._getConfig=function(e){return e=l({},this.constructor.Default,o.default(this._element).data(),e),p.typeCheckConfig(De,e,this.constructor.DefaultType),e},t._getMenuElement=function(){if(!this._menu){var t=e._getParentFromElement(this._element);t&&(this._menu=t.querySelector(Ge))}return this._menu},t._getPlacement=function(){var e=o.default(this._element.parentNode),t="bottom-start";return e.hasClass("dropup")?t=o.default(this._menu).hasClass(Re)?"top-end":"top-start":e.hasClass("dropright")?t="right-start":e.hasClass("dropleft")?t="left-start":o.default(this._menu).hasClass(Re)&&(t="bottom-end"),t},t._detectNavbar=function(){return o.default(this._element).closest(".navbar").length>0},t._getOffset=function(){var e=this,t={};return"function"==typeof this._config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e._config.offset(t.offsets,e._element)||{}),t}:t.offset=this._config.offset,t},t._getPopperConfig=function(){var e={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(e.modifiers.applyStyle={enabled:!1}),l({},e,this._config.popperConfig)},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this).data(Ie);if(i||(i=new e(this,"object"==typeof t?t:null),o.default(this).data(Ie,i)),"string"==typeof t){if(void 0===i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},e._clearMenus=function(t){if(!t||3!==t.which&&("keyup"!==t.type||9===t.which))for(var i=[].slice.call(document.querySelectorAll(We)),n=0,a=i.length;n<a;n++){var s=e._getParentFromElement(i[n]),r=o.default(i[n]).data(Ie),l={relatedTarget:i[n]};if(t&&"click"===t.type&&(l.clickEvent=t),r){var c=r._menu;if(o.default(s).hasClass(Ue)&&!(t&&("click"===t.type&&/input|textarea/i.test(t.target.tagName)||"keyup"===t.type&&9===t.which)&&o.default.contains(s,t.target))){var d=o.default.Event(xe,l);o.default(s).trigger(d),d.isDefaultPrevented()||("ontouchstart"in document.documentElement&&o.default(document.body).children().off("mouseover",null,o.default.noop),i[n].setAttribute("aria-expanded","false"),r._popper&&r._popper.destroy(),o.default(c).removeClass(Ue),o.default(s).removeClass(Ue).trigger(o.default.Event(Fe,l)))}}}},e._getParentFromElement=function(e){var t,i=p.getSelectorFromElement(e);return i&&(t=document.querySelector(i)),t||e.parentNode},e._dataApiKeydownHandler=function(t){if(!(/input|textarea/i.test(t.target.tagName)?32===t.which||27!==t.which&&(40!==t.which&&38!==t.which||o.default(t.target).closest(Ge).length):!Te.test(t.which))&&!this.disabled&&!o.default(this).hasClass(Ne)){var i=e._getParentFromElement(this),n=o.default(i).hasClass(Ue);if(n||27!==t.which){if(t.preventDefault(),t.stopPropagation(),!n||27===t.which||32===t.which)return 27===t.which&&o.default(i.querySelector(We)).trigger("focus"),void o.default(this).trigger("click");var a=[].slice.call(i.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter(function(e){return o.default(e).is(":visible")});if(0!==a.length){var s=a.indexOf(t.target);38===t.which&&s>0&&s--,40===t.which&&s<a.length-1&&s++,s<0&&(s=0),a[s].focus()}}}},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return Ve}},{key:"DefaultType",get:function(){return He}}]),e}();o.default(document).on(Ee,We,je._dataApiKeydownHandler).on(Ee,Ge,je._dataApiKeydownHandler).on(Be+" "+Le,je._clearMenus).on(Be,We,function(e){e.preventDefault(),e.stopPropagation(),je._jQueryInterface.call(o.default(this),"toggle")}).on(Be,".dropdown form",function(e){e.stopPropagation()}),o.default.fn[De]=je._jQueryInterface,o.default.fn[De].Constructor=je,o.default.fn[De].noConflict=function(){return o.default.fn[De]=Ae,je._jQueryInterface};var Ye="modal",qe="bs.modal",ze="."+qe,Xe=o.default.fn[Ye],Ze={backdrop:!0,keyboard:!0,focus:!0,show:!0},Je={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},Qe="hide"+ze,Ke="hidePrevented"+ze,et="hidden"+ze,tt="show"+ze,it="shown"+ze,nt="focusin"+ze,ot="resize"+ze,at="click.dismiss"+ze,st="keydown.dismiss"+ze,rt="mouseup.dismiss"+ze,lt="mousedown.dismiss"+ze,ct="click"+ze+".data-api",dt="modal-open",ut="fade",pt="show",ht="modal-static",mt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",gt=".sticky-top",vt=function(){function e(e,t){this._config=this._getConfig(t),this._element=e,this._dialog=e.querySelector(".modal-dialog"),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var t=e.prototype;return t.toggle=function(e){return this._isShown?this.hide():this.show(e)},t.show=function(e){var t=this;if(!this._isShown&&!this._isTransitioning){o.default(this._element).hasClass(ut)&&(this._isTransitioning=!0);var i=o.default.Event(tt,{relatedTarget:e});o.default(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),o.default(this._element).on(at,'[data-dismiss="modal"]',function(e){return t.hide(e)}),o.default(this._dialog).on(lt,function(){o.default(t._element).one(rt,function(e){o.default(e.target).is(t._element)&&(t._ignoreBackdropClick=!0)})}),this._showBackdrop(function(){return t._showElement(e)}))}},t.hide=function(e){var t=this;if(e&&e.preventDefault(),this._isShown&&!this._isTransitioning){var i=o.default.Event(Qe);if(o.default(this._element).trigger(i),this._isShown&&!i.isDefaultPrevented()){this._isShown=!1;var n=o.default(this._element).hasClass(ut);if(n&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),o.default(document).off(nt),o.default(this._element).removeClass(pt),o.default(this._element).off(at),o.default(this._dialog).off(lt),n){var a=p.getTransitionDurationFromElement(this._element);o.default(this._element).one(p.TRANSITION_END,function(e){return t._hideModal(e)}).emulateTransitionEnd(a)}else this._hideModal()}}},t.dispose=function(){[window,this._element,this._dialog].forEach(function(e){return o.default(e).off(ze)}),o.default(document).off(nt),o.default.removeData(this._element,qe),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},t.handleUpdate=function(){this._adjustDialog()},t._getConfig=function(e){return e=l({},Ze,e),p.typeCheckConfig(Ye,e,Je),e},t._triggerBackdropTransition=function(){var e=this,t=o.default.Event(Ke);if(o.default(this._element).trigger(t),!t.isDefaultPrevented()){var i=this._element.scrollHeight>document.documentElement.clientHeight;i||(this._element.style.overflowY="hidden"),this._element.classList.add(ht);var n=p.getTransitionDurationFromElement(this._dialog);o.default(this._element).off(p.TRANSITION_END),o.default(this._element).one(p.TRANSITION_END,function(){e._element.classList.remove(ht),i||o.default(e._element).one(p.TRANSITION_END,function(){e._element.style.overflowY=""}).emulateTransitionEnd(e._element,n)}).emulateTransitionEnd(n),this._element.focus()}},t._showElement=function(e){var t=this,i=o.default(this._element).hasClass(ut),n=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),o.default(this._dialog).hasClass("modal-dialog-scrollable")&&n?n.scrollTop=0:this._element.scrollTop=0,i&&p.reflow(this._element),o.default(this._element).addClass(pt),this._config.focus&&this._enforceFocus();var a=o.default.Event(it,{relatedTarget:e}),s=function(){t._config.focus&&t._element.focus(),t._isTransitioning=!1,o.default(t._element).trigger(a)};if(i){var r=p.getTransitionDurationFromElement(this._dialog);o.default(this._dialog).one(p.TRANSITION_END,s).emulateTransitionEnd(r)}else s()},t._enforceFocus=function(){var e=this;o.default(document).off(nt).on(nt,function(t){document!==t.target&&e._element!==t.target&&0===o.default(e._element).has(t.target).length&&e._element.focus()})},t._setEscapeEvent=function(){var e=this;this._isShown?o.default(this._element).on(st,function(t){e._config.keyboard&&27===t.which?(t.preventDefault(),e.hide()):e._config.keyboard||27!==t.which||e._triggerBackdropTransition()}):this._isShown||o.default(this._element).off(st)},t._setResizeEvent=function(){var e=this;this._isShown?o.default(window).on(ot,function(t){return e.handleUpdate(t)}):o.default(window).off(ot)},t._hideModal=function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop(function(){o.default(document.body).removeClass(dt),e._resetAdjustments(),e._resetScrollbar(),o.default(e._element).trigger(et)})},t._removeBackdrop=function(){this._backdrop&&(o.default(this._backdrop).remove(),this._backdrop=null)},t._showBackdrop=function(e){var t=this,i=o.default(this._element).hasClass(ut)?ut:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",i&&this._backdrop.classList.add(i),o.default(this._backdrop).appendTo(document.body),o.default(this._element).on(at,function(e){t._ignoreBackdropClick?t._ignoreBackdropClick=!1:e.target===e.currentTarget&&("static"===t._config.backdrop?t._triggerBackdropTransition():t.hide())}),i&&p.reflow(this._backdrop),o.default(this._backdrop).addClass(pt),!e)return;if(!i)return void e();var n=p.getTransitionDurationFromElement(this._backdrop);o.default(this._backdrop).one(p.TRANSITION_END,e).emulateTransitionEnd(n)}else if(!this._isShown&&this._backdrop){o.default(this._backdrop).removeClass(pt);var a=function(){t._removeBackdrop(),e&&e()};if(o.default(this._element).hasClass(ut)){var s=p.getTransitionDurationFromElement(this._backdrop);o.default(this._backdrop).one(p.TRANSITION_END,a).emulateTransitionEnd(s)}else a()}else e&&e()},t._adjustDialog=function(){var e=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&e&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!e&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var e=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(e.left+e.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},t._setScrollbar=function(){var e=this;if(this._isBodyOverflowing){var t=[].slice.call(document.querySelectorAll(mt)),i=[].slice.call(document.querySelectorAll(gt));o.default(t).each(function(t,i){var n=i.style.paddingRight,a=o.default(i).css("padding-right");o.default(i).data("padding-right",n).css("padding-right",parseFloat(a)+e._scrollbarWidth+"px")}),o.default(i).each(function(t,i){var n=i.style.marginRight,a=o.default(i).css("margin-right");o.default(i).data("margin-right",n).css("margin-right",parseFloat(a)-e._scrollbarWidth+"px")});var n=document.body.style.paddingRight,a=o.default(document.body).css("padding-right");o.default(document.body).data("padding-right",n).css("padding-right",parseFloat(a)+this._scrollbarWidth+"px")}o.default(document.body).addClass(dt)},t._resetScrollbar=function(){var e=[].slice.call(document.querySelectorAll(mt));o.default(e).each(function(e,t){var i=o.default(t).data("padding-right");o.default(t).removeData("padding-right"),t.style.paddingRight=i||""});var t=[].slice.call(document.querySelectorAll(""+gt));o.default(t).each(function(e,t){var i=o.default(t).data("margin-right");void 0!==i&&o.default(t).css("margin-right",i).removeData("margin-right")});var i=o.default(document.body).data("padding-right");o.default(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},t._getScrollbarWidth=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},e._jQueryInterface=function(t,i){return this.each(function(){var n=o.default(this).data(qe),a=l({},Ze,o.default(this).data(),"object"==typeof t&&t?t:{});if(n||(n=new e(this,a),o.default(this).data(qe,n)),"string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t](i)}else a.show&&n.show(i)})},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return Ze}}]),e}();o.default(document).on(ct,'[data-toggle="modal"]',function(e){var t,i=this,n=p.getSelectorFromElement(this);n&&(t=document.querySelector(n));var a=o.default(t).data(qe)?"toggle":l({},o.default(t).data(),o.default(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||e.preventDefault();var s=o.default(t).one(tt,function(e){e.isDefaultPrevented()||s.one(et,function(){o.default(i).is(":visible")&&i.focus()})});vt._jQueryInterface.call(o.default(t),a,this)}),o.default.fn[Ye]=vt._jQueryInterface,o.default.fn[Ye].Constructor=vt,o.default.fn[Ye].noConflict=function(){return o.default.fn[Ye]=Xe,vt._jQueryInterface};var ft=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],Ct={"*":["class","dir","id","lang","role",/^aria-[\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:[]},St=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi,yt=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;function bt(e,t,i){if(0===e.length)return e;if(i&&"function"==typeof i)return i(e);for(var n=(new window.DOMParser).parseFromString(e,"text/html"),o=Object.keys(t),a=[].slice.call(n.body.querySelectorAll("*")),s=function(e,i){var n=a[e],s=n.nodeName.toLowerCase();if(-1===o.indexOf(n.nodeName.toLowerCase()))return n.parentNode.removeChild(n),"continue";var r=[].slice.call(n.attributes),l=[].concat(t["*"]||[],t[s]||[]);r.forEach(function(e){(function(e,t){var i=e.nodeName.toLowerCase();if(-1!==t.indexOf(i))return-1===ft.indexOf(i)||Boolean(e.nodeValue.match(St)||e.nodeValue.match(yt));for(var n=t.filter(function(e){return e instanceof RegExp}),o=0,a=n.length;o<a;o++)if(i.match(n[o]))return!0;return!1})(e,l)||n.removeAttribute(e.nodeName)})},r=0,l=a.length;r<l;r++)s(r);return n.body.innerHTML}var kt="tooltip",_t="bs.tooltip",Dt="."+_t,It=o.default.fn[kt],wt="bs-tooltip",Pt=new RegExp("(^|\\s)"+wt+"\\S+","g"),At=["sanitize","whiteList","sanitizeFn"],Tt={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},xt={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},Ft={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",customClass:"",sanitize:!0,sanitizeFn:null,whiteList:Ct,popperConfig:null},$t="show",Ot="out",Mt={HIDE:"hide"+Dt,HIDDEN:"hidden"+Dt,SHOW:"show"+Dt,SHOWN:"shown"+Dt,INSERTED:"inserted"+Dt,CLICK:"click"+Dt,FOCUSIN:"focusin"+Dt,FOCUSOUT:"focusout"+Dt,MOUSEENTER:"mouseenter"+Dt,MOUSELEAVE:"mouseleave"+Dt},Bt="fade",Et="show",Lt="hover",Nt="focus",Ut=function(){function e(e,t){if(void 0===a.default)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=e,this.config=this._getConfig(t),this.tip=null,this._setListeners()}var t=e.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(e){if(this._isEnabled)if(e){var t=this.constructor.DATA_KEY,i=o.default(e.currentTarget).data(t);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),o.default(e.currentTarget).data(t,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(o.default(this.getTipElement()).hasClass(Et))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),o.default.removeData(this.element,this.constructor.DATA_KEY),o.default(this.element).off(this.constructor.EVENT_KEY),o.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&o.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===o.default(this.element).css("display"))throw new Error("Please use show on visible elements");var t=o.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){o.default(this.element).trigger(t);var i=p.findShadowRoot(this.element),n=o.default.contains(null!==i?i:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!n)return;var s=this.getTipElement(),r=p.getUID(this.constructor.NAME);s.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&o.default(s).addClass(Bt);var l="function"==typeof this.config.placement?this.config.placement.call(this,s,this.element):this.config.placement,c=this._getAttachment(l);this.addAttachmentClass(c);var d=this._getContainer();o.default(s).data(this.constructor.DATA_KEY,this),o.default.contains(this.element.ownerDocument.documentElement,this.tip)||o.default(s).appendTo(d),o.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new a.default(this.element,s,this._getPopperConfig(c)),o.default(s).addClass(Et),o.default(s).addClass(this.config.customClass),"ontouchstart"in document.documentElement&&o.default(document.body).children().on("mouseover",null,o.default.noop);var u=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,o.default(e.element).trigger(e.constructor.Event.SHOWN),t===Ot&&e._leave(null,e)};if(o.default(this.tip).hasClass(Bt)){var h=p.getTransitionDurationFromElement(this.tip);o.default(this.tip).one(p.TRANSITION_END,u).emulateTransitionEnd(h)}else u()}},t.hide=function(e){var t=this,i=this.getTipElement(),n=o.default.Event(this.constructor.Event.HIDE),a=function(){t._hoverState!==$t&&i.parentNode&&i.parentNode.removeChild(i),t._cleanTipClass(),t.element.removeAttribute("aria-describedby"),o.default(t.element).trigger(t.constructor.Event.HIDDEN),null!==t._popper&&t._popper.destroy(),e&&e()};if(o.default(this.element).trigger(n),!n.isDefaultPrevented()){if(o.default(i).removeClass(Et),"ontouchstart"in document.documentElement&&o.default(document.body).children().off("mouseover",null,o.default.noop),this._activeTrigger.click=!1,this._activeTrigger[Nt]=!1,this._activeTrigger[Lt]=!1,o.default(this.tip).hasClass(Bt)){var s=p.getTransitionDurationFromElement(i);o.default(i).one(p.TRANSITION_END,a).emulateTransitionEnd(s)}else a();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(e){o.default(this.getTipElement()).addClass(wt+"-"+e)},t.getTipElement=function(){return this.tip=this.tip||o.default(this.config.template)[0],this.tip},t.setContent=function(){var e=this.getTipElement();this.setElementContent(o.default(e.querySelectorAll(".tooltip-inner")),this.getTitle()),o.default(e).removeClass(Bt+" "+Et)},t.setElementContent=function(e,t){"object"!=typeof t||!t.nodeType&&!t.jquery?this.config.html?(this.config.sanitize&&(t=bt(t,this.config.whiteList,this.config.sanitizeFn)),e.html(t)):e.text(t):this.config.html?o.default(t).parent().is(e)||e.empty().append(t):e.text(o.default(t).text())},t.getTitle=function(){var e=this.element.getAttribute("data-original-title");return e||(e="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),e},t._getPopperConfig=function(e){var t=this;return l({},{placement:e,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(e){e.originalPlacement!==e.placement&&t._handlePopperPlacementChange(e)},onUpdate:function(e){return t._handlePopperPlacementChange(e)}},this.config.popperConfig)},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:p.isElement(this.config.container)?o.default(this.config.container):o.default(document).find(this.config.container)},t._getAttachment=function(e){return xt[e.toUpperCase()]},t._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)o.default(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if("manual"!==t){var i=t===Lt?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,n=t===Lt?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;o.default(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(n,e.config.selector,function(t){return e._leave(t)})}}),this._hideModalHandler=function(){e.element&&e.hide()},o.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var e=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==e)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(e,t){var i=this.constructor.DATA_KEY;(t=t||o.default(e.currentTarget).data(i))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),o.default(e.currentTarget).data(i,t)),e&&(t._activeTrigger["focusin"===e.type?Nt:Lt]=!0),o.default(t.getTipElement()).hasClass(Et)||t._hoverState===$t?t._hoverState=$t:(clearTimeout(t._timeout),t._hoverState=$t,t.config.delay&&t.config.delay.show?t._timeout=setTimeout(function(){t._hoverState===$t&&t.show()},t.config.delay.show):t.show())},t._leave=function(e,t){var i=this.constructor.DATA_KEY;(t=t||o.default(e.currentTarget).data(i))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),o.default(e.currentTarget).data(i,t)),e&&(t._activeTrigger["focusout"===e.type?Nt:Lt]=!1),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState=Ot,t.config.delay&&t.config.delay.hide?t._timeout=setTimeout(function(){t._hoverState===Ot&&t.hide()},t.config.delay.hide):t.hide())},t._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},t._getConfig=function(e){var t=o.default(this.element).data();return Object.keys(t).forEach(function(e){-1!==At.indexOf(e)&&delete t[e]}),"number"==typeof(e=l({},this.constructor.Default,t,"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),p.typeCheckConfig(kt,e,this.constructor.DefaultType),e.sanitize&&(e.template=bt(e.template,e.whiteList,e.sanitizeFn)),e},t._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},t._cleanTipClass=function(){var e=o.default(this.getTipElement()),t=e.attr("class").match(Pt);null!==t&&t.length&&e.removeClass(t.join(""))},t._handlePopperPlacementChange=function(e){this.tip=e.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(e.placement))},t._fixTransition=function(){var e=this.getTipElement(),t=this.config.animation;null===e.getAttribute("x-placement")&&(o.default(e).removeClass(Bt),this.config.animation=!1,this.hide(),this.show(),this.config.animation=t)},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this),n=i.data(_t),a="object"==typeof t&&t;if((n||!/dispose|hide/.test(t))&&(n||(n=new e(this,a),i.data(_t,n)),"string"==typeof t)){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}})},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return Ft}},{key:"NAME",get:function(){return kt}},{key:"DATA_KEY",get:function(){return _t}},{key:"Event",get:function(){return Mt}},{key:"EVENT_KEY",get:function(){return Dt}},{key:"DefaultType",get:function(){return Tt}}]),e}();o.default.fn[kt]=Ut._jQueryInterface,o.default.fn[kt].Constructor=Ut,o.default.fn[kt].noConflict=function(){return o.default.fn[kt]=It,Ut._jQueryInterface};var Rt="popover",Wt="bs.popover",Gt="."+Wt,Vt=o.default.fn[Rt],Ht="bs-popover",jt=new RegExp("(^|\\s)"+Ht+"\\S+","g"),Yt=l({},Ut.Default,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),qt=l({},Ut.DefaultType,{content:"(string|element|function)"}),zt={HIDE:"hide"+Gt,HIDDEN:"hidden"+Gt,SHOW:"show"+Gt,SHOWN:"shown"+Gt,INSERTED:"inserted"+Gt,CLICK:"click"+Gt,FOCUSIN:"focusin"+Gt,FOCUSOUT:"focusout"+Gt,MOUSEENTER:"mouseenter"+Gt,MOUSELEAVE:"mouseleave"+Gt},Xt=function(e){var t,i;function n(){return e.apply(this,arguments)||this}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i;var a=n.prototype;return a.isWithContent=function(){return this.getTitle()||this._getContent()},a.addAttachmentClass=function(e){o.default(this.getTipElement()).addClass(Ht+"-"+e)},a.getTipElement=function(){return this.tip=this.tip||o.default(this.config.template)[0],this.tip},a.setContent=function(){var e=o.default(this.getTipElement());this.setElementContent(e.find(".popover-header"),this.getTitle());var t=this._getContent();"function"==typeof t&&(t=t.call(this.element)),this.setElementContent(e.find(".popover-body"),t),e.removeClass("fade show")},a._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},a._cleanTipClass=function(){var e=o.default(this.getTipElement()),t=e.attr("class").match(jt);null!==t&&t.length>0&&e.removeClass(t.join(""))},n._jQueryInterface=function(e){return this.each(function(){var t=o.default(this).data(Wt),i="object"==typeof e?e:null;if((t||!/dispose|hide/.test(e))&&(t||(t=new n(this,i),o.default(this).data(Wt,t)),"string"==typeof e)){if(void 0===t[e])throw new TypeError('No method named "'+e+'"');t[e]()}})},r(n,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return Yt}},{key:"NAME",get:function(){return Rt}},{key:"DATA_KEY",get:function(){return Wt}},{key:"Event",get:function(){return zt}},{key:"EVENT_KEY",get:function(){return Gt}},{key:"DefaultType",get:function(){return qt}}]),n}(Ut);o.default.fn[Rt]=Xt._jQueryInterface,o.default.fn[Rt].Constructor=Xt,o.default.fn[Rt].noConflict=function(){return o.default.fn[Rt]=Vt,Xt._jQueryInterface};var Zt="scrollspy",Jt="bs.scrollspy",Qt="."+Jt,Kt=o.default.fn[Zt],ei={offset:10,method:"auto",target:""},ti={offset:"number",method:"string",target:"(string|element)"},ii="activate"+Qt,ni="scroll"+Qt,oi="load"+Qt+".data-api",ai="active",si=".nav, .list-group",ri=".nav-link",li=".list-group-item",ci="position",di=function(){function e(e,t){var i=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(t),this._selector=this._config.target+" "+ri+","+this._config.target+" "+li+","+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,o.default(this._scrollElement).on(ni,function(e){return i._process(e)}),this.refresh(),this._process()}var t=e.prototype;return t.refresh=function(){var e=this,t=this._scrollElement===this._scrollElement.window?"offset":ci,i="auto"===this._config.method?t:this._config.method,n=i===ci?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map(function(e){var t,a=p.getSelectorFromElement(e);if(a&&(t=document.querySelector(a)),t){var s=t.getBoundingClientRect();if(s.width||s.height)return[o.default(t)[i]().top+n,a]}return null}).filter(function(e){return e}).sort(function(e,t){return e[0]-t[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},t.dispose=function(){o.default.removeData(this._element,Jt),o.default(this._scrollElement).off(Qt),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},t._getConfig=function(e){if("string"!=typeof(e=l({},ei,"object"==typeof e&&e?e:{})).target&&p.isElement(e.target)){var t=o.default(e.target).attr("id");t||(t=p.getUID(Zt),o.default(e.target).attr("id",t)),e.target="#"+t}return p.typeCheckConfig(Zt,e,ti),e},t._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},t._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},t._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},t._process=function(){var e=this._getScrollTop()+this._config.offset,t=this._getScrollHeight(),i=this._config.offset+t-this._getOffsetHeight();if(this._scrollHeight!==t&&this.refresh(),e>=i){var n=this._targets[this._targets.length-1];this._activeTarget!==n&&this._activate(n)}else{if(this._activeTarget&&e<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&e>=this._offsets[o]&&(void 0===this._offsets[o+1]||e<this._offsets[o+1])&&this._activate(this._targets[o])}}},t._activate=function(e){this._activeTarget=e,this._clear();var t=this._selector.split(",").map(function(t){return t+'[data-target="'+e+'"],'+t+'[href="'+e+'"]'}),i=o.default([].slice.call(document.querySelectorAll(t.join(","))));i.hasClass("dropdown-item")?(i.closest(".dropdown").find(".dropdown-toggle").addClass(ai),i.addClass(ai)):(i.addClass(ai),i.parents(si).prev(ri+", "+li).addClass(ai),i.parents(si).prev(".nav-item").children(ri).addClass(ai)),o.default(this._scrollElement).trigger(ii,{relatedTarget:e})},t._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter(function(e){return e.classList.contains(ai)}).forEach(function(e){return e.classList.remove(ai)})},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this).data(Jt);if(i||(i=new e(this,"object"==typeof t&&t),o.default(this).data(Jt,i)),"string"==typeof t){if(void 0===i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"Default",get:function(){return ei}}]),e}();o.default(window).on(oi,function(){for(var e=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),t=e.length;t--;){var i=o.default(e[t]);di._jQueryInterface.call(i,i.data())}}),o.default.fn[Zt]=di._jQueryInterface,o.default.fn[Zt].Constructor=di,o.default.fn[Zt].noConflict=function(){return o.default.fn[Zt]=Kt,di._jQueryInterface};var ui="tab",pi="bs.tab",hi="."+pi,mi=o.default.fn[ui],gi="hide"+hi,vi="hidden"+hi,fi="show"+hi,Ci="shown"+hi,Si="click"+hi+".data-api",yi="active",bi="fade",ki="show",_i=".active",Di="> li > .active",Ii=function(){function e(e){this._element=e}var t=e.prototype;return t.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&o.default(this._element).hasClass(yi)||o.default(this._element).hasClass("disabled"))){var t,i,n=o.default(this._element).closest(".nav, .list-group")[0],a=p.getSelectorFromElement(this._element);if(n){var s="UL"===n.nodeName||"OL"===n.nodeName?Di:_i;i=(i=o.default.makeArray(o.default(n).find(s)))[i.length-1]}var r=o.default.Event(gi,{relatedTarget:this._element}),l=o.default.Event(fi,{relatedTarget:i});if(i&&o.default(i).trigger(r),o.default(this._element).trigger(l),!l.isDefaultPrevented()&&!r.isDefaultPrevented()){a&&(t=document.querySelector(a)),this._activate(this._element,n);var c=function(){var t=o.default.Event(vi,{relatedTarget:e._element}),n=o.default.Event(Ci,{relatedTarget:i});o.default(i).trigger(t),o.default(e._element).trigger(n)};t?this._activate(t,t.parentNode,c):c()}}},t.dispose=function(){o.default.removeData(this._element,pi),this._element=null},t._activate=function(e,t,i){var n=this,a=(!t||"UL"!==t.nodeName&&"OL"!==t.nodeName?o.default(t).children(_i):o.default(t).find(Di))[0],s=i&&a&&o.default(a).hasClass(bi),r=function(){return n._transitionComplete(e,a,i)};if(a&&s){var l=p.getTransitionDurationFromElement(a);o.default(a).removeClass(ki).one(p.TRANSITION_END,r).emulateTransitionEnd(l)}else r()},t._transitionComplete=function(e,t,i){if(t){o.default(t).removeClass(yi);var n=o.default(t.parentNode).find("> .dropdown-menu .active")[0];n&&o.default(n).removeClass(yi),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!1)}if(o.default(e).addClass(yi),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!0),p.reflow(e),e.classList.contains(bi)&&e.classList.add(ki),e.parentNode&&o.default(e.parentNode).hasClass("dropdown-menu")){var a=o.default(e).closest(".dropdown")[0];if(a){var s=[].slice.call(a.querySelectorAll(".dropdown-toggle"));o.default(s).addClass(yi)}e.setAttribute("aria-expanded",!0)}i&&i()},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this),n=i.data(pi);if(n||(n=new e(this),i.data(pi,n)),"string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t]()}})},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}}]),e}();o.default(document).on(Si,'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',function(e){e.preventDefault(),Ii._jQueryInterface.call(o.default(this),"show")}),o.default.fn[ui]=Ii._jQueryInterface,o.default.fn[ui].Constructor=Ii,o.default.fn[ui].noConflict=function(){return o.default.fn[ui]=mi,Ii._jQueryInterface};var wi="toast",Pi="bs.toast",Ai="."+Pi,Ti=o.default.fn[wi],xi="click.dismiss"+Ai,Fi="hide"+Ai,$i="hidden"+Ai,Oi="show"+Ai,Mi="shown"+Ai,Bi="hide",Ei="show",Li="showing",Ni={animation:"boolean",autohide:"boolean",delay:"number"},Ui={animation:!0,autohide:!0,delay:500},Ri=function(){function e(e,t){this._element=e,this._config=this._getConfig(t),this._timeout=null,this._setListeners()}var t=e.prototype;return t.show=function(){var e=this,t=o.default.Event(Oi);if(o.default(this._element).trigger(t),!t.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var i=function(){e._element.classList.remove(Li),e._element.classList.add(Ei),o.default(e._element).trigger(Mi),e._config.autohide&&(e._timeout=setTimeout(function(){e.hide()},e._config.delay))};if(this._element.classList.remove(Bi),p.reflow(this._element),this._element.classList.add(Li),this._config.animation){var n=p.getTransitionDurationFromElement(this._element);o.default(this._element).one(p.TRANSITION_END,i).emulateTransitionEnd(n)}else i()}},t.hide=function(){if(this._element.classList.contains(Ei)){var e=o.default.Event(Fi);o.default(this._element).trigger(e),e.isDefaultPrevented()||this._close()}},t.dispose=function(){this._clearTimeout(),this._element.classList.contains(Ei)&&this._element.classList.remove(Ei),o.default(this._element).off(xi),o.default.removeData(this._element,Pi),this._element=null,this._config=null},t._getConfig=function(e){return e=l({},Ui,o.default(this._element).data(),"object"==typeof e&&e?e:{}),p.typeCheckConfig(wi,e,this.constructor.DefaultType),e},t._setListeners=function(){var e=this;o.default(this._element).on(xi,'[data-dismiss="toast"]',function(){return e.hide()})},t._close=function(){var e=this,t=function(){e._element.classList.add(Bi),o.default(e._element).trigger($i)};if(this._element.classList.remove(Ei),this._config.animation){var i=p.getTransitionDurationFromElement(this._element);o.default(this._element).one(p.TRANSITION_END,t).emulateTransitionEnd(i)}else t()},t._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},e._jQueryInterface=function(t){return this.each(function(){var i=o.default(this),n=i.data(Pi);if(n||(n=new e(this,"object"==typeof t&&t),i.data(Pi,n)),"string"==typeof t){if(void 0===n[t])throw new TypeError('No method named "'+t+'"');n[t](this)}})},r(e,null,[{key:"VERSION",get:function(){return"4.6.0"}},{key:"DefaultType",get:function(){return Ni}},{key:"Default",get:function(){return Ui}}]),e}();o.default.fn[wi]=Ri._jQueryInterface,o.default.fn[wi].Constructor=Ri,o.default.fn[wi].noConflict=function(){return o.default.fn[wi]=Ti,Ri._jQueryInterface},e.Alert=y,e.Button=O,e.Carousel=ae,e.Collapse=_e,e.Dropdown=je,e.Modal=vt,e.Popover=Xt,e.Scrollspy=di,e.Tab=Ii,e.Toast=Ri,e.Tooltip=Ut,e.Util=p,Object.defineProperty(e,"__esModule",{value:!0})}),function(e,t){"use strict";e.fn.rating=function(i){this.each(function(){var n=e(this),o=e.extend({},n.data(),i);o.start=parseInt(o.start,10)||t,o.stop=parseInt(o.stop,10)||o.start+5||t,o.step=parseInt(o.step,10)||t,o=e.extend({},e.fn.rating.defaults,o);for(var a=function(e){var t=c.children();t.eq(e).prevAll(".rating-symbol").addBack().removeClass(o.empty).addClass(o.filled),t.eq(e).nextAll(".rating-symbol").removeClass(o.filled).addClass(o.empty)},s=function(e){return Math.max(Math.ceil((e-o.start)/o.step),0)},r=function(e){var t=parseInt(e,10);(function(e){var t=o.step>0?o.start:o.stop,i=o.step>0?o.stop-1:o.start+1;return e>=t&&i>=e&&(o.start+e)%o.step===0})(t)&&a(s(t))},l=function(e){return function(){n.prop("disabled")||n.prop("readonly")||e.call(this)}},c=e("<div></div>").insertBefore(n),d=0;d<s(o.stop);d++)c.append('<div class="rating-symbol '+o.empty+'"></div>');r(n.val()),n.on("change",function(){r(e(this).val())}),c.on("click",".rating-symbol",l(function(){n.val(function(e){return o.start+e*o.step}(e(this).index())).change()})).on("mouseenter",".rating-symbol",l(function(){a(e(this).index())})).on("mouseleave",".rating-symbol",l(function(){a(s(n.val()))}))})},e.fn.rating.defaults={filled:"glyphicon glyphicon-star",empty:"glyphicon glyphicon-star-empty",start:0,stop:5,step:1},e(function(){e("input.rating").rating()})}(jQuery),function(){
/*
     geolocation-marker version 2.0.5
     @copyright 2012, 2015 Chad Killingsworth
     @see https://github.com/ChadKillingsworth/geolocation-marker/blob/master/LICENSE.txt
    */
"use strict";var e;function t(e,t,n,o,a,s){var r=google.maps.MVCObject.call(this)||this;r.c=null,r.b=null,r.a=null,r.i=-1;var l={clickable:!1,cursor:"pointer",draggable:!1,flat:!0,icon:{path:google.maps.SymbolPath.CIRCLE,fillColor:"#C8D6EC",fillOpacity:.7,scale:12,strokeWeight:0},position:new google.maps.LatLng(a,s),title:"Current location",zIndex:2},c={clickable:!1,cursor:"pointer",draggable:!1,flat:!0,icon:{path:google.maps.SymbolPath.CIRCLE,fillColor:"#4285F4",fillOpacity:1,scale:6,strokeColor:"white",strokeWeight:2},optimized:!1,position:new google.maps.LatLng(a,s),title:"Current location",zIndex:3};return t&&(l=i(l,t)),n&&(c=i(c,n)),t={clickable:!1,radius:0,strokeColor:"1bb6ff",strokeOpacity:0,fillColor:"61a0bf",fillOpacity:0,strokeWeight:0,zIndex:1},o&&(t=i(t,o)),r.c=new google.maps.Marker(l),r.b=new google.maps.Marker(c),r.a=new google.maps.Circle(t),google.maps.MVCObject.prototype.set.call(r,"accuracy",null),google.maps.MVCObject.prototype.set.call(r,"position",null),google.maps.MVCObject.prototype.set.call(r,"map",null),r.set("minimum_accuracy",null),r.set("position_options",{enableHighAccuracy:!0,maximumAge:1e3}),r.a.bindTo("map",r.c),r.a.bindTo("map",r.b),e&&r.setMap(e),r}function i(e,t){for(var i in t)!0!==n[i]&&(e[i]=t[i]);return e}!function(e,t){function i(){}for(var n in i.prototype=t.prototype,e.B=t.prototype,e.prototype=new i,e.prototype.constructor=e,t)if("prototype"!=n)if(Object.defineProperties){var o=Object.getOwnPropertyDescriptor(t,n);o&&Object.defineProperty(e,n,o)}else e[n]=t[n]}(t,google.maps.MVCObject),(e=t.prototype).set=function(e,t){if(o.test(e))throw"'"+e+"' is a read-only property.";"map"===e?this.setMap(t):google.maps.MVCObject.prototype.set.call(this,e,t)},e.f=function(){return this.get("map")},e.l=function(){return this.get("position_options")},e.w=function(e){this.set("position_options",e)},e.g=function(){return this.get("position")},e.m=function(){return this.get("position")?this.a.getBounds():null},e.j=function(){return this.get("accuracy")},e.h=function(){return this.get("minimum_accuracy")},e.v=function(e){this.set("minimum_accuracy",e)},e.setMap=function(e){google.maps.MVCObject.prototype.set.call(this,"map",e),this.c.unbind("position"),this.b.unbind("position"),this.a.unbind("center"),this.a.unbind("radius"),google.maps.MVCObject.prototype.set.call(this,"accuracy",null),google.maps.MVCObject.prototype.set.call(this,"position",null),this.c.setMap(e),this.b.setMap(e)},e.u=function(e){this.b.setOptions(i({},e))},e.s=function(e){this.a.setOptions(i({},e))},e.A=function(e){var t=new google.maps.LatLng(e.coords.latitude,e.coords.longitude),i=!this.b.getMap();if(i){if(null!=this.h()&&e.coords.accuracy>this.h())return;this.c.setMap(this.f()),this.b.setMap(this.f()),this.c.bindTo("position",this),this.b.bindTo("position",this),this.a.bindTo("center",this,"position"),this.a.bindTo("radius",this,"accuracy")}this.j()!=e.coords.accuracy&&google.maps.MVCObject.prototype.set.call(this,"accuracy",e.coords.accuracy),!i&&this.g()&&this.g().equals(t)||google.maps.MVCObject.prototype.set.call(this,"position",t)},e.o=function(e){google.maps.event.trigger(this,"geolocation_error",e)};var n={map:!0,position:!0,radius:!0},o=/^(?:position|accuracy)$/i,a=window;function s(){return t.prototype.getAccuracy=t.prototype.j,t.prototype.getBounds=t.prototype.m,t.prototype.getMap=t.prototype.f,t.prototype.getMinimumAccuracy=t.prototype.h,t.prototype.getPosition=t.prototype.g,t.prototype.getPositionOptions=t.prototype.l,t.prototype.setCircleOptions=t.prototype.s,t.prototype.setMap=t.prototype.setMap,t.prototype.setMarkerOptions=t.prototype.u,t.prototype.setMinimumAccuracy=t.prototype.v,t.prototype.setPositionOptions=t.prototype.w,t}"function"==typeof a.define&&a.define.amd?a.define([],s):"object"==typeof a.exports?a.module.exports=s():a.GeolocationMarker=s()}.call(this),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var e,t;function i(){return e.apply(null,arguments)}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function o(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function s(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(a(e,t))return;return 1}function r(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function d(e,t){for(var i=[],n=0;n<e.length;++n)i.push(t(e[n],n));return i}function u(e,t){for(var i in t)a(t,i)&&(e[i]=t[i]);return a(t,"toString")&&(e.toString=t.toString),a(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,i,n){return wt(e,t,i,n,!0).utc()}function h(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function m(e){if(null==e._isValid){var i=h(e),n=t.call(i.parsedDateParts,function(e){return null!=e}),o=!isNaN(e._d.getTime())&&i.overflow<0&&!i.empty&&!i.invalidEra&&!i.invalidMonth&&!i.invalidWeekday&&!i.weekdayMismatch&&!i.nullInput&&!i.invalidFormat&&!i.userInvalidated&&(!i.meridiem||i.meridiem&&n);if(e._strict&&(o=o&&0===i.charsLeftOver&&0===i.unusedTokens.length&&void 0===i.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return o;e._isValid=o}return e._isValid}function g(e){var t=p(NaN);return null!=e?u(h(t),e):h(t).userInvalidated=!0,t}t=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),i=t.length>>>0,n=0;n<i;n++)if(n in t&&e.call(this,t[n],n,t))return!0;return!1};var v=i.momentProperties=[],f=!1;function C(e,t){var i,n,o;if(r(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),r(t._i)||(e._i=t._i),r(t._f)||(e._f=t._f),r(t._l)||(e._l=t._l),r(t._strict)||(e._strict=t._strict),r(t._tzm)||(e._tzm=t._tzm),r(t._isUTC)||(e._isUTC=t._isUTC),r(t._offset)||(e._offset=t._offset),r(t._pf)||(e._pf=h(t)),r(t._locale)||(e._locale=t._locale),0<v.length)for(i=0;i<v.length;i++)r(o=t[n=v[i]])||(e[n]=o);return e}function S(e){C(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===f&&(f=!0,i.updateOffset(this),f=!1)}function y(e){return e instanceof S||null!=e&&null!=e._isAMomentObject}function b(e){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function k(e,t){var n=!0;return u(function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,e),n){for(var o,s,r=[],l=0;l<arguments.length;l++){if(o="","object"==typeof arguments[l]){for(s in o+="\n["+l+"] ",arguments[0])a(arguments[0],s)&&(o+=s+": "+arguments[0][s]+", ");o=o.slice(0,-2)}else o=arguments[l];r.push(o)}b(e+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)},t)}var _,D={};function I(e,t){null!=i.deprecationHandler&&i.deprecationHandler(e,t),D[e]||(b(t),D[e]=!0)}function w(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function P(e,t){var i,n=u({},e);for(i in t)a(t,i)&&(o(e[i])&&o(t[i])?(n[i]={},u(n[i],e[i]),u(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);for(i in e)a(e,i)&&!a(t,i)&&o(e[i])&&(n[i]=u({},n[i]));return n}function A(e){null!=e&&this.set(e)}function T(e,t,i){var n=""+Math.abs(e),o=t-n.length;return(0<=e?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,_=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)a(e,t)&&i.push(t);return i};var x=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,F=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,$={},O={};function M(e,t,i,n){var o="string"==typeof n?function(){return this[n]()}:n;e&&(O[e]=o),t&&(O[t[0]]=function(){return T(o.apply(this,arguments),t[1],t[2])}),i&&(O[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function B(e,t){return e.isValid()?(t=E(t,e.localeData()),$[t]=$[t]||function(e){for(var t,i=e.match(x),n=0,o=i.length;n<o;n++)O[i[n]]?i[n]=O[i[n]]:i[n]=(t=i[n]).match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"");return function(t){for(var n="",a=0;a<o;a++)n+=w(i[a])?i[a].call(t,e):i[a];return n}}(t),$[t](e)):e.localeData().invalidDate()}function E(e,t){var i=5;function n(e){return t.longDateFormat(e)||e}for(F.lastIndex=0;0<=i&&F.test(e);)e=e.replace(F,n),F.lastIndex=0,--i;return e}var L={};function N(e,t){var i=e.toLowerCase();L[i]=L[i+"s"]=L[t]=e}function U(e){return"string"==typeof e?L[e]||L[e.toLowerCase()]:void 0}function R(e){var t,i,n={};for(i in e)a(e,i)&&(t=U(i))&&(n[t]=e[i]);return n}var W={};function G(e,t){W[e]=t}function V(e){return e%4==0&&e%100!=0||e%400==0}function H(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function j(e){var t=+e,i=0;return 0!=t&&isFinite(t)&&(i=H(t)),i}function Y(e,t){return function(n){return null!=n?(z(this,e,n),i.updateOffset(this,t),this):q(this,e)}}function q(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function z(e,t,i){e.isValid()&&!isNaN(i)&&("FullYear"===t&&V(e.year())&&1===e.month()&&29===e.date()?(i=j(i),e._d["set"+(e._isUTC?"UTC":"")+t](i,e.month(),Ae(i,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](i))}var X,Z=/\d/,J=/\d\d/,Q=/\d{3}/,K=/\d{4}/,ee=/[+-]?\d{6}/,te=/\d\d?/,ie=/\d\d\d\d?/,ne=/\d\d\d\d\d\d?/,oe=/\d{1,3}/,ae=/\d{1,4}/,se=/[+-]?\d{1,6}/,re=/\d+/,le=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,de=/Z|[+-]\d\d(?::?\d\d)?/gi,ue=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,t,i){X[e]=w(t)?t:function(e,n){return e&&i?i:t}}function he(e,t){return a(X,e)?X[e](t._strict,t._locale):new RegExp(me(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,o){return t||i||n||o})))}function me(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}X={};var ge={};function ve(e,t){var i,n=t;for("string"==typeof e&&(e=[e]),l(t)&&(n=function(e,i){i[t]=j(e)}),i=0;i<e.length;i++)ge[e[i]]=n}function fe(e,t){ve(e,function(e,i,n,o){n._w=n._w||{},t(e,n._w,n,o)})}var Ce,Se=0,ye=1,be=2,ke=3,_e=4,De=5,Ie=6,we=7,Pe=8;function Ae(e,t){if(isNaN(e)||isNaN(t))return NaN;var i=(t%12+12)%12;return e+=(t-i)/12,1==i?V(e)?29:28:31-i%7%2}Ce=Array.prototype.indexOf?Array.prototype.indexOf:function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},M("M",["MM",2],"Mo",function(){return this.month()+1}),M("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),M("MMMM",0,0,function(e){return this.localeData().months(this,e)}),N("month","M"),G("month",8),pe("M",te),pe("MM",te,J),pe("MMM",function(e,t){return t.monthsShortRegex(e)}),pe("MMMM",function(e,t){return t.monthsRegex(e)}),ve(["M","MM"],function(e,t){t[ye]=j(e)-1}),ve(["MMM","MMMM"],function(e,t,i,n){var o=i._locale.monthsParse(e,n,i._strict);null!=o?t[ye]=o:h(i).invalidMonth=e});var Te="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),xe="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Fe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,$e=ue,Oe=ue;function Me(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=j(t);else if(!l(t=e.localeData().monthsParse(t)))return e;return i=Math.min(e.date(),Ae(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function Be(e){return null!=e?(Me(this,e),i.updateOffset(this,!0),this):q(this,"Month")}function Ee(){function e(e,t){return t.length-e.length}for(var t,i=[],n=[],o=[],a=0;a<12;a++)t=p([2e3,a]),i.push(this.monthsShort(t,"")),n.push(this.months(t,"")),o.push(this.months(t,"")),o.push(this.monthsShort(t,""));for(i.sort(e),n.sort(e),o.sort(e),a=0;a<12;a++)i[a]=me(i[a]),n[a]=me(n[a]);for(a=0;a<24;a++)o[a]=me(o[a]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Le(e){return V(e)?366:365}M("Y",0,0,function(){var e=this.year();return e<=9999?T(e,4):"+"+e}),M(0,["YY",2],0,function(){return this.year()%100}),M(0,["YYYY",4],0,"year"),M(0,["YYYYY",5],0,"year"),M(0,["YYYYYY",6,!0],0,"year"),N("year","y"),G("year",1),pe("Y",le),pe("YY",te,J),pe("YYYY",ae,K),pe("YYYYY",se,ee),pe("YYYYYY",se,ee),ve(["YYYYY","YYYYYY"],Se),ve("YYYY",function(e,t){t[Se]=2===e.length?i.parseTwoDigitYear(e):j(e)}),ve("YY",function(e,t){t[Se]=i.parseTwoDigitYear(e)}),ve("Y",function(e,t){t[Se]=parseInt(e,10)}),i.parseTwoDigitYear=function(e){return j(e)+(68<j(e)?1900:2e3)};var Ne=Y("FullYear",!0);function Ue(e){var t,i;return e<100&&0<=e?((i=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,i)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Re(e,t,i){var n=7+t-i;return n-(7+Ue(e,0,n).getUTCDay()-t)%7-1}function We(e,t,i,n,o){var a,s=1+7*(t-1)+(7+i-n)%7+Re(e,n,o),r=s<=0?Le(a=e-1)+s:s>Le(e)?(a=e+1,s-Le(e)):(a=e,s);return{year:a,dayOfYear:r}}function Ge(e,t,i){var n,o,a=Re(e.year(),t,i),s=Math.floor((e.dayOfYear()-a-1)/7)+1;return s<1?n=s+Ve(o=e.year()-1,t,i):s>Ve(e.year(),t,i)?(n=s-Ve(e.year(),t,i),o=e.year()+1):(o=e.year(),n=s),{week:n,year:o}}function Ve(e,t,i){var n=Re(e,t,i),o=Re(e+1,t,i);return(Le(e)-n+o)/7}function He(e,t){return e.slice(t,7).concat(e.slice(0,t))}M("w",["ww",2],"wo","week"),M("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),G("week",5),G("isoWeek",5),pe("w",te),pe("ww",te,J),pe("W",te),pe("WW",te,J),fe(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=j(e)}),M("d",0,"do","day"),M("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),M("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),M("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),M("e",0,0,"weekday"),M("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),G("day",11),G("weekday",11),G("isoWeekday",11),pe("d",te),pe("e",te),pe("E",te),pe("dd",function(e,t){return t.weekdaysMinRegex(e)}),pe("ddd",function(e,t){return t.weekdaysShortRegex(e)}),pe("dddd",function(e,t){return t.weekdaysRegex(e)}),fe(["dd","ddd","dddd"],function(e,t,i,n){var o=i._locale.weekdaysParse(e,n,i._strict);null!=o?t.d=o:h(i).invalidWeekday=e}),fe(["d","e","E"],function(e,t,i,n){t[n]=j(e)});var je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ye="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),qe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ze=ue,Xe=ue,Ze=ue;function Je(){function e(e,t){return t.length-e.length}for(var t,i,n,o,a=[],s=[],r=[],l=[],c=0;c<7;c++)t=p([2e3,1]).day(c),i=me(this.weekdaysMin(t,"")),n=me(this.weekdaysShort(t,"")),o=me(this.weekdays(t,"")),a.push(i),s.push(n),r.push(o),l.push(i),l.push(n),l.push(o);a.sort(e),s.sort(e),r.sort(e),l.sort(e),this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Qe(){return this.hours()%12||12}function Ke(e,t){M(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function et(e,t){return t._meridiemParse}M("H",["HH",2],0,"hour"),M("h",["hh",2],0,Qe),M("k",["kk",2],0,function(){return this.hours()||24}),M("hmm",0,0,function(){return""+Qe.apply(this)+T(this.minutes(),2)}),M("hmmss",0,0,function(){return""+Qe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),M("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),M("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),Ke("a",!0),Ke("A",!1),N("hour","h"),G("hour",13),pe("a",et),pe("A",et),pe("H",te),pe("h",te),pe("k",te),pe("HH",te,J),pe("hh",te,J),pe("kk",te,J),pe("hmm",ie),pe("hmmss",ne),pe("Hmm",ie),pe("Hmmss",ne),ve(["H","HH"],ke),ve(["k","kk"],function(e,t,i){var n=j(e);t[ke]=24===n?0:n}),ve(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),ve(["h","hh"],function(e,t,i){t[ke]=j(e),h(i).bigHour=!0}),ve("hmm",function(e,t,i){var n=e.length-2;t[ke]=j(e.substr(0,n)),t[_e]=j(e.substr(n)),h(i).bigHour=!0}),ve("hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[ke]=j(e.substr(0,n)),t[_e]=j(e.substr(n,2)),t[De]=j(e.substr(o)),h(i).bigHour=!0}),ve("Hmm",function(e,t,i){var n=e.length-2;t[ke]=j(e.substr(0,n)),t[_e]=j(e.substr(n))}),ve("Hmmss",function(e,t,i){var n=e.length-4,o=e.length-2;t[ke]=j(e.substr(0,n)),t[_e]=j(e.substr(n,2)),t[De]=j(e.substr(o))});var tt,it=Y("Hours",!0),nt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Te,monthsShort:xe,week:{dow:0,doy:6},weekdays:je,weekdaysMin:qe,weekdaysShort:Ye,meridiemParse:/[ap]\.?m?\.?/i},ot={},at={};function st(e){return e?e.toLowerCase().replace("_","-"):e}function rt(e){var t;if(void 0===ot[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=tt._abbr,require("./locale/"+e),lt(t)}catch(t){ot[e]=null}return ot[e]}function lt(e,t){var i;return e&&((i=r(t)?dt(e):ct(e,t))?tt=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),tt._abbr}function ct(e,t){if(null===t)return delete ot[e],null;var i,n=nt;if(t.abbr=e,null!=ot[e])I("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ot[e]._config;else if(null!=t.parentLocale)if(null!=ot[t.parentLocale])n=ot[t.parentLocale]._config;else{if(null==(i=rt(t.parentLocale)))return at[t.parentLocale]||(at[t.parentLocale]=[]),at[t.parentLocale].push({name:e,config:t}),null;n=i._config}return ot[e]=new A(P(n,t)),at[e]&&at[e].forEach(function(e){ct(e.name,e.config)}),lt(e),ot[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return tt;if(!n(e)){if(t=rt(e))return t;e=[e]}return function(e){for(var t,i,n,o,a=0;a<e.length;){for(t=(o=st(e[a]).split("-")).length,i=(i=st(e[a+1]))?i.split("-"):null;0<t;){if(n=rt(o.slice(0,t).join("-")))return n;if(i&&i.length>=t&&function(e,t){for(var i=Math.min(e.length,t.length),n=0;n<i;n+=1)if(e[n]!==t[n])return n;return i}(o,i)>=t-1)break;t--}a++}return tt}(e)}function ut(e){var t,i=e._a;return i&&-2===h(e).overflow&&(t=i[ye]<0||11<i[ye]?ye:i[be]<1||i[be]>Ae(i[Se],i[ye])?be:i[ke]<0||24<i[ke]||24===i[ke]&&(0!==i[_e]||0!==i[De]||0!==i[Ie])?ke:i[_e]<0||59<i[_e]?_e:i[De]<0||59<i[De]?De:i[Ie]<0||999<i[Ie]?Ie:-1,h(e)._overflowDayOfYear&&(t<Se||be<t)&&(t=be),h(e)._overflowWeeks&&-1===t&&(t=we),h(e)._overflowWeekday&&-1===t&&(t=Pe),h(e).overflow=t),e}var pt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ht=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/Z|[+-]\d\d(?::?\d\d)?/,gt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],vt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ft=/^\/?Date\((-?\d+)/i,Ct=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,St={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function yt(e){var t,i,n,o,a,s,r=e._i,l=pt.exec(r)||ht.exec(r);if(l){for(h(e).iso=!0,t=0,i=gt.length;t<i;t++)if(gt[t][1].exec(l[1])){o=gt[t][0],n=!1!==gt[t][2];break}if(null==o)return void(e._isValid=!1);if(l[3]){for(t=0,i=vt.length;t<i;t++)if(vt[t][1].exec(l[3])){a=(l[2]||" ")+vt[t][0];break}if(null==a)return void(e._isValid=!1)}if(!n&&null!=a)return void(e._isValid=!1);if(l[4]){if(!mt.exec(l[4]))return void(e._isValid=!1);s="Z"}e._f=o+(a||"")+(s||""),Dt(e)}else e._isValid=!1}function bt(e){var t,i,n,o,a=Ct.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(a){if(t=function(e,t,i,n,o,a){var s=[function(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}(e),xe.indexOf(t),parseInt(i,10),parseInt(n,10),parseInt(o,10)];return a&&s.push(parseInt(a,10)),s}(a[4],a[3],a[2],a[5],a[6],a[7]),n=t,o=e,(i=a[1])&&Ye.indexOf(i)!==new Date(n[0],n[1],n[2]).getDay()&&(h(o).weekdayMismatch=!0,!void(o._isValid=!1)))return;e._a=t,e._tzm=function(e,t,i){if(e)return St[e];if(t)return 0;var n=parseInt(i,10),o=n%100;return(n-o)/100*60+o}(a[8],a[9],a[10]),e._d=Ue.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function kt(e,t,i){return null!=e?e:null!=t?t:i}function _t(e){var t,n,o,a,s,r,l,c=[];if(!e._d){for(r=e,l=new Date(i.now()),o=r._useUTC?[l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()]:[l.getFullYear(),l.getMonth(),l.getDate()],e._w&&null==e._a[be]&&null==e._a[ye]&&function(e){var t,i,n,o,a,s,r,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(a=1,s=4,i=kt(t.GG,e._a[Se],Ge(Pt(),1,4).year),n=kt(t.W,1),((o=kt(t.E,1))<1||7<o)&&(l=!0)):(a=e._locale._week.dow,s=e._locale._week.doy,c=Ge(Pt(),a,s),i=kt(t.gg,e._a[Se],c.year),n=kt(t.w,c.week),null!=t.d?((o=t.d)<0||6<o)&&(l=!0):null!=t.e?(o=t.e+a,(t.e<0||6<t.e)&&(l=!0)):o=a),n<1||n>Ve(i,a,s)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(r=We(i,n,o,a,s),e._a[Se]=r.year,e._dayOfYear=r.dayOfYear)}(e),null!=e._dayOfYear&&(s=kt(e._a[Se],o[Se]),(e._dayOfYear>Le(s)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=Ue(s,0,e._dayOfYear),e._a[ye]=n.getUTCMonth(),e._a[be]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=o[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ke]&&0===e._a[_e]&&0===e._a[De]&&0===e._a[Ie]&&(e._nextDay=!0,e._a[ke]=0),e._d=(e._useUTC?Ue:function(e,t,i,n,o,a,s){var r;return e<100&&0<=e?(r=new Date(e+400,t,i,n,o,a,s),isFinite(r.getFullYear())&&r.setFullYear(e)):r=new Date(e,t,i,n,o,a,s),r}).apply(null,c),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ke]=24),e._w&&void 0!==e._w.d&&e._w.d!==a&&(h(e).weekdayMismatch=!0)}}function Dt(e){if(e._f!==i.ISO_8601)if(e._f!==i.RFC_2822){e._a=[],h(e).empty=!0;for(var t,n,o,s,r,l,c,d=""+e._i,u=d.length,p=0,m=E(e._f,e._locale).match(x)||[],g=0;g<m.length;g++)n=m[g],(t=(d.match(he(n,e))||[])[0])&&(0<(o=d.substr(0,d.indexOf(t))).length&&h(e).unusedInput.push(o),d=d.slice(d.indexOf(t)+t.length),p+=t.length),O[n]?(t?h(e).empty=!1:h(e).unusedTokens.push(n),r=n,c=e,null!=(l=t)&&a(ge,r)&&ge[r](l,c._a,c,r)):e._strict&&!t&&h(e).unusedTokens.push(n);h(e).charsLeftOver=u-p,0<d.length&&h(e).unusedInput.push(d),e._a[ke]<=12&&!0===h(e).bigHour&&0<e._a[ke]&&(h(e).bigHour=void 0),h(e).parsedDateParts=e._a.slice(0),h(e).meridiem=e._meridiem,e._a[ke]=function(e,t,i){var n;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):(null!=e.isPM&&((n=e.isPM(i))&&t<12&&(t+=12),n||12!==t||(t=0)),t)}(e._locale,e._a[ke],e._meridiem),null!==(s=h(e).era)&&(e._a[Se]=e._locale.erasConvertYear(s,e._a[Se])),_t(e),ut(e)}else bt(e);else yt(e)}function It(e){var t,a,s=e._i,p=e._f;return e._locale=e._locale||dt(e._l),null===s||void 0===p&&""===s?g({nullInput:!0}):("string"==typeof s&&(e._i=s=e._locale.preparse(s)),y(s)?new S(ut(s)):(c(s)?e._d=s:n(p)?function(e){var t,i,n,o,a,s,r=!1;if(0===e._f.length)return h(e).invalidFormat=!0,e._d=new Date(NaN);for(o=0;o<e._f.length;o++)a=0,s=!1,t=C({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[o],Dt(t),m(t)&&(s=!0),a+=h(t).charsLeftOver,a+=10*h(t).unusedTokens.length,h(t).score=a,r?a<n&&(n=a,i=t):(null==n||a<n||s)&&(n=a,i=t,s&&(r=!0));u(e,i||t)}(e):p?Dt(e):r(a=(t=e)._i)?t._d=new Date(i.now()):c(a)?t._d=new Date(a.valueOf()):"string"==typeof a?function(e){var t=ft.exec(e._i);null===t?(yt(e),!1===e._isValid&&(delete e._isValid,bt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:i.createFromInputFallback(e)))):e._d=new Date(+t[1])}(t):n(a)?(t._a=d(a.slice(0),function(e){return parseInt(e,10)}),_t(t)):o(a)?function(e){var t,i;e._d||(i=void 0===(t=R(e._i)).day?t.date:t.day,e._a=d([t.year,t.month,i,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),_t(e))}(t):l(a)?t._d=new Date(a):i.createFromInputFallback(t),m(e)||(e._d=null),e))}function wt(e,t,i,a,r){var l,c={};return!0!==t&&!1!==t||(a=t,t=void 0),!0!==i&&!1!==i||(a=i,i=void 0),(o(e)&&s(e)||n(e)&&0===e.length)&&(e=void 0),c._isAMomentObject=!0,c._useUTC=c._isUTC=r,c._l=i,c._i=e,c._f=t,c._strict=a,(l=new S(ut(It(c))))._nextDay&&(l.add(1,"d"),l._nextDay=void 0),l}function Pt(e,t,i,n){return wt(e,t,i,n,!1)}i.createFromInputFallback=k("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),i.ISO_8601=function(){},i.RFC_2822=function(){};var At=k("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Pt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()}),Tt=k("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Pt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:g()});function xt(e,t){var i,o;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return Pt();for(i=t[0],o=1;o<t.length;++o)t[o].isValid()&&!t[o][e](i)||(i=t[o]);return i}var Ft=["year","quarter","month","week","day","hour","minute","second","millisecond"];function $t(e){var t=R(e),i=t.year||0,n=t.quarter||0,o=t.month||0,s=t.week||t.isoWeek||0,r=t.day||0,l=t.hour||0,c=t.minute||0,d=t.second||0,u=t.millisecond||0;this._isValid=function(e){var t,i,n=!1;for(t in e)if(a(e,t)&&(-1===Ce.call(Ft,t)||null!=e[t]&&isNaN(e[t])))return!1;for(i=0;i<Ft.length;++i)if(e[Ft[i]]){if(n)return!1;parseFloat(e[Ft[i]])!==j(e[Ft[i]])&&(n=!0)}return!0}(t),this._milliseconds=+u+1e3*d+6e4*c+1e3*l*60*60,this._days=+r+7*s,this._months=+o+3*n+12*i,this._data={},this._locale=dt(),this._bubble()}function Ot(e){return e instanceof $t}function Mt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Bt(e,t){M(e,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+T(~~(e/60),2)+t+T(~~e%60,2)})}Bt("Z",":"),Bt("ZZ",""),pe("Z",de),pe("ZZ",de),ve(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Lt(de,e)});var Et=/([\+\-]|\d\d)/gi;function Lt(e,t){var i,n,o=(t||"").match(e);return null===o?null:0===(n=60*(i=((o[o.length-1]||[])+"").match(Et)||["-",0,0])[1]+j(i[2]))?0:"+"===i[0]?n:-n}function Nt(e,t){var n,o;return t._isUTC?(n=t.clone(),o=(y(e)||c(e)?e.valueOf():Pt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),i.updateOffset(n,!1),n):Pt(e).local()}function Ut(e){return-Math.round(e._d.getTimezoneOffset())}function Rt(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var Wt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Gt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Vt(e,t){var i,n,o,s=e,r=null;return Ot(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:l(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(r=Wt.exec(e))?(i="-"===r[1]?-1:1,s={y:0,d:j(r[be])*i,h:j(r[ke])*i,m:j(r[_e])*i,s:j(r[De])*i,ms:j(Mt(1e3*r[Ie]))*i}):(r=Gt.exec(e))?(i="-"===r[1]?-1:1,s={y:Ht(r[2],i),M:Ht(r[3],i),w:Ht(r[4],i),d:Ht(r[5],i),h:Ht(r[6],i),m:Ht(r[7],i),s:Ht(r[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=function(e,t){var i;return e.isValid()&&t.isValid()?(t=Nt(t,e),e.isBefore(t)?i=jt(e,t):((i=jt(t,e)).milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}(Pt(s.from),Pt(s.to)),(s={}).ms=o.milliseconds,s.M=o.months),n=new $t(s),Ot(e)&&a(e,"_locale")&&(n._locale=e._locale),Ot(e)&&a(e,"_isValid")&&(n._isValid=e._isValid),n}function Ht(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function jt(e,t){var i={};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=t-e.clone().add(i.months,"M"),i}function Yt(e,t){return function(i,n){var o;return null===n||isNaN(+n)||(I(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),qt(this,Vt(i,n),e),this}}function qt(e,t,n,o){var a=t._milliseconds,s=Mt(t._days),r=Mt(t._months);e.isValid()&&(o=null==o||o,r&&Me(e,q(e,"Month")+r*n),s&&z(e,"Date",q(e,"Date")+s*n),a&&e._d.setTime(e._d.valueOf()+a*n),o&&i.updateOffset(e,s||r))}Vt.fn=$t.prototype,Vt.invalid=function(){return Vt(NaN)};var zt=Yt(1,"add"),Xt=Yt(-1,"subtract");function Zt(e){return"string"==typeof e||e instanceof String}function Jt(e,t){if(e.date()<t.date())return-Jt(t,e);var i=12*(t.year()-e.year())+(t.month()-e.month()),n=e.clone().add(i,"months");return-(i+(t-n<0?(t-n)/(n-e.clone().add(i-1,"months")):(t-n)/(e.clone().add(1+i,"months")-n)))||0}function Qt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=dt(e))&&(this._locale=t),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Kt=k("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function ei(){return this._locale}var ti=126227808e5;function ii(e,t){return(e%t+t)%t}function ni(e,t,i){return e<100&&0<=e?new Date(e+400,t,i)-ti:new Date(e,t,i).valueOf()}function oi(e,t,i){return e<100&&0<=e?Date.UTC(e+400,t,i)-ti:Date.UTC(e,t,i)}function ai(e,t){return t.erasAbbrRegex(e)}function si(){for(var e=[],t=[],i=[],n=[],o=this.eras(),a=0,s=o.length;a<s;++a)t.push(me(o[a].name)),e.push(me(o[a].abbr)),i.push(me(o[a].narrow)),n.push(me(o[a].name)),n.push(me(o[a].abbr)),n.push(me(o[a].narrow));this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+i.join("|")+")","i")}function ri(e,t){M(0,[e,e.length],0,t)}function li(e,t,i,n,o){var a;return null==e?Ge(this,n,o).year:((a=Ve(e,n,o))<t&&(t=a),function(e,t,i,n,o){var a=We(e,t,i,n,o),s=Ue(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}.call(this,e,t,i,n,o))}M("N",0,0,"eraAbbr"),M("NN",0,0,"eraAbbr"),M("NNN",0,0,"eraAbbr"),M("NNNN",0,0,"eraName"),M("NNNNN",0,0,"eraNarrow"),M("y",["y",1],"yo","eraYear"),M("y",["yy",2],0,"eraYear"),M("y",["yyy",3],0,"eraYear"),M("y",["yyyy",4],0,"eraYear"),pe("N",ai),pe("NN",ai),pe("NNN",ai),pe("NNNN",function(e,t){return t.erasNameRegex(e)}),pe("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),ve(["N","NN","NNN","NNNN","NNNNN"],function(e,t,i,n){var o=i._locale.erasParse(e,n,i._strict);o?h(i).era=o:h(i).invalidEra=e}),pe("y",re),pe("yy",re),pe("yyy",re),pe("yyyy",re),pe("yo",function(e,t){return t._eraYearOrdinalRegex||re}),ve(["y","yy","yyy","yyyy"],Se),ve(["yo"],function(e,t,i,n){var o;i._locale._eraYearOrdinalRegex&&(o=e.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?t[Se]=i._locale.eraYearOrdinalParse(e,o):t[Se]=parseInt(e,10)}),M(0,["gg",2],0,function(){return this.weekYear()%100}),M(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ri("gggg","weekYear"),ri("ggggg","weekYear"),ri("GGGG","isoWeekYear"),ri("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),G("weekYear",1),G("isoWeekYear",1),pe("G",le),pe("g",le),pe("GG",te,J),pe("gg",te,J),pe("GGGG",ae,K),pe("gggg",ae,K),pe("GGGGG",se,ee),pe("ggggg",se,ee),fe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=j(e)}),fe(["gg","GG"],function(e,t,n,o){t[o]=i.parseTwoDigitYear(e)}),M("Q",0,"Qo","quarter"),N("quarter","Q"),G("quarter",7),pe("Q",Z),ve("Q",function(e,t){t[ye]=3*(j(e)-1)}),M("D",["DD",2],"Do","date"),N("date","D"),G("date",9),pe("D",te),pe("DD",te,J),pe("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ve(["D","DD"],be),ve("Do",function(e,t){t[be]=j(e.match(te)[0])});var ci=Y("Date",!0);M("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),G("dayOfYear",4),pe("DDD",oe),pe("DDDD",Q),ve(["DDD","DDDD"],function(e,t,i){i._dayOfYear=j(e)}),M("m",["mm",2],0,"minute"),N("minute","m"),G("minute",14),pe("m",te),pe("mm",te,J),ve(["m","mm"],_e);var di=Y("Minutes",!1);M("s",["ss",2],0,"second"),N("second","s"),G("second",15),pe("s",te),pe("ss",te,J),ve(["s","ss"],De);var ui,pi,hi=Y("Seconds",!1);for(M("S",0,0,function(){return~~(this.millisecond()/100)}),M(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),M(0,["SSS",3],0,"millisecond"),M(0,["SSSS",4],0,function(){return 10*this.millisecond()}),M(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),M(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),M(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),M(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),M(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),N("millisecond","ms"),G("millisecond",16),pe("S",oe,Z),pe("SS",oe,J),pe("SSS",oe,Q),ui="SSSS";ui.length<=9;ui+="S")pe(ui,re);function mi(e,t){t[Ie]=j(1e3*("0."+e))}for(ui="S";ui.length<=9;ui+="S")ve(ui,mi);pi=Y("Milliseconds",!1),M("z",0,0,"zoneAbbr"),M("zz",0,0,"zoneName");var gi=S.prototype;function vi(e){return e}gi.add=zt,gi.calendar=function(e,t){1===arguments.length&&(arguments[0]?function(e){return y(e)||c(e)||Zt(e)||l(e)||function(e){var t=n(e),i=!1;return t&&(i=0===e.filter(function(t){return!l(t)&&Zt(e)}).length),t&&i}(e)||function(e){var t,i=o(e)&&!s(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<r.length;t+=1)n=n||a(e,r[t]);return i&&n}(e)||null==e}(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=o(e)&&!s(e),i=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],r=0;r<n.length;r+=1)i=i||a(e,n[r]);return t&&i}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var r=e||Pt(),d=Nt(r,this).startOf("day"),u=i.calendarFormat(this,d)||"sameElse",p=t&&(w(t[u])?t[u].call(this,r):t[u]);return this.format(p||this.localeData().calendar(u,this,Pt(r)))},gi.clone=function(){return new S(this)},gi.diff=function(e,t,i){var n,o,a;if(!this.isValid())return NaN;if(!(n=Nt(e,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),t=U(t)){case"year":a=Jt(this,n)/12;break;case"month":a=Jt(this,n);break;case"quarter":a=Jt(this,n)/3;break;case"second":a=(this-n)/1e3;break;case"minute":a=(this-n)/6e4;break;case"hour":a=(this-n)/36e5;break;case"day":a=(this-n-o)/864e5;break;case"week":a=(this-n-o)/6048e5;break;default:a=this-n}return i?a:H(a)},gi.endOf=function(e){var t,n;if(void 0===(e=U(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?oi:ni,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-ii(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-ii(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-ii(t,1e3)-1}return this._d.setTime(t),i.updateOffset(this,!0),this},gi.format=function(e){var t=B(this,e=e||(this.isUtc()?i.defaultFormatUtc:i.defaultFormat));return this.localeData().postformat(t)},gi.from=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Pt(e).isValid())?Vt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},gi.fromNow=function(e){return this.from(Pt(),e)},gi.to=function(e,t){return this.isValid()&&(y(e)&&e.isValid()||Pt(e).isValid())?Vt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},gi.toNow=function(e){return this.to(Pt(),e)},gi.get=function(e){return w(this[e=U(e)])?this[e]():this},gi.invalidAt=function(){return h(this).overflow},gi.isAfter=function(e,t){var i=y(e)?e:Pt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=U(t)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf())},gi.isBefore=function(e,t){var i=y(e)?e:Pt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=U(t)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf())},gi.isBetween=function(e,t,i,n){var o=y(e)?e:Pt(e),a=y(t)?t:Pt(t);return!!(this.isValid()&&o.isValid()&&a.isValid())&&("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(a,i):!this.isAfter(a,i))},gi.isSame=function(e,t){var i,n=y(e)?e:Pt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=U(t)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf()))},gi.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},gi.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},gi.isValid=function(){return m(this)},gi.lang=Kt,gi.locale=Qt,gi.localeData=ei,gi.max=Tt,gi.min=At,gi.parsingFlags=function(){return u({},h(this))},gi.set=function(e,t){if("object"==typeof e)for(var i=function(e){var t,i=[];for(t in e)a(e,t)&&i.push({unit:t,priority:W[t]});return i.sort(function(e,t){return e.priority-t.priority}),i}(e=R(e)),n=0;n<i.length;n++)this[i[n].unit](e[i[n].unit]);else if(w(this[e=U(e)]))return this[e](t);return this},gi.startOf=function(e){var t,n;if(void 0===(e=U(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?oi:ni,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=ii(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=ii(t,6e4);break;case"second":t=this._d.valueOf(),t-=ii(t,1e3)}return this._d.setTime(t),i.updateOffset(this,!0),this},gi.subtract=Xt,gi.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},gi.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},gi.toDate=function(){return new Date(this.valueOf())},gi.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,i=t?this.clone().utc():this;return i.year()<0||9999<i.year()?B(i,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):w(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",B(i,"Z")):B(i,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},gi.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,i,n="moment",o="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=o+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+i)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(gi[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),gi.toJSON=function(){return this.isValid()?this.toISOString():null},gi.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},gi.unix=function(){return Math.floor(this.valueOf()/1e3)},gi.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},gi.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},gi.eraName=function(){for(var e,t=this.localeData().eras(),i=0,n=t.length;i<n;++i){if(e=this.clone().startOf("day").valueOf(),t[i].since<=e&&e<=t[i].until)return t[i].name;if(t[i].until<=e&&e<=t[i].since)return t[i].name}return""},gi.eraNarrow=function(){for(var e,t=this.localeData().eras(),i=0,n=t.length;i<n;++i){if(e=this.clone().startOf("day").valueOf(),t[i].since<=e&&e<=t[i].until)return t[i].narrow;if(t[i].until<=e&&e<=t[i].since)return t[i].narrow}return""},gi.eraAbbr=function(){for(var e,t=this.localeData().eras(),i=0,n=t.length;i<n;++i){if(e=this.clone().startOf("day").valueOf(),t[i].since<=e&&e<=t[i].until)return t[i].abbr;if(t[i].until<=e&&e<=t[i].since)return t[i].abbr}return""},gi.eraYear=function(){for(var e,t,n=this.localeData().eras(),o=0,a=n.length;o<a;++o)if(e=n[o].since<=n[o].until?1:-1,t=this.clone().startOf("day").valueOf(),n[o].since<=t&&t<=n[o].until||n[o].until<=t&&t<=n[o].since)return(this.year()-i(n[o].since).year())*e+n[o].offset;return this.year()},gi.year=Ne,gi.isLeapYear=function(){return V(this.year())},gi.weekYear=function(e){return li.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},gi.isoWeekYear=function(e){return li.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},gi.quarter=gi.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},gi.month=Be,gi.daysInMonth=function(){return Ae(this.year(),this.month())},gi.week=gi.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},gi.isoWeek=gi.isoWeeks=function(e){var t=Ge(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},gi.weeksInYear=function(){var e=this.localeData()._week;return Ve(this.year(),e.dow,e.doy)},gi.weeksInWeekYear=function(){var e=this.localeData()._week;return Ve(this.weekYear(),e.dow,e.doy)},gi.isoWeeksInYear=function(){return Ve(this.year(),1,4)},gi.isoWeeksInISOWeekYear=function(){return Ve(this.isoWeekYear(),1,4)},gi.date=ci,gi.day=gi.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,i,n=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,i=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=i.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-n,"d")):n},gi.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},gi.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t,i,n=(t=e,i=this.localeData(),"string"==typeof t?i.weekdaysParse(t)%7||7:isNaN(t)?null:t);return this.day(this.day()%7?n:n-7)},gi.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},gi.hour=gi.hours=it,gi.minute=gi.minutes=di,gi.second=gi.seconds=hi,gi.millisecond=gi.milliseconds=pi,gi.utcOffset=function(e,t,n){var o,a=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?a:Ut(this);if("string"==typeof e){if(null===(e=Lt(de,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(o=Ut(this)),this._offset=e,this._isUTC=!0,null!=o&&this.add(o,"m"),a!==e&&(!t||this._changeInProgress?qt(this,Vt(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this},gi.utc=function(e){return this.utcOffset(0,e)},gi.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ut(this),"m")),this},gi.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Lt(ce,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},gi.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Pt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},gi.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},gi.isLocal=function(){return!!this.isValid()&&!this._isUTC},gi.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},gi.isUtc=Rt,gi.isUTC=Rt,gi.zoneAbbr=function(){return this._isUTC?"UTC":""},gi.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},gi.dates=k("dates accessor is deprecated. Use date instead.",ci),gi.months=k("months accessor is deprecated. Use month instead",Be),gi.years=k("years accessor is deprecated. Use year instead",Ne),gi.zone=k("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),gi.isDSTShifted=k("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var e,t={};return C(t,this),(t=It(t))._a?(e=(t._isUTC?p:Pt)(t._a),this._isDSTShifted=this.isValid()&&0<function(e,t){for(var i=Math.min(e.length,t.length),n=Math.abs(e.length-t.length),o=0,a=0;a<i;a++)j(e[a])!==j(t[a])&&o++;return o+n}(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted});var fi=A.prototype;function Ci(e,t,i,n){var o=dt(),a=p().set(n,t);return o[i](a,e)}function Si(e,t,i){if(l(e)&&(t=e,e=void 0),e=e||"",null!=t)return Ci(e,t,i,"month");for(var n=[],o=0;o<12;o++)n[o]=Ci(e,o,i,"month");return n}function yi(e,t,i,n){"boolean"==typeof e?l(t)&&(i=t,t=void 0):(t=e,e=!1,l(i=t)&&(i=t,t=void 0)),t=t||"";var o,a=dt(),s=e?a._week.dow:0,r=[];if(null!=i)return Ci(t,(i+s)%7,n,"day");for(o=0;o<7;o++)r[o]=Ci(t,(o+s)%7,n,"day");return r}fi.calendar=function(e,t,i){var n=this._calendar[e]||this._calendar.sameElse;return w(n)?n.call(t,i):n},fi.longDateFormat=function(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.match(x).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},fi.invalidDate=function(){return this._invalidDate},fi.ordinal=function(e){return this._ordinal.replace("%d",e)},fi.preparse=vi,fi.postformat=vi,fi.relativeTime=function(e,t,i,n){var o=this._relativeTime[i];return w(o)?o(e,t,i,n):o.replace(/%d/i,e)},fi.pastFuture=function(e,t){var i=this._relativeTime[0<e?"future":"past"];return w(i)?i(t):i.replace(/%s/i,t)},fi.set=function(e){var t,i;for(i in e)a(e,i)&&(w(t=e[i])?this[i]=t:this["_"+i]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},fi.eras=function(e,t){for(var n,o=this._eras||dt("en")._eras,a=0,s=o.length;a<s;++a){if("string"==typeof o[a].since)n=i(o[a].since).startOf("day"),o[a].since=n.valueOf();switch(typeof o[a].until){case"undefined":o[a].until=1/0;break;case"string":n=i(o[a].until).startOf("day").valueOf(),o[a].until=n.valueOf()}}return o},fi.erasParse=function(e,t,i){var n,o,a,s,r,l=this.eras();for(e=e.toUpperCase(),n=0,o=l.length;n<o;++n)if(a=l[n].name.toUpperCase(),s=l[n].abbr.toUpperCase(),r=l[n].narrow.toUpperCase(),i)switch(t){case"N":case"NN":case"NNN":if(s===e)return l[n];break;case"NNNN":if(a===e)return l[n];break;case"NNNNN":if(r===e)return l[n]}else if(0<=[a,s,r].indexOf(e))return l[n]},fi.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?i(e.since).year():i(e.since).year()+(t-e.offset)*n},fi.erasAbbrRegex=function(e){return a(this,"_erasAbbrRegex")||si.call(this),e?this._erasAbbrRegex:this._erasRegex},fi.erasNameRegex=function(e){return a(this,"_erasNameRegex")||si.call(this),e?this._erasNameRegex:this._erasRegex},fi.erasNarrowRegex=function(e){return a(this,"_erasNarrowRegex")||si.call(this),e?this._erasNarrowRegex:this._erasRegex},fi.months=function(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Fe).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone},fi.monthsShort=function(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Fe.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},fi.monthsParse=function(e,t,i){var n,o,a;if(this._monthsParseExact)return function(e,t,i){var n,o,a,s=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)a=p([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(a,"").toLocaleLowerCase();return i?"MMM"===t?-1!==(o=Ce.call(this._shortMonthsParse,s))?o:null:-1!==(o=Ce.call(this._longMonthsParse,s))?o:null:"MMM"===t?-1!==(o=Ce.call(this._shortMonthsParse,s))||-1!==(o=Ce.call(this._longMonthsParse,s))?o:null:-1!==(o=Ce.call(this._longMonthsParse,s))||-1!==(o=Ce.call(this._shortMonthsParse,s))?o:null}.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=p([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(a="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=new RegExp(a.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}},fi.monthsRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ee.call(this),e?this._monthsStrictRegex:this._monthsRegex):(a(this,"_monthsRegex")||(this._monthsRegex=Oe),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},fi.monthsShortRegex=function(e){return this._monthsParseExact?(a(this,"_monthsRegex")||Ee.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(a(this,"_monthsShortRegex")||(this._monthsShortRegex=$e),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},fi.week=function(e){return Ge(e,this._week.dow,this._week.doy).week},fi.firstDayOfYear=function(){return this._week.doy},fi.firstDayOfWeek=function(){return this._week.dow},fi.weekdays=function(e,t){var i=n(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?He(i,this._week.dow):e?i[e.day()]:i},fi.weekdaysMin=function(e){return!0===e?He(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},fi.weekdaysShort=function(e){return!0===e?He(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},fi.weekdaysParse=function(e,t,i){var n,o,a;if(this._weekdaysParseExact)return function(e,t,i){var n,o,a,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)a=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(a,"").toLocaleLowerCase();return i?"dddd"===t?-1!==(o=Ce.call(this._weekdaysParse,s))?o:null:"ddd"===t?-1!==(o=Ce.call(this._shortWeekdaysParse,s))?o:null:-1!==(o=Ce.call(this._minWeekdaysParse,s))?o:null:"dddd"===t?-1!==(o=Ce.call(this._weekdaysParse,s))||-1!==(o=Ce.call(this._shortWeekdaysParse,s))||-1!==(o=Ce.call(this._minWeekdaysParse,s))?o:null:"ddd"===t?-1!==(o=Ce.call(this._shortWeekdaysParse,s))||-1!==(o=Ce.call(this._weekdaysParse,s))||-1!==(o=Ce.call(this._minWeekdaysParse,s))?o:null:-1!==(o=Ce.call(this._minWeekdaysParse,s))||-1!==(o=Ce.call(this._weekdaysParse,s))||-1!==(o=Ce.call(this._shortWeekdaysParse,s))?o:null}.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(a="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(a.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(i&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(i&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!i&&this._weekdaysParse[n].test(e))return n}},fi.weekdaysRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Je.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=ze),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},fi.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Je.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Xe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},fi.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Je.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ze),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},fi.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},fi.meridiem=function(e,t,i){return 11<e?i?"pm":"PM":i?"am":"AM"},lt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===j(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),i.lang=k("moment.lang is deprecated. Use moment.locale instead.",lt),i.langData=k("moment.langData is deprecated. Use moment.localeData instead.",dt);var bi=Math.abs;function ki(e,t,i,n){var o=Vt(t,i);return e._milliseconds+=n*o._milliseconds,e._days+=n*o._days,e._months+=n*o._months,e._bubble()}function _i(e){return e<0?Math.floor(e):Math.ceil(e)}function Di(e){return 4800*e/146097}function Ii(e){return 146097*e/4800}function wi(e){return function(){return this.as(e)}}var Pi=wi("ms"),Ai=wi("s"),Ti=wi("m"),xi=wi("h"),Fi=wi("d"),$i=wi("w"),Oi=wi("M"),Mi=wi("Q"),Bi=wi("y");function Ei(e){return function(){return this.isValid()?this._data[e]:NaN}}var Li=Ei("milliseconds"),Ni=Ei("seconds"),Ui=Ei("minutes"),Ri=Ei("hours"),Wi=Ei("days"),Gi=Ei("months"),Vi=Ei("years"),Hi=Math.round,ji={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};var Yi=Math.abs;function qi(e){return(0<e)-(e<0)||+e}function zi(){if(!this.isValid())return this.localeData().invalidDate();var e,t,i,n,o,a,s,r,l=Yi(this._milliseconds)/1e3,c=Yi(this._days),d=Yi(this._months),u=this.asSeconds();return u?(e=H(l/60),t=H(e/60),l%=60,e%=60,i=H(d/12),d%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",o=u<0?"-":"",a=qi(this._months)!==qi(u)?"-":"",s=qi(this._days)!==qi(u)?"-":"",r=qi(this._milliseconds)!==qi(u)?"-":"",o+"P"+(i?a+i+"Y":"")+(d?a+d+"M":"")+(c?s+c+"D":"")+(t||e||l?"T":"")+(t?r+t+"H":"")+(e?r+e+"M":"")+(l?r+n+"S":"")):"P0D"}var Xi=$t.prototype;return Xi.isValid=function(){return this._isValid},Xi.abs=function(){var e=this._data;return this._milliseconds=bi(this._milliseconds),this._days=bi(this._days),this._months=bi(this._months),e.milliseconds=bi(e.milliseconds),e.seconds=bi(e.seconds),e.minutes=bi(e.minutes),e.hours=bi(e.hours),e.months=bi(e.months),e.years=bi(e.years),this},Xi.add=function(e,t){return ki(this,e,t,1)},Xi.subtract=function(e,t){return ki(this,e,t,-1)},Xi.as=function(e){if(!this.isValid())return NaN;var t,i,n=this._milliseconds;if("month"===(e=U(e))||"quarter"===e||"year"===e)switch(t=this._days+n/864e5,i=this._months+Di(t),e){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(t=this._days+Math.round(Ii(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}},Xi.asMilliseconds=Pi,Xi.asSeconds=Ai,Xi.asMinutes=Ti,Xi.asHours=xi,Xi.asDays=Fi,Xi.asWeeks=$i,Xi.asMonths=Oi,Xi.asQuarters=Mi,Xi.asYears=Bi,Xi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*j(this._months/12):NaN},Xi._bubble=function(){var e,t,i,n,o,a=this._milliseconds,s=this._days,r=this._months,l=this._data;return 0<=a&&0<=s&&0<=r||a<=0&&s<=0&&r<=0||(a+=864e5*_i(Ii(r)+s),r=s=0),l.milliseconds=a%1e3,e=H(a/1e3),l.seconds=e%60,t=H(e/60),l.minutes=t%60,i=H(t/60),l.hours=i%24,s+=H(i/24),r+=o=H(Di(s)),s-=_i(Ii(o)),n=H(r/12),r%=12,l.days=s,l.months=r,l.years=n,this},Xi.clone=function(){return Vt(this)},Xi.get=function(e){return e=U(e),this.isValid()?this[e+"s"]():NaN},Xi.milliseconds=Li,Xi.seconds=Ni,Xi.minutes=Ui,Xi.hours=Ri,Xi.days=Wi,Xi.weeks=function(){return H(this.days()/7)},Xi.months=Gi,Xi.years=Vi,Xi.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var i,n,o=!1,a=ji;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(o=e),"object"==typeof t&&(a=Object.assign({},ji,t),null!=t.s&&null==t.ss&&(a.ss=t.s-1)),n=function(e,t,i,n){var o=Vt(e).abs(),a=Hi(o.as("s")),s=Hi(o.as("m")),r=Hi(o.as("h")),l=Hi(o.as("d")),c=Hi(o.as("M")),d=Hi(o.as("w")),u=Hi(o.as("y")),p=(a<=i.ss?["s",a]:a<i.s&&["ss",a])||s<=1&&["m"]||s<i.m&&["mm",s]||r<=1&&["h"]||r<i.h&&["hh",r]||l<=1&&["d"]||l<i.d&&["dd",l];return null!=i.w&&(p=p||d<=1&&["w"]||d<i.w&&["ww",d]),(p=p||c<=1&&["M"]||c<i.M&&["MM",c]||u<=1&&["y"]||["yy",u])[2]=t,p[3]=0<+e,p[4]=n,function(e,t,i,n,o){return o.relativeTime(t||1,!!i,e,n)}.apply(null,p)}(this,!o,a,i=this.localeData()),o&&(n=i.pastFuture(+this,n)),i.postformat(n)},Xi.toISOString=zi,Xi.toString=zi,Xi.toJSON=zi,Xi.locale=Qt,Xi.localeData=ei,Xi.toIsoString=k("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",zi),Xi.lang=Kt,M("X",0,0,"unix"),M("x",0,0,"valueOf"),pe("x",le),pe("X",/[+-]?\d+(\.\d{1,3})?/),ve("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e))}),ve("x",function(e,t,i){i._d=new Date(j(e))}),i.version="2.29.1",e=Pt,i.fn=gi,i.min=function(){return xt("isBefore",[].slice.call(arguments,0))},i.max=function(){return xt("isAfter",[].slice.call(arguments,0))},i.now=function(){return Date.now?Date.now():+new Date},i.utc=p,i.unix=function(e){return Pt(1e3*e)},i.months=function(e,t){return Si(e,t,"months")},i.isDate=c,i.locale=lt,i.invalid=g,i.duration=Vt,i.isMoment=y,i.weekdays=function(e,t,i){return yi(e,t,i,"weekdays")},i.parseZone=function(){return Pt.apply(null,arguments).parseZone()},i.localeData=dt,i.isDuration=Ot,i.monthsShort=function(e,t){return Si(e,t,"monthsShort")},i.weekdaysMin=function(e,t,i){return yi(e,t,i,"weekdaysMin")},i.defineLocale=ct,i.updateLocale=function(e,t){var i,n,o;return null!=t?(o=nt,null!=ot[e]&&null!=ot[e].parentLocale?ot[e].set(P(ot[e]._config,t)):(null!=(n=rt(e))&&(o=n._config),t=P(o,t),null==n&&(t.abbr=e),(i=new A(t)).parentLocale=ot[e],ot[e]=i),lt(e)):null!=ot[e]&&(null!=ot[e].parentLocale?(ot[e]=ot[e].parentLocale,e===lt()&&lt(e)):null!=ot[e]&&delete ot[e]),ot[e]},i.locales=function(){return _(ot)},i.weekdaysShort=function(e,t,i){return yi(e,t,i,"weekdaysShort")},i.normalizeUnits=U,i.relativeTimeRounding=function(e){return void 0===e?Hi:"function"==typeof e&&(Hi=e,!0)},i.relativeTimeThreshold=function(e,t){return void 0!==ji[e]&&(void 0===t?ji[e]:(ji[e]=t,"s"===e&&(ji.ss=t-1),!0))},i.calendarFormat=function(e,t){var i=e.diff(t,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},i.prototype=gi,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i});var xdsoft_moveStart=!1,AnyTime="Anytime",TimeClick=!1,wHour=null;!function(){"use strict";var e,t,i,n,o,a;a=864e5,e=function(e,t){return"string"==typeof e&&"string"==typeof t&&e.toLowerCase()===t.toLowerCase()},t=function(e,i,n){var o=e.toString();return n=n||"0",o.length<i?t(n+o,i):o},i=function(e){var t,n;for(e=e||{},t=1;t<arguments.length;t++)if(n=arguments[t])for(var o in n)n.hasOwnProperty(o)&&("object"==typeof n[o]?i(e[o],n[o]):e[o]=n[o]);return e},n=function(e,t){for(var i=0;i<t.length;i++)if(t[i].toLowerCase()===e.toLowerCase())return i;return-1},o={dateSettings:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["AM","PM"],ordinal:function(e){var t=e%10,i={1:"st",2:"nd",3:"rd"};return 1!==Math.floor(e%100/10)&&i[t]?i[t]:"th"}},separators:/[ \-+\/\.T:@]/g,validParts:/[dDjlNSwzWFmMntLoYyaABgGhHisueTIOPZcrU]/g,intParts:/[djwNzmnyYhHgGis]/g,tzParts:/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,tzClip:/[^-+\dA-Z]/g},(DateFormatter=function(e){var t=this,n=i(o,e);t.dateSettings=n.dateSettings,t.separators=n.separators,t.validParts=n.validParts,t.intParts=n.intParts,t.tzParts=n.tzParts,t.tzClip=n.tzClip}).prototype={constructor:DateFormatter,getMonth:function(e){var t;return 0===(t=n(e,this.dateSettings.monthsShort)+1)&&(t=n(e,this.dateSettings.months)+1),t},parseDate:function(t,i){var n,o,a,s,r,l,c,d,u,p,h=this,m=!1,g=!1,v=h.dateSettings,f={date:null,year:null,month:null,day:null,hour:0,min:0,sec:0};if(!t)return null;if(t instanceof Date)return t;if("U"===i)return(a=parseInt(t))?new Date(1e3*a):t;switch(typeof t){case"number":return new Date(t);case"string":break;default:return null}if(!(n=i.match(h.validParts))||0===n.length)throw new Error("Invalid date format definition.");for(o=t.replace(h.separators,"\0").split("\0"),a=0;a<o.length;a++)switch(s=o[a],r=parseInt(s),n[a]){case"y":case"Y":if(!r)return null;u=s.length,f.year=2===u?parseInt((r<70?"20":"19")+s):r,m=!0;break;case"m":case"n":case"M":case"F":if(isNaN(r)){if(!((l=h.getMonth(s))>0))return null;f.month=l}else{if(!(r>=1&&r<=12))return null;f.month=r}m=!0;break;case"d":case"j":if(!(r>=1&&r<=31))return null;f.day=r,m=!0;break;case"g":case"h":if(p=o[c=n.indexOf("a")>-1?n.indexOf("a"):n.indexOf("A")>-1?n.indexOf("A"):-1],-1!==c)d=e(p,v.meridiem[0])?0:e(p,v.meridiem[1])?12:-1,r>=1&&r<=12&&-1!==d?f.hour=r%12==0?d:r+d:r>=0&&r<=23&&(f.hour=r);else{if(!(r>=0&&r<=23))return null;f.hour=r}g=!0;break;case"G":case"H":if(!(r>=0&&r<=23))return null;f.hour=r,g=!0;break;case"i":if(!(r>=0&&r<=59))return null;f.min=r,g=!0;break;case"s":if(!(r>=0&&r<=59))return null;f.sec=r,g=!0}if(!0===m&&f.year&&f.month&&f.day)f.date=new Date(f.year,f.month-1,f.day,f.hour,f.min,f.sec,0);else{if(!0!==g)return null;f.date=new Date(0,0,0,f.hour,f.min,f.sec,0)}return f.date},guessDate:function(e,t){if("string"!=typeof e)return e;var i,n,o,a,s,r,l=e.replace(this.separators,"\0").split("\0"),c=t.match(this.validParts),d=new Date,u=0;if(!/^[djmn]/g.test(c[0]))return e;for(o=0;o<l.length;o++){if(u=2,s=l[o],r=parseInt(s.substr(0,2)),isNaN(r))return null;switch(o){case 0:"m"===c[0]||"n"===c[0]?d.setMonth(r-1):d.setDate(r);break;case 1:"m"===c[0]||"n"===c[0]?d.setDate(r):d.setMonth(r-1);break;case 2:if(n=d.getFullYear(),u=(i=s.length)<4?i:4,!(n=parseInt(i<4?n.toString().substr(0,4-i)+s:s.substr(0,4))))return null;d.setFullYear(n);break;case 3:d.setHours(r);break;case 4:d.setMinutes(r);break;case 5:d.setSeconds(r)}(a=s.substr(u)).length>0&&l.splice(o+1,0,a)}return d},parseFormat:function(e,i){var n,o=this,s=o.dateSettings,r=/\\?(.?)/gi,l=function(e,t){return n[e]?n[e]():t};return n={d:function(){return t(n.j(),2)},D:function(){return s.daysShort[n.w()]},j:function(){return i.getDate()},l:function(){return s.days[n.w()]},N:function(){return n.w()||7},w:function(){return i.getDay()},z:function(){var e=new Date(n.Y(),n.n()-1,n.j()),t=new Date(n.Y(),0,1);return Math.round((e-t)/a)},W:function(){var e=new Date(n.Y(),n.n()-1,n.j()-n.N()+3),i=new Date(e.getFullYear(),0,4);return t(1+Math.round((e-i)/a/7),2)},F:function(){return s.months[i.getMonth()]},m:function(){return t(n.n(),2)},M:function(){return s.monthsShort[i.getMonth()]},n:function(){return i.getMonth()+1},t:function(){return new Date(n.Y(),n.n(),0).getDate()},L:function(){var e=n.Y();return e%4==0&&e%100!=0||e%400==0?1:0},o:function(){var e=n.n(),t=n.W();return n.Y()+(12===e&&t<9?1:1===e&&t>9?-1:0)},Y:function(){return i.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return n.A().toLowerCase()},A:function(){var e=n.G()<12?0:1;return s.meridiem[e]},B:function(){var e=3600*i.getUTCHours(),n=60*i.getUTCMinutes(),o=i.getUTCSeconds();return t(Math.floor((e+n+o+3600)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return i.getHours()},h:function(){return t(n.g(),2)},H:function(){return t(n.G(),2)},i:function(){return t(i.getMinutes(),2)},s:function(){return t(i.getSeconds(),2)},u:function(){return t(1e3*i.getMilliseconds(),6)},e:function(){return/\((.*)\)/.exec(String(i))[1]||"Coordinated Universal Time"},I:function(){return new Date(n.Y(),0)-Date.UTC(n.Y(),0)!==new Date(n.Y(),6)-Date.UTC(n.Y(),6)?1:0},O:function(){var e=i.getTimezoneOffset(),n=Math.abs(e);return(e>0?"-":"+")+t(100*Math.floor(n/60)+n%60,4)},P:function(){var e=n.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return(String(i).match(o.tzParts)||[""]).pop().replace(o.tzClip,"")||"UTC"},Z:function(){return 60*-i.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(r,l)},r:function(){return"D, d M Y H:i:s O".replace(r,l)},U:function(){return i.getTime()/1e3||0}},l(e,e)},formatDate:function(e,t){var i,n,o,a,s,r=this,l="";if("string"==typeof e&&!(e=r.parseDate(e,t)))return null;if(e instanceof Date){for(o=t.length,i=0;i<o;i++)if("S"!==(s=t.charAt(i))&&"\\"!==s)if(i>0&&"\\"===t.charAt(i-1))l+=s;else{if("a"===s)if(i+1<o)if("t"===t.charAt(i+1)){l+=s;continue}if("t"===s)if(i+1<o)if("a"===t.charAt(i-1)){l+=s;continue}a=r.parseFormat(s,e),i!==o-1&&r.intParts.test(s)&&"S"===t.charAt(i+1)&&(n=parseInt(a)||0,a+=r.dateSettings.ordinal(n)),l+=a}return l}return""}}}(),function(e){"function"==typeof define&&define.amd?define(["jquery","jquery-mousewheel"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){"use strict";var t={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeekShort:["ن","ث","ع","خ","ج","س","ح"],dayOfWeek:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"]},ro:{months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],dayOfWeekShort:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],dayOfWeek:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeekShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],dayOfWeek:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},is:{months:["Janúar","Febrúar","Mars","Apríl","Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],dayOfWeekShort:["Sun","Mán","Þrið","Mið","Fim","Fös","Lau"],dayOfWeek:["Sunnudagur","Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeekShort:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Неделя","Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота"]},fa:{months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dayOfWeekShort:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayOfWeek:["یک‌شنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنج‌شنبه","جمعه","شنبه","یک‌شنبه"]},ru:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayOfWeekShort:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],dayOfWeek:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],dayOfWeekShort:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"],dayOfWeek:["Неділя","Понеділок","Вівторок","Середа","Четвер","П'ятниця","Субота"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Su","Mo","Tu","We","Th","Fr","Sa"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeekShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],dayOfWeek:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeekShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayOfWeek:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeekShort:["zo","ma","di","wo","do","vr","za"],dayOfWeek:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeekShort:["Paz","Pts","Sal","Çar","Per","Cum","Cts"],dayOfWeek:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeekShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],dayOfWeek:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeekShort:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],dayOfWeek:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"]},th:{months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],dayOfWeekShort:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],dayOfWeek:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัส","ศุกร์","เสาร์","อาทิตย์"]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeekShort:["nd","pn","wt","śr","cz","pt","sb"],dayOfWeek:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},km:{months:["មករា​","កុម្ភៈ","មិនា​","មេសា​","ឧសភា​","មិថុនា​","កក្កដា​","សីហា​","កញ្ញា​","តុលា​","វិច្ឋិកា​","ធ្នូ​"],dayOfWeekShort:["អាទិ​","ចន្ទ​","អង្គារ​","ពុធ​","ព្រហ​​","សុក្រ​","សៅរ៍"],dayOfWeek:["អាទិត្យ​","ចន្ទ​","អង្គារ​","ពុធ​","ព្រហស្បតិ៍​","សុក្រ​","សៅរ៍"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayOfWeek:["Domenica","Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"]},da:{months:["January","Februar","Marts","April","Maj","Juni","July","August","September","Oktober","November","December"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeekShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayOfWeek:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","Lørdag"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeekShort:["日","月","火","水","木","金","土"],dayOfWeek:["日曜","月曜","火曜","水曜","木曜","金曜","土曜"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeekShort:["CN","T2","T3","T4","T5","T6","T7"],dayOfWeek:["Chủ nhật","Thứ hai","Thứ ba","Thứ tư","Thứ năm","Thứ sáu","Thứ bảy"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeekShort:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"],dayOfWeek:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeekShort:["Ne","Po","Út","St","Čt","Pá","So"]},hu:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeekShort:["Va","Hé","Ke","Sze","Cs","Pé","Szo"],dayOfWeek:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"]},az:{months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],dayOfWeekShort:["B","Be","Ça","Ç","Ca","C","Ş"],dayOfWeek:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"]},bs:{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ca:{months:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Agost","Setembre","Octubre","Novembre","Desembre"],dayOfWeekShort:["Dg","Dl","Dt","Dc","Dj","Dv","Ds"],dayOfWeek:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"]},"en-GB":{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeekShort:["Su","Mo","Tu","We","Th","Fr","Sa"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},et:{months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],dayOfWeekShort:["P","E","T","K","N","R","L"],dayOfWeek:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"]},eu:{months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],dayOfWeekShort:["Ig.","Al.","Ar.","Az.","Og.","Or.","La."],dayOfWeek:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"]},fi:{months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],dayOfWeekShort:["Su","Ma","Ti","Ke","To","Pe","La"],dayOfWeek:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},gl:{months:["Xan","Feb","Maz","Abr","Mai","Xun","Xul","Ago","Set","Out","Nov","Dec"],dayOfWeekShort:["Dom","Lun","Mar","Mer","Xov","Ven","Sab"],dayOfWeek:["Domingo","Luns","Martes","Mércores","Xoves","Venres","Sábado"]},hr:{months:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],dayOfWeekShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayOfWeek:["Nedjelja","Ponedjeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"]},ko:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeekShort:["일","월","화","수","목","금","토"],dayOfWeek:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},lt:{months:["Sausio","Vasario","Kovo","Balandžio","Gegužės","Birželio","Liepos","Rugpjūčio","Rugsėjo","Spalio","Lapkričio","Gruodžio"],dayOfWeekShort:["Sek","Pir","Ant","Tre","Ket","Pen","Šeš"],dayOfWeek:["Sekmadienis","Pirmadienis","Antradienis","Trečiadienis","Ketvirtadienis","Penktadienis","Šeštadienis"]},lv:{months:["Janvāris","Februāris","Marts","Aprīlis ","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],dayOfWeekShort:["Sv","Pr","Ot","Tr","Ct","Pk","St"],dayOfWeek:["Svētdiena","Pirmdiena","Otrdiena","Trešdiena","Ceturtdiena","Piektdiena","Sestdiena"]},mk:{months:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"],dayOfWeekShort:["нед","пон","вто","сре","чет","пет","саб"],dayOfWeek:["Недела","Понеделник","Вторник","Среда","Четврток","Петок","Сабота"]},mn:{months:["1-р сар","2-р сар","3-р сар","4-р сар","5-р сар","6-р сар","7-р сар","8-р сар","9-р сар","10-р сар","11-р сар","12-р сар"],dayOfWeekShort:["Дав","Мяг","Лха","Пүр","Бсн","Бям","Ням"],dayOfWeek:["Даваа","Мягмар","Лхагва","Пүрэв","Баасан","Бямба","Ням"]},"pt-BR":{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeekShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayOfWeek:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"]},sk:{months:["Január","Február","Marec","Apríl","Máj","Jún","Júl","August","September","Október","November","December"],dayOfWeekShort:["Ne","Po","Ut","St","Št","Pi","So"],dayOfWeek:["Nedeľa","Pondelok","Utorok","Streda","Štvrtok","Piatok","Sobota"]},sq:{months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],dayOfWeekShort:["Die","Hën","Mar","Mër","Enj","Pre","Shtu"],dayOfWeek:["E Diel","E Hënë","E Martē","E Mërkurë","E Enjte","E Premte","E Shtunë"]},"sr-YU":{months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],dayOfWeekShort:["Ned","Pon","Uto","Sre","čet","Pet","Sub"],dayOfWeek:["Nedelja","Ponedeljak","Utorak","Sreda","Četvrtak","Petak","Subota"]},sr:{months:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"],dayOfWeekShort:["нед","пон","уто","сре","чет","пет","суб"],dayOfWeek:["Недеља","Понедељак","Уторак","Среда","Четвртак","Петак","Субота"]},sv:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeekShort:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"],dayOfWeek:["Söndag","Måndag","Tisdag","Onsdag","Torsdag","Fredag","Lördag"]},"zh-TW":{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},zh:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeekShort:["日","一","二","三","四","五","六"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},he:{months:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],dayOfWeekShort:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],dayOfWeek:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שבת","ראשון"]},hy:{months:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս","Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],dayOfWeekShort:["Կի","Երկ","Երք","Չոր","Հնգ","Ուրբ","Շբթ"],dayOfWeek:["Կիրակի","Երկուշաբթի","Երեքշաբթի","Չորեքշաբթի","Հինգշաբթի","Ուրբաթ","Շաբաթ"]},kg:{months:["Үчтүн айы","Бирдин айы","Жалган Куран","Чын Куран","Бугу","Кулжа","Теке","Баш Оона","Аяк Оона","Тогуздун айы","Жетинин айы","Бештин айы"],dayOfWeekShort:["Жек","Дүй","Шей","Шар","Бей","Жум","Ише"],dayOfWeek:["Жекшемб","Дүйшөмб","Шейшемб","Шаршемб","Бейшемби","Жума","Ишенб"]},rm:{months:["Schaner","Favrer","Mars","Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],dayOfWeekShort:["Du","Gli","Ma","Me","Gie","Ve","So"],dayOfWeek:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"]},ka:{months:["იანვარი","თებერვალი","მარტი","აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი"],dayOfWeekShort:["კვ","ორშ","სამშ","ოთხ","ხუთ","პარ","შაბ"],dayOfWeek:["კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"]}},ownerDocument:document,contentWindow:window,value:"",rtl:!1,format:"YYYY/M/D h:mm",formatTime:"h:mm",formatDate:"MMM DD,YYYY",startDate:!1,step:60,monthChangeSpinner:!0,closeOnDateSelect:!1,closeOnTimeSelect:!0,closeOnWithoutClick:!0,closeOnInputClick:!0,timepicker:!0,datepicker:!0,weeks:!1,defaultTime:!1,defaultDate:!1,minDate:!1,maxDate:!1,minTime:!1,maxTime:!1,disabledMinTime:!1,disabledMaxTime:!1,allowTimes:[],opened:!1,initTime:!0,inline:!1,theme:"",onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onGetWeekOfYear:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:!0,inverseButton:!1,hours12:!1,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:0,parentID:"body",timeHeightInTimePicker:34,timepickerScrollbar:!0,todayButton:!0,prevButton:!0,nextButton:!0,defaultSelect:!0,scrollMonth:!0,scrollTime:!0,scrollInput:!1,lazyInit:!1,mask:!1,validateOnBlur:!0,allowBlank:!0,yearStart:2008,yearEnd:2050,monthStart:0,monthEnd:11,style:"",id:"",fixed:!1,roundTime:"round",className:"",weekends:[],highlightedDates:[],highlightedPeriods:[],allowDates:[],allowDateRe:null,disabledDates:[],disabledWeekDays:[],disabledTimePicker:[],yearOffset:0,beforeShowDay:null,enterLikeTab:!0,showOkCloseButtons:!0},i=null,n="en",o={meridiem:["AM","PM"]},a=function(){var a=t.i18n[n],s={days:a.dayOfWeek,daysShort:a.dayOfWeekShort,months:a.months,monthsShort:e.map(a.months,function(e){return e.substring(0,3)})};"function"==typeof DateFormatter&&(i=new DateFormatter({dateSettings:e.extend({},o,s)}))};function s(e,t,i){this.date=e,this.desc=t,this.style=i}e.datetimepicker={setLocale:function(e){var i=t.i18n[e]?e:"en";n!=i&&(n=i,a())},setDateFormatter:function(e){i=e},RFC_2822:"D, d M Y H:i:s O",ATOM:"Y-m-dTH:i:sP",ISO_8601:"Y-m-dTH:i:sO",RFC_822:"D, d M y H:i:s O",RFC_850:"l, d-M-y H:i:s T",RFC_1036:"D, d M y H:i:s O",RFC_1123:"D, d M Y H:i:s O",RSS:"D, d M Y H:i:s O",W3C:"Y-m-dTH:i:sP"},a(),window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var i=/(\-([a-z]){1})/g;return"float"===t&&(t="styleFloat"),i.test(t)&&(t=t.replace(i,function(e,t,i){return i.toUpperCase()})),e.currentStyle[t]||null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var i,n;for(i=t||0,n=this.length;i<n;i+=1)if(this[i]===e)return i;return-1}),Date.prototype.countDaysInMonth=function(){return new Date(this.getFullYear(),this.getMonth()+1,0).getDate()},e.fn.xdsoftScroller=function(t,i){return this.each(function(){var n,o,a,s,r,l=e(this),c=function(e){var t,i={x:0,y:0};return"touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type||"touchcancel"===e.type?(t=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],i.x=t.clientX,i.y=t.clientY):"mousedown"!==e.type&&"mouseup"!==e.type&&"mousemove"!==e.type&&"mouseover"!==e.type&&"mouseout"!==e.type&&"mouseenter"!==e.type&&"mouseleave"!==e.type||(i.x=e.clientX,i.y=e.clientY),i},d=100,u=!1,p=0,h=0,m=0,g=!1,v=0,f=function(){};"hide"!==i?(e(this).hasClass("xdsoft_scroller_box")||(n=l.children().eq(0),o=l[0].clientHeight,a=n[0].offsetHeight,s=e('<div class="xdsoft_scrollbar"></div>'),r=e('<div class="xdsoft_scroller"></div>'),s.append(r),l.addClass("xdsoft_scroller_box").append(s),f=function(e){var t=c(e).y-p+v;t<0&&(t=0),t+r[0].offsetHeight>m&&(t=m-r[0].offsetHeight),l.trigger("scroll_element.xdsoft_scroller",[d?t/d:0])},r.on("touchstart.xdsoft_scroller mousedown.xdsoft_scroller",function(n){o||l.trigger("resize_scroll.xdsoft_scroller",[i]),p=c(n).y,v=parseInt(r.css("margin-top"),10),m=s[0].offsetHeight,"mousedown"===n.type||"touchstart"===n.type?(t.ownerDocument&&e(t.ownerDocument.body).addClass("xdsoft_noselect"),e([t.ownerDocument.body,t.contentWindow]).on("touchend mouseup.xdsoft_scroller",function i(){e([t.ownerDocument.body,t.contentWindow]).off("touchend mouseup.xdsoft_scroller",i).off("mousemove.xdsoft_scroller",f).removeClass("xdsoft_noselect")}),e(t.ownerDocument.body).on("mousemove.xdsoft_scroller",f)):(g=!0,n.stopPropagation(),n.preventDefault())}).on("touchmove",function(e){g&&(e.preventDefault(),f(e))}).on("touchend touchcancel",function(){g=!1,v=0}),l.on("scroll_element.xdsoft_scroller",function(e,t){o||l.trigger("resize_scroll.xdsoft_scroller",[t,!0]),t=t>1?1:t<0||isNaN(t)?0:t,r.css("margin-top",d*t),setTimeout(function(){n.css("marginTop",-parseInt((n[0].offsetHeight-o)*t,10))},10)}).on("resize_scroll.xdsoft_scroller",function(e,t,i){var c,u;o=l[0].clientHeight,a=n[0].offsetHeight,u=(c=o/a)*s[0].offsetHeight,c>1?r.hide():(r.show(),r.css("height",parseInt(u>10?u:10,10)),d=s[0].offsetHeight-r[0].offsetHeight,!0!==i&&l.trigger("scroll_element.xdsoft_scroller",[t||Math.abs(parseInt(n.css("marginTop"),10))/(a-o)]))}),l.on("mousewheel",function(e){var t=Math.abs(parseInt(n.css("marginTop"),10));return(t-=20*e.deltaY)<0&&(t=0),l.trigger("scroll_element.xdsoft_scroller",[t/(a-o)]),e.stopPropagation(),!1}),l.on("touchstart",function(e){u=c(e),h=Math.abs(parseInt(n.css("marginTop"),10))}),l.on("touchmove",function(e){if(u){e.preventDefault();var t=c(e);l.trigger("scroll_element.xdsoft_scroller",[(h-(t.y-u.y))/(a-o)])}}),l.on("touchend touchcancel",function(){u=!1,h=0})),l.trigger("resize_scroll.xdsoft_scroller",[i])):l.find(".xdsoft_scrollbar").hide()})},e.fn.datetimepicker=function(o,a){var r,l,c=this,d=17,u=46,p=13,h=27,m=37,g=38,v=39,f=40,C=9,S=116,y=65,b=67,k=86,_=90,D=89,I=!1,w=e.isPlainObject(o)||!o?e.extend(!0,{},t,o):e.extend(!0,{},t),P=0,A=!1;return r=function(t){w.id,e(window).on("click.xdsoft",function(e){void 0!==x&&null!=x&&x.trigger("close.xdsoft")}).on("blur.xdsoft",function(e){});var a,r,l,c,P,T,x=e('<div class="xdsoft_datetimepicker xdsoft_noselect vagaro-datepicker" aria-modal="true" aria-label="Anytime Today dialog" ></div>'),F=e('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),$=e('<div class="xdsoft_datepicker active"></div>'),O=e('<div class="xdsoft_monthpicker"><button type="button" class="xdsoft_prev" aria-label="previous month">&#xf104;</button><button type="button" class="xdsoft_today_button"></button><div class="xdsoft_label xdsoft_month" role="combobox" aria-expanded="true" aria-haspopup="listbox"><span></span><i>&#xf107;</i></div><div class="xdsoft_label xdsoft_year" role="combobox" aria-expanded="true" aria-haspopup="listbox"><span></span><i>&#xf107;</i></div><button type="button" class="xdsoft_next" aria-label="next month">&#xf105</button></div>'),M=e('<div class="xdsoft_calendar" aira-hidden="true"></div>'),B=e('<div class="xdsoft_timepicker active"><div class="hmanytime-text" onclick="AnyTimeDate(); return false;" ontouchstart="AnyTimeDate(); return false;" > Anytime </div><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),E=B.find(".xdsoft_time_box").eq(0),L=e('<div class="xdsoft_time_variant" role="listbox"></div>'),N=e('<button type="button" class="xdsoft_save_button w-button-primary w-button border-radius3px flamingo-button" tabindex="0">OK</button>'),U=e('<button type="button" class="xdsoft_cancel w-button-default w-button border-radius3px secondary-button" tabindex="0">Cancel</button>'),R=e('<div class="xdsoft_datepicker-buttons w-clearfix"></div>'),W=(U=e('<button type="button" class="xdsoft_cancel w-button-default w-button border-radius3px secondary-button" tabindex="0">Cancel</button>'),e('<div class="xdsoft_select xdsoft_monthselect" role="listbox"><div></div></div>')),G=e('<div class="xdsoft_select xdsoft_yearselect" role="listbox"><div></div></div>'),V=!1,H=0;function j(){var e,i=!1;return w.startDate?i=P.strToDate(w.startDate):(i=w.value||(t&&t.val&&t.val()?t.val():""))?i=P.strToDateTime(i):w.defaultDate&&(i=P.strToDateTime(w.defaultDate),w.defaultTime&&(e=P.strtotime(w.defaultTime),i.setHours(e.getHours()),i.setMinutes(e.getMinutes()))),i&&P.isValidDate(i)?x.data("changed",!0):i="",i||0}function Y(i){var n=function(e,t){var i=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return new RegExp(i).test(t)},o=function(e,t){if(!(e="string"==typeof e||e instanceof String?i.ownerDocument.getElementById(e):e))return!1;if(e.createTextRange){var n=e.createTextRange();return n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",t),n.select(),!0}return!!e.setSelectionRange&&(e.setSelectionRange(t,t),!0)};i.mask&&t.off("keydown.xdsoft"),!0===i.mask&&("undefined"!=typeof moment?i.mask=i.format.replace(/Y{4}/g,"9999").replace(/Y{2}/g,"99").replace(/M{2}/g,"19").replace(/D{2}/g,"39").replace(/H{2}/g,"29").replace(/m{2}/g,"59").replace(/s{2}/g,"59"):i.mask=i.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59")),"string"===e.type(i.mask)&&(n(i.mask,t.val())||(t.val(i.mask.replace(/[0-9]/g,"_")),o(t[0],0)),t.on("keydown.xdsoft",function(a){var s,r,l=this.value,c=a.which;if(c>=48&&c<=57||c>=96&&c<=105||8===c||c===u){for(s=function(e){try{if(i.ownerDocument.selection&&i.ownerDocument.selection.createRange)return i.ownerDocument.selection.createRange().getBookmark().charCodeAt(2)-2;if(e.setSelectionRange)return e.selectionStart}catch(e){return 0}}(this),r=8!==c&&c!==u?String.fromCharCode(96<=c&&c<=105?c-48:c):"_",8!==c&&c!==u||!s||(s-=1,r="_");/[^0-9_]/.test(i.mask.substr(s,1))&&s<i.mask.length&&s>0;)s+=8===c||c===u?-1:1;if(l=l.substr(0,s)+r+l.substr(s+1),""===e.trim(l))l=i.mask.replace(/[0-9]/g,"_");else if(s===i.mask.length)return a.preventDefault(),!1;for(s+=8===c||c===u?0:1;/[^0-9_]/.test(i.mask.substr(s,1))&&s<i.mask.length&&s>0;)s+=8===c||c===u?-1:1;n(i.mask,l)?(this.value=l,o(this,s)):""===e.trim(l)?this.value=i.mask.replace(/[0-9]/g,"_"):t.trigger("error_input.xdsoft")}else if(-1!==[y,b,k,_,D].indexOf(c)&&I||-1!==[h,g,f,m,v,S,d,C,p].indexOf(c))return!0;return a.preventDefault(),!1}))}w.id&&x.attr("id",w.id),w.style&&x.attr("style",w.style),w.weeks&&x.addClass("xdsoft_showweeks"),w.rtl&&x.addClass("xdsoft_rtl"),x.addClass("xdsoft_"+w.theme),x.addClass(w.className),O.find(".xdsoft_month span").after(W),O.find(".xdsoft_year span").after(G),O.find(".xdsoft_month,.xdsoft_year").on("touchstart mousedown.xdsoft",function(t){var i,n,o=e(this).find(".xdsoft_select").eq(0),a=0,s=0,r=o.is(":visible");for(O.find(".xdsoft_select").hide(),(void 0===P.currentTime||null===P.currentTime||P.currentTime==AnyTime||e("#txtHomeServicesDate").length>0&&e("#txtHomeServicesDate").val().toLowerCase()==AnyTime.toLowerCase())&&(P.currentTime=P.now()),P.currentTime&&(a=P.currentTime[e(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]()),e(".scroller_custom").removeClass("scroller_custom"),r||e(this).addClass("scroller_custom"),o[r?"hide":"show"](),i=o.find("div.xdsoft_option"),n=0;n<i.length&&i.eq(n).data("value")!==a;n+=1)s+=i[0].offsetHeight;return o.xdsoftScroller(w,s/(o.children()[0].offsetHeight-o[0].clientHeight)),t.stopPropagation(),!1}),O.find(".xdsoft_select").xdsoftScroller(w).on("touchstart mousedown.xdsoft",function(e){e.stopPropagation(),e.preventDefault()}).on("touchmove",".xdsoft_option",function(e){xdsoft_moveStart=!0}).on("touchend mousedown.xdsoft",".xdsoft_option",function(){if(void 0===xdsoft_moveStart||1!=xdsoft_moveStart){(void 0===P.currentTime||null===P.currentTime||e("#txtHomeServicesDate").length>0&&e("#txtHomeServicesDate").val().toLowerCase()==AnyTime.toLowerCase())&&(P.currentTime=P.now(),e(".hmanytime-text").removeClass("xdsoft_current"));var t=P.currentTime.getFullYear();P&&P.currentTime&&P.currentTime[e(this).parent().parent().hasClass("xdsoft_monthselect")?"setMonth":"setFullYear"](e(this).data("value")),e(this).parent().parent().hide(),e(this).parent().parent().parent().removeClass("scroller_custom"),x.trigger("xchange.xdsoft"),w.onChangeMonth&&e.isFunction(w.onChangeMonth)&&w.onChangeMonth.call(x,P.currentTime,x.data("input")),t!==P.currentTime.getFullYear()&&e.isFunction(w.onChangeYear)&&w.onChangeYear.call(x,P.currentTime,x.data("input"))}else xdsoft_moveStart=!1}),x.getValue=function(){return P.getCurrentTime()},x.setOptions=function(n){var o={};w=e.extend(!0,{},w,n),n.allowTimes&&e.isArray(n.allowTimes)&&n.allowTimes.length&&(w.allowTimes=e.extend(!0,[],n.allowTimes)),n.weekends&&e.isArray(n.weekends)&&n.weekends.length&&(w.weekends=e.extend(!0,[],n.weekends)),n.allowDates&&e.isArray(n.allowDates)&&n.allowDates.length&&(w.allowDates=e.extend(!0,[],n.allowDates)),n.allowDateRe&&"[object String]"===Object.prototype.toString.call(n.allowDateRe)&&(w.allowDateRe=new RegExp(n.allowDateRe)),n.highlightedDates&&e.isArray(n.highlightedDates)&&n.highlightedDates.length&&(e.each(n.highlightedDates,function(t,n){var a,r=e.map(n.split(","),e.trim),l=new s(i.parseDate(r[0],w.formatDate),r[1],r[2]),c=i.formatDate(l.date,w.formatDate);void 0!==o[c]?(a=o[c].desc)&&a.length&&l.desc&&l.desc.length&&(o[c].desc=a+"\n"+l.desc):o[c]=l}),w.highlightedDates=e.extend(!0,[],o)),n.highlightedPeriods&&e.isArray(n.highlightedPeriods)&&n.highlightedPeriods.length&&(o=e.extend(!0,[],w.highlightedDates),e.each(n.highlightedPeriods,function(t,n){var a,r,l,c,d,u,p;if(e.isArray(n))a=n[0],r=n[1],l=n[2],p=n[3];else{var h=e.map(n.split(","),e.trim);a=i.parseDate(h[0],w.formatDate),r=i.parseDate(h[1],w.formatDate),l=h[2],p=h[3]}for(;a<=r;)c=new s(a,l,p),d=i.formatDate(a,w.formatDate),a.setDate(a.getDate()+1),void 0!==o[d]?(u=o[d].desc)&&u.length&&c.desc&&c.desc.length&&(o[d].desc=u+"\n"+c.desc):o[d]=c}),w.highlightedDates=e.extend(!0,[],o)),n.disabledDates&&e.isArray(n.disabledDates)&&n.disabledDates.length&&(w.disabledDates=e.extend(!0,[],n.disabledDates)),n.disabledWeekDays&&e.isArray(n.disabledWeekDays)&&n.disabledWeekDays.length&&(w.disabledWeekDays=e.extend(!0,[],n.disabledWeekDays)),n.disabledTimePicker&&e.isArray(n.disabledTimePicker)&&n.disabledTimePicker.length&&w.disabledTimePicker.length>1&&(w.minTime=w.disabledTimePicker[0],w.maxTime=w.disabledTimePicker[1]),!w.open&&!w.opened||w.inline||t.trigger("open.xdsoft"),w.inline&&(V=!0,x.addClass("xdsoft_inline"),t.after(x).hide()),w.inverseButton&&(w.next="xdsoft_prev",w.prev="xdsoft_next"),w.datepicker?$.addClass("active"):$.removeClass("active"),w.timepicker?B.addClass("active"):B.removeClass("active"),w.value&&(P.setCurrentTime(w.value),t&&t.val&&t.val(P.str)),isNaN(w.dayOfWeekStart)?w.dayOfWeekStart=0:w.dayOfWeekStart=parseInt(w.dayOfWeekStart,10)%7,w.timepickerScrollbar||E.xdsoftScroller(w,"hide"),w.minDate&&/^[\+\-](.*)$/.test(w.minDate)&&(w.minDate=i.formatDate(P.strToDateTime(w.minDate),w.formatDate)),w.maxDate&&/^[\+\-](.*)$/.test(w.maxDate)&&(w.maxDate=i.formatDate(P.strToDateTime(w.maxDate),w.formatDate)),R.toggle(w.showOkCloseButtons),O.find(".xdsoft_today_button").css("display",w.todayButton?"block":"none"),O.find("."+w.prev).css("visibility",w.prevButton?"visible":"hidden"),O.find("."+w.next).css("visibility",w.nextButton?"visible":"hidden"),Y(w),w.validateOnBlur&&t.off("blur.xdsoft").on("blur.xdsoft",function(){if(w.allowBlank&&(!e.trim(e(this).val()).length||"string"==typeof w.mask&&e.trim(e(this).val())===w.mask.replace(/[0-9]/g,"_")))e(this).val(null),x.data("xdsoft_datetime").empty();else{var t=i.parseDate(e(this).val(),w.format);if(t)e(this).val(i.formatDate(t,w.format));else{var n=+[e(this).val()[0],e(this).val()[1]].join(""),o=+[e(this).val()[2],e(this).val()[3]].join("");!w.datepicker&&w.timepicker&&n>=0&&n<24&&o>=0&&o<60?e(this).val([n,o].map(function(e){return e>9?e:"0"+e}).join(":")):e(this).val(i.formatDate(P.now(),w.format))}x.data("xdsoft_datetime").setCurrentTime(e(this).val())}x.trigger("changedatetime.xdsoft"),x.trigger("close.xdsoft")}),w.dayOfWeekStartPrev=0===w.dayOfWeekStart?6:w.dayOfWeekStart-1,x.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")},x.data("options",w).on("touchstart mousedown.xdsoft",function(e){return e.stopPropagation(),e.preventDefault(),G.parent().removeClass("scroller_custom"),G.hide(),W.parent().removeClass("scroller_custom"),W.hide(),!1}),E.append(L),E.xdsoftScroller(w),x.on("afterOpen.xdsoft",function(){E.xdsoftScroller(w),e(".xdsoft_current").attr("tabindex",0),w.id&&(e(".xdsoft_current").find("div").attr("id","div_"+w.id),e(".xdsoft_current").attr("tabindex",0))}),x.append($).append(B).append(R),!0!==w.withoutCopyright&&x.append(F),R.append(U).append(N),$.append(O).append(M),e(w.parentID).append(x),P=new function(){var t=this;t.now=function(e){var i,n,o=new Date;return!e&&w.defaultDate&&(i=t.strToDateTime(w.defaultDate),o.setDate(1),o.setFullYear(i.getFullYear()),o.setMonth(i.getMonth()),o.setDate(i.getDate())),w.yearOffset&&o.setFullYear(o.getFullYear()+w.yearOffset),!e&&w.defaultTime&&(n=t.strtotime(w.defaultTime),o.setHours(n.getHours()),o.setMinutes(n.getMinutes())),o},t.isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},t.setCurrentTime=function(e,i){"string"==typeof e?t.currentTime=t.strToDateTime(e):t.isValidDate(e)?t.currentTime=e:e||i||!w.allowBlank?t.currentTime=t.now():t.currentTime=null,x.trigger("xchange.xdsoft")},t.empty=function(){t.currentTime=null},t.getCurrentTime=function(e){return t.currentTime},t.nextMonth=function(){void 0!==t.currentTime&&null!==t.currentTime&&t.currentTime!==AnyTime||(t.currentTime=t.now()),e(".hmanytime-text").removeClass("xdsoft_current");var i,n=t.currentTime.getMonth()+1;return 12===n&&(t.currentTime.getFullYear()+1>w.yearEnd&&$this.removeClass(w.next),t.currentTime.setFullYear(t.currentTime.getFullYear()+1),n=0),i=t.currentTime.getFullYear(),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),n+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(n),w.onChangeMonth&&e.isFunction(w.onChangeMonth)&&w.onChangeMonth.call(x,P.currentTime,x.data("input")),i!==t.currentTime.getFullYear()&&e.isFunction(w.onChangeYear)&&w.onChangeYear.call(x,P.currentTime,x.data("input")),x.trigger("xchange.xdsoft"),n},t.prevMonth=function(){void 0!==t.currentTime&&null!==t.currentTime&&t.currentTime!==AnyTime||(t.currentTime=t.now());var i=t.currentTime.getMonth()-1;return-1===i&&(t.currentTime.getFullYear()-1<w.yearStart&&$this.removeClass(w.prev),t.currentTime.setFullYear(t.currentTime.getFullYear()-1),i=11),t.currentTime.setDate(Math.min(new Date(t.currentTime.getFullYear(),i+1,0).getDate(),t.currentTime.getDate())),t.currentTime.setMonth(i),w.onChangeMonth&&e.isFunction(w.onChangeMonth)&&w.onChangeMonth.call(x,P.currentTime,x.data("input")),x.trigger("xchange.xdsoft"),i},t.getWeekOfYear=function(t){if(w.onGetWeekOfYear&&e.isFunction(w.onGetWeekOfYear)){var i=w.onGetWeekOfYear.call(x,t);if(void 0!==i)return i}var n=new Date(t.getFullYear(),0,1);return 4!=n.getDay()&&n.setMonth(0,1+(4-n.getDay()+7)%7),Math.ceil(((t-n)/864e5+n.getDay()+1)/7)},t.strToDateTime=function(e){var n,o,a=[];return e&&e instanceof Date&&t.isValidDate(e)?e:((a=/^(\+|\-)(.*)$/.exec(e))&&(a[2]=i.parseDate(a[2],w.formatDate)),a&&a[2]?(n=a[2].getTime()-6e4*a[2].getTimezoneOffset(),o=new Date(t.now(!0).getTime()+parseInt(a[1]+"1",10)*n)):(P.currentTime,o=null!=P.currentTime&&""!=P.currentTime?P.currentTime:e?i.parseDate(e,w.format):t.now()),t.isValidDate(o)||(o=t.now()),o)},t.strToDate=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?i.parseDate(e,w.formatDate):t.now(!0);return t.isValidDate(n)||(n=t.now(!0)),n},t.strtotime=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?i.parseDate(e,w.formatTime):t.now(!0);t.isValidDate(n)||(n=t.now(!0));try{"undefined"!=typeof _onlineCheckout&&void 0!==_onlineCheckout.currentTime&&null!=_onlineCheckout.currentTime&&(n=_onlineCheckout.objMin==e?_onlineCheckout.minDate:_onlineCheckout.currentTime)}catch(e){}return n},t.str=function(){return i.formatDate(t.currentTime,w.format)},t.currentTime=this.now()},N.on("touchend click",function(i){i.preventDefault(),x.data("changed",!0),void 0!==e("#txtHomeServicesDate")&&0!=e("#txtHomeServicesDate").length&&e("#txtHomeServicesDate").val().toLowerCase()==AnyTime.toLowerCase()&&e(".hmanytime-text").hasClass("xdsoft_current")||(P.setCurrentTime(j()),t.val(P.str()),TimeClick=!0,e("#btnSearchBuss").length>0&&e("#btnSearchBuss").attr("tabindex",-1).focus(),e("#ancSearchbook").length>0&&e("#ancSearchbook").attr("tabindex",-1).focus(),e("#divcheckoutSelectPaymentMethodTitle").length>0&&e("#divcheckoutSelectPaymentMethodTitle").attr("role","heading").attr("aria-live","polite").attr("tabindex",-1).focus(),e("#ancFilter").length>0&&e("#ancFilter").attr("tabindex",-1).focus()),x.trigger("close.xdsoft")}),U.on("touchend click",function(t){t.preventDefault(),x.trigger("close.xdsoft"),e("#btnSearchBuss").length>0&&e("#btnSearchBuss").attr("tabindex",-1).focus(),e("#ancSearchbook").length>0&&e("#ancSearchbook").attr("tabindex",-1).focus(),e("#divcheckoutSelectPaymentMethodTitle").length>0&&e("#divcheckoutSelectPaymentMethodTitle").attr("role","heading").attr("aria-live","polite").attr("tabindex",-1).focus(),e("#ancFilter").length>0&&e("#ancFilter").attr("tabindex",-1).focus()}),O.find(".xdsoft_today_button").on("touchend mousedown.xdsoft",function(){x.data("changed",!0),P.setCurrentTime(0,!0),x.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){var e,i,n=P.getCurrentTime();n=new Date(n.getFullYear(),n.getMonth(),n.getDate()),e=P.strToDate(w.minDate),n<(e=new Date(e.getFullYear(),e.getMonth(),e.getDate()))||(i=P.strToDate(w.maxDate),n>(i=new Date(i.getFullYear(),i.getMonth(),i.getDate()))||(t.val(P.str()),t.trigger("change"),x.trigger("close.xdsoft")))}),O.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var t=e(this),i=0,n=!1;!function e(o){t.hasClass(w.next)?P.nextMonth():t.hasClass(w.prev)&&P.prevMonth(),w.monthChangeSpinner&&(n||(i=setTimeout(e,o||100)))}(500),e([w.ownerDocument.body,w.contentWindow]).on("touchend mouseup.xdsoft",function t(){clearTimeout(i),n=!0,e([w.ownerDocument.body,w.contentWindow]).off("touchend mouseup.xdsoft",t)})}),B.find(".xdsoft_prev,.xdsoft_next").on("touchend mousedown.xdsoft",function(){var t=e(this),i=0,n=!1,o=110;!function e(a){var s=E[0].clientHeight,r=L[0].offsetHeight,l=Math.abs(parseInt(L.css("marginTop"),10));t.hasClass(w.next)&&r-s-w.timeHeightInTimePicker>=l?L.css("marginTop","-"+(l+w.timeHeightInTimePicker)+"px"):t.hasClass(w.prev)&&l-w.timeHeightInTimePicker>=0&&L.css("marginTop","-"+(l-w.timeHeightInTimePicker)+"px"),E.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(L[0].style.marginTop,10)/(r-s))]),o=o>10?10:o-10,n||(i=setTimeout(e,a||o))}(500),e([w.ownerDocument.body,w.contentWindow]).on("touchend mouseup.xdsoft",function t(){clearTimeout(i),n=!0,e([w.ownerDocument.body,w.contentWindow]).off("touchend mouseup.xdsoft",t)})}),a=0,x.on("xchange.xdsoft",function(s){function r(e){return 3600*e.getHours()+60*e.getMinutes()+e.getSeconds()}clearTimeout(a),void 0!==IdSearchServiceMain&&e(IdSearchServiceMain).length&&e(IdSearchServiceMain).data("select2")&&setTimeout(function(){e(IdSearchServiceMain).select2("close")},100),a=setTimeout(function(){var a=!1;if(void 0===P.currentTime||null===P.currentTime){if(w.allowBlank)return;P.currentTime=P.now()}P.currentTime===AnyTime&&(a=!0,P.currentTime=P.now()),!1!==w.minDateTime&&w.minDateTime>P.currentTime&&0==a&&null!=a&&void 0!==a&&(P.currentTime=new Date(w.minDateTime),t.val(P.str())),!1!==w.maxDate&&P.currentTime>w.maxDate&&(P.currentTime=new Date(w.maxDate),t.val(P.str()));for(var s,l,c,d,u,p,h,m,g,v,f="",C=new Date(P.currentTime.getFullYear(),P.currentTime.getMonth(),1,12,0,0),S=0,y=P.now(),b=!1,k=!1,_=[],D=!0,I="";C.getDay()!==w.dayOfWeekStart;)C.setDate(C.getDate()-1);for(f+='<table style="hyphens:manual;" role="grid"><thead><tr style="hyphens:manual;">',w.weeks&&(f+="<th></th>"),s=0;s<7;s+=1)f+='<th scope="col" abbr="'+w.i18n[n].dayOfWeek[(s+w.dayOfWeekStart)%7]+'" aria-label="'+w.i18n[n].dayOfWeek[(s+w.dayOfWeekStart)%7]+'"> <span aria-hidden="true">'+w.i18n[n].dayOfWeekShort[(s+w.dayOfWeekStart)%7]+"</span></th>";f+="</tr></thead>",f+="<tbody>",!1!==w.maxDate&&(b=P.strToDate(w.maxDate),b=new Date(b.getFullYear(),b.getMonth(),b.getDate(),23,59,59,999)),!1!==w.minDate&&(k=P.strToDate(w.minDate),k=new Date(k.getFullYear(),k.getMonth(),k.getDate()));try{if(void 0!==wHour&&null!=wHour&&0==TimeClick&&wHour.length>0&&P.currentTime.getDate()!=(new Date).getDate()&&P.currentTime.getMonth()==(new Date).getMonth()&&P.currentTime.getFullYear()==(new Date).getFullYear()){var A=new Date(P.currentTime).getDay()+1,T=wHour.filter(function(e){return e.DayID===A})[0];new Date(P.currentTime.setHours(Converttimeformat(T.FromTime))),new Date(P.currentTime.setMinutes(ConverttimeformattoMiniut(T.FromTime))),t.val(P.str())}TimeClick=!1}catch(e){}for(;S<P.currentTime.countDaysInMonth()||C.getDay()!==w.dayOfWeekStart||P.currentTime.getMonth()===C.getMonth();){_=[],S+=1,c=C.getDay(),d=C.getDate(),u=C.getFullYear(),p=C.getMonth(),h=P.getWeekOfYear(C),v="",_.push("xdsoft_date"),m=w.beforeShowDay&&e.isFunction(w.beforeShowDay.call)?w.beforeShowDay.call(x,C):null,w.allowDateRe&&"[object RegExp]"===Object.prototype.toString.call(w.allowDateRe)?w.allowDateRe.test(i.formatDate(C,w.formatDate))||_.push("xdsoft_disabled"):w.allowDates&&w.allowDates.length>0?-1===w.allowDates.indexOf(i.formatDate(C,w.formatDate))&&_.push("xdsoft_disabled"):(!1!==b&&C>b||!1!==k&&C<k||m&&!1===m[0]||-1!==w.disabledDates.indexOf(i.formatDate(C,w.formatDate))||-1!==w.disabledWeekDays.indexOf(c)||t.is("[readonly]"))&&_.push("xdsoft_disabled"),m&&""!==m[1]&&_.push(m[1]),P.currentTime.getMonth()!==p&&_.push("xdsoft_other_month"),(w.defaultSelect||x.data("changed"))&&i.formatDate(P.currentTime,w.formatDate)===i.formatDate(C,w.formatDate)&&_.push("xdsoft_current"),i.formatDate(y,w.formatDate)===i.formatDate(C,w.formatDate)&&_.push("xdsoft_today"),0!==C.getDay()&&6!==C.getDay()&&-1===w.weekends.indexOf(i.formatDate(C,w.formatDate))||_.push("xdsoft_weekend"),void 0!==w.highlightedDates[i.formatDate(C,w.formatDate)]&&(l=w.highlightedDates[i.formatDate(C,w.formatDate)],_.push(void 0===l.style?"xdsoft_highlighted_default":l.style),v=void 0===l.desc?"":l.desc),w.beforeShowDay&&e.isFunction(w.beforeShowDay)&&_.push(w.beforeShowDay(C)),D&&(f+='<tr style="hyphens:manual;">',D=!1,w.weeks&&(f+="<th>"+h+"</th>"));var F="",$="",B=" tabindex='-1'",E="";"function"==typeof moment&&($=" aria-label='"+moment(new Date(u,p,d)).format("dddd, MMM D, YYYY")+"'"),void 0!==_&&null!=_&&_.length>0&&(_.indexOf("xdsoft_current")>-1&&(B=" tabindex='0'",F=" aria-selected='true'"),_.indexOf("xdsoft_disabled")>-1&&(B=" tabindex='-1'",$=" aria-label='Booking is not available on "+moment(new Date(u,p,d)).format("dddd, MMM D, YYYY")+"'")),((new Date).getMonth()<=p||(new Date).getFullYear()<=u)&&!_.indexOf("xdsoft_disabled")>-1&&(B="tabindex='0'"),f+='<td data-date="'+d+'" data-month="'+p+'" data-year="'+u+'" class="xdsoft_date xdsoft_day_of_week'+C.getDay()+" "+_.join(" ")+'" aria-live="off" title="'+v+'" '+B+" "+F+" "+$+' onclick="javascript:_xdsoft_dateid('+d+')"><div aria-hidden="true">'+d+"</div></td>",C.getDay()===w.dayOfWeekStartPrev&&(f+="</tr>",D=!0),C.setDate(d+1)}if(f+="</tbody></table>",M.html(f),O.find(".xdsoft_label span").eq(0).text(w.i18n[n].months[P.currentTime.getMonth()]),O.find(".xdsoft_label span").eq(1).text(P.currentTime.getFullYear()),I="",p="",g=function(n,o){var a,s,l,c,d=P.now(),u=w.allowTimes&&e.isArray(w.allowTimes)&&w.allowTimes.length;d.setHours(n),n=parseInt(d.getHours(),10),d.setMinutes(o),d.setSeconds(0),d.setMilliseconds(0),o=parseInt(d.getMinutes(),10),(l=new Date(P.currentTime)).setHours(n),l.setMinutes(o),l.setSeconds(0),l.setMilliseconds(0),_=[],window.location.href.includes("/shopping-bag")?!1!==w.minDateTime&&w.minDateTime>l||!1!==w.maxTime&&r(P.strtotime(w.maxTime))<r(d)||!1!==w.minTime&&r(P.strtotime(w.minTime))>r(d)||!1!==w.minDateTime&&w.minDateTime>l||!1!==w.disabledMinTime&&d.getTime()>P.strtotime(w.disabledMinTime).getTime()&&!1!==w.disabledMaxTime&&d.getTime()<P.strtotime(w.disabledMaxTime).getTime()||t.is("[readonly]")?(_.push("xdsoft_disabled"),a=" tabindex='-1'",s=" aria-hidden='true' "):(a=" tabindex='0'",s=" aria-hidden='false' "):!1!==w.minDateTime&&w.minDateTime>l||!1!==w.maxTime&&P.strtotime(w.maxTime).getTime()<d.getTime()||!1!==w.minTime&&P.strtotime(w.minTime).getTime()>d.getTime()||!1!==w.minDateTime&&w.minDateTime>l||!1!==w.disabledMinTime&&d.getTime()>P.strtotime(w.disabledMinTime).getTime()&&!1!==w.disabledMaxTime&&d.getTime()<P.strtotime(w.disabledMaxTime).getTime()||t.is("[readonly]")||!1!==w.maxDate&&l>w.maxDate?(_.push("xdsoft_disabled"),a=" tabindex='-1'",s=" aria-hidden='true' "):(a=" tabindex='0'",s=" aria-hidden='false' "),(c=new Date(P.currentTime)).setHours(parseInt(P.currentTime.getHours(),10)),u||c.setMinutes(Math[w.roundTime](P.currentTime.getMinutes()/w.step)*w.step),(w.initTime||w.defaultSelect||x.data("changed"))&&c.getHours()===parseInt(n,10)&&(!u&&w.step>59||c.getMinutes()===parseInt(o,10))&&(w.defaultSelect||x.data("changed")?(_.push("xdsoft_current"),e(".xdsoft_date.xdsoft_current").focus()):w.initTime&&_.push("xdsoft_init_time")),parseInt(y.getHours(),10)===parseInt(n,10)&&parseInt(y.getMinutes(),10)===parseInt(o,10)&&_.push("xdsoft_today"),E="xdsoft_current"==_?"aria-selected='true'":"",I+='<div class="xdsoft_time '+_.join(" ")+'" data-hour="'+n+'" data-minute="'+o+'" role="option" aria-label="'+i.formatDate(d,w.formatTime)+'" '+a+" "+s+" "+E+' "onclick="javascript:_xdsoft_timeid('+i.formatDate(d,w.formatTime)+')" >'+i.formatDate(d,w.formatTime)+"</div>"},w.allowTimes&&e.isArray(w.allowTimes)&&w.allowTimes.length)for(S=0;S<w.allowTimes.length;S+=1)g(P.strtotime(w.allowTimes[S]).getHours(),p=P.strtotime(w.allowTimes[S]).getMinutes());else for(S=0,s=0;S<(w.hours12?12:24);S+=1)for(s=0;s<60;s+=w.step)g((S<10?"0":"")+S,p=(s<10?"0":"")+s);for(L.html(I),o="",S=0,S=parseInt(w.yearStart,10)+w.yearOffset;S<=parseInt(w.yearEnd,10)+w.yearOffset;S+=1)o+='<div class="xdsoft_option '+(P.currentTime.getFullYear()===S?"xdsoft_current":"")+'" data-value="'+S+'"  role="option">'+S+"</div>";for(G.children().eq(0).html(o),S=parseInt(w.monthStart,10),o="";S<=parseInt(w.monthEnd,10);S+=1)o+='<div class="xdsoft_option '+(P.currentTime.getMonth()===S?"xdsoft_current":"")+'" data-value="'+S+'" role="option">'+w.i18n[n].months[S]+"</div>";W.children().eq(0).html(o),e(x).trigger("generate.xdsoft"),a?(e("#txtHomeServicesDate").length>0&&e("#txtHomeServicesDate").val(AnyTime),e(".hmanytime-text").addClass("xdsoft_current"),e(".xdsoft_time_variant .xdsoft_current").removeClass("xdsoft_current"),e(".xdsoft_calendar .xdsoft_current").removeClass("xdsoft_current")):e(".hmanytime-text").removeClass("xdsoft_current")},10),s.stopPropagation(),e("#div_txtHomeServicesDate_picker").attr("tabindex",-1),e("#div_txtHomeServicesDate_picker").focus()}).on("afterOpen.xdsoft",function(){var e,t,i,n;w.timepicker&&(L.find(".xdsoft_current").length?e=".xdsoft_current":L.find(".xdsoft_init_time").length&&(e=".xdsoft_init_time"),e?(t=E[0].clientHeight,(i=L[0].offsetHeight)-t<(n=L.find(e).index()*w.timeHeightInTimePicker)&&(n=i-t),E.trigger("scroll_element.xdsoft_scroller",[parseInt(n,10)/(i-t)])):E.trigger("scroll_element.xdsoft_scroller",[0]))}),r=0,M.on("touchend click.xdsoft","td",function(i){i.stopPropagation(),r+=1;var n=e(this),o=P.currentTime;if(null!=o&&o!=AnyTime||(P.currentTime=P.now(),o=P.currentTime),n.hasClass("xdsoft_disabled"))return!1;o.setDate(1),o.setFullYear(n.data("year")),o.setMonth(n.data("month")),o.setDate(n.data("date")),x.trigger("select.xdsoft",[o]),t.val(P.str()),t.focus(),w.onSelectDate&&e.isFunction(w.onSelectDate)&&w.onSelectDate.call(x,P.currentTime,x.data("input"),i),w.disabledTimePicker&&null!=w.disabledTimePicker&&e.isArray(w.disabledTimePicker)&&void 0!==o&&void 0!==w.disabledTimePicker&&w.disabledTimePicker.length&&w.disabledTimePicker.length>1&&(w.minTime=w.disabledTimePicker[0],w.maxTime=w.disabledTimePicker[1]),x.data("changed",!0),x.trigger("xchange.xdsoft"),x.trigger("changedatetime.xdsoft"),(r>1||!0===w.closeOnDateSelect||!1===w.closeOnDateSelect&&!w.timepicker)&&!w.inline&&x.trigger("close.xdsoft");var a=200;void 0!==w.id&&null!=w.id&&"txtpickupdatetime_picker"==w.id.toLowerCase()&&(a=1200),setTimeout(function(){e("div.xdsoft_time.xdsoft_current").focus()},a),setTimeout(function(){r=0},200),e(".hmanytime-text").removeClass("xdsoft_current")}).on("focus.xdsoft","td",function(t){e(".xdsoft_date").removeAttr("id"),e(".xdsoft_date").find("div").removeAttr("aria-selected"),e(t.currentTarget).attr("tabindex",0),w.id&&e(t.currentTarget).find("div").attr("id","div_"+w.id),e(t.currentTarget).find("div").attr("aria-selected",!0)}).on("keypress.xdsoft","td",function(i){if(13===i.keyCode){i.stopPropagation(),r+=1;var n=e(this),o=P.currentTime;if(null!=o&&o!=AnyTime||(P.currentTime=P.now(),o=P.currentTime),n.hasClass("xdsoft_disabled"))return!1;o.setDate(1),o.setFullYear(n.data("year")),o.setMonth(n.data("month")),o.setDate(n.data("date")),x.trigger("select.xdsoft",[o]),t.val(P.str()),w.onSelectDate&&e.isFunction(w.onSelectDate)&&w.onSelectDate.call(x,P.currentTime,x.data("input"),i),w.disabledTimePicker&&null!=w.disabledTimePicker&&e.isArray(w.disabledTimePicker)&&void 0!==o&&void 0!==w.disabledTimePicker&&w.disabledTimePicker.length&&w.disabledTimePicker.length>1&&(w.minTime=w.disabledTimePicker[0],w.maxTime=w.disabledTimePicker[1]),x.data("changed",!0),x.trigger("xchange.xdsoft"),x.trigger("changedatetime.xdsoft"),(r>1||!0===w.closeOnDateSelect||!1===w.closeOnDateSelect&&!w.timepicker)&&!w.inline&&x.trigger("close.xdsoft"),setTimeout(function(){r=0,e("div.xdsoft_time.xdsoft_current").focus()},200),e(".hmanytime-text").removeClass("xdsoft_current")}}),L.on("touchend click.xdsoft","div",function(t){t.stopPropagation();var i=e(this),n=P.currentTime;if(null!=n&&n!==AnyTime||(P.currentTime=P.now(),n=P.currentTime),i.hasClass("xdsoft_disabled"))return!1;n.setHours(i.data("hour")),n.setMinutes(i.data("minute")),x.trigger("select.xdsoft",[n]),x.data("input").val(P.str()),TimeClick=!0,w.onSelectTime&&e.isFunction(w.onSelectTime)&&w.onSelectTime.call(x,P.currentTime,x.data("input"),t),x.data("changed",!0),x.trigger("xchange.xdsoft"),x.trigger("changedatetime.xdsoft"),!0!==w.inline&&!0===w.closeOnTimeSelect&&x.trigger("close.xdsoft"),e(".hmanytime-text").removeClass("xdsoft_current"),setTimeout(function(){e(".xdsoft_cancel").focus()},10)}),$.on("mousewheel.xdsoft",function(e){return!w.scrollMonth||(e.deltaY<0?P.nextMonth():P.prevMonth(),!1)}),t.on("mousewheel.xdsoft",function(e){return!w.scrollInput||(!w.datepicker&&w.timepicker?((l=L.find(".xdsoft_current").length?L.find(".xdsoft_current").eq(0).index():0)+e.deltaY>=0&&l+e.deltaY<L.children().length&&(l+=e.deltaY),L.children().eq(l).length&&L.children().eq(l).trigger("mousedown"),!1):w.datepicker&&!w.timepicker?($.trigger(e,[e.deltaY,e.deltaX,e.deltaY]),t.val&&t.val(P.str()),x.trigger("changedatetime.xdsoft"),!1):void 0)}),x.on("changedatetime.xdsoft",function(t){if(w.onChangeDateTime&&e.isFunction(w.onChangeDateTime)){var i=x.data("input");w.onChangeDateTime.call(x,P.currentTime,i,t),delete w.value,i.trigger("change")}}).on("generate.xdsoft",function(){w.onGenerate&&e.isFunction(w.onGenerate)&&w.onGenerate.call(x,P.currentTime,x.data("input")),V&&(x.trigger("afterOpen.xdsoft"),V=!1)}).on("click.xdsoft",function(e){e.stopPropagation()}),l=0,T=function(e,t){do{if(!1===t(e=e.parentNode))break}while("HTML"!==e.nodeName)},c=function(){var t,i,n,o,a,s,r,l,c,d,u,p,h;if(t=(l=x.data("input")).offset(),i=l[0],d="top",n=t.top+i.offsetHeight-1,o=t.left,a="absolute",c=e(w.contentWindow).width(),p=e(w.contentWindow).height(),h=e(w.contentWindow).scrollTop(),w.ownerDocument.documentElement.clientWidth-t.left<$.parent().outerWidth(!0)){var m=$.parent().outerWidth(!0)-i.offsetWidth;o-=m}"rtl"===l.parent().css("direction")&&(o-=x.outerWidth()-l.outerWidth()),w.fixed?(n-=h,o-=e(w.contentWindow).scrollLeft(),a="fixed"):(r=!1,T(i,function(e){if("fixed"===window.getComputedStyle(e).getPropertyValue("position"))return r=!0,!1}),r?(a="fixed",n+x.outerHeight()>p+h?(d="bottom",n=p+h-t.top):n-=h):n+i.offsetHeight>p+h&&(n=t.top-i.offsetHeight+1),n<0&&(n=0),o+i.offsetWidth>c&&(o=c-i.offsetWidth)),s=x[0],T(s,function(e){if("relative"===window.getComputedStyle(e).getPropertyValue("position")&&c>=e.offsetWidth)return o-=(c-e.offsetWidth)/2,!1}),(u={position:a,left:o,top:"",bottom:""})[d]=n,x.css(u)},x.on("open.xdsoft",function(t){var i=!0;w.onShow&&e.isFunction(w.onShow)&&(void 0!==e("#txtHomeServicesDate")&&e("#txtHomeServicesDate").length>0&&e("#txtHomeServicesDate").val().toLowerCase()==AnyTime.toLowerCase()&&P.currentTime<P.now()&&(P.currentTime=AnyTime,e(".hmanytime-text").addClass("xdsoft_current"),e(".xdsoft_time_variant .xdsoft_current").removeClass("xdsoft_current"),e(".xdsoft_calendar .xdsoft_current").removeClass("xdsoft_current")),i=w.onShow.call(x,P.currentTime,x.data("input"),t)),!1!==i&&(x.show(),c(),e(w.contentWindow).off("resize.xdsoft").on("resize.xdsoft",c).off("scroll.xdsoft").on("scroll.xdsoft",c),w.closeOnWithoutClick&&"open"!=t.type&&e([w.ownerDocument.body,w.contentWindow]).on("touchstart mousedown.xdsoft",function t(){x.trigger("close.xdsoft"),e([w.ownerDocument.body,w.contentWindow]).off("touchstart mousedown.xdsoft",t)}))}).on("close.xdsoft",function(t){null!=w.allowDates&&w.allowDates.length>0&&-1===w.allowDates.indexOf(P.currentTime.format(w.formatDate))&&(P.currentTime=new Date(moment(w.allowDates[0])._d));var i=!0;O.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide(),O.find(".xdsoft_month,.xdsoft_year").removeClass("scroller_custom"),w.onClose&&e.isFunction(w.onClose)&&(i=w.onClose.call(x,P.currentTime,x.data("input"),t)),!1===i||w.opened||w.inline||x.hide(),A=!1,t.stopPropagation()}).on("toggle.xdsoft",function(){x.is(":visible")?x.trigger("close.xdsoft"):x.trigger("open.xdsoft")}).data("input",t),H=0,x.data("xdsoft_datetime",P),x.setOptions(w),P.setCurrentTime(j()),t.data("xdsoft_datetimepicker",x).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function(){t.is(":disabled")||t.data("xdsoft_datetimepicker").is(":visible")&&w.closeOnInputClick||(clearTimeout(H),H=setTimeout(function(){t.is(":disabled")||(A=!0,V=!0,P.setCurrentTime(j(),!0),w.mask&&Y(w),x.trigger("open.xdsoft"))},100))}).on("keydown.xdsoft",function(t){var i,n=t.which;return-1!==[p].indexOf(n)&&w.enterLikeTab?(i=e("input:visible,textarea:visible,button:visible,a:visible"),x.trigger("close.xdsoft"),i.eq(i.index(this)+1),!1):-1!==[C].indexOf(n)?(x.trigger("close.xdsoft"),!0):void 0}).on("blur.xdsoft",function(){}).on("click.xdsoft",function(e){e.stopPropagation()}).closest("div").on("click.xdsoft",function(e){e.stopPropagation()}),"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&navigator.userAgent.toLowerCase().indexOf("com.vagaro")>-1&&e(".page-form-wrapper, .pagebodycontainer,.wrap-page").on("touchstart",function(){1==A&&x.trigger("close.xdsoft")}),"undefined"!=typeof navigator&&null!=navigator&&void 0!==navigator.userAgent&&null!=navigator.userAgent&&navigator.userAgent.toLowerCase().match(/safari/i)&&navigator.userAgent.toLowerCase().match(/mac/i)&&e(".page-form-wrapper, .pagebodycontainer,.wrap-page").on("mousedown",function(){1==A&&x.trigger("close.xdsoft")})},l=function(t){e(window).off("click.xdsoft"),e(window).off("blur.xdsoft");var i=t.data("xdsoft_datetimepicker");i&&(i.data("xdsoft_datetime",null),i.remove(),t.data("xdsoft_datetimepicker",null).off(".xdsoft"),t.off("click.xdsoft"),t.closest("div").off("click.xdsoft"),e(w.contentWindow).off("resize.xdsoft"),e(w.contentWindow).off("scroll.xdsoft"),e([w.contentWindow,w.ownerDocument.body]).off("mousedown.xdsoft touchstart"),t.unmousewheel&&t.unmousewheel())},e(w.ownerDocument).off("keydown.xdsoftctrl keyup.xdsoftctrl").on("keydown.xdsoftctrl",function(e){e.keyCode===d&&(I=!0)}).on("keyup.xdsoftctrl",function(e){e.keyCode===d&&(I=!1)}),this.each(function(){var t,n=e(this).data("xdsoft_datetimepicker");if(n){if("string"===e.type(o))switch(o){case"show":e(this).select().focus(),n.trigger("open.xdsoft");break;case"hide":n.trigger("close.xdsoft");break;case"toggle":n.trigger("toggle.xdsoft");break;case"destroy":l(e(this));break;case"reset":this.value=this.defaultValue,this.value&&n.data("xdsoft_datetime").isValidDate(i.parseDate(this.value,w.format))||n.data("changed",!1),n.data("xdsoft_datetime").setCurrentTime(this.value);break;case"validate":n.data("input").trigger("blur.xdsoft");break;default:n[o]&&e.isFunction(n[o])&&(c=n[o](a))}else n.setOptions(o);return 0}"string"!==e.type(o)&&(!w.lazyInit||w.open||w.inline?r(e(this)):(t=e(this)).on("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",function e(){t.is(":disabled")||t.data("xdsoft_datetimepicker")||(clearTimeout(P),P=setTimeout(function(){t.data("xdsoft_datetimepicker")||r(t),t.off("open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart",e).trigger("open.xdsoft")},100))}))}),c},e.fn.datetimepicker.defaults=t}),
/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */
function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){var t,i,n=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],o="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],a=Array.prototype.slice;if(e.event.fixHooks)for(var s=n.length;s;)e.event.fixHooks[n[--s]]=e.event.mouseHooks;var r=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=o.length;t;)this.addEventListener(o[--t],l,!1);else this.onmousewheel=l;e.data(this,"mousewheel-line-height",r.getLineHeight(this)),e.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=o.length;t;)this.removeEventListener(o[--t],l,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t),n=i["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(n){var o,s=n||window.event,l=a.call(arguments,1),u=0,p=0,h=0,m=0,g=0;if((n=e.event.fix(s)).type="mousewheel","detail"in s&&(h=-1*s.detail),"wheelDelta"in s&&(h=s.wheelDelta),"wheelDeltaY"in s&&(h=s.wheelDeltaY),"wheelDeltaX"in s&&(p=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(p=-1*h,h=0),u=0===h?p:h,"deltaY"in s&&(u=h=-1*s.deltaY),"deltaX"in s&&(p=s.deltaX,0===h&&(u=-1*p)),0!==h||0!==p){if(1===s.deltaMode){var v=e.data(this,"mousewheel-line-height");u*=v,h*=v,p*=v}else if(2===s.deltaMode){var f=e.data(this,"mousewheel-page-height");u*=f,h*=f,p*=f}if(o=Math.max(Math.abs(h),Math.abs(p)),(!i||o<i)&&(i=o,d(s,o)&&(i/=40)),d(s,o)&&(u/=40,p/=40,h/=40),u=Math[u>=1?"floor":"ceil"](u/i),p=Math[p>=1?"floor":"ceil"](p/i),h=Math[h>=1?"floor":"ceil"](h/i),r.settings.normalizeOffset&&this.getBoundingClientRect){var C=this.getBoundingClientRect();m=n.clientX-C.left,g=n.clientY-C.top}return n.deltaX=p,n.deltaY=h,n.deltaFactor=i,n.offsetX=m,n.offsetY=g,n.deltaMode=0,l.unshift(n,u,p,h),t&&clearTimeout(t),t=setTimeout(c,200),(e.event.dispatch||e.event.handle).apply(this,l)}}function c(){i=null}function d(e,t){return r.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}}),_xdsoft_dateid=function(t){e("#txtdivSearchDate").length},_xdsoft_timeid=function(e){}}),
/*!
 * jQuery MobiScroll v2.6.2
 * http://mobiscroll.com
 *
 * Copyright 2010-2013, Acid Media
 * Licensed under the MIT license.
 *
 */
function(e){function t(t,i){var r,d,h,v,I,w,P,A,T,x,F,$,O,M,B,E,L,N,U,R,W,G,V,H,j,Y,q,z,X=this,Z=e.mobiscroll,J=t,Q=e(J),K=y({},D),ee={},te={},ie={},ne={},oe=[],ae=Q.is("input"),se=!1,re=function(t){!n(t)||l||ve(this)||B||(t.preventDefault(),l=!0,E="clickpick"!=K.mode,Ce(H=e(".dw-ul",this)),L=void 0!==te[j],W=L?function(t){var i,n,o=window.getComputedStyle?getComputedStyle(t[0]):t[0].style;f?(e.each(["t","webkitT","MozT","OT","msT"],function(e,t){if(void 0!==o[t+"ransform"])return i=o[t+"ransform"],!1}),n=(i=i.split(")")[0].split(", "))[13]||i[5]):n=o.top.replace("px","");return Math.round(r-n/d)}(H):ie[j],N=o(t,"Y"),U=new Date,R=N,be(H,j,W,.001),E&&H.closest(".dwwl").addClass("dwa"),e(document).on(k,le).on(_,ce))},le=function(e){E&&(e.preventDefault(),e.stopPropagation(),R=o(e,"Y"),be(H,j,a(W+(N-R)/d,G-1,V+1))),L=!0},ce=function(t){var i,n,o,s=new Date-U,r=a(W+(N-R)/d,G-1,V+1),c=H.offset().top;if(s<300?(n=(i=(R-N)/s)*i/K.speedUnit,R-N<0&&(n=-n)):n=R-N,o=Math.round(W-n/d),!n&&!L){var u=Math.floor((R-c)/d),p=e(".dw-li",H).eq(u),h=E;!1!==_e("onValueTap",[p])?o=u:h=!0,h&&(p.addClass("dw-hl"),setTimeout(function(){p.removeClass("dw-hl")},200))}E&&De(H,o,0,!0,Math.round(r)),l=!1,H=null,e(document).off(k,le).off(_,ce)},de=function(t){var i=e(this);e(document).on(_,ue),i.hasClass("dwb-d")||i.addClass("dwb-a"),setTimeout(function(){i.blur()},10),i.hasClass("dwwb")&&n(t)&&ge(t,i.closest(".dwwl"),i.hasClass("dwwbp")?Ie:we)},ue=function(t){B&&(clearInterval(Y),B=!1),e(document).off(_,ue),e(".dwb-a",v).removeClass("dwb-a")},pe=function(t){38==t.keyCode?ge(t,e(this),we):40==t.keyCode&&ge(t,e(this),Ie)},he=function(e){B&&(clearInterval(Y),B=!1)},me=function(t){if(!ve(this)){t.preventDefault();var i=(t=t.originalEvent||t).wheelDelta?t.wheelDelta/120:t.detail?-t.detail/3:0,n=e(".dw-ul",this);Ce(n),De(n,Math.round(ie[j]-i),i<0?1:2)}};function ge(e,t,i){if(e.stopPropagation(),e.preventDefault(),!B&&!ve(t)&&!t.hasClass("dwa")){B=!0;var n=t.find(".dw-ul");Ce(n),clearInterval(Y),Y=setInterval(function(){i(n)},K.delay),i(n)}}function ve(t){if(e.isArray(K.readonly)){var i=e(".dwwl",v).index(t);return K.readonly[i]}return K.readonly}function fe(t){var i='<div class="dw-bf">',n=oe[t],o=n.values?n:s(n),a=1,r=o.labels||[],l=o.values,c=o.keys||l;return e.each(l,function(e,t){a%20==0&&(i+='</div><div class="dw-bf">'),i+='<div role="option" aria-selected="false" class="dw-li dw-v" data-val="'+c[e]+'"'+(r[e]?' aria-label="'+r[e]+'"':"")+' style="height:'+d+"px;line-height:"+d+'px;"><div class="dw-i">'+t+"</div></div>",a++}),i+="</div>"}function Ce(t){G=e(".dw-li",t).index(e(".dw-v",t).eq(0)),V=e(".dw-li",t).index(e(".dw-v",t).eq(-1)),j=e(".dw-ul",v).index(t)}function Se(){X.temp=ae&&null!==X.val&&X.val!=Q.val()||null===X.values?K.parseValue(Q.val()||"",X):X.values.slice(0),Pe()}function ye(e,t){clearTimeout(te[t]),delete te[t],e.closest(".dwwl").removeClass("dwa")}function be(e,t,i,n,o){var a=(r-i)*d,s=e[0].style;a==ne[t]&&te[t]||(n&&a!=ne[t]&&_e("onAnimStart",[v,t,n]),ne[t]=a,s[S+"Transition"]="all "+(n?n.toFixed(3):0)+"s ease-out",f?s[S+"Transform"]="translate3d(0,"+a+"px,0)":s.top=a+"px",te[t]&&ye(e,t),n&&o&&(e.closest(".dwwl").addClass("dwa"),te[t]=setTimeout(function(){ye(e,t)},1e3*n)),ie[t]=i)}function ke(t,i,n,o,a){!1!==_e("validate",[v,i,t])&&(e(".dw-ul",v).each(function(n){var s=e(this),r=e('.dw-li[data-val="'+X.temp[n]+'"]',s),l=e(".dw-li",s),c=l.index(r),d=l.length,u=n==i||void 0===i;if(!r.hasClass("dw-v")){for(var p=r,h=r,m=0,g=0;c-m>=0&&!p.hasClass("dw-v");)m++,p=l.eq(c-m);for(;c+g<d&&!h.hasClass("dw-v");)g++,h=l.eq(c+g);(g<m&&g&&2!==o||!m||c-m<0||1==o)&&h.hasClass("dw-v")?(r=h,c+=g):(r=p,c-=m)}if(!r.hasClass("dw-sel")||u){X.temp[n]=r.attr("data-val"),e(".dw-sel",s).removeClass("dw-sel"),K.multiple||(e(".dw-sel",s).removeAttr("aria-selected"),r.attr("aria-selected","true")),r.addClass("dw-sel");var v=1;e(".dwtoptwosel",s).removeClass("dwtoptwosel"),e(".dwtoponesel",s).removeClass("dwtoponesel"),e(".dwlasttwosel",s).removeClass("dwlasttwosel"),e(".dwlastonesel",s).removeClass("dwlastonesel"),r.prev().length>0?r.prev().addClass("dwtoponesel"):0==r.prev().length&&(r.parent().prev("div").find(".dw-li.dw-v:last").addClass("dwtoponesel"),v=0),r.prev().prev().length>0?r.prev().prev().addClass("dwtoptwosel"):0==r.prev().prev().length&&(1==v?r.parent().prev("div").find(".dw-li.dw-v:last").addClass("dwtoptwosel"):r.parent().prev("div").find(".dw-li.dw-v:last").prev().addClass("dwtoptwosel")),v=1,r.next().length>0?r.next().addClass("dwlastonesel"):0==r.next().length&&(r.parent().next("div").find(".dw-li.dw-v:first").addClass("dwlastonesel"),v=0),r.next().next().length>0?r.next().next().addClass("dwlasttwosel"):0==r.next().next().length&&(1==v?r.parent().next("div").find(".dw-li.dw-v:first").addClass("dwlasttwosel"):r.parent().next("div").find(".dw-li.dw-v:first").next().addClass("dwlasttwosel")),be(s,n,c,u?t:.1,!!u&&a)}}),h=K.formatResult(X.temp),"inline"==K.display?Pe(n,0,!0):e(".dwv",v).html(function(e){var t=K.headerText;return t?"function"==typeof t?t.call(J,e):t.replace(/\{value\}/i,e):""}(h)),n&&_e("onChange",[h]))}function _e(t,n){var o;return n.push(X),e.each([O.defaults,ee,i],function(e,i){i[t]&&(o=i[t].apply(J,n))}),o}function De(t,i,n,o,s){i=a(i,G,V);var r=e(".dw-li",t).eq(i),l=void 0===s?i:s,c=j,d=o?i==l?.1:Math.abs((i-l)*K.timeUnit):0;X.temp[c]=r.attr("data-val"),be(t,c,i,d,s),setTimeout(function(){ke(d,c,!0,n,void 0!==s)},10)}function Ie(e){var t=ie[j]+1;De(e,t>V?G:t,1,!0)}function we(e){var t=ie[j]-1;De(e,t<G?V:t,2,!0)}function Pe(e,t,i,n){se&&!i&&ke(t),h=K.formatResult(X.temp),n||(X.values=X.temp.slice(0),X.val=h),e&&ae&&Q.val(h).trigger("change")}X.position=function(t){if(!("inline"==K.display||I===e(window).width()&&P===e(window).height()&&t||!1===_e("onPosition",[v]))){var i,n,o,s,r,l,c,d,u,p,h,m,g=0,f=0,C=e(window).scrollTop(),S=e(".dwwr",v),y=e(".dw",v),b={},k=void 0===K.anchor?Q:K.anchor;I=e(window).width(),P=e(window).height(),w=(w=window.innerHeight)||P,/modal|bubble/.test(K.display)&&(e(".dwc",v).each(function(){i=e(this).outerWidth(!0),g+=i,f=i>f?i:f}),i=g>I?f:g,S.width(i).css("white-space",g>I?"":"nowrap")),A=y.outerWidth(),T=y.outerHeight(!0),x=T<=w&&A<=I,"modal"==K.display?(n=(I-A)/2,o=C+(w-T)/2):"bubble"==K.display?(m=!0,u=e(".dw-arrw-i",v),c=(l=k.offset()).top,d=l.left,s=k.outerWidth(),r=k.outerHeight(),n=(n=(n=d-(y.outerWidth(!0)-s)/2)>I-A?I-(A+20):n)>=0?n:20,(o=c-T)<C||c>C+w?(y.removeClass("dw-bubble-top").addClass("dw-bubble-bottom"),o=c+r):y.removeClass("dw-bubble-bottom").addClass("dw-bubble-top"),p=u.outerWidth(),h=d+s/2-(n+(A-p)/2),e(".dw-arr",v).css({left:a(h,0,p)})):(b.width="100%","top"==K.display?o=C:"bottom"==K.display&&(o=C+w-T)),b.top=o<0?0:o,b.left=n,y.css(b),e(".dw-persp",v).height(0).height(o+T>e(document).height()?o+T:e(document).height()),m&&(o+T>C+w||c>C+w)&&e(window).scrollTop(o+T-w)}},X.enable=function(){K.disabled=!1,ae&&Q.prop("disabled",!1)},X.disable=function(){K.disabled=!0,ae&&Q.prop("disabled",!0)},X.setValue=function(t,i,n,o){X.temp=e.isArray(t)?t.slice(0):K.parseValue.call(J,t+"",X),Pe(i,n,!1,o)},X.getValue=function(){return X.values},X.getValues=function(){var e,t=[];for(e in X._selectedValues)t.push(X._selectedValues[e]);return t},X.changeWheel=function(t,i){if(v){var n=0,o=t.length;e.each(K.wheels,function(a,s){if(e.each(s,function(a,s){if(e.inArray(n,t)>-1&&(oe[n]=s,e(".dw-ul",v).eq(n).html(fe(n)),! --o))return X.position(),ke(i,void 0,!0),!1;n++}),!o)return!1})}},X.isVisible=function(){return se},X.tap=function(e,t){var i,n;K.tap&&e.on("touchstart.dw",function(e){e.preventDefault(),i=o(e,"X"),n=o(e,"Y")}).on("touchend.dw",function(e){Math.abs(o(e,"X")-i)<20&&Math.abs(o(e,"Y")-n)<20&&t.call(this,e),c=!0,setTimeout(function(){c=!1},300)}),e.on("click.dw",function(e){c||t.call(this,e)})},X.show=function(t){if(e("body").addClass("mobidatepicker"),K.disabled||se)return!1;"top"==K.display&&(F="slidedown"),"bottom"==K.display&&(F="slideup"),Se(),_e("onBeforeShow",[]);var i,n=0,o="";F&&!t&&(o="dw-"+F+" dw-in");var a='<div role="dialog" class="'+K.theme+" dw-"+K.display+(C?" dw"+C:"")+' mobile-datepicker-bottom">'+("inline"==K.display?'<div class="dw dwbg dwi"><div class="dwwr">':'<div class="dw-persp"><div class="dwo"></div><div class="dw dwbg '+o+'"><div class="dw-arrw"><div class="dw-arrw-i"><div class="dw-arr"></div></div></div><div class="dwwr"><div aria-live="assertive" class="dwv flamingo-background-color'+(K.headerText?"":" dw-hidden")+'"></div>')+'<div class="dwcc">';e.each(K.wheels,function(t,o){a+='<div class="dwc'+("scroller"!=K.mode?" dwpm":" dwsc")+(K.showLabel?"":" dwhl")+'"><div class="dwwc dwrc"><table cellpadding="0" cellspacing="0"><tr>',e.each(o,function(e,t){oe[n]=t,i=void 0!==t.label?t.label:e,a+='<td><div class="dwwl dwrc dwwl'+n+'">'+("scroller"!=K.mode?'<div class="dwb-e dwwb dwwbp" style="height:'+d+"px;line-height:"+d+'px;"><span>+</span></div><div class="dwb-e dwwb dwwbm" style="height:'+d+"px;line-height:"+d+'px;"><span>&ndash;</span></div>':"")+'<div class="dwl">'+i+'</div><div tabindex="0" aria-live="off" aria-label="'+i+'" role="listbox" class="dwww"><div class="dww" style="height:'+K.rows*d+"px;min-width:"+K.width+'px;"><div class="dw-ul">',a+=fe(n),a+='</div><div class="dwwol"></div></div><div class="dwwo"></div></div><div class="dwwol"></div></div></td>',n++}),a+="</tr></table></div></div>"}),a+="</div>"+("inline"!=K.display?'<div class="dwbc'+(K.button3?" dwbc-p":"")+'"><span class="dwbw dwb-s"><span class="dwb dwb-e" role="button" tabindex="0">'+K.setText+"</span></span>"+(K.button3?'<span class="dwbw dwb-n"><span class="dwb dwb-e" role="button" tabindex="0">'+K.button3Text+"</span></span>":"")+'<span class="dwbw dwb-c"><span class="dwb dwb-e" role="button" tabindex="0">'+K.cancelText+"</span></span></div></div>":"")+"</div></div></div>",v=e(a),ke(),_e("onMarkupReady",[v]),"inline"!=K.display?(v.appendTo("body"),F&&!t&&(v.addClass("dw-trans"),setTimeout(function(){v.removeClass("dw-trans").find(".dw").removeClass(o)},350))):Q.is("div")?Q.html(v):v.insertAfter(Q),_e("onMarkupInserted",[v]),se=!0,O.init(v,X),"inline"!=K.display&&(X.tap(e(".dwb-s span",v),function(){X.select()}),X.tap(e(".dwb-c span",v),function(){X.cancel()}),K.button3&&X.tap(e(".dwb-n span",v),K.button3),e(window).on("keydown.dw",function(e){13==e.keyCode?X.select():27==e.keyCode&&X.cancel()}),K.scrollLock&&v.on("touchmove touchstart",function(e){x&&e.preventDefault()}),e("input,select,button").each(function(){this.disabled||(e(this).attr("autocomplete")&&e(this).data("autocomplete",e(this).attr("autocomplete")),e(this).addClass("dwtd").prop("disabled",!0).attr("autocomplete","off"))}),X.position(),e(window).on("orientationchange.dw resize.dw scroll.dw",function(e){clearTimeout($),$=setTimeout(function(){var t="scroll"==e.type;(t&&x||!t)&&X.position(!t)},500)}),X.alert(K.ariaDesc)),e(".dwwl",v).on("DOMMouseScroll mousewheel",me).on(b,re).on("keydown",pe).on("keyup",he),v.on(b,".dwb-e",de).on("keydown",".dwb-e",function(t){32==t.keyCode&&(t.preventDefault(),t.stopPropagation(),e(this).click())}),_e("onShow",[v,h])},X.hide=function(t,i){if(e("body").removeClass("mobidatepicker"),!se||!1===_e("onClose",[h,i]))return!1;e(".dwtd").each(function(){e(this).prop("disabled",!1).removeClass("dwtd"),e(this).data("autocomplete")?e(this).attr("autocomplete",e(this).data("autocomplete")):e(this).removeAttr("autocomplete")}),v&&("inline"!=K.display&&F&&!t?(v.addClass("dw-trans").find(".dw").addClass("dw-"+F+" dw-out"),setTimeout(function(){v.remove(),v=null},350)):(v.remove(),v=null),e(window).off(".dw")),ne={},se=!1,z=!0,Q.focus()},X.select=function(){!1!==X.hide(!1,"set")&&(Pe(!0,0,!0),_e("onSelect",[X.val]))},X.alert=function(e){p.text(e),clearTimeout(u),u=setTimeout(function(){p.text("")},5e3)},X.cancel=function(){!1!==X.hide(!1,"cancel")&&_e("onCancel",[X.val])},X.init=function(e){O=y({defaults:{},init:g},Z.themes[e.theme||K.theme]),M=Z.i18n[e.lang||K.lang],y(i,e),y(K,O.defaults,M,i),X.settings=K,Q.off(".dw");var t=Z.presets[K.preset];t&&(ee=t.call(J,X),y(K,ee,i)),r=Math.floor(K.rows/2),d=K.height,F=K.animate,se&&X.hide(),"inline"==K.display?X.show():(Se(),ae&&(void 0===q&&(q=J.readOnly),J.readOnly=!0,K.showOnFocus&&Q.on("focus.dw",function(){z||X.show(),z=!1})),K.showOnTap&&X.tap(Q,function(){X.show()}))},X.trigger=function(e,t){return _e(e,t)},X.option=function(e,t){var i={};"object"==typeof e?i=e:i[e]=t,X.init(i)},X.destroy=function(){X.hide(),Q.off(".dw"),delete m[J.id],ae&&(J.readOnly=q)},X.getInst=function(){return X},X.values=null,X.val=null,X.temp=null,X._selectedValues={},X.init(i)}function i(e){var t;for(t in e)if(void 0!==v[e[t]])return!0;return!1}function n(e){if("touchstart"===e.type)d=!0;else if(d)return d=!1,!1;return!0}function o(e,t){var i=e.originalEvent,n=e.changedTouches;return n||i&&i.changedTouches?i?i.changedTouches[0]["page"+t]:n[0]["page"+t]:e["page"+t]}function a(e,t,i){return Math.max(t,Math.min(e,i))}function s(t){var i={values:[],keys:[]};return e.each(t,function(e,t){i.keys.push(e),i.values.push(t)}),i}function r(e,i,n){var o=e;return"object"==typeof i?e.each(function(){this.id||(h+=1,this.id="mobiscroll"+h),m[this.id]=new t(this,i)}):("string"==typeof i&&e.each(function(){var e,t=m[this.id];if(t&&t[i]&&void 0!==(e=t[i].apply(this,Array.prototype.slice.call(n,1))))return o=e,!1}),o)}var l,c,d,u,p,h=(new Date).getTime(),m={},g=function(){},v=document.createElement("modernizr").style,f=i(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]),C=function(){var e,t=["Webkit","Moz","O","ms"];for(e in t)if(i([t[e]+"Transform"]))return"-"+t[e].toLowerCase();return""}(),S=C.replace(/^\-/,"").replace("moz","Moz"),y=e.extend,b="touchstart mousedown",k="touchmove mousemove",_="touchend mouseup",D={width:70,height:40,rows:3,delay:300,disabled:!1,readonly:!1,showOnFocus:!0,showOnTap:!0,showLabel:!0,wheels:[],theme:"",headerText:"{value}",display:"modal",mode:"scroller",preset:"",lang:"en-US",setText:"Done",cancelText:"Anytime",ariaDesc:"",scrollLock:!0,tap:!0,speedUnit:.0012,timeUnit:.1,formatResult:function(e){return e.join(" ")},parseValue:function(t,i){var n,o=t.split(" "),a=[],r=0;return e.each(i.settings.wheels,function(t,i){e.each(i,function(t,i){i=i.values?i:s(i),n=i.keys||i.values,-1!==e.inArray(o[r],n)?a.push(o[r]):a.push(n[0]),r++})}),a}};e(function(){p=e('<div class="dw-hidden" role="alert"></div>').appendTo("body")}),e(document).on("mouseover mouseup mousedown click",function(e){if(c)return e.stopPropagation(),e.preventDefault(),!1}),e.fn.mobiscroll=function(t){return y(this,e.mobiscroll.shorts),r(this,t,arguments)},e.mobiscroll=e.mobiscroll||{setDefaults:function(e){y(D,e)},presetShort:function(e){this.shorts[e]=function(t){return r(this,y(t,{preset:e}),arguments)}},has3d:f,shorts:{},presets:{},themes:{},i18n:{}},e.scroller=e.scroller||e.mobiscroll,e.fn.scroller=e.fn.scroller||e.fn.mobiscroll}(jQuery),function(e){e.fn.vgMultiMonthDatePicker=function(t){var n={defaultOptions:{numberOfMonths:3,selectedDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),minDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),maxDate:new Date((new Date).getFullYear(),(new Date).getMonth()+7,(new Date).getDate()),dateFormat:"MMM DD, YYYY",arrValidDates:[],arrInValidDates:[],validDatesFormat:"MMM DD,YYYY",inValidDatesFormat:"MMM DD,YYYY",disabledWeekDays:[],ignoreValidation:!1},monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],disabledClass:"vg_disable",todayClass:"vg_today",activeClass:"vg_current",currentDate:null};!function(t,o){if(0!=e(t).length){var a=e("#vgCalendar_"+t.attr("id"));if("string"!=typeof o||"destroy"!=o.toLowerCase())if("string"!=typeof o||"show"!=o.toLowerCase())if("string"!=typeof o||"hide"!=o.toLowerCase())if("object"==typeof o&&void 0!==o.value&&l(o.value)){if(a.length>0&&e("#hdnOldOptions",a).length>0&&""!=e("#hdnOldOptions",a).val()){var s=e.parseJSON(e("#hdnOldOptions",a).val());null!=s&&r(s)}h(t,o.value)}else void 0!==o&&null!=o?r(n.defaultOptions):o=n.defaultOptions,a.length>0&&S(),u(),e(t).on("click touchstart",function(i){(i.preventDefault(),e(t).prop("disabled"))||(n.currentDate=function(t){if(void 0!==e(t).data("vgselectedvalue")&&""!=e(t).data("vgselectedvalue")){var i=e(t).data("vgselectedvalue").split("-");return new Date(i[0],i[1]-1,i[2])}return new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate())}(t),0==e("#vgCalendar_"+t.attr("id")).length&&u(),v(n.currentDate,!0),f(!0),v(n.currentDate,!1))}),e(window).resize(function(){C()});else a.is(":visible")&&f(!1);else a.is(":visible")||f(!0);else S()}function r(e){(void 0===o.numberOfMonths||isNaN(parseInt(o.numberOfMonths)))&&(o.numberOfMonths=e.numberOfMonths),(void 0===o.selectedDate||isNaN(o.selectedDate.getDate()))&&(o.selectedDate=new Date(e.selectedDate)),(void 0===o.minDate||isNaN(o.minDate.getDate()))&&(o.minDate=new Date(e.minDate)),(void 0===o.maxDate||isNaN(o.maxDate.getDate()))&&(o.maxDate=new Date(e.maxDate)),void 0===o.dateFormat||null==o.dateFormat||""==o.dateFormat?o.dateFormat=e.dateFormat:o.dateFormat=o.dateFormat.toUpperCase(),void 0!==o.arrValidDates&&null!=o.arrValidDates&&""!=o.arrValidDates||(o.arrValidDates=e.arrValidDates),void 0!==o.arrInValidDates&&null!=o.arrInValidDates&&""!=o.arrInValidDates||(o.arrInValidDates=e.arrInValidDates),void 0===o.validDatesFormat||null==o.validDatesFormat||""==o.validDatesFormat?o.validDatesFormat=e.validDatesFormat:o.validDatesFormat=o.validDatesFormat.toUpperCase(),void 0===o.inValidDatesFormat||null==o.inValidDatesFormat||""==o.inValidDatesFormat?o.inValidDatesFormat=e.inValidDatesFormat:o.inValidDatesFormat=o.inValidDatesFormat.toUpperCase(),void 0!==o.disabledWeekDays&&null!=o.disabledWeekDays&&""!=o.disabledWeekDays||(o.disabledWeekDays=e.disabledWeekDays),void 0!==o.ignoreValidation&&null!=o.ignoreValidation&&""!=o.ignoreValidation||(o.ignoreValidation=e.ignoreValidation)}function l(e){var t=!0,i=new Date(e);return i.setHours(0),i.setMinutes(0),i.setMilliseconds(0),!(i<o.minDate||i>o.maxDate)&&(void 0!==o.arrValidDates&&null!=o.arrValidDates&&o.arrValidDates.length>0&&-1==o.arrValidDates.indexOf(moment(i).format(o.validDatesFormat))&&(t=!1),!(t&&void 0!==o.arrInValidDates&&null!=o.arrInValidDates&&o.arrInValidDates.length>0&&o.arrInValidDates.indexOf(moment(i).format(o.inValidDatesFormat))>-1)&&t)}function c(e,t){var i;return(i=12*(t.getFullYear()-e.getFullYear()))>0?(i-=e.getMonth()+1,i+=t.getMonth()):i=t.getMonth()-e.getMonth(),i<=0?0:i}function d(e,t){return new Date(t,e,0).getDate()}function u(){var i=e('<div id="vgCalendar_'+t.attr("id")+'" class="vg_calendar-container vagaro-datepicker-mobile" />'),n=e('<input type="hidden" id="hdnOldOptions" value="" />'),a=e('<div class="vg_calendar-dates" />'),s=e('<div class="vg_calendar-date-div" />'),r=e('<div class="vg_cal-header" />'),d=e('<div class="vg_cal_head"><div class="vg_cal-close font-awesome-light">&#xf00d;</div></div>'),u=e('<div class="vg_cal-next-button font-awesome-light">&#xf107;</div>'),m=e('<div class="vg_cal-week-div w-clearfix"><div class="vg_cal-week-day text-primary-lg">Su</div><div class="vg_cal-week-day text-primary-lg">Mo</div><div class="vg_cal-week-day text-primary-lg">Tu</div><div class="vg_cal-week-day text-primary-lg">We</div><div class="vg_cal-week-day text-primary-lg">Th</div><div class="vg_cal-week-day text-primary-lg">Fr</div><div class="vg_cal-week-day text-primary-lg">Sa</div></div>');n.val(JSON.stringify(o)),n.appendTo(i),e(d).on("click touchstart",function(e){e.preventDefault(),g()}),e(d).appendTo(r),e(m).appendTo(r),e(r).appendTo(i),e(s).appendTo(a),e(u).on("click",function(e){e.preventDefault(),p(t),C()}),e(u).data("nextmonth",o.minDate.getMonth()),e(u).data("nextyear",o.minDate.getFullYear()),e(u).appendTo(a),e(a).appendTo(i),e(i).appendTo(e("body"));var v=o.numberOfMonths,f=c(o.selectedDate,o.minDate);f>v&&(o.numberOfMonths=f),p(t),o.numberOfMonths=v,h(t,1==o.ignoreValidation||l(o.selectedDate)?o.selectedDate:o.minDate)}function p(t){var a=t.attr("id"),s=e("#vgCalendar_"+a);a&&e(t).attr("aria-activedescendant","div_"+a),e(t).attr("aria-live","polite");var r=s.find(".vg_calendar-date-div"),c=s.find(".vg_cal-next-button"),u=c.data("nextmonth"),p=c.data("nextyear");for(i=0;i<o.numberOfMonths;i++){var m=new Date(p,u+i,1),v=m.getFullYear(),f=m.getMonth(),C=n.monthNames[f]+" "+v,S=e('<div class="vg_cal-month"><div class="vg_cal-month-title">'+C+"</div></div>"),y=e('<div class="vg_cal-month-div" />'),b=e('<table class="vg_cal-month-div" role="presentation" />'),_=e("<tbody />"),D=e("<tr />"),I=new Date(v,f,1).getDay();for(j=0;j<I;j++){e('<td class="vg_cal-days-placeholder"></td>').appendTo(D)}var w=I,P=d(f+1,v);for(k=1;k<=P;k++){var A=new Date(v,f,k),T=e('<td class="vg_cal-days" data-value="'+moment(A).format("YYYY-MM-DD")+'">'+k+"</td>"),x=void 0!==o.disabledWeekDays&&null!=o.disabledWeekDays&&o.disabledWeekDays.length>0&&o.disabledWeekDays.indexOf(A.getDay()+1)>-1;A.getFullYear()==(new Date).getFullYear()&&A.getMonth()==(new Date).getMonth()&&A.getDate()==(new Date).getDate()&&T.addClass(n.todayClass);var F=moment(A).format("dddd, MMM D, YYYY");T.attr("role","text"),!l(A)||x?(T.addClass(n.disabledClass),T.attr("aria-label","Booking is not available on "+F)):T.attr("aria-label",F),T.on("click",function(i){if(i.preventDefault(),!e(this).hasClass(n.disabledClass)){var a=e(this).data("value").split("-");h(t,new Date(a[0],a[1]-1,a[2])),"function"==typeof o.ondatechange&&o.ondatechange(n.currentDate),g()}}),w%7==0&&(e(D).appendTo(_),D=e("<tr />")),T.appendTo(D),w++}if(e(D).appendTo(_),e(S).appendTo(r),e(_).appendTo(b),e(b).appendTo(y),e(y).appendTo(r),c.data("nextmonth",f+1),c.data("nextyear",v),v==o.maxDate.getFullYear()&&f==o.maxDate.getMonth()){c.remove();break}}}function h(t,i){var a=void 0!==o.ignoreValidation&&o.ignoreValidation;if(a||l(new Date(i))){m(new Date(i));var s=t.attr("id"),r=e("#vgCalendar_"+s).find(".vg_calendar-date-div"),c=e(r).find("[data-value='"+moment(i).format("YYYY-MM-DD")+"']");if(e(r).find("[aria-selected='true']").removeAttr("aria-selected").removeAttr("id"),a||c.length>0&&!c.hasClass(n.disabledClass))return e(t).data("vgselectedvalue",moment(i).format("YYYY-MM-DD")),e(t).val(moment(i).format(o.dateFormat)),e(r).find("td").removeClass(n.activeClass),e(c).addClass(n.activeClass),e(c).attr("aria-selected","true"),e(c).attr("tabindex",0),s&&e(c).attr("id","div_"+s),"txtPayrollStartingDate"==e(t)[0].id&&_RentAndFees.PayrollDateChange(),setTimeout(function(){e(c).focus()},100),n.currentDate=new Date(i),!0;e(c).attr("tabindex",-1)}return!1}function m(i){var n=e("#vgCalendar_"+t.attr("id")).find(".vg_cal-next-button"),a=n.data("nextmonth")-1,s=n.data("nextyear"),r=new Date(s,a,d(a+1,s));if(i.setHours(0),i.setMinutes(0),i.setMilliseconds(0),i>r){var l=c(r,i),u=o.numberOfMonths;l>0&&(o.numberOfMonths=l),p(t),o.numberOfMonths=u}}function g(){f(!1),"function"==typeof o.onclose&&o.onclose()}function v(e,t){1==t&&null!=o.openBeforeCallBack&&"function"==typeof o.openBeforeCallBack?o.openBeforeCallBack(e):0==t&&null!=o.openAfterCallBack&&"function"==typeof o.openAfterCallBack&&o.openAfterCallBack(e)}function f(i){var o=e("#vgCalendar_"+t.attr("id")),a=o.find(".vg_calendar-dates");if(e(o).attr("role","dialog"),e(o).attr("aria-modal",!0),i)e(o).attr("role","dialog"),e(o).attr("aria-modal",!0),o.slideDown(300),a.slideDown(300),e("html, body").addClass("overflowHidden"),C(),setTimeout(function(){var e=a.find("."+n.activeClass).parent().parent().parent().parent(),t=a.scrollTop(),i=0;e.length>0&&(i=e.offset().top),a.scrollTop(t+i-a.height()+283)},350);else{var s=o.find(".vg_calendar-date-div"),r=e(s).find("[aria-selected='true']");e(r).attr("tabindex",-1),e(o).removeAttr("role"),e(o).removeAttr("aria-modal"),e("#txtdivSearchDate").focus(),o.slideUp(300),a.slideUp(300),e("html, body").removeClass("overflowHidden")}}function C(){setTimeout(function(){e("#vgCalendar_"+t.attr("id")).find(".vg_calendar-date-div").find("td").each(function(t,i){e(this).height(e(this).width()-1)})},100)}function S(){e(t).removeAttr("data-vgselectedvalue"),e(t).unbind("click touchstart"),a.remove()}}(e(this),t)}}(jQuery);var serviceDateFormat_year="MMM DD YYYY hh:mm A";function getCurrentLocationDate(){var e=iPadAndroid||isWindowsPhone?15:5,t=new Date;if(void 0!==utcOffset){var i=new Date;(t=new Date(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds())).setSeconds(t.getSeconds()+utcOffset)}var n=moment(t).format("nn"),o=parseInt(parseInt(n)%e);return o>0&&(n=n-o+e,t.setMinutes(n)),t}function applydatepicker(e){var t=e.divid,n=e.textid,o=e.dateTimeFormat,a=e.callBackOnHide;void 0!==a&&""!=a||(a=null);var s=e.BeforecallBackOnOpenForMobile;void 0!==s&&""!=s||(s=null);var r=e.AftercallBackOnOpenForMobile;void 0!==r&&""!=r||(r=null);var l=e.callBackOnChange;void 0!==l&&""!=l||(l=null);var c=e.onGenerate;void 0!==c&&""!=c||(c=null);var d=e.preset;void 0!==d&&null!=d&&""!=d||(d="datetime");var u=e.arrValidDates;void 0===u&&(u=null);var p=e.defaultDateTime,h=e.pickTime;void 0===h&&(h=!1);var m=e.formatTime;void 0===m&&(m=null);var g=e.contentWindow;void 0===g&&(g=null);var v=e.parentID;void 0===v&&(v="body");var f=e.scrollMonth;void 0===f&&(f=!0);var C=e.isMobileFriendly;void 0===C&&(C="undefined"!=typeof _vgClassSessionSelection&&void 0!==_vgClassSessionSelection.VisibleControlLength&&_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&(0==$("body").hasClass("Embedded_Widget")||1==$("body").hasClass("Embedded_Widget")&&void 0!==e.isApplyInWidget&&null!=e.isApplyInWidget&&1==e.isApplyInWidget)),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&$("body").hasClass("Popup_Widget")&&(C=!1);var S=e.disabledWeekDays;void 0===S&&(S=null);var y=e.disabledTimePicker;void 0===y&&(y=null);var b=e.disabledMobileTimePicker;void 0===b&&(b=null);var k=e.MinDate;void 0===k&&(k=null);var _=e.MaxDate;void 0===_&&(_=null);var D=e.unavailableShowDate;void 0===D&&(D=!1);var I=e.inline;if(void 0===I&&(I=!1),(iPadAndroid||isWindowsPhone)&&C&&null!=typeof e.flagVgMultiMonthDatePicker&&e.flagVgMultiMonthDatePicker){$(n).data("dtmindate","");var w={};if(void 0!==e.numberOfMonths&&e.numberOfMonths>0&&(w.numberOfMonths=e.numberOfMonths),void 0!==e.ignoreValidation&&null!=e.ignoreValidation&&(w.ignoreValidation=e.ignoreValidation),null!=u&&u.length>0&&(w.arrValidDates=u,""!=u[0]&&(k=new Date(moment(u[0])._d),_=new Date(moment(u[u.length-1])._d),$(n).data("dtmindate",u[0]))),null!=k&&(w.minDate=new Date(k)),null!=_&&(w.maxDate=new Date(_)),void 0!==o&&null!=o&&(w.dateFormat=o),null!=S&&(w.disabledWeekDays=S),null!=y&&(w.disabledTimePicker=y),void 0!==p&&""!=p)B>(M=new Date(p))?(p=B,M=B):B=M,w.selectedDate=p;return null!=l&&(w.ondatechange=l),null!=a&&(w.onclose=a),w.openBeforeCallBack=s,w.openAfterCallBack=r,void $(n).vgMultiMonthDatePicker(w)}var P=t+"input";if((iPadAndroid||isWindowsPhone)&&1==C)if(0==$(t).find(P).length){$(t).append("<input id="+P.replace(/[#.]/g,"")+' type="text" style="display:none" />');var A="android-ics light",T="bottom",x="y";if(A="ios",T="bottom",x="y",isWindowsPhone&&(A="wp light",T="modal",x="MD ddyy"),null!=u)u.length>0&&""!=u[0]?(U=B=new Date(moment(u[0])._d),E=new Date(moment(u[u.length-1])._d),$(n).data("dtmindate",u[0])):(u=null,U=B=new Date,E=B,$(n).data("dtmindate",""));else if(null==u){B=void 0===getLocationDate?void 0===getLocationDatepickupinstrore?getCurrentLocationDate():"undefined"!=typeof pageval&&void 0!==getLocationDatepickupinstrore&&"onlineshopppingcart"==pageval?getLocationDatepickupinstrore():getCurrentLocationDate():getLocationDate();var F=moment(B).format("nn");(N=parseInt(parseInt(F)%15))>0&&(F=F-N+15,B.setMinutes(F)),U=B,(E=new Date(B)).setMonth(E.getMonth()+6)}"date"==d&&1==D&&$("body").addClass("iosdateonly");var O={preset:d,minDate:null!=k?k:U,maxDate:null!=_?_:E,stepMinute:15,dateFormat:"M dd yy",timeWheels:"hhii A",separator:" ",dateOrder:x,mergeDate:!isWindowsPhone,mergeTime:!isWindowsPhone,validDates:u,unavailableShowDate:D,onCancel:function(){$(P).val("Anytime"),$(n).data("date","Anytime"),$(n).val("Anytime"),void 0!==a&&null!=a&&a(t,n),$(P).mobiscroll("hide")},onSelect:function(e){$(P).val(moment(e).format(serviceDateFormat_year)),$(n).data("date",e),$(n).val(moment(e).format(o)),void 0!==a&&null!=a&&a(t,n),void 0!==l&&null!=l&&l(new Date(moment(e)))}};if(null!=S&&(O.disabledWeekDays=S),null!=b&&(O.disabledMobileTimePicker=b),void 0!==p&&""!=p)B>(M=new Date(p))?(p=B,M=B):B=M;$(n).data("date",moment(B).format(serviceDateFormat_year)),$(n).data("preset",d),$(P).val(moment(B).format(serviceDateFormat_year)).scroller("destroy").scroller($.extend(O,{theme:A,mode:"scroller",display:T})),$(n).val(moment(B).format(o)),$(n).bind("click touchend",function(e,t){$(P).mobiscroll("show")})}else{var M;if(void 0!==p&&""!=p)B>(M=new Date(p))?(p=B,M=B):B=M;$(n).data("date",moment(B).format(serviceDateFormat_year)),$(P).val(moment(B).format(serviceDateFormat_year)),$(n).val(moment(B).format(o))}else{if(void 0===$(n).data("xdsoft_datetimepicker")||null==$(n).data("xdsoft_datetimepicker")){var B,E;$.datetimepicker.setDateFormatter({parseDate:function(e,t){var i=moment(e,t);return!!i.isValid()&&i.toDate()},formatDate:function(e,t){return moment(e).format(t)}});var L={minDate:new Date,maxDate:new Date,defaultDate:new Date,format:o,timepickerScrollbar:h,timepicker:h,validateOnBlur:!1,id:$(n).attr("id")+"_picker",closeOnTimeSelect:!1,todayButton:!1,showOkCloseButtons:1==h,yearStart:(new Date).getFullYear(),yearEnd:(new Date).getFullYear()+5,scrollMonth:f,inline:I};if(null!=e.yearStart&&(L.yearStart=e.yearStart),null!=e.yearEnd&&(L.yearEnd=e.yearEnd),null!=g&&(L.contentWindow=g),L.parentID=v,null!=S&&(L.disabledWeekDays=S),null!=y&&(L.disabledTimePicker=y),null!=m&&(L.formatTime=m,L.step=30),null!=u)u.length>0&&""!=u[0]?(B=new Date(moment(u[0])._d),E=new Date(moment(u[u.length-1])._d),L.defaultDate=new Date(B),L.minDate=new Date(B),L.maxDate=new Date(E),L.allowDates=u,$(n).data("dtmindate",u[0]),L.yearEnd=new Date(moment(u[u.length-1])).getFullYear()):(B=new Date,L.allowDates=u,$(n).data("dtmindate",""));else{B=void 0===getLocationDate?void 0===getLocationDatepickupinstrore?getCurrentLocationDate():"undefined"!=typeof pageval&&void 0!==getLocationDatepickupinstrore&&"onlineshopppingcart"==pageval?getLocationDatepickupinstrore():getCurrentLocationDate():getLocationDate();var N;F=moment(B).format("nn");(N=parseInt(parseInt(F)%5))>0&&(F=F-N+5,B.setMinutes(F)),(E=new Date(B)).setMonth(E.getMonth()+6),L.defaultDate=new Date(B),L.minDate=new Date(B),L.maxDate=E,1==h&&(L.minDateTime=new Date(B))}void 0!==l&&null!=l&&(L.onSelectDate=function(e){l(new Date(e))}),void 0!==c&&null!=c&&(L.monthChangeSpinner=!1,L.onGenerate=function(e){c(new Date(e))}),void 0!==a&&null!=a&&(L.onClose=function(e){a(t,n)}),null!=k&&(L.minDate=k,1==h&&(L.minDateTime=k)),null!=_&&(L.maxDate=_),$(n).datetimepicker(L)}if((void 0===p||null==p)&&0==h&&null!=u&&u.length>0&&""!=u[0]){var U,R=new Date(getdatepickervalue(n));if(R<=(U=new Date(moment(u[0])._d)))p=new Date(U);else if(-1===u.indexOf(R.format("MMM DD,YYYY")))for(i=0;i<u.length;i++){var W=new Date(moment(u[i])._d),G=!1;W>R&&(p=W,G=!0),G||(p=new Date(moment(u[0])._d))}}void 0!==p&&""!=p&&("undefined"!=typeof Search&&Search.IsFromSearchrPage()&&null!=u&&u.length>0&&p.format()==new Date(moment(u[u.length-1])._d).format()?setdatepickervalue(e,new Date(moment($("#ucAppointments_hdnDate").val()).format())):setdatepickervalue(e,new Date(moment(p).format())))}}function getdatepickervalue(e,t,i,n,o){if(void 0!==t&&null!=t||(t="undefined"!=typeof _vgClassSessionSelection&&void 0!==_vgClassSessionSelection.VisibleControlLength&&_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&(0==$("body").hasClass("Embedded_Widget")||1==$("body").hasClass("Embedded_Widget")&&void 0!==n&&null!=n&&1==n)),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&$("body").hasClass("Popup_Widget")&&(t=!1),(iPadAndroid||isWindowsPhone)&&t&&void 0!==i&&i){if(void 0!==$(e).data("vgselectedvalue")){var a=$(e).data("vgselectedvalue").split("-");return new Date(a[0],a[1]-1,a[2])}if(void 0!==$(e).data("xdsoft_datetimepicker"))return new Date(moment($(e).data("xdsoft_datetimepicker").getValue()))}if((iPadAndroid||isWindowsPhone)&&1==t){if(void 0!==$(e).data("preset")&&"datetime"==$(e).data("preset").toLowerCase())return new Date($(e).data("date"));var s=new Date($(e).data("date"));return new Date(s.getFullYear(),s.getMonth(),s.getDate())}if(void 0!==$(e).data("xdsoft_datetimepicker")&&1==$(e).data("xdsoft_datetimepicker").data("options").timepicker)return new Date(moment($(e).data("xdsoft_datetimepicker").getValue()));if(""==$(e).val()||"Never"==$(e).val())return"";if(void 0!==o&&null!=o&&""!=o&&1==o){s=new Date(moment($(e).val()).format());return new Date(s.getFullYear(),s.getMonth(),s.getDate())}if(void 0!==$(e).data("xdsoft_datetimepicker")){s=new Date(moment($(e).data("xdsoft_datetimepicker").getValue()).format());return new Date(s.getFullYear(),s.getMonth(),s.getDate())}return null}function setdatepickervalue(e,t){var i=e.isMobileFriendly;void 0===i&&(i="undefined"!=typeof _vgClassSessionSelection&&void 0!==_vgClassSessionSelection.VisibleControlLength&&_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&(0==$("body").hasClass("Embedded_Widget")||1==$("body").hasClass("Embedded_Widget")&&void 0!==e.isApplyInWidget&&null!=e.isApplyInWidget&&1==e.isApplyInWidget)),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&$("body").hasClass("Popup_Widget")&&(i=!1);var n=e.divid,o=e.textid,a=e.dateTimeFormat;(iPadAndroid||isWindowsPhone)&&i&&void 0!==e.flagVgMultiMonthDatePicker&&e.flagVgMultiMonthDatePicker?"undefined"!=typeof _shopdetail&&_shopdetail.IsClassSelected()||"undefined"!=typeof _invoice?$(o).vgMultiMonthDatePicker({value:t,dateFormat:a,ignoreValidation:!0}):($(o).vgMultiMonthDatePicker({value:t,dateFormat:a}),""!=t&&"Never"!=t||$(o).val(t),""!=t&&"Send Now"!=t||$(o).val(t)):(iPadAndroid||isWindowsPhone)&&1==i?($(n).find(n+"input").val(moment(t).format(serviceDateFormat_year)),$(o).val(moment(t).format(a)),$(o).data("date",moment(t).format(serviceDateFormat_year))):(o=$(o),$(o).datetimepicker({value:t}),""!=t&&"Never"!=t||$(o).val(t),""!=t&&"Send Now"!=t||$(o).val(t))}function destroydatepicker(e){var t=e.divid,i=e.textid,n=e.isMobileFriendly;if(void 0===n&&(n="undefined"!=typeof _vgClassSessionSelection&&void 0!==_vgClassSessionSelection.VisibleControlLength&&_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&(0==$("body").hasClass("Embedded_Widget")||1==$("body").hasClass("Embedded_Widget")&&void 0!==e.isApplyInWidget&&null!=e.isApplyInWidget&&1==e.isApplyInWidget)),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&$("body").hasClass("Popup_Widget")&&(n=!1),n&&void 0!==e.flagVgMultiMonthDatePicker&&e.flagVgMultiMonthDatePicker)$(i).vgMultiMonthDatePicker("destroy");else if((iPadAndroid||isWindowsPhone)&&1==n){var o=t+"input";$(t).find(o).length>0&&($(o).scroller("destroy"),$(i).unbind("click touchend"),$(o).remove())}else void 0!==$(i).data("xdsoft_datetimepicker")&&null!=$(i).data("xdsoft_datetimepicker")&&$(i).datetimepicker("destroy");applydatepicker(e)}function enabledisabledatepicker(e,t){var i=t.divid,n=t.textid,o=t.isMobileFriendly;if(void 0===o&&(o=!0),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&$("body").hasClass("Popup_Widget")&&(o=!1),o&&void 0!==t.flagVgMultiMonthDatePicker&&t.flagVgMultiMonthDatePicker)return $(n).vgMultiMonthDatePicker("hide"),void $(n).prop("disabled",!e);if(e)if((iPadAndroid||isWindowsPhone)&&1==o){var a=i+"input";$(n).unbind("click touchend"),$(n).bind("click touchend",function(e,t){$(a).mobiscroll("show")})}else $(n).prop("disabled",!1);else(iPadAndroid||isWindowsPhone)&&1==o?$(n).unbind("click touchend"):$(n).prop("disabled",!0)}function getMinDateValue(e){var t=$(e.textid).data("dtmindate");return void 0!==t&&""!=t?new Date(moment(t)._d):new Date(moment($(e.textid).data("xdsoft_datetimepicker").getValue()))}function HideShowdatepicker(e,t){var i=t.divid,n=t.textid,o=t.isMobileFriendly;void 0===o&&(o="undefined"!=typeof _vgClassSessionSelection&&void 0!==_vgClassSessionSelection.VisibleControlLength&&_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&(0==$("body").hasClass("Embedded_Widget")||1==$("body").hasClass("Embedded_Widget")&&void 0!==t.isApplyInWidget&&null!=t.isApplyInWidget&&1==t.isApplyInWidget)),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&$("body").hasClass("Popup_Widget")&&(o=!1),o&&void 0!==t.flagVgMultiMonthDatePicker&&t.flagVgMultiMonthDatePicker?$(n).vgMultiMonthDatePicker(e?"show":"hide"):1==e?(iPadAndroid||isWindowsPhone)&&1==o?$(i+"input").mobiscroll("show"):$(n).datetimepicker("show"):(iPadAndroid||isWindowsPhone)&&1==o?$(i+"input").mobiscroll("hide"):$(n).datetimepicker("hide")}function setMinMaxTimeValue(e){var t=e.isMobileFriendly;void 0===t&&(t="undefined"!=typeof _vgClassSessionSelection&&void 0!==_vgClassSessionSelection.VisibleControlLength&&_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&(0==$("body").hasClass("Embedded_Widget")||1==$("body").hasClass("Embedded_Widget")&&void 0!==e.isApplyInWidget&&null!=e.isApplyInWidget&&1==e.isApplyInWidget)),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&$("body").hasClass("Popup_Widget")&&(t=!1);e.divid;var i=e.textid;e.dateTimeFormat;(iPadAndroid||isWindowsPhone)&&1==t||(i=$(i),$(i).data("xdsoft_datetimepicker").setOptions({disabledTimePicker:e.disabledTimePicker}))}!function(e){"use strict";"function"==typeof d&&d.amd?d(["jquery"],e):"undefined"!=typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";var t,i=window.Slick||{};t=0,i=function(i,n){var o,a,s=this;if(s.defaults={accessibility:!1,adaptiveHeight:!1,appendArrows:e(i),appendDots:e(i),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev">Previous</button>',nextArrow:'<button type="button" data-role="none" class="slick-next">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return'<button type="button" data-role="none">'+(t+1)+"</button>"},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",onBeforeChange:null,onAfterChange:null,onInit:null,onReInit:null,onSetPosition:null,pauseOnHover:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rtl:!1,slide:"div",slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,variableWidth:!1,vertical:!1,waitForAnimate:!0,CurrentSlideDirection:""},s.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,CurrentSlideDirection:""},e.extend(s,s.initials),s.activeBreakpoint=null,s.animType=null,s.animProp=null,s.breakpoints=[],s.breakpointSettings=[],s.cssTransitions=!1,s.paused=!1,s.positionProp=null,s.respondTo=null,s.shouldClick=!0,s.$slider=e(i),s.$slidesCache=null,s.transformType=null,s.transitionType=null,s.windowWidth=0,s.windowTimer=null,s.options=e.extend({},s.defaults,n),s.currentSlide=s.options.initialSlide,s.originalSettings=s.options,(o=s.options.responsive||null)&&o.length>-1){for(a in s.respondTo=s.options.respondTo||"window",o)o.hasOwnProperty(a)&&(s.breakpoints.push(o[a].breakpoint),s.breakpointSettings[o[a].breakpoint]=o[a].settings);s.breakpoints.sort(function(e,t){return t-e})}s.autoPlay=e.proxy(s.autoPlay,s),s.autoPlayClear=e.proxy(s.autoPlayClear,s),s.changeSlide=e.proxy(s.changeSlide,s),s.clickHandler=e.proxy(s.clickHandler,s),s.selectHandler=e.proxy(s.selectHandler,s),s.setPosition=e.proxy(s.setPosition,s),s.swipeHandler=e.proxy(s.swipeHandler,s),s.dragHandler=e.proxy(s.dragHandler,s),s.keyHandler=e.proxy(s.keyHandler,s),s.autoPlayIterator=e.proxy(s.autoPlayIterator,s),s.instanceUid=t++,s.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,s.init(),s.checkResponsive()},i.prototype.addSlide=function(t,i,n){var o=this;if("boolean"==typeof i)n=i,i=null;else if(i<0||i>=o.slideCount)return!1;o.unload(),"number"==typeof i?0===i&&0===o.$slides.length?e(t).appendTo(o.$slideTrack):n?e(t).insertBefore(o.$slides.eq(i)):e(t).insertAfter(o.$slides.eq(i)):!0===n?e(t).prependTo(o.$slideTrack):e(t).appendTo(o.$slideTrack),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slides.each(function(t,i){e(i).attr("index",t)}),o.$slidesCache=o.$slides,o.reinit()},i.prototype.animateSlide=function(t,i){var n={},o=this;if(1===o.options.slidesToShow&&!0===o.options.adaptiveHeight&&!1===o.options.vertical){var a=o.$slides.eq(o.currentSlide).outerHeight(!0);o.$list.animate({height:a},o.options.speed)}!0===o.options.rtl&&!1===o.options.vertical&&(t=-t),!1===o.transformsEnabled?!1===o.options.vertical?o.$slideTrack.animate({left:t},o.options.speed,o.options.easing,i):o.$slideTrack.animate({top:t},o.options.speed,o.options.easing,i):!1===o.cssTransitions?e({animStart:o.currentLeft}).animate({animStart:t},{duration:o.options.speed,easing:o.options.easing,step:function(e){!1===o.options.vertical?(n[o.animType]="translate("+e+"px, 0px)",o.$slideTrack.css(n)):(n[o.animType]="translate(0px,"+e+"px)",o.$slideTrack.css(n))},complete:function(){i&&i.call()}}):(o.applyTransition(),!1===o.options.vertical?n[o.animType]="translate3d("+t+"px, 0px, 0px)":n[o.animType]="translate3d(0px,"+t+"px, 0px)",o.$slideTrack.css(n),i&&setTimeout(function(){o.disableTransition(),i.call()},o.options.speed))},i.prototype.asNavFor=function(t){var i=null!=this.options.asNavFor?e(this.options.asNavFor).getSlick():null;null!=i&&i.slideHandler(t,!0)},i.prototype.applyTransition=function(e){var t=this,i={};!1===t.options.fade?i[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:i[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},i.prototype.autoPlay=function(){var e=this;e.autoPlayTimer&&clearInterval(e.autoPlayTimer),e.slideCount>e.options.slidesToShow&&!0!==e.paused&&(e.autoPlayTimer=setInterval(e.autoPlayIterator,e.options.autoplaySpeed))},i.prototype.autoPlayClear=function(){this.autoPlayTimer&&clearInterval(this.autoPlayTimer)},i.prototype.autoPlayIterator=function(){var e=this;!1===e.options.infinite?1===e.direction?(e.currentSlide+1===e.slideCount-1&&(e.direction=0),e.slideHandler(e.currentSlide+e.options.slidesToScroll)):(e.currentSlide-1==0&&(e.direction=1),e.slideHandler(e.currentSlide-e.options.slidesToScroll)):e.slideHandler(e.currentSlide+e.options.slidesToScroll)},i.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow=e(t.options.prevArrow),t.$nextArrow=e(t.options.nextArrow),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.appendTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled"))},i.prototype.buildDots=function(){var t,i,n=this;if(!0===n.options.dots&&n.slideCount>n.options.slidesToShow){for(i='<ul class="'+n.options.dotsClass+'">',t=0;t<=n.getDotCount();t+=1)i+="<li>"+n.options.customPaging.call(this,n,t)+"</li>";i+="</ul>",n.$dots=e(i).appendTo(n.options.appendDots),n.$dots.find("li").first().addClass("slick-active")}},i.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each(function(t,i){e(i).attr("index",t)}),t.$slidesCache=t.$slides,t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?e('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),!0===t.options.centerMode&&(t.options.slidesToScroll=1),e("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),!0===t.options.accessibility&&t.$list.prop("tabIndex",0),t.setSlideClasses("number"==typeof this.currentSlide?this.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},i.prototype.checkResponsive=function(){var t,i,n,o=this,a=o.$slider.width(),s=window.innerWidth||e(window).width();if("window"===o.respondTo?n=s:"slider"===o.respondTo?n=a:"min"===o.respondTo&&(n=Math.min(s,a)),o.originalSettings.responsive&&o.originalSettings.responsive.length>-1&&null!==o.originalSettings.responsive){for(t in i=null,o.breakpoints)o.breakpoints.hasOwnProperty(t)&&n<o.breakpoints[t]&&(i=o.breakpoints[t]);null!==i?null!==o.activeBreakpoint?i!==o.activeBreakpoint&&(o.activeBreakpoint=i,o.options=e.extend({},o.originalSettings,o.breakpointSettings[i]),o.refresh()):(o.activeBreakpoint=i,o.options=e.extend({},o.originalSettings,o.breakpointSettings[i]),o.refresh()):null!==o.activeBreakpoint&&(o.activeBreakpoint=null,o.options=o.originalSettings,o.refresh())}},i.prototype.changeSlide=function(t,i){var n,o,a,s,r=this;switch(e(t.target).is("a")&&t.preventDefault(),n=r.slideCount%r.options.slidesToScroll!==0?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,r.CurrentSlideDirection="",t.data.message){case"previous":r.CurrentSlideDirection="Prev",r.currentDirection=0,o=0===n?r.options.slidesToScroll:r.options.slidesToShow-n,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-o,!1,i);break;case"next":r.CurrentSlideDirection="Next",r.currentDirection=1,o=0===n?r.options.slidesToScroll:n,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+o,!1,i);break;case"index":r.CurrentSlideDirection="Index";var l=0===t.data.index?0:t.data.index||e(t.target).parent().index()*r.options.slidesToScroll;if(s=0,(a=r.getNavigableIndexes())[l]&&a[l]===l)if(l>a[a.length-1])l=a[a.length-1];else for(var c in a){if(l<a[c]){l=s;break}s=a[c]}r.slideHandler(l,!1,i);default:return}},i.prototype.clickHandler=function(e){!1===this.shouldClick&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},i.prototype.destroy=function(){var t=this;t.autoPlayClear(),t.touchObject={},e(".slick-cloned",t.$slider).remove(),t.$dots&&t.$dots.remove(),t.$prevArrow&&"object"!=typeof t.options.prevArrow&&t.$prevArrow.remove(),t.$nextArrow&&"object"!=typeof t.options.nextArrow&&t.$nextArrow.remove(),null!=t.$slides&&(t.$slides.parent().hasClass("slick-track")&&t.$slides.unwrap().unwrap(),t.$slides.removeClass("slick-slide slick-active slick-center slick-visible").removeAttr("index").css({position:"",left:"",top:"",zIndex:"",opacity:"",width:""}),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$list.off(".slick"),e(window).off(".slick-"+t.instanceUid),e(document).off(".slick-"+t.instanceUid))},i.prototype.disableTransition=function(e){var t=this,i={};i[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(i):t.$slides.eq(e).css(i)},i.prototype.fadeSlide=function(e,t,i){var n=this;!1===n.cssTransitions?(n.$slides.eq(t).css({zIndex:1e3}),n.$slides.eq(t).animate({opacity:1},n.options.speed,n.options.easing,i),n.$slides.eq(e).animate({opacity:0},n.options.speed,n.options.easing)):(n.applyTransition(t),n.applyTransition(e),n.$slides.eq(t).css({opacity:1,zIndex:1e3}),n.$slides.eq(e).css({opacity:0}),i&&setTimeout(function(){n.disableTransition(t),n.disableTransition(e),i.call()},n.options.speed))},i.prototype.filterSlides=function(e){var t=this;null!==e&&(t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(e).appendTo(t.$slideTrack),t.reinit())},i.prototype.getCurrent=function(){return this.currentSlide},i.prototype.getDotCount=function(){var e=this,t=0,i=0,n=0;if(!0===e.options.infinite)n=Math.ceil(e.slideCount/e.options.slidesToScroll);else for(;t<e.slideCount;)++n,t=i+e.options.slidesToShow,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return n-1},i.prototype.getLeft=function(e){var t,i,n,o=this,a=0;return o.slideOffset=0,i=o.$slides.first().outerHeight(),!0===o.options.infinite?(o.slideCount>o.options.slidesToShow&&(o.slideOffset=o.slideWidth*o.options.slidesToShow*-1,a=i*o.options.slidesToShow*-1),o.slideCount%o.options.slidesToScroll!==0&&e+o.options.slidesToScroll>o.slideCount&&o.slideCount>o.options.slidesToShow&&(e>o.slideCount?(o.slideOffset=(o.options.slidesToShow-(e-o.slideCount))*o.slideWidth*-1,a=(o.options.slidesToShow-(e-o.slideCount))*i*-1):(o.slideOffset=o.slideCount%o.options.slidesToScroll*o.slideWidth*-1,a=o.slideCount%o.options.slidesToScroll*i*-1))):e+o.options.slidesToShow>o.slideCount&&(o.slideOffset=(e+o.options.slidesToShow-o.slideCount)*o.slideWidth,a=(e+o.options.slidesToShow-o.slideCount)*i),o.slideCount<=o.options.slidesToShow&&(o.slideOffset=0,a=0),!0===o.options.centerMode&&!0===o.options.infinite?o.slideOffset+=o.slideWidth*Math.floor(o.options.slidesToShow/2)-o.slideWidth:!0===o.options.centerMode&&(o.slideOffset=0,o.slideOffset+=o.slideWidth*Math.floor(o.options.slidesToShow/2)),t=!1===o.options.vertical?e*o.slideWidth*-1+o.slideOffset:e*i*-1+a,!0===o.options.variableWidth&&(t=(n=o.slideCount<=o.options.slidesToShow||!1===o.options.infinite?o.$slideTrack.children(".slick-slide").eq(e):o.$slideTrack.children(".slick-slide").eq(e+o.options.slidesToShow))[0]?-1*n[0].offsetLeft:0,!0===o.options.centerMode&&(t=(n=!1===o.options.infinite?o.$slideTrack.children(".slick-slide").eq(e):o.$slideTrack.children(".slick-slide").eq(e+o.options.slidesToShow+1))[0]?-1*n[0].offsetLeft:0,t+=(o.$list.width()-n.outerWidth())/2)),t},i.prototype.getNavigableIndexes=function(){for(var e=this,t=0,i=0,n=[];t<e.slideCount;)n.push(t),t=i+e.options.slidesToScroll,i+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return n},i.prototype.getSlideCount=function(){var t=this;if(!0===t.options.swipeToSlide){var i=null;return t.$slideTrack.find(".slick-slide").each(function(n,o){if(o.offsetLeft+e(o).outerWidth()/2>-1*t.swipeLeft)return i=o,!1}),Math.abs(e(i).attr("index")-t.currentSlide)}return t.options.slidesToScroll},i.prototype.init=function(){var t=this;e(t.$slider).hasClass("slick-initialized")||(e(t.$slider).addClass("slick-initialized"),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots()),null!==t.options.onInit&&t.options.onInit.call(this,t)},i.prototype.initArrowEvents=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.on("click.slick",{message:"previous"},e.changeSlide),e.$nextArrow.on("click.slick",{message:"next"},e.changeSlide))},i.prototype.initDotEvents=function(){var t=this;!0===t.options.dots&&t.slideCount>t.options.slidesToShow&&e("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide),!0===t.options.dots&&!0===t.options.pauseOnDotsHover&&!0===t.options.autoplay&&e("li",t.$dots).on("mouseenter.slick",function(){t.paused=!0,t.autoPlayClear()}).on("mouseleave.slick",function(){t.paused=!1,t.autoPlay()})},i.prototype.initializeEvents=function(){var t=this;t.initArrowEvents(),t.initDotEvents(),t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler),t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler),t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler),t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler),t.$list.on("click.slick",t.clickHandler),!0===t.options.pauseOnHover&&!0===t.options.autoplay&&(t.$list.on("mouseenter.slick",function(){t.paused=!0,t.autoPlayClear()}),t.$list.on("mouseleave.slick",function(){t.paused=!1,t.autoPlay()})),!0===t.options.accessibility&&t.$list.on("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.options.slide,t.$slideTrack).on("click.slick",t.selectHandler),e(window).on("orientationchange.slick.slick-"+t.instanceUid,function(){t.checkResponsive(),t.setPosition()}),e(window).on("resize.slick.slick-"+t.instanceUid,function(){e(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=e(window).width(),t.checkResponsive(),t.setPosition()},50))}),e("*[draggable!=true]",t.$slideTrack).on("dragstart",function(e){e.preventDefault()}),e(window).on("load.slick.slick-"+t.instanceUid,t.setPosition),e(document).on("ready.slick.slick-"+t.instanceUid,t.setPosition)},i.prototype.initUI=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.show(),e.$nextArrow.show()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.show(),!0===e.options.autoplay&&e.autoPlay()},i.prototype.keyHandler=function(e){var t=this;37===e.keyCode&&!0===t.options.accessibility?t.changeSlide({data:{message:"previous"}}):39===e.keyCode&&!0===t.options.accessibility&&t.changeSlide({data:{message:"next"}})},i.prototype.lazyLoad=function(){var t,i,n=this;function o(t){e(".lazy",t).each(function(){var t=e(this),i=e(this).attr("data-original");t.css({opacity:0}),t.is("img")?t.attr("src",i):t.css("background-image","url('"+i+"')"),t.removeAttr("data-original"),t.removeClass("slick-loading").removeClass("lazy");var n=new Image;e(n).load(function(){e(t).animate({opacity:1}).fadeIn()}),e(n).attr("src",i)})}!0===n.options.centerMode?!0===n.options.infinite?i=(t=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(t=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),i=n.options.slidesToShow/2+1+2+n.currentSlide):(i=(t=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide)+n.options.slidesToShow,!0===n.options.fade&&(t>0&&t--,i<=n.slideCount&&i++)),o(n.$slider.find(".slick-slide").slice(t,i)),n.slideCount<=n.options.slidesToShow?o(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?o(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&o(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},i.prototype.loadSlider=function(){var e=this;e.setPosition(),e.$slideTrack.css({opacity:1}),e.$slider.removeClass("slick-loading"),e.initUI(),"progressive"===e.options.lazyLoad&&e.progressiveLazyLoad()},i.prototype.postSlide=function(e){var t=this;null!==t.options.onAfterChange&&t.options.onAfterChange.call(this,t,e),t.animating=!1,t.setPosition(),t.swipeLeft=null,!0===t.options.autoplay&&!1===t.paused&&t.autoPlay()},i.prototype.progressiveLazyLoad=function(){var t,i=this;e("img[data-lazy]",i.$slider).length>0&&(t=e("img[data-lazy]",i.$slider).first()).attr("src",t.attr("data-lazy")).removeClass("slick-loading").load(function(){t.removeAttr("data-lazy"),i.progressiveLazyLoad()}).error(function(){t.removeAttr("data-lazy"),i.progressiveLazyLoad()})},i.prototype.refresh=function(){var t=this,i=t.currentSlide;t.destroy(),e.extend(t,t.initials),t.init(),t.changeSlide({data:{message:"index",index:i}},!0)},i.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),!0===t.options.focusOnSelect&&e(t.options.slide,t.$slideTrack).on("click.slick",t.selectHandler),t.setSlideClasses(0),t.setPosition(),null!==t.options.onReInit&&t.options.onReInit.call(this,t)},i.prototype.removeSlide=function(e,t,i){var n=this;if(e="boolean"==typeof e?!0===(t=e)?0:n.slideCount-1:!0===t?--e:e,n.slideCount<1||e<0||e>n.slideCount-1)return!1;n.unload(),!0===i?n.$slideTrack.children().remove():n.$slideTrack.children(this.options.slide).eq(e).remove(),n.$slides=n.$slideTrack.children(this.options.slide),n.$slideTrack.children(this.options.slide).detach(),n.$slideTrack.append(n.$slides),n.$slidesCache=n.$slides,n.reinit()},i.prototype.setCSS=function(e){var t,i,n=this,o={};!0===n.options.rtl&&(e=-e),t="left"==n.positionProp?e+"px":"0px",i="top"==n.positionProp?e+"px":"0px",o[n.positionProp]=e,!1===n.transformsEnabled?n.$slideTrack.css(o):(o={},!1===n.cssTransitions?(o[n.animType]="translate("+t+", "+i+")",n.$slideTrack.css(o)):(o[n.animType]="translate3d("+t+", "+i+", 0px)",n.$slideTrack.css(o)))},i.prototype.setDimensions=function(){var t=this;if(!1===t.options.vertical?!0===t.options.centerMode&&t.$list.css({padding:"0px "+t.options.centerPadding}):(t.$list.height(t.$slides.first().outerHeight(!0)*t.options.slidesToShow),!0===t.options.centerMode&&t.$list.css({padding:t.options.centerPadding+" 0px"})),t.listWidth=t.$list.width(),t.listHeight=t.$list.height(),!1===t.options.vertical&&!1===t.options.variableWidth)t.slideWidth=Math.ceil(t.listWidth/t.options.slidesToShow),t.$slideTrack.width(Math.ceil(t.slideWidth*t.$slideTrack.children(".slick-slide").length));else if(!0===t.options.variableWidth){var i=0;t.slideWidth=Math.ceil(t.listWidth/t.options.slidesToShow),t.$slideTrack.children(".slick-slide").each(function(){i+=Math.ceil(e(this).outerWidth(!0))}),t.$slideTrack.width(Math.ceil(i)+1)}else t.slideWidth=Math.ceil(t.listWidth),t.$slideTrack.height(Math.ceil(t.$slides.first().outerHeight(!0)*t.$slideTrack.children(".slick-slide").length));var n=t.$slides.first().outerWidth(!0)-t.$slides.first().width();!1===t.options.variableWidth&&t.$slideTrack.children(".slick-slide").width(t.slideWidth-n)},i.prototype.setFade=function(){var t,i=this;i.$slides.each(function(n,o){t=i.slideWidth*n*-1,!0===i.options.rtl?e(o).css({position:"relative",right:t,top:0,zIndex:800,opacity:0}):e(o).css({position:"relative",left:t,top:0,zIndex:800,opacity:0})}),i.$slides.eq(i.currentSlide).css({zIndex:900,opacity:1})},i.prototype.setHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.css("height",t)}},i.prototype.setPosition=function(){var e=this;e.setDimensions(),e.setHeight(),!1===e.options.fade?e.setCSS(e.getLeft(e.currentSlide)):e.setFade(),null!==e.options.onSetPosition&&e.options.onSetPosition.call(this,e)},i.prototype.setProps=function(){var e=this,t=document.body.style;e.positionProp=!0===e.options.vertical?"top":"left","top"===e.positionProp?e.$slider.addClass("slick-vertical"):e.$slider.removeClass("slick-vertical"),void 0===t.WebkitTransition&&void 0===t.MozTransition&&void 0===t.msTransition||!0===e.options.useCSS&&(e.cssTransitions=!0),void 0!==t.OTransform&&(e.animType="OTransform",e.transformType="-o-transform",e.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.MozTransform&&(e.animType="MozTransform",e.transformType="-moz-transform",e.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(e.animType=!1)),void 0!==t.webkitTransform&&(e.animType="webkitTransform",e.transformType="-webkit-transform",e.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.msTransform&&(e.animType="msTransform",e.transformType="-ms-transform",e.transitionType="msTransition",void 0===t.msTransform&&(e.animType=!1)),void 0!==t.transform&&!1!==e.animType&&(e.animType="transform",e.transformType="transform",e.transitionType="transition"),e.transformsEnabled=null!==e.animType&&!1!==e.animType},i.prototype.setSlideClasses=function(e){var t,i,n,o,a=this;a.$slider.find(".slick-slide").removeClass("slick-active").removeClass("slick-center"),i=a.$slider.find(".slick-slide"),!0===a.options.centerMode?(t=Math.floor(a.options.slidesToShow/2),!0===a.options.infinite&&(e>=t&&e<=a.slideCount-1-t?a.$slides.slice(e-t,e+t+1).addClass("slick-active"):(n=a.options.slidesToShow+e,i.slice(n-t+1,n+t+2).addClass("slick-active")),0===e?i.eq(i.length-1-a.options.slidesToShow).addClass("slick-center"):e===a.slideCount-1&&i.eq(a.options.slidesToShow).addClass("slick-center")),a.$slides.eq(e).addClass("slick-center")):e>=0&&e<=a.slideCount-a.options.slidesToShow?a.$slides.slice(e,e+a.options.slidesToShow).addClass("slick-active"):i.length<=a.options.slidesToShow?i.addClass("slick-active"):(o=a.slideCount%a.options.slidesToShow,n=!0===a.options.infinite?a.options.slidesToShow+e:e,a.options.slidesToShow==a.options.slidesToScroll&&a.slideCount-e<a.options.slidesToShow?i.slice(n-(a.options.slidesToShow-o),n+o).addClass("slick-active"):i.slice(n,n+a.options.slidesToShow).addClass("slick-active")),"ondemand"===a.options.lazyLoad&&a.lazyLoad()},i.prototype.setupInfinite=function(){var t,i,n,o=this;if(!0===o.options.fade&&(o.options.centerMode=!1),!0===o.options.infinite&&!1===o.options.fade&&(i=null,o.slideCount>o.options.slidesToShow)){for(n=!0===o.options.centerMode?o.options.slidesToShow+1:o.options.slidesToShow,t=o.slideCount;t>o.slideCount-n;t-=1)i=t-1,e(o.$slides[i]).clone(!0).attr("id","").attr("index",i-o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned");for(t=0;t<n;t+=1)i=t,e(o.$slides[i]).clone(!0).attr("id","").attr("index",i+o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned");o.$slideTrack.find(".slick-cloned").find("[id]").each(function(){e(this).attr("id","")})}},i.prototype.selectHandler=function(t){var i=this,n=parseInt(e(t.target).parents(".slick-slide").attr("index"));if(n||(n=0),i.slideCount<=i.options.slidesToShow)return i.$slider.find(".slick-slide").removeClass("slick-active"),i.$slides.eq(n).addClass("slick-active"),!0===i.options.centerMode&&(i.$slider.find(".slick-slide").removeClass("slick-center"),i.$slides.eq(n).addClass("slick-center")),void i.asNavFor(n);i.slideHandler(n)},i.prototype.slideHandler=function(e,t,i){var n,o,a,s,r,l=this;t=t||!1,!0===l.animating&&!0===l.options.waitForAnimate||!0===l.options.fade&&l.currentSlide===e||l.slideCount<=l.options.slidesToShow||(!1===t&&l.asNavFor(e),n=e,r=l.getLeft(n),s=l.getLeft(l.currentSlide),l.currentLeft=null===l.swipeLeft?s:l.swipeLeft,!1===l.options.infinite&&!1===l.options.centerMode&&(e<0||e>l.getDotCount()*l.options.slidesToScroll)||!1===l.options.infinite&&!0===l.options.centerMode&&(e<0||e>l.slideCount-l.options.slidesToScroll)?!1===l.options.fade&&(n=l.currentSlide,!0!==i?l.animateSlide(s,function(){l.postSlide(n)}):l.postSlide(n)):(!0===l.options.autoplay&&clearInterval(l.autoPlayTimer),o=n<0?l.slideCount%l.options.slidesToScroll!==0?l.slideCount-l.slideCount%l.options.slidesToScroll:l.slideCount+n:n>=l.slideCount?l.slideCount%l.options.slidesToScroll!==0?0:n-l.slideCount:n,l.animating=!0,null!==l.options.onBeforeChange&&e!==l.currentSlide&&l.options.onBeforeChange.call(this,l,l.currentSlide,o),a=l.currentSlide,l.currentSlide=o,l.setSlideClasses(l.currentSlide),l.updateDots(),l.updateArrows(),!0!==l.options.fade?!0!==i?l.animateSlide(r,function(){l.postSlide(o)}):l.postSlide(o):!0!==i?l.fadeSlide(a,o,function(){l.postSlide(o)}):l.postSlide(o)))},i.prototype.startLoad=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.hide(),e.$nextArrow.hide()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.hide(),e.$slider.addClass("slick-loading")},i.prototype.swipeDirection=function(){var e,t,i,n,o=this;return e=o.touchObject.startX-o.touchObject.curX,t=o.touchObject.startY-o.touchObject.curY,i=Math.atan2(t,e),(n=Math.round(180*i/Math.PI))<0&&(n=360-Math.abs(n)),n<=45&&n>=0||n<=360&&n>=315?!1===o.options.rtl?"left":"right":n>=135&&n<=225?!1===o.options.rtl?"right":"left":"vertical"},i.prototype.swipeEnd=function(e){var t=this;if(t.dragging=!1,t.shouldClick=!(t.touchObject.swipeLength>10),void 0===t.touchObject.curX)return!1;if(t.CurrentSlideDirection="",t.touchObject.swipeLength>=t.touchObject.minSwipe)switch(t.swipeDirection()){case"left":t.CurrentSlideDirection="Next",t.slideHandler(t.currentSlide+t.getSlideCount()),t.currentDirection=1,t.touchObject={};break;case"right":t.CurrentSlideDirection="Prev",t.slideHandler(t.currentSlide-t.getSlideCount()),t.currentDirection=0,t.touchObject={}}else t.touchObject.startX!==t.touchObject.curX&&(t.slideHandler(t.currentSlide),t.touchObject={})},i.prototype.swipeHandler=function(t){var i=this;if(!(!1===i.options.swipe||"ontouchend"in document&&!1===i.options.swipe||!1===i.options.draggable&&-1!==t.type.indexOf("mouse"))){switch(i.touchObject.fingerCount=t.originalEvent&&void 0!==t.originalEvent.touches?t.originalEvent.touches.length:1,i.touchObject.minSwipe=i.listWidth/i.options.touchThreshold,t.data.action){case"start":i.swipeStart(t);break;case"move":i.swipeMove(t);break;case"end":i.swipeEnd(t)}-1!==t.type.indexOf("mouse")&&1==e(t.target).is("img")&&t.preventDefault()}},i.prototype.swipeMove=function(e){var t,i,n,o=this;return n=void 0!==e.originalEvent?e.originalEvent.touches:null,!(!o.dragging||n&&1!==n.length)&&(t=o.getLeft(o.currentSlide),o.touchObject.curX=void 0!==n?n[0].pageX:e.clientX,o.touchObject.curY=void 0!==n?n[0].pageY:e.clientY,o.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(o.touchObject.curX-o.touchObject.startX,2))),"vertical"!==o.swipeDirection()?(void 0!==e.originalEvent&&o.touchObject.swipeLength>4&&e.preventDefault(),i=(!1===o.options.rtl?1:-1)*(o.touchObject.curX>o.touchObject.startX?1:-1),!1===o.options.vertical?o.swipeLeft=t+o.touchObject.swipeLength*i:o.swipeLeft=t+o.touchObject.swipeLength*(o.$list.height()/o.listWidth)*i,!0!==o.options.fade&&!1!==o.options.touchMove&&(!0===o.animating?(o.swipeLeft=null,!1):void o.setCSS(o.swipeLeft))):void 0)},i.prototype.swipeStart=function(e){var t,i=this;if(1!==i.touchObject.fingerCount||i.slideCount<=i.options.slidesToShow)return i.touchObject={},!1;void 0!==e.originalEvent&&void 0!==e.originalEvent.touches&&(t=e.originalEvent.touches[0]),i.touchObject.startX=i.touchObject.curX=void 0!==t?t.pageX:e.clientX,i.touchObject.startY=i.touchObject.curY=void 0!==t?t.pageY:e.clientY,i.dragging=!0},i.prototype.unfilterSlides=function(){var e=this;null!==e.$slidesCache&&(e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.appendTo(e.$slideTrack),e.reinit())},i.prototype.unload=function(){var t=this;e(".slick-cloned",t.$slider).remove(),t.$dots&&t.$dots.remove(),t.$prevArrow&&"object"!=typeof t.options.prevArrow&&t.$prevArrow.remove(),t.$nextArrow&&"object"!=typeof t.options.nextArrow&&t.$nextArrow.remove(),t.$slides.removeClass("slick-slide slick-active slick-visible").css("width","")},i.prototype.updateArrows=function(){var e,t=this;e=Math.floor(t.options.slidesToShow/2),!0===t.options.arrows&&!0!==t.options.infinite&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow.removeClass("slick-disabled"),t.$nextArrow.removeClass("slick-disabled"),t.$prevArrow.addClass("text-primary"),t.$nextArrow.addClass("text-primary"),t.$prevArrow.removeClass("border-outline"),t.$nextArrow.removeClass("border-outline"),0===t.currentSlide?(t.$prevArrow.addClass("slick-disabled"),t.$prevArrow.addClass("border-outline"),t.$prevArrow.removeClass("text-primary"),t.$nextArrow.removeClass("slick-disabled"),t.$nextArrow.addClass("text-primary")):(t.currentSlide>=t.slideCount-t.options.slidesToShow&&!1===t.options.centerMode||t.currentSlide>t.slideCount-t.options.slidesToShow+e&&!0===t.options.centerMode)&&(t.$nextArrow.addClass("slick-disabled"),t.$nextArrow.addClass("border-outline"),t.$nextArrow.removeClass("text-primary"),t.$prevArrow.removeClass("slick-disabled"),t.$prevArrow.addClass("text-primary")))},i.prototype.updateDots=function(){var e=this;null!==e.$dots&&(e.$dots.find("li").removeClass("slick-active"),e.$dots.find("li").eq(Math.floor(e.currentSlide/e.options.slidesToScroll)).addClass("slick-active"))},e.fn.slick=function(e){return this.each(function(t,n){n.slick=new i(n,e)})},e.fn.slickAdd=function(e,t,i){return this.each(function(n,o){o.slick.addSlide(e,t,i)})},e.fn.slickCurrentSlide=function(){return this.get(0).slick.getCurrent()},e.fn.slickFilter=function(e){return this.each(function(t,i){i.slick.filterSlides(e)})},e.fn.slickGoTo=function(e,t){return this.each(function(i,n){n.slick.changeSlide({data:{message:"index",index:parseInt(e)}},t)})},e.fn.slickNext=function(){return this.each(function(e,t){t.slick.changeSlide({data:{message:"next"}})})},e.fn.slickPause=function(){return this.each(function(e,t){t.slick.autoPlayClear(),t.slick.paused=!0})},e.fn.slickPlay=function(){return this.each(function(e,t){t.slick.paused=!1,t.slick.autoPlay()})},e.fn.slickPrev=function(){return this.each(function(e,t){t.slick.changeSlide({data:{message:"previous"}})})},e.fn.slickRemove=function(e,t){return this.each(function(i,n){n.slick.removeSlide(e,t)})},e.fn.slickRemoveAll=function(){return this.each(function(e,t){t.slick.removeSlide(null,null,!0)})},e.fn.slickGetOption=function(e){return this.get(0).slick.options[e]},e.fn.slickSetOption=function(e,t,i){return this.each(function(n,o){o.slick.options[e]=t,!0===i&&(o.slick.unload(),o.slick.reinit())})},e.fn.slickUnfilter=function(){return this.each(function(e,t){t.slick.unfilterSlides()})},e.fn.unslick=function(){return this.each(function(e,t){t.slick&&t.slick.destroy()})},e.fn.getSlick=function(){var e=null;return this.each(function(t,i){e=i.slick}),e}}),function(e){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e("undefined"!=typeof module&&module.exports?require("jquery"):jQuery)}(function(e){"use strict";function t(t){return!t||void 0!==t.allowPageScroll||void 0===t.swipe&&void 0===t.swipeStatus||(t.allowPageScroll=c),void 0!==t.click&&void 0===t.tap&&(t.tap=t.click),t||(t={}),t=e.extend({},e.fn.swipe.defaults,t),this.each(function(){var n=e(this),o=n.data(P);o||(o=new i(this,t),n.data(P,o))})}function i(t,i){function A(t){if(!(!0===ke.data(P+"_intouch")||e(t.target).closest(i.excludedElements,ke).length>0)){var r=t.originalEvent?t.originalEvent:t;if(!r.pointerType||"mouse"!=r.pointerType||0!=i.fallbackToMouseEvents){var l,c=r.touches,d=c?c[0]:r;return _e=y,c?De=c.length:!1!==i.preventDefaultEvents&&t.preventDefault(),pe=0,he=null,me=null,ye=null,ge=0,ve=0,fe=0,Ce=1,Se=0,(u={})[n]=te(n),u[o]=te(o),u[a]=te(a),u[s]=te(s),be=u,X(),Q(0,d),!c||De===i.fingers||i.fingers===C||W()?(we=ae(),2==De&&(Q(1,c[1]),ve=fe=ne(Ie[0].start,Ie[1].start)),(i.swipeStatus||i.pinchStatus)&&(l=B(r,_e))):l=!1,!1===l?(B(r,_e=_),l):(i.hold&&($e=setTimeout(e.proxy(function(){ke.trigger("hold",[r.target]),i.hold&&(l=i.hold.call(ke,r,r.target))},this),i.longTapThreshold)),J(!0),null)}}var u}function T(t){var u,p,h=t.originalEvent?t.originalEvent:t;if(_e!==k&&_e!==_&&!Z()){var m,g=h.touches,S=K(g?g[0]:h);if(Pe=ae(),g&&(De=g.length),i.hold&&clearTimeout($e),_e=b,2==De&&(0==ve?(Q(1,g[1]),ve=fe=ne(Ie[0].start,Ie[1].start)):(K(g[1]),fe=ne(Ie[0].end,Ie[1].end),Ie[0].end,Ie[1].end,ye=Ce<1?l:r),Ce=(fe/ve*1).toFixed(2),Se=Math.abs(ve-fe)),De===i.fingers||i.fingers===C||!g||W()){if(he=oe(S.start,S.end),function(e,t){if(!1!==i.preventDefaultEvents)if(i.allowPageScroll===c)e.preventDefault();else{var r=i.allowPageScroll===d;switch(t){case n:(i.swipeLeft&&r||!r&&i.allowPageScroll!=v)&&e.preventDefault();break;case o:(i.swipeRight&&r||!r&&i.allowPageScroll!=v)&&e.preventDefault();break;case a:(i.swipeUp&&r||!r&&i.allowPageScroll!=f)&&e.preventDefault();break;case s:(i.swipeDown&&r||!r&&i.allowPageScroll!=f)&&e.preventDefault()}}}(t,me=oe(S.last,S.end)),u=S.start,p=S.end,pe=Math.round(Math.sqrt(Math.pow(p.x-u.x,2)+Math.pow(p.y-u.y,2))),ge=ie(),function(e,t){e!=c&&(t=Math.max(t,ee(e)),be[e].distance=t)}(he,pe),m=B(h,_e),!i.triggerOnTouchEnd||i.triggerOnTouchLeave){var y=!0;if(i.triggerOnTouchLeave){var D=function(t){var i=(t=e(t)).offset(),n={left:i.left,right:i.left+t.outerWidth(),top:i.top,bottom:i.top+t.outerHeight()};return n}(this);y=function(e,t){return e.x>t.left&&e.x<t.right&&e.y>t.top&&e.y<t.bottom}(S.end,D)}!i.triggerOnTouchEnd&&y?_e=M(b):i.triggerOnTouchLeave&&!y&&(_e=M(k)),_e!=_&&_e!=k||B(h,_e)}}else B(h,_e=_);!1===m&&B(h,_e=_)}}function x(e){var t=e.originalEvent?e.originalEvent:e,n=t.touches;if(n){if(n.length&&!Z())return function(e){Ae=ae(),Te=e.touches.length+1}(t),!0;if(n.length&&Z())return!0}return Z()&&(De=Te),Pe=ae(),ge=ie(),N()||!L()?B(t,_e=_):i.triggerOnTouchEnd||!1===i.triggerOnTouchEnd&&_e===b?(!1!==i.preventDefaultEvents&&!1!==e.cancelable&&e.preventDefault(),B(t,_e=k)):!i.triggerOnTouchEnd&&Y()?E(t,_e=k,h):_e===b&&B(t,_e=_),J(!1),null}function F(){De=0,Pe=0,we=0,ve=0,fe=0,Ce=1,X(),J(!1)}function $(e){var t=e.originalEvent?e.originalEvent:e;i.triggerOnTouchLeave&&B(t,_e=M(k))}function O(){ke.unbind(re,A),ke.unbind(ue,F),ke.unbind(le,T),ke.unbind(ce,x),de&&ke.unbind(de,$),J(!1)}function M(e){var t=e,n=U(),o=L(),a=N();return!n||a?t=_:!o||e!=b||i.triggerOnTouchEnd&&!i.triggerOnTouchLeave?!o&&e==k&&i.triggerOnTouchLeave&&(t=_):t=k,t}function B(e,t){var n,o=e.touches;return(!(!G()||!V())||V())&&(n=E(e,t,u)),(!(!R()||!W())||W())&&!1!==n&&(n=E(e,t,p)),z()&&q()&&!1!==n?n=E(e,t,m):ge>i.longTapThreshold&&pe<S&&i.longTap&&!1!==n?n=E(e,t,g):!(1!==De&&D||!(isNaN(pe)||pe<i.threshold)||!Y())&&!1!==n&&(n=E(e,t,h)),t===_&&F(),t===k&&(o&&o.length||F()),n}function E(t,c,d){var v;if(d==u){if(ke.trigger("swipeStatus",[c,he||null,pe||0,ge||0,De,Ie,me]),i.swipeStatus&&!1===(v=i.swipeStatus.call(ke,t,c,he||null,pe||0,ge||0,De,Ie,me)))return!1;if(c==k&&G()){if(clearTimeout(Fe),clearTimeout($e),ke.trigger("swipe",[he,pe,ge,De,Ie,me]),i.swipe&&!1===(v=i.swipe.call(ke,t,he,pe,ge,De,Ie,me)))return!1;switch(he){case n:ke.trigger("swipeLeft",[he,pe,ge,De,Ie,me]),i.swipeLeft&&(v=i.swipeLeft.call(ke,t,he,pe,ge,De,Ie,me));break;case o:ke.trigger("swipeRight",[he,pe,ge,De,Ie,me]),i.swipeRight&&(v=i.swipeRight.call(ke,t,he,pe,ge,De,Ie,me));break;case a:ke.trigger("swipeUp",[he,pe,ge,De,Ie,me]),i.swipeUp&&(v=i.swipeUp.call(ke,t,he,pe,ge,De,Ie,me));break;case s:ke.trigger("swipeDown",[he,pe,ge,De,Ie,me]),i.swipeDown&&(v=i.swipeDown.call(ke,t,he,pe,ge,De,Ie,me))}}}if(d==p){if(ke.trigger("pinchStatus",[c,ye||null,Se||0,ge||0,De,Ce,Ie]),i.pinchStatus&&!1===(v=i.pinchStatus.call(ke,t,c,ye||null,Se||0,ge||0,De,Ce,Ie)))return!1;if(c==k&&R())switch(ye){case r:ke.trigger("pinchIn",[ye||null,Se||0,ge||0,De,Ce,Ie]),i.pinchIn&&(v=i.pinchIn.call(ke,t,ye||null,Se||0,ge||0,De,Ce,Ie));break;case l:ke.trigger("pinchOut",[ye||null,Se||0,ge||0,De,Ce,Ie]),i.pinchOut&&(v=i.pinchOut.call(ke,t,ye||null,Se||0,ge||0,De,Ce,Ie))}}return d==h?c!==_&&c!==k||(clearTimeout(Fe),clearTimeout($e),q()&&!z()?(xe=ae(),Fe=setTimeout(e.proxy(function(){xe=null,ke.trigger("tap",[t.target]),i.tap&&(v=i.tap.call(ke,t,t.target))},this),i.doubleTapThreshold)):(xe=null,ke.trigger("tap",[t.target]),i.tap&&(v=i.tap.call(ke,t,t.target)))):d==m?c!==_&&c!==k||(clearTimeout(Fe),clearTimeout($e),xe=null,ke.trigger("doubletap",[t.target]),i.doubleTap&&(v=i.doubleTap.call(ke,t,t.target))):d==g&&(c!==_&&c!==k||(clearTimeout(Fe),xe=null,ke.trigger("longtap",[t.target]),i.longTap&&(v=i.longTap.call(ke,t,t.target)))),v}function L(){var e=!0;return null!==i.threshold&&(e=pe>=i.threshold),e}function N(){var e=!1;return null!==i.cancelThreshold&&null!==he&&(e=ee(he)-pe>=i.cancelThreshold),e}function U(){return!(i.maxTimeThreshold&&ge>=i.maxTimeThreshold)}function R(){var e=H(),t=j(),n=null===i.pinchThreshold||Se>=i.pinchThreshold;return e&&t&&n}function W(){return!!(i.pinchStatus||i.pinchIn||i.pinchOut)}function G(){var e=U(),t=L(),i=H(),n=j();return!N()&&n&&i&&t&&e}function V(){return!!(i.swipe||i.swipeStatus||i.swipeLeft||i.swipeRight||i.swipeUp||i.swipeDown)}function H(){return De===i.fingers||i.fingers===C||!D}function j(){return 0!==Ie[0].end.x}function Y(){return!!i.tap}function q(){return!!i.doubleTap}function z(){if(null==xe)return!1;var e=ae();return q()&&e-xe<=i.doubleTapThreshold}function X(){Ae=0,Te=0}function Z(){var e=!1;Ae&&(ae()-Ae<=i.fingerReleaseThreshold&&(e=!0));return e}function J(e){ke&&(!0===e?(ke.bind(le,T),ke.bind(ce,x),de&&ke.bind(de,$)):(ke.unbind(le,T,!1),ke.unbind(ce,x,!1),de&&ke.unbind(de,$,!1)),ke.data(P+"_intouch",!0===e))}function Q(e,t){var i={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return i.start.x=i.last.x=i.end.x=t.pageX||t.clientX,i.start.y=i.last.y=i.end.y=t.pageY||t.clientY,Ie[e]=i,i}function K(e){var t=void 0!==e.identifier?e.identifier:0,i=function(e){return Ie[e]||null}(t);return null===i&&(i=Q(t,e)),i.last.x=i.end.x,i.last.y=i.end.y,i.end.x=e.pageX||e.clientX,i.end.y=e.pageY||e.clientY,i}function ee(e){if(be[e])return be[e].distance}function te(e){return{direction:e,distance:0}}function ie(){return Pe-we}function ne(e,t){var i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.round(Math.sqrt(i*i+n*n))}function oe(e,t){if(r=t,(i=e).x==r.x&&i.y==r.y)return c;var i,r,l=function(e,t){var i=e.x-t.x,n=t.y-e.y,o=Math.atan2(n,i),a=Math.round(180*o/Math.PI);return a<0&&(a=360-Math.abs(a)),a}(e,t);return l<=45&&l>=0||l<=360&&l>=315?n:l>=135&&l<=225?o:l>45&&l<135?s:a}function ae(){return(new Date).getTime()}i=e.extend({},i);var se=D||w||!i.fallbackToMouseEvents,re=se?w?I?"MSPointerDown":"pointerdown":"touchstart":"mousedown",le=se?w?I?"MSPointerMove":"pointermove":"touchmove":"mousemove",ce=se?w?I?"MSPointerUp":"pointerup":"touchend":"mouseup",de=se?w?"mouseleave":null:"mouseleave",ue=w?I?"MSPointerCancel":"pointercancel":"touchcancel",pe=0,he=null,me=null,ge=0,ve=0,fe=0,Ce=1,Se=0,ye=0,be=null,ke=e(t),_e="start",De=0,Ie={},we=0,Pe=0,Ae=0,Te=0,xe=0,Fe=null,$e=null;try{ke.bind(re,A),ke.bind(ue,F)}catch(t){e.error("events not supported "+re+","+ue+" on jQuery.swipe")}this.enable=function(){return this.disable(),ke.bind(re,A),ke.bind(ue,F),ke},this.disable=function(){return O(),ke},this.destroy=function(){O(),ke.data(P,null),ke=null},this.option=function(t,n){if("object"==typeof t)i=e.extend(i,t);else if(void 0!==i[t]){if(void 0===n)return i[t];i[t]=n}else{if(!t)return i;e.error("Option "+t+" does not exist on jQuery.swipe.options")}return null}}var n="left",o="right",a="up",s="down",r="in",l="out",c="none",d="auto",u="swipe",p="pinch",h="tap",m="doubletap",g="longtap",v="horizontal",f="vertical",C="all",S=10,y="start",b="move",k="end",_="cancel",D="ontouchstart"in window,I=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!D,w=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!D,P="TouchSwipe";e.fn.swipe=function(i){var n=e(this),o=n.data(P);if(o&&"string"==typeof i){if(o[i])return o[i].apply(o,Array.prototype.slice.call(arguments,1));e.error("Method "+i+" does not exist on jQuery.swipe")}else if(o&&"object"==typeof i)o.option.apply(o,arguments);else if(!(o||"object"!=typeof i&&i))return t.apply(this,arguments);return n},e.fn.swipe.version="1.6.18",e.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:".noSwipe",preventDefaultEvents:!0},e.fn.swipe.phases={PHASE_START:y,PHASE_MOVE:b,PHASE_END:k,PHASE_CANCEL:_},e.fn.swipe.directions={LEFT:n,RIGHT:o,UP:a,DOWN:s,IN:r,OUT:l},e.fn.swipe.pageScroll={NONE:c,HORIZONTAL:v,VERTICAL:f,AUTO:d},e.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:C}}),function(e){null==e.isNumeric&&(e.isNumeric=function(e){return null!=e&&e.constructor===Number}),null==e.isFunction&&(e.isFunction=function(e){return null!=e&&e instanceof Function});var t=e(window),i=e(document),n={defaultConfig:{animate:!1,cellW:100,cellH:100,delay:0,engine:"giot",fixSize:null,gutterX:15,gutterY:15,keepOrder:!1,selector:"> div",draggable:!1,cacheSize:!0,rightToLeft:!1,bottomToTop:!1,onGapFound:function(){},onComplete:function(){},onResize:function(){},onBlockDrag:function(){},onBlockMove:function(){},onBlockDrop:function(){},onBlockReady:function(){},onBlockFinish:function(){},onBlockActive:function(){},onBlockResize:function(){}},plugin:{},totalGrid:1,transition:!1,loadBlock:function(t,i){var n=i.runtime,o=n.gutterX,a=n.gutterY,s=n.cellH,r=n.cellW,l=null,c=e(t),d=c.data("active"),u=c.attr("data-position"),p=parseInt(c.attr("data-fixSize")),h=n.lastId+++"-"+n.totalGrid;if(c.hasClass("fw-float"))return null;c.attr({id:h,"data-delay":t.index}),i.animate&&this.transition&&this.setTransition(t,""),isNaN(p)&&(p=null),null==p&&(p=i.fixSize);var m=p?"ceil":"round";null==c.attr("data-height")&&c.attr("data-height",c.height()),null==c.attr("data-width")&&c.attr("data-width",c.width());var g=1*c.attr("data-height"),v=1*c.attr("data-width");i.cacheSize||(t.style.width="",v=c.width(),t.style.height="",g=c.height());var f=v?Math[m]((v+o)/r):0,C=g?Math[m]((g+a)/s):0;if(p||"auto"!=i.cellH||(c.width(r*f-o),t.style.height="",C=(g=c.height())?Math.round((g+a)/s):0),p||"auto"!=i.cellW||(c.height(s*C-a),t.style.width="",f=(v=c.width())?Math.round((v+o)/r):0),null!=p&&(f>n.limitCol||C>n.limitRow))l=null;else if(C&&C<n.minHoB&&(n.minHoB=C),f&&f<n.minWoB&&(n.minWoB=f),C>n.maxHoB&&(n.maxHoB=C),f>n.maxWoB&&(n.maxWoB=f),0==v&&(f=0),0==g&&(C=0),l={resize:!1,id:h,width:f,height:C,fixSize:p},u){u=u.split("-"),l.y=1*u[0],l.x=1*u[1],l.width=null!=p?f:Math.min(f,n.limitCol-l.x),l.height=null!=p?C:Math.min(C,n.limitRow-l.y);var S=l.y+"-"+l.x+"-"+l.width+"-"+l.height;d?(n.holes[S]={id:l.id,top:l.y,left:l.x,width:l.width,height:l.height},this.setBlock(l,i)):delete n.holes[S]}return null==c.attr("data-state")?c.attr("data-state","init"):c.attr("data-state","move"),i.onBlockReady.call(t,l,i),u&&d?null:l},setBlock:function(e,t){var i=t.runtime,n=i.gutterX,o=i.gutterY,a=e.height,s=e.width,r=i.cellH,l=i.cellW,c=e.x,d=e.y;t.rightToLeft&&(c=i.limitCol-c-s),t.bottomToTop&&(d=i.limitRow-d-a);var u={fixSize:e.fixSize,resize:e.resize,top:d*r,left:c*l,width:l*s-n,height:r*a-o};return u.top=1*u.top.toFixed(2),u.left=1*u.left.toFixed(2),u.width=1*u.width.toFixed(2),u.height=1*u.height.toFixed(2),e.id&&(i.blocks[e.id]=u),u},showBlock:function(t,i){var n=i.runtime,o=i.animate&&!this.transition?"animate":"css",a=n.blocks[t.id],s=e(t),r=this,l="move"!=s.attr("data-state"),c=l?"width 0.5s, height 0.5s":"top 0.5s, left 0.5s, width 0.5s, height 0.5s, opacity 0.5s";function d(){if(l&&s.attr("data-state","start"),i.animate&&r.transition&&r.setTransition(t,c),n.length-=1,a)a.fixSize&&(a.height=1*s.attr("data-height"),a.width=1*s.attr("data-width")),s.css({opacity:1,width:a.width,height:a.height}),s[o]({top:a.top,left:a.left}),null!=s.attr("data-nested")&&r.nestedGrid(t,i);else{var e=parseInt(t.style.height)||0,d=parseInt(t.style.width)||0,u=parseInt(t.style.left)||0,p=parseInt(t.style.top)||0;s[o]({left:u+d/2,top:p+e/2,width:0,height:0,opacity:0})}if(i.onBlockFinish.call(t,a,i),0==n.length){var h=i.animate?500:0;t.delay=setTimeout(function(){i.onComplete.call(t,a,i)},h)}}t.delay&&clearTimeout(t.delay),s.hasClass("fw-float")||(r.setTransition(t,""),t.style.position="absolute",i.onBlockActive.call(t,a,i),a&&a.resize&&i.onBlockResize.call(t,a,i),i.delay>0?t.delay=setTimeout(d,i.delay*s.attr("data-delay")):d())},nestedGrid:function(t,i){var n,o=e(t),s=i.runtime,r=o.attr("data-gutterX")||i.gutterX,l=o.attr("data-gutterY")||i.gutterY,c=o.attr("data-method")||"fitZone",d=o.attr("data-nested")||"> div",u=o.attr("data-cellH")||i.cellH,p=o.attr("data-cellW")||i.cellW,h=s.blocks[t.id];if(h)switch((n=new a(o)).reset({cellH:u,cellW:p,gutterX:1*r,gutterY:1*l,selector:d,cacheSize:!1}),c){case"fitHeight":n[c](h.height);break;case"fitWidth":n[c](h.width);break;case"fitZone":n[c](h.width,h.height)}},adjustBlock:function(t,i){var n=i.runtime,o=n.gutterX,a=n.gutterY,s=e("#"+t.id),r=n.cellH,l=n.cellW;"auto"==i.cellH&&(s.width(t.width*l-o),s[0].style.height="",t.height=Math.round((s.height()+a)/r))},adjustUnit:function(t,i,n){var o=n.gutterX,a=n.gutterY,s=n.runtime,r=n.cellW,l=n.cellH;if(e.isFunction(r)&&(r=r(t)),r*=1,!e.isNumeric(r)&&(r=1),e.isFunction(l)&&(l=l(i)),l*=1,!e.isNumeric(l)&&(l=1),e.isNumeric(t)){r<1&&(r*=t);var c=Math.max(1,Math.floor(t/r));e.isNumeric(o)||(o=(t-c*r)/Math.max(1,c-1),o=Math.max(0,o)),c=Math.floor((t+o)/r),s.cellW=(t+o)/Math.max(c,1),s.cellS=s.cellW/r,s.gutterX=o,s.limitCol=c}if(e.isNumeric(i)){l<1&&(l*=i);var d=Math.max(1,Math.floor(i/l));e.isNumeric(a)||(a=(i-d*l)/Math.max(1,d-1),a=Math.max(0,a)),d=Math.floor((i+a)/l),s.cellH=(i+a)/Math.max(d,1),s.cellS=s.cellH/l,s.gutterY=a,s.limitRow=d}e.isNumeric(t)||(r<1&&(r=s.cellH),s.cellW=1!=r?r*s.cellS:1,s.gutterX=o,s.limitCol=666666),e.isNumeric(i)||(l<1&&(l=s.cellW),s.cellH=1!=l?l*s.cellS:1,s.gutterY=a,s.limitRow=666666),s.keepOrder=n.keepOrder},resetGrid:function(e){e.blocks={},e.length=0,e.cellH=0,e.cellW=0,e.lastId=1,e.matrix={},e.totalCol=0,e.totalRow=0},setDraggable:function(t,n){var o=!1,a={startX:0,startY:0,top:0,left:0,handle:null,onDrop:function(){},onDrag:function(){},onStart:function(){}};e(t).each(function(){var t=e.extend({},a,n),s=t.handle||this,r=this,l=e(r),c=e(s);function d(e){e=e.originalEvent,o&&(e=e.changedTouches[0]),l.css({top:t.top-(t.startY-e.clientY),left:t.left-(t.startX-e.clientX)}),t.onDrag.call(r,e)}function u(e){e=e.originalEvent,o&&(e=e.changedTouches[0]),t.onDrop.call(r,e),i.unbind("mouseup touchend",u),i.unbind("mousemove touchmove",d)}"absolute"!=l.css("position")&&l.css("position","relative"),l.find("iframe, form, input, textarea, .ignore-drag").each(function(){e(this).on("touchstart mousedown",function(e){e.stopPropagation()})}),i.unbind("mouseup touchend",u),i.unbind("mousemove touchmove",d),c.unbind("mousedown touchstart").bind("mousedown touchstart",function(e){return e.stopPropagation(),(e=e.originalEvent).touches&&(o=!0,e=e.changedTouches[0]),2!=e.button&&3!=e.which&&(t.onStart.call(r,e),t.startX=e.clientX,t.startY=e.clientY,t.top=parseInt(l.css("top"))||0,t.left=parseInt(l.css("left"))||0,i.bind("mouseup touchend",u),i.bind("mousemove touchmove",d)),!1})})},setTransition:function(t,i){var n=t.style,o=e(t);!this.transition&&o.stop?o.stop():null!=n.webkitTransition?n.webkitTransition=i:null!=n.MozTransition?n.MozTransition=i:null!=n.msTransition?n.msTransition=i:null!=n.OTransition?n.OTransition=i:n.transition=i},getFreeArea:function(e,t,i){for(var n=Math.min(e+i.maxHoB,i.limitRow),o=Math.min(t+i.maxWoB,i.limitCol),a=o,s=n,r=i.matrix,l=e;l<s;++l)for(var c=t;c<o;++c)r[l+"-"+c]&&t<c&&c<a&&(a=c);for(l=e;l<n;++l)for(c=t;c<a;++c)r[l+"-"+c]&&e<l&&l<s&&(s=l);return{top:e,left:t,width:a-t,height:s-e}},setWallSize:function(e,t){var i=e.totalRow,n=e.totalCol,o=e.gutterY,a=e.gutterX,s=e.cellH,r=e.cellW,l=Math.max(0,r*n-a),c=Math.max(0,s*i-o);t.attr({"data-total-col":n,"data-total-row":i,"data-wall-width":Math.ceil(l),"data-wall-height":Math.ceil(c)}),e.limitCol<e.limitRow&&!t.attr("data-height")&&t.height(Math.ceil(c))}},o={giot:function(e,t){var i=t.runtime,o=i.limitRow,a=i.limitCol,s=0,r=0,l=i.totalCol,c=i.totalRow,d={},u=i.holes,p=null,h=i.matrix,m=Math.max(a,o),g=null,v=null,f=a<o?1:0,C=null,S=Math.min(a,o);function y(e,t,i,n,o){for(var a=t;a<t+o;){for(var s=i;s<i+n;)h[a+"-"+s]=e,++s>l&&(l=s);++a>c&&(c=a)}}for(var b in u)u.hasOwnProperty(b)&&y(u[b].id||!0,u[b].top,u[b].left,u[b].width,u[b].height);for(var k=0;k<m&&e.length;++k){f?r=k:s=k,C=null;for(var _=0;_<S&&e.length;++_)if(p=null,f?s=_:r=_,!i.matrix[r+"-"+s]){if(g=n.getFreeArea(r,s,i),null==t.fixSize){if(C&&!f&&i.minHoB>g.height){C.height+=g.height,C.resize=!0,y(C.id,C.y,C.x,C.width,C.height),n.setBlock(C,t);continue}if(C&&f&&i.minWoB>g.width){C.width+=g.width,C.resize=!0,y(C.id,C.y,C.x,C.width,C.height),n.setBlock(C,t);continue}}if(i.keepOrder)(p=e.shift()).resize=!0;else{for(b=0;b<e.length;++b)if(!(e[b].height>g.height||e[b].width>g.width)){p=e.splice(b,1)[0];break}if(null==p&&null==t.fixSize)for(b=0;b<e.length;++b)if(null==e[b].fixSize){(p=e.splice(b,1)[0]).resize=!0;break}}if(null!=p)p.resize&&(f?(p.width=g.width,"auto"==t.cellH&&n.adjustBlock(p,t),p.height=Math.min(p.height,g.height)):(p.height=g.height,p.width=Math.min(p.width,g.width))),d[p.id]={id:p.id,x:s,y:r,width:p.width,height:p.height,resize:p.resize,fixSize:p.fixSize},y((C=d[p.id]).id,C.y,C.x,C.width,C.height),n.setBlock(C,t);else{v={x:s,y:r,fixSize:0};if(f){v.width=g.width,v.height=0;for(var D=s-1,I=r;h[I+"-"+D];)h[I+"-"+s]=!0,v.height+=1,I+=1}else{v.height=g.height,v.width=0;for(I=r-1,D=s;h[I+"-"+D];)h[r+"-"+D]=!0,v.width+=1,D+=1}t.onGapFound(n.setBlock(v,t),t)}}}i.matrix=h,i.totalRow=c,i.totalCol=l}};function a(i){var a=e(i);"static"==a.css("position")&&a.css("position","relative");var s=Number.MAX_VALUE,r=this;n.totalGrid+=1;var l=e.extend({},n.defaultConfig),c={arguments:null,blocks:{},events:{},matrix:{},holes:{},cellW:0,cellH:0,cellS:1,filter:"",lastId:0,length:0,maxWoB:0,maxHoB:0,minWoB:s,minHoB:s,running:0,gutterX:15,gutterY:15,totalCol:0,totalRow:0,limitCol:666666,limitRow:666666,sortFunc:null,keepOrder:!1};l.runtime=c,c.totalGrid=n.totalGrid;var d=document.body.style;function u(t){c.gutterX,c.gutterY;var i=c.cellH,o=c.cellW,a=e(t),s=a.find(a.attr("data-handle"));n.setDraggable(t,{handle:s[0],onStart:function(e){l.animate&&n.transition&&n.setTransition(this,""),a.css("z-index",9999).addClass("fw-float"),l.onBlockDrag.call(t,e)},onDrag:function(e,n){var s=a.position(),d=Math.round(s.top/i),u=Math.round(s.left/o),p=Math.round(a.width()/o),h=Math.round(a.height()/i);d=Math.min(Math.max(0,d),c.limitRow-h),u=Math.min(Math.max(0,u),c.limitCol-p),r.setHoles({top:d,left:u,width:p,height:h}),r.refresh(),l.onBlockMove.call(t,e)},onDrop:function(n){var s,d,u,p,h=a.position(),m=Math.round(h.top/i),g=Math.round(h.left/o),v=Math.round(a.width()/o),f=Math.round(a.height()/i);for(m=Math.min(Math.max(0,m),c.limitRow-f),g=Math.min(Math.max(0,g),c.limitCol-v),a.removeClass("fw-float"),a.css({zIndex:"auto",top:m*i,left:g*o}),d=0;d<f;++d)for(s=0;s<v;++s)u=d+m+"-"+(s+g),(p=c.matrix[u])&&1!=p&&e("#"+p).removeAttr("data-position");c.holes={},a.attr({"data-width":a.width(),"data-height":a.height(),"data-position":m+"-"+g}),r.refresh(),l.onBlockDrop.call(t,n)}})}for(var p in n.transition||(null!=d.webkitTransition||null!=d.MozTransition||null!=d.msTransition||null!=d.OTransition||null!=d.transition)&&(n.transition=!0),e.extend(r,{addCustomEvent:function(e,t){var i=c.events;return!i[e=e.toLowerCase()]&&(i[e]=[]),t.eid=i[e].length,i[e].push(t),this},appendBlock:function(t){var i=e(t).appendTo(a),s=null,r=[];c.arguments&&(e.isFunction(c.sortFunc)&&i.sort(c.sortFunc),i.each(function(e,t){t.index=++e,(s=n.loadBlock(t,l))&&r.push(s)}),o[l.engine](r,l),n.setWallSize(c,a),c.length=i.length,i.each(function(e,t){n.showBlock(t,l),(l.draggable||t.getAttribute("data-draggable"))&&u(t)}))},appendHoles:function(e){var t,i=[].concat(e),n={};for(t=0;t<i.length;++t)n=i[t],c.holes[n.top+"-"+n.left+"-"+n.width+"-"+n.height]=n;return this},container:a,destroy:function(){a.find(l.selector).removeAttr("id").each(function(t,i){$item=e(i);var n=1*$item.attr("data-width")||"",o=1*$item.attr("data-height")||"";$item.width(n).height(o).css({position:"static"})})},fillHoles:function(e){if(0==arguments.length)c.holes={};else{var t,i=[].concat(e),n={};for(t=0;t<i.length;++t)n=i[t],delete c.holes[n.top+"-"+n.left+"-"+n.width+"-"+n.height]}return this},filter:function(e){return c.filter=e,c.arguments&&this.refresh(),this},fireEvent:function(e,t,i){var n=c.events;if(n[e=e.toLowerCase()]&&n[e].length)for(var o=0;o<n[e].length;++o)n[e][o].call(this,t,i);return this},fitHeight:function(e){e=e||(a.height()||t.height());this.fitZone("auto",e),c.arguments=arguments},fitWidth:function(e){e=e||(a.width()||t.width());this.fitZone(e,"auto"),c.arguments=arguments},fitZone:function(i,s){var d=a.find(l.selector).removeAttr("id"),p=null,h=[];s=s||(a.height()||t.height()),i=i||(a.width()||t.width()),c.arguments=arguments,n.resetGrid(c),n.adjustUnit(i,s,l),c.filter?(d.data("active",0),d.filter(c.filter).data("active",1)):d.data("active",1),e.isFunction(c.sortFunc)&&d.sort(c.sortFunc),d.each(function(t,i){var o=e(i);i.index=++t,(p=n.loadBlock(i,l))&&o.data("active")&&h.push(p)}),r.fireEvent("onGridReady",a,l),o[l.engine](h,l),n.setWallSize(c,a),r.fireEvent("onGridArrange",a,l),c.length=d.length,d.each(function(e,t){n.showBlock(t,l),(l.draggable||t.getAttribute("data-draggable"))&&u(t)})},fixPos:function(t){return e(t.block).attr({"data-position":t.top+"-"+t.left}),this},fixSize:function(t){return null!=t.height&&e(t.block).attr({"data-height":t.height}),null!=t.width&&e(t.block).attr({"data-width":t.width}),this},prepend:function(e){return a.prepend(e),c.arguments&&this.refresh(),this},refresh:function(){var e=arguments.length?arguments:c.arguments,t=c.arguments;return(t?t.callee:this.fitWidth).apply(this,Array.prototype.slice.call(e,0)),this},reset:function(t){return e.extend(l,t),this},setHoles:function(e){var t,i=[].concat(e),n={};for(c.holes={},t=0;t<i.length;++t)n=i[t],c.holes[n.top+"-"+n.left+"-"+n.width+"-"+n.height]=n;return this},sortBy:function(e){return c.sortFunc=e,c.arguments&&this.refresh(),this},unFilter:function(){return delete c.filter,this.refresh(),this}}),a.attr("data-min-width",80*Math.floor(t.width()/80)),n.plugin)n.plugin.hasOwnProperty(p)&&n.plugin[p].call(r,l,a);t.resize(function(){c.running||(c.running=1,setTimeout(function(){c.running=0,l.onResize.call(r,a)},122),a.attr("data-min-width",80*Math.floor(t.width()/80)))})}a.addConfig=function(t){e.extend(n.defaultConfig,t)},a.createEngine=function(t){e.extend(o,t)},a.createPlugin=function(t){e.extend(n.plugin,t)},a.getMethod=function(e){return n[e]},window.Freewall=window.freewall=a}(window.Zepto||window.jQuery),
/*!
 * imagesLoaded PACKAGED v3.1.8
 * JavaScript is all like "You images are done yet or what?"
 * MIT License
 */
/*!
 * EventEmitter v4.2.6 - git.io/ee
 * Oliver Caldwell
 * MIT license
 * @preserve
 */
function(){function e(){}var t=e.prototype,i=this,n=i.EventEmitter;function o(e,t){for(var i=e.length;i--;)if(e[i].listener===t)return i;return-1}function a(e){return function(){return this[e].apply(this,arguments)}}t.getListeners=function(e){var t,i,n=this._getEvents();if("object"==typeof e)for(i in t={},n)n.hasOwnProperty(i)&&e.test(i)&&(t[i]=n[i]);else t=n[e]||(n[e]=[]);return t},t.flattenListeners=function(e){var t,i=[];for(t=0;t<e.length;t+=1)i.push(e[t].listener);return i},t.getListenersAsObject=function(e){var t,i=this.getListeners(e);return i instanceof Array&&((t={})[e]=i),t||i},t.addListener=function(e,t){var i,n=this.getListenersAsObject(e),a="object"==typeof t;for(i in n)n.hasOwnProperty(i)&&-1===o(n[i],t)&&n[i].push(a?t:{listener:t,once:!1});return this},t.on=a("addListener"),t.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},t.once=a("addOnceListener"),t.defineEvent=function(e){return this.getListeners(e),this},t.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},t.removeListener=function(e,t){var i,n,a=this.getListenersAsObject(e);for(n in a)a.hasOwnProperty(n)&&-1!==(i=o(a[n],t))&&a[n].splice(i,1);return this},t.off=a("removeListener"),t.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},t.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},t.manipulateListeners=function(e,t,i){var n,o,a=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(n=i.length;n--;)a.call(this,t,i[n]);else for(n in t)t.hasOwnProperty(n)&&(o=t[n])&&("function"==typeof o?a.call(this,n,o):s.call(this,n,o));return this},t.removeEvent=function(e){var t,i=typeof e,n=this._getEvents();if("string"===i)delete n[e];else if("object"===i)for(t in n)n.hasOwnProperty(t)&&e.test(t)&&delete n[t];else delete this._events;return this},t.removeAllListeners=a("removeEvent"),t.emitEvent=function(e,t){var i,n,o,a=this.getListenersAsObject(e);for(o in a)if(a.hasOwnProperty(o))for(n=a[o].length;n--;)!0===(i=a[o][n]).once&&this.removeListener(e,i.listener),i.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,i.listener);return this},t.trigger=a("emitEvent"),t.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},t.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},t._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},t._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return i.EventEmitter=n,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}.call(this),
/*!
 * eventie v1.0.4
 * event binding helper
 *   eventie.bind( elem, 'click', myFn )
 *   eventie.unbind( elem, 'click', myFn )
 */
function(e){var t=document.documentElement,i=function(){};function n(t){var i=e.event;return i.target=i.target||i.srcElement||t,i}t.addEventListener?i=function(e,t,i){e.addEventListener(t,i,!1)}:t.attachEvent&&(i=function(e,t,i){e[t+i]=i.handleEvent?function(){var t=n(e);i.handleEvent.call(i,t)}:function(){var t=n(e);i.call(e,t)},e.attachEvent("on"+t,e[t+i])});var o=function(){};t.removeEventListener?o=function(e,t,i){e.removeEventListener(t,i,!1)}:t.detachEvent&&(o=function(e,t,i){e.detachEvent("on"+t,e[t+i]);try{delete e[t+i]}catch(n){e[t+i]=void 0}});var a={bind:i,unbind:o};"function"==typeof define&&define.amd?define("eventie/eventie",a):e.eventie=a}(this),
/*!
 * imagesLoaded v3.1.8
 * JavaScript is all like "You images are done yet or what?"
 * MIT License
 */
function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(i,n){return t(e,i,n)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,i){var n=e.jQuery,o=e.console,a=void 0!==o;function s(e,t){for(var i in t)e[i]=t[i];return e}var r=Object.prototype.toString;function l(e){var t=[];if(function(e){return"[object Array]"===r.call(e)}(e))t=e;else if("number"==typeof e.length)for(var i=0,n=e.length;i<n;i++)t.push(e[i]);else t.push(e);return t}function c(e,t,i){if(!(this instanceof c))return new c(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=l(e),this.options=s({},this.options),"function"==typeof t?i=t:s(this.options,t),i&&this.on("always",i),this.getImages(),n&&(this.jqDeferred=new n.Deferred);var o=this;setTimeout(function(){o.check()})}function d(e){this.img=e}function u(e){this.src=e}return c.prototype=new t,c.prototype.options={},c.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;e<t;e++){var i=this.elements[e];"IMG"===i.nodeName&&this.addImage(i);var n=i.nodeType;if(n&&(1===n||9===n||11===n))for(var o=i.querySelectorAll("img"),a=0,s=o.length;a<s;a++){var r=o[a];this.addImage(r)}}},c.prototype.addImage=function(e){var t=new d(e);this.images.push(t)},c.prototype.check=function(){var e=this,t=0,i=this.images.length;if(this.hasAnyBroken=!1,i)for(var n=0;n<i;n++){var s=this.images[n];s.on("confirm",r),s.check()}else this.complete();function r(n,s){return e.options.debug&&a&&o.log("confirm",n,s),e.progress(n),++t===i&&e.complete(),!0}},c.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},c.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var i=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[i](t)}})},n&&(n.fn.imagesLoaded=function(e,t){return new c(this,e,t).jqDeferred.promise(n(this))}),d.prototype=new t,d.prototype.check=function(){var e=new u(this.img.src);if(e.isConfirmed)this.confirm(e.isLoaded,"cached was confirmed");else if(this.img.complete&&void 0!==this.img.naturalWidth)this.confirm(0!==this.img.naturalWidth,"naturalWidth");else{var t=this;e.on("confirm",function(e,i){return t.confirm(e.isLoaded,i),!0}),e.check()}},d.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)},u.prototype=new t,u.prototype.check=function(){if(!this.isChecked){var e=new Image;i.bind(e,"load",this),i.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},u.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},u.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},u.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},u.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},u.prototype.unbindProxyEvents=function(e){i.unbind(e.target,"load",this),i.unbind(e.target,"error",this)},c});var ajaxQueue=$({}),currentRequest=null;vagaro={},function(e){vagaro.ajax=function(){this.datamodel={},this.datamodel.url="",this.datamodel.data="",this.datamodel.callback="",this.datamodel.Token="",this.datamodel.Error,this.datamodel.async=!0,this.datamodel.ErrorMessage="An Error Has Occurred",this.datamodel.GroupToken="",this.datamodel.IsNewVagaroAPI=!1,this.datamodel.Proxy=!1,this.datamodel.RouteParameter={},this.datamodel.QueryStringParameter={},this.datamodel.merchantId="",this.datamodel.userId="",this.Post=function(){if("undefined"==typeof keepAlive&&e("#IsWaitforKeepALive").length>0&&void 0!==e("#IsWaitforKeepALive").val()&&"true"===e("#IsWaitforKeepALive").val().toLowerCase()){var t=e(this),i=this.datamodel.url,n=this.datamodel.data,o=this.datamodel.callback,a=this.datamodel.Token,s=this.datamodel.Error,r=this.datamodel.async,l=this.datamodel.ErrorMessage,c=this.datamodel.GroupToken,d=this.datamodel.Proxy,u=this.datamodel.RouteParameter={},p=this.datamodel.QueryStringParameter={},h=this.datamodel.merchantId="",m=this.datamodel.userId="";setTimeout(function(){t[0].datamodel.url=i,t[0].datamodel.data=n,t[0].datamodel.callback=o,t[0].datamodel.Token=a,t[0].datamodel.Error=s,t[0].datamodel.async=r,t[0].datamodel.ErrorMessage=l,t[0].datamodel.GroupToken=c,t[0].datamodel.Proxy=d,t[0].datamodel.RouteParameter=u,t[0].datamodel.QueryStringParameter=p,t[0].datamodel.merchantId=h,t[0].datamodel.userId=m,t[0].Post()},500)}else{var g=this.datamodel;g.async="undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()&&"undefined"!=typeof businessID&&null!=businessID&&(156973===parseInt(businessID)||383713===parseInt(businessID)||377983===parseInt(businessID)||430616===parseInt(businessID)||400713===parseInt(businessID))||g.async;var v={};1==g.Proxy?(v.Data=""+JSON.stringify(g.data),v.Token=g.Token,v.IsPublic=g.IsPublic,v.RouteParameter=g.RouteParameter,v.QueryStringParameter=g.QueryStringParameter):1==g.IsNewVagaroAPI?v=g.data:(v.Data=""+JSON.stringify(g.data),v.Token=g.Token);var f=this.datamodel.GroupToken;e.ajax({url:1==g.Proxy?this.seturl(2):this.seturl(1),type:"POST",contentType:"application/json; charset=utf-8",xhr:function(){return 1==g.IsNewVagaroAPI&&null!=window.childWindow&&g.Token.indexOf("http")>-1&&g.Token.indexOf("api")>-1?new window.childWindow.XMLHttpRequest:new window.XMLHttpRequest},beforeSend:function(t){try{"function"==typeof EncH&&0==g.IsNewVagaroAPI&&t.setRequestHeader("H",EncH())}catch(e){}if(0==g.IsNewVagaroAPI){if("undefined"!=typeof getek&&"function"==typeof getek)t.setRequestHeader("K",getek());else try{void 0!==window.parent.getek&&"function"==typeof window.parent.getek&&t.setRequestHeader("K",window.parent.getek())}catch(e){}if("undefined"!=typeof getek&&"function"==typeof getek)t.setRequestHeader("I",getei());else try{void 0!==window.parent.getek&&"function"==typeof window.parent.getek&&t.setRequestHeader("I",window.parent.getei())}catch(e){}if("undefined"!=typeof getek&&"function"==typeof getek)t.setRequestHeader("Val",EncIV());else try{void 0!==window.parent.getek&&"function"==typeof window.parent.getek&&t.setRequestHeader("Val",window.parent.EncIV())}catch(e){}}if("undefined"!=typeof keepAlive&&t.setRequestHeader("keepAlive",keepAlive),1==e("#hdnToken1").length&&void 0!==e("#hdnToken1").val()&&t.setRequestHeader("token1",e("#hdnToken1").val()),1==e("#hdnToken2").length&&void 0!==e("#hdnToken2").val()&&t.setRequestHeader("token2",e("#hdnToken2").val()),1==e("#hdnToken0").length&&void 0!==e("#hdnToken0").val()&&t.setRequestHeader("token0",e("#hdnToken0").val()),void 0!==f&&null!=f&&""!=f?t.setRequestHeader("grouptoken",f):"undefined"!=typeof groupID&&t.setRequestHeader("grouptoken",groupID),"undefined"!=typeof myAccountUserGroupID&&t.setRequestHeader("usergrouptoken",myAccountUserGroupID),1==e("#hdnCheckInApp").length&&void 0!==e("#hdnCheckInApp").val()&&t.setRequestHeader("checkinApp",e("#hdnCheckInApp").val()),1==e("#hdnIsBrandedApp").length&&void 0!==e("#hdnIsBrandedApp").val()&&t.setRequestHeader("brandedApp",e("#hdnIsBrandedApp").val()),1==g.IsNewVagaroAPI&&g.Token.indexOf("http")>-1&&g.Token.indexOf("api")>-1&&(1==e("#hdnCalendarVersion").length&&void 0!==e("#hdnCalendarVersion").val()?(t.setRequestHeader("Version",e("#hdnCalendarVersion").val()),t.setRequestHeader("Device","website"),t.setRequestHeader("DeviceID","calendar")):1==e("#hdnVersionDetail").length&&void 0!==e("#hdnVersionDetail").val()&&(t.setRequestHeader("Version",e("#hdnVersionDetail").val()),t.setRequestHeader("Device","website"),t.setRequestHeader("DeviceID","masterpage")),("undefined"!=typeof PublicBusinessID&&"undefined"!=typeof UserID||"undefined"!=typeof businessID&&"undefined"!=typeof UserID||"undefined"!=typeof BusinessID&&"undefined"!=typeof UserID||"undefined"!=typeof SecuBusinessID&&"undefined"!=typeof SecuUserID)&&getheader(t)),"undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget())"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&t.setRequestHeader("widgetcookievalue",widgetcookievalue);else try{void 0!==window.parent._common&&void 0!==window.parent._common.IsCookieLessWidget&&window.parent._common.IsCookieLessWidget()&&"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&t.setRequestHeader("widgetcookievalue",widgetcookievalue)}catch(e){}try{"undefined"!=typeof _freeCardReader&&void 0!==_freeCardReader.userdata&&null!=_freeCardReader.userdata&&void 0!==_freeCardReader.userdata.BusinessId&&t.setRequestHeader("businessId",_freeCardReader.userdata.BusinessId),"undefined"!=typeof _freeCardReader&&void 0!==_freeCardReader.userdata&&null!=_freeCardReader.userdata&&void 0!==_freeCardReader.userdata.UserId&&t.setRequestHeader("loggedInUserId",_freeCardReader.userdata.UserId)}catch(e){}try{void 0!==g.merchantId&&null!=g.merchantId&&""!=g.merchantId&&t.setRequestHeader("merchantId",g.merchantId),void 0!==g.userId&&null!=g.userId&&""!=g.userId&&t.setRequestHeader("userId",g.userId)}catch(e){}try{"undefined"!=vm&&"undefined"!=vm.V2VTransferCoreApiHeader&&"undefined"!=vm.V2VTransferCoreApiHeader._vdpb_id&&t.setRequestHeader("_vdpb_id",vm.V2VTransferCoreApiHeader._vdpb_id),"undefined"!=vm&&"undefined"!=vm.V2VTransferCoreApiHeader&&"undefined"!=vm.V2VTransferCoreApiHeader._vdpu_id&&t.setRequestHeader("_vdpu_id",vm.V2VTransferCoreApiHeader._vdpu_id)}catch(e){}},async:g.async,data:JSON.stringify(v),dataType:"json"}).done(function(e){if(1==g.IsNewVagaroAPI)(t=void 0!==e&&null!=e&&void 0!==e.CustomCode&&null!=e.CustomCode&&(g.Token.indexOf("http")>-1&&g.Token.indexOf("api")>-1||g.Token.indexOf("myaccount")>-1))&&1032==e.CustomCode?window.location.href="/ScheduleMaintenance.aspx":t&&1036==e.CustomCode?window.location.reload():t&&1034==e.CustomCode?"function"==typeof ShowHideFailedMessageCommon?ShowHideFailedMessageCommon(e.Message):vagaro.alert({message:e.Message,title:"Invalid!"}):g.callback(e);else if(1==g.Proxy){var t;(t=void 0!==e&&null!=e&&void 0!==e.responseCode&&null!=e.responseCode&&(g.Token.indexOf("http")>-1&&g.Token.indexOf("api")>-1||g.Token.indexOf("myaccount")>-1))&&1032==e.responseCode?window.location.href="/ScheduleMaintenance.aspx":t&&1036==e.responseCode?window.location.reload():t&&1034==e.responseCode?"function"==typeof ShowHideFailedMessageCommon?ShowHideFailedMessageCommon(e.message):vagaro.alert({message:e.message,title:"Invalid!"}):g.callback(e)}else g.callback(e.d)}).fail(function(e){try{if(403===e.status)return void location.reload(!0)}catch(e){}if(void 0!==e&&null!=e&&999==e.status)return vagaro.reloadDetailPage(e.status,g.Token),void ShowLoader(!1);if(void 0===e||null==e||0!=e.status||"undefined"==typeof vgAppicationType||1!=vgAppicationType){if(""!=g.ErrorMessage){var t="",i="undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()&&"undefined"!=typeof businessID&&null!=businessID&&(156973===parseInt(businessID)||383713===parseInt(businessID)||377983===parseInt(businessID)||430616===parseInt(businessID)||400713===parseInt(businessID));try{t=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase().match(/com.vagaro.iospro/i),ShowLoader(!1)}catch(e){}!t&&!i&&"websiteapi/homepage/getupcomingappintmentdata"!=g.Token&&"websiteapi/homepage/getallpetdetails"!=g.Token&&"websiteapi/homepage/getupcominglivestreamclasses"!=g.Token&&g.Token.toLowerCase().indexOf("addloginamplitude")<0&&"addbusiness/signupbusinessailog"!=g.Token&&vagaro.alert({message:g.ErrorMessage+g.Token,title:"Oops!"})}void 0!==g.Error&&g.Error(e)}})}},this.PostQue=function(){if("undefined"==typeof keepAlive&&e("#IsWaitforKeepALive").length>0&&void 0!==e("#IsWaitforKeepALive").val()&&"true"===e("#IsWaitforKeepALive").val().toLowerCase()){var t=e(this),i=this.datamodel.url,n=this.datamodel.data,o=this.datamodel.callback,a=this.datamodel.Token,s=this.datamodel.Error,r=this.datamodel.async,l=this.datamodel.ErrorMessage;setTimeout(function(){t[0].datamodel.url=i,t[0].datamodel.data=n,t[0].datamodel.callback=o,t[0].datamodel.Token=a,t[0].datamodel.Error=s,t[0].datamodel.async=r,t[0].datamodel.ErrorMessage=l,t[0].PostQue()},500)}else{var c=this.datamodel,d={};1==c.IsNewVagaroAPI?d=c.data:(d.Data=""+JSON.stringify(c.data),d.Token=c.Token),this.que({url:this.seturl(1),type:"POST",contentType:"application/json; charset=utf-8",beforeSend:function(t){try{"function"==typeof EncH&&t.setRequestHeader("H",EncH())}catch(e){}if(0==c.IsNewVagaroAPI&&(t.setRequestHeader("K",getek()),t.setRequestHeader("I",getei()),t.setRequestHeader("Val",EncIV())),"undefined"!=typeof keepAlive&&t.setRequestHeader("keepAlive",keepAlive),1==e("#hdnToken1").length&&void 0!==e("#hdnToken1").val()&&t.setRequestHeader("token1",e("#hdnToken1").val()),1==e("#hdnToken2").length&&void 0!==e("#hdnToken2").val()&&t.setRequestHeader("token2",e("#hdnToken2").val()),1==e("#hdnToken0").length&&void 0!==e("#hdnToken0").val()&&t.setRequestHeader("token0",e("#hdnToken0").val()),1==e("#hdnCheckInApp").length&&void 0!==e("#hdnCheckInApp").val()&&t.setRequestHeader("checkinApp",e("#hdnCheckInApp").val()),"undefined"!=typeof groupID&&t.setRequestHeader("grouptoken",groupID),"undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget())"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&t.setRequestHeader("widgetcookievalue",widgetcookievalue);else try{void 0!==window.parent._common&&void 0!==window.parent._common.IsCookieLessWidget&&window.parent._common.IsCookieLessWidget()&&"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&t.setRequestHeader("widgetcookievalue",widgetcookievalue)}catch(e){}},data:JSON.stringify(d),dataType:"json",success:function(e){1==c.IsNewVagaroAPI?c.callback(e):c.callback(e.d)},error:function(e){try{if(403===e.status)return void location.reload(!0)}catch(e){}if(void 0!==e&&null!=e&&999==e.status)return vagaro.reloadDetailPage(e.status,c.Token),void ShowLoader(!1);if("abort"!=e.statusText){if(""!=c.ErrorMessage){try{ShowLoader(!1)}catch(e){}c.Token.toLowerCase().indexOf("addloginamplitude")<0&&vagaro.alert({message:c.ErrorMessage+c.Token,title:"Oops!"})}void 0!==c.Error&&c.Error(e)}}})}},this.que=function(t){var i=t.complete;ajaxQueue.clearQueue(),currentRequest&&currentRequest.abort(),ajaxQueue.queue(function(n){t.complete=function(){i&&i.apply(this,arguments),n()},currentRequest=e.ajax(t)})},this.Get=function(){e.ajax({url:this.seturl(this.datamodel.url),type:"GET",data:JSON.stringify(this.datamodel.data),dataType:"json"}).done(function(e){this.datamodel.callback(e)}).fail(function(e){this.datamodel.ErrorMessage.length>0&&(ShowLoader(!1),vagaro.alert({message:Model.ErrorMessage,title:"Oops!"})),"undefined"!=this.datamodel.Error&&this.datamodel.Error(e)})},this.GetDirectV2=function(){var t=this,i=t.datamodel.url;if(t.datamodel.RouteParameter&&"object"==typeof t.datamodel.RouteParameter&&Object.keys(t.datamodel.RouteParameter).length>0)for(var n in t.datamodel.RouteParameter)if(t.datamodel.RouteParameter.hasOwnProperty(n)){var o=t.datamodel.RouteParameter[n];null!=o&&""!==o&&(i+=(i.endsWith("/")?"":"/")+encodeURIComponent(o))}if(t.datamodel.QueryStringParameter&&"object"==typeof t.datamodel.QueryStringParameter&&Object.keys(t.datamodel.QueryStringParameter).length>0){var a=e.param(t.datamodel.QueryStringParameter);i+=(i.includes("?")?"&":"?")+a}var s={};t.datamodel.merchantId&&(s.MerchantId=t.datamodel.merchantId),t.datamodel.userId&&(s.UserId=t.datamodel.userId),void 0!==t.datamodel.ErrorMessage&&(s.IsErrorMsgReq=""!==t.datamodel.ErrorMessage?"true":"false"),e.ajax({url:i,type:"GET",headers:s,dataType:"json"}).done(function(e){"function"==typeof t.datamodel.callback&&t.datamodel.callback(e)}).fail(function(e){t.datamodel.ErrorMessage&&t.datamodel.ErrorMessage.length>0&&(ShowLoader(!1),vagaro.alert({message:t.datamodel.ErrorMessage,title:"Oops!"})),"function"==typeof t.datamodel.Error&&t.datamodel.Error(e)})},this.seturl=function(e){var t=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";if(t.indexOf("webcache.googleusercontent.com")>-1&&"vagaro.com"==DomainName&&(t="https://www.vagaro.com/"),1==e){var i="";if("undefined"!=typeof regionId&&""!=regionId&&(i=regionId+"/"),1==this.datamodel.IsNewVagaroAPI)this.datamodel.Token.indexOf("http")>-1&&this.datamodel.Token.indexOf("api")>-1?t=this.datamodel.Token:("undefined"!=typeof vagaroSiteBuilder&&null!=vagaroSiteBuilder&&void 0!==vagaroSiteBuilder.BaseURLOfWebSiteBuilderAPI&&t.indexOf(vagaroSiteBuilder.BaseURLOfWebSiteBuilderAPI)>-1&&(t=vagaroSiteBuilder.BaseURLOfVagaroAPI),t=t+i+this.datamodel.Token);else try{t=void 0!==this.datamodel.Token&&null!=this.datamodel.Token&&""!=this.datamodel.Token?t+i+"WebServices/MySampleService.asmx/PageMethodsProxyJson?token="+this.datamodel.Token:t+i+"WebServices/MySampleService.asmx/PageMethodsProxyJson"}catch(e){t=t+i+"WebServices/MySampleService.asmx/PageMethodsProxyJson"}}else if(2==e){i="";"undefined"!=typeof regionId&&""!=regionId&&(i=regionId+"/"),t=t+i+"api/proxy"}else try{t=void 0!==this.datamodel.Token&&null!=this.datamodel.Token&&""!=this.datamodel.Token?t+i+"WebServices/MySampleService.asmx/PageMethodsProxyJson?token="+this.datamodel.Token:t+i+"WebServices/MySampleService.asmx/PageMethodsProxyJson"}catch(e){t=t+i+"WebServices/MySampleService.asmx/PageMethodsProxyJson"}return t}},vagaro.alert=function(e){"undefined"!=typeof bootbox?bootbox.alert(e):ShowPopupAlert(e.message,1,null)},vagaro.alertsmall=function(e){"undefined"!=typeof bootbox?bootbox.alertsmall(e):ShowPopupAlert(e.message,1,null)},vagaro.alertmidium=function(e,t){"undefined"!=typeof bootbox?bootbox.alert({className:"vagaro-midium-popup",message:e,title:"Alert",callback:"function"==typeof t?t:null}):ShowPopupAlert(e.message,1,null)},vagaro.popup=function(e){"undefined"!=typeof bootbox?bootbox.dialog(e):ShowPopupAlert(e.message,4,null)},vagaro.confirm=function(e){"undefined"!=typeof bootbox&&bootbox.confirm(e)},vagaro.confirmsmall=function(e){"undefined"!=typeof bootbox&&bootbox.confirm(e,e.success.label,e.success.label)},vagaro.prompt=function(){"undefined"!=typeof bootbox&&bootbox.prompt(options)},vagaro.reloadDetailPage=function(e,t){999===e&&["SaveSettingHistory","GetServiceProviderDetails","GetServicesDetails","GetShoppingCartInventory","GetShoppingCartProductType","GetShoppingCartBrand","GetShoppingCartPopupData","GetShoppingCartPopupDataNew","AddToCart","MembershipAddToCart","GiftCertificateAddToCart","ServiceAddToCart","ClassAddToCart","UpdateCartItem","UpdateMutipleCartItem","GetNextAvailableDateWorkShop","RemoveCartItem","ValidateShoppingCartData","GetCartCount","GetEventCartDetail","GetGiftcertificateCategory","GetReturnPolicy","GetAppointmentCancellationPolicy","BindSalonServiceComboForGC","GetGiftCertificateExpMonth","GetGiftCertificateImgByCategory","GetShopDetailStyle","LikeStyle","GetStyleImagesCommaSeparated","GetBookRequestButtonText","GetDealDataWithServicesByPromotionID","ShareSPorStyle","GetCustomerNameByEmailId","GetAvailableDates","SendEmailtoSP","ShowFavorites","GetAvailableMultiAppointments","GetUserCCDetailsByOnlyUserID","GetStatesByCountryID","GetStatesByMultipleCountryID","CheckUserExistsByUserId","GetValidatePromotionsDetails","GetAvailableDatesForEvents","GetEventDetailAndAvailableDates","CheckUserExistanceInEvent","GetEventDetailForReschedule","GetEventDetailForRescheduleForWorkShop","GetClassCancellationPolicy","GetMembershipAndPackageByBusinessId","GetOnlineCheckoutTipSetting","GetOnlineBookingTabDetail","GetGCPackageAndPointForOnlineCheckout","RemoveCehckOutItem","ValidatePromocodeAndGetDetails","GetOnlineInvoiceBusinessUserDetailsByInvoiceId","GetAllPetDetails","GetMyAppintmentData","GetMyProducts","GetMyAccountFavoriteBusinesses","GetBusinessPoints","GetCustomerPoints","GetUserCompleteAppointmentsForReviews","GetGiftCertificateDetails","GetBusinessMembershipNew","GetMyAccountInvoices","GetFamilyAndFriendsDetailsByUserID"].indexOf(t)>-1&&location.reload(!0)},vagaro.ajaxCall=function(e,t,i,n,o,a,s,r){var l=new vagaro.ajax;l.datamodel.Token=e,l.datamodel.data=t,l.datamodel.callback=i,l.datamodel.Error=n,void 0!==a&&1==a&&(l.datamodel.IsNewVagaroAPI=a),void 0!==r&&1==r&&(l.datamodel.ErrorMessage=""),o?l.PostQue():l.Post()},vagaro.ajaxCallV2=function(e,t,i,n,o,a,s,r,l,c){var d=new vagaro.ajax;d.datamodel.Token=e,d.datamodel.data=t,d.datamodel.callback=o,d.datamodel.Error=a,d.datamodel.Proxy=!0,d.datamodel.IsPublic=!1,void 0!==c&&(d.datamodel.IsPublic=c),void 0!==i&&null!=i&&(d.datamodel.RouteParameter=i),void 0!==n&&null!=n&&(d.datamodel.QueryStringParameter=n),void 0!==r&&1==r&&(d.datamodel.ErrorMessage=""),void 0!==l&&void 0!==l.MerchantId&&null!==l.MerchantId&&""!==l.MerchantId&&(d.datamodel.merchantId=l.MerchantId),void 0!==l&&void 0!==l.UserId&&null!==l.UserId&&""!==l.UserId&&(d.datamodel.userId=l.UserId),s?d.PostQue():d.Post()},vagaro.ajaxCallV2Direct=function(e,t,i,n,o,a,s,r){var l=new vagaro.ajax;"undefined"==VagaroCorePublicAPIURLV2||isNullOrUndefineOrBlank(VagaroCorePublicAPIURLV2)?(VagaroCorePublicAPIURLV2="https://api.vagaro.com/US02/api/v2/public/",l.datamodel.Token=VagaroCorePublicAPIURLV2+e):l.datamodel.Token=VagaroCorePublicAPIURLV2+e,l.datamodel.IsNewVagaroAPI=!0,l.datamodel.Proxy=!1,void 0!==i&&null!=i&&(l.datamodel.RouteParameter=i),void 0!==n&&null!=n&&(l.datamodel.QueryStringParameter=n),void 0!==s&&1==s&&(l.datamodel.ErrorMessage=""),void 0!==r&&void 0!==r.MerchantId&&null!==r.MerchantId&&""!==r.MerchantId&&(l.datamodel.merchantId=r.MerchantId),void 0!==r&&void 0!==r.UserId&&null!==r.UserId&&""!==r.UserId&&(l.datamodel.userId=r.UserId),l.datamodel.data=t,"undefined"!=typeof isAsync&&null!=isAsync&&(l.datamodel.async=isAsync),l.datamodel.Error=a,l.datamodel.callback=o,l.datamodel.url=l.datamodel.Token,l.GetDirectV2()},vagaro.VagaroCoreApiResponseCode={Success:1e3,Error:1001,UnderMaintanance:1032,QuotaExceeded:1038},vagaro.VagaroCoreApiStatusCode={OK:200,Created:201,BadRequest:400}}(jQuery);var isNullOrUndefineOrBlank=e=>void 0===e||null==e||""==e||null==e;function onKeyPressBlockNumbers(e){var t=window.event?window.event.keyCode:e.which;if(46!=t&&(32==t||39==t||46==t||8==t||9==t||189==t||0==t))return t;var i=String.fromCharCode(t),n=/\d/;return window.event?event.returnValue=n.test(i):n.test(i)}function resize_bg(){$(".replaced").css({left:"160px"}),$("#fullbackground-wrapper").css("display","block"),$(".model").css("padding-left","0px!important");var e=$(window).width(),t=$(window).height(),i=$(".replaced").width()/$(".replaced").height(),n=e,o=Math.round(n/i);if(o<t){o=t,n=Math.round(o*i);var a=Math.round((n-e)/2);$(".replaced").css("left","-"+a+"px")}$(".replaced").width(n),$(".replaced").height(o)}function onOnlineiFrameLoad(){loader(!1)}function ajaxCallV2DirectAsync(e,t,i,n,o=!1,a={}){return new Promise((s,r)=>{try{vagaro.ajaxCallV2Direct(e,t,i,n,e=>s(e),e=>r(e),o,a)}catch(e){r(e)}})}!function(e){e.fn.applyupdown=function(t,i){t?(this.parent().find(".arrow-up-down").find(".uparrow").bind(i,function(){var t=e(this).attr("disabled");if(void 0===t||!1===t){var i=e(this).parent().siblings("input:text"),n=0;null!=i.attr("max")&&(n=i.attr("max"));var o=parseFloat(i.val());(0==n||o<n)&&i.val(o+1).change()}}),this.parent().find(".arrow-up-down").find(".downarrow").bind(i,function(){var t=e(this).attr("disabled");if(void 0===t||!1===t){var i=e(this).parent().siblings("input:text");null!=i.attr("min")&&(max=i.attr("min"));var n=parseFloat(i.val());(0==max||n>max)&&i.val(n-1).change()}})):(this.parent().siblings(".arrow-up-down").find(".uparrow").bind("click",function(){var t=e(this).attr("disabled");if(void 0===t||!1===t){var i=e(this).parent().siblings(".upDownArow").find("input:text"),n=0;null!=i.attr("max")&&(n=i.attr("max"));var o=parseFloat(i.val());(0==n||o<n)&&i.val(o+1).change()}}),this.parent().siblings(".arrow-up-down").find(".downarrow").bind("click",function(){var t=e(this).attr("disabled");if(void 0===t||!1===t){var i=e(this).parent().siblings(".upDownArow").find("input:text");null!=i.attr("min")&&(max=i.attr("min"));var n=parseFloat(i.val());(0==max||n>max)&&i.val(n-1).change()}})),this.bind("keyup",function(t){var i=0,n=0,o=e(this);if(38==t.keyCode){null!=o.attr("max")&&(i=o.attr("max"));var a=parseFloat(o.val());(0==i||a<i)&&o.val(a+1).change()}else if(40==t.keyCode){null!=o.attr("min")&&(i=o.attr("min"));a=parseFloat(o.val());(0==i||a>i)&&o.val(a-1).change()}else{null!=o.attr("max")&&(i=parseFloat(o.attr("max"))),null!=o.attr("min")&&(n=parseFloat(o.attr("min")));a=parseFloat(o.val());0!=i&&a>i?o.val(i).change():0!=n&&a<n&&o.val(n).change()}});var n=/Firefox/i.test(navigator.userAgent)?"DOMMouseScroll":"mousewheel";return this.bind(n,function(t){var i=0,o=e(this),a=e(this).attr("disabled");if(void 0===a||!1===a){if("mousewheel"==n){if(t.originalEvent.wheelDelta/120>0){null!=o.attr("max")&&(i=o.attr("max"));var s=parseFloat(o.val());(0==i||s<i)&&o.val(s+1).change()}else if(t.originalEvent.wheelDelta/120<0){null!=o.attr("min")&&(i=o.attr("min"));s=parseFloat(o.val());(0==i||s>i)&&o.val(s-1).change()}}else if(t.originalEvent.detail>0){null!=o.attr("max")&&(i=o.attr("max"));s=parseFloat(o.val());(0==i||s<i)&&o.val(s+1).change()}else if(t.originalEvent.detail<0){null!=o.attr("min")&&(i=o.attr("min"));s=parseFloat(o.val());(0==i||s>i)&&o.val(s-1).change()}t.preventDefault(),t.stopPropagation()}}),this}}(jQuery),Object.keys||(Object.keys=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t}),jQuery,vagaro.commonUtils={},vagaro.commonUtils.isNullOrUndefined=function(e){return void 0===e||null==e},vagaro.commonUtils.isFunction=function(e){return"function"==typeof e},vagaro.commonUtils.CheckPhonenoCount=function(e,t){var i=e;return null!=i&&null!=i&&""!=i?"4"==t?9==i.length?0+e:10==i.length?e:null:e:1},radGridWrapper=function(e){var t=this;return t.gridEvents={onRowMouseOver:null,onRowMouseOut:null,onRowDropped:null,onRowClick:null,onGridCreated:null},t.clientId=e,t.getGrid=function(){return $find(t.clientId)},t.getDataItems=function(){return t.getMasterTableView().get_dataItems()},t.getDataItem=function(e){return t.getMasterTableView().get_dataItems()[e]},t.getHTMLElement=function(e){return t.getMasterTableView().get_dataItems()[e].get_element()},t.addCssClassToRow=function(e,i){var n=t.getHTMLElement(e);$(n).addClass(i)},t.removeCssClassToRow=function(e,i){var n=t.getHTMLElement(e);$(n).removeClass(i)},t.getDataKeyValue=function(e,i){return t.getDataItem(e).getDataKeyValue(i)},t.getDataKeyValueFromRow=function(e,t){return e.getDataKeyValue(t)},t.getMasterTableView=function(){return t.getGrid().get_masterTableView()},t.dataBind=function(e){var i=t.getMasterTableView();i.set_dataSource(e),i.dataBind()},t.getSelectedItems=function(){return t.getMasterTableView().get_selectedItems()},t.selectItemByIndex=function(e){t.getMasterTableView().selectItem(e)},t.getItemIndex=function(e){return parseInt(e.get_itemIndexHierarchical())},t.getCellValueByKey=function(e,i){return t.getMasterTableView().getCellByColumnUniqueName(e,i)},t.getCell=function(e,i){var n=t.getMasterTableView(),o=n.get_dataItems()[e];return n.getCellByColumnUniqueName(o,i)},t.destroy=function(){t.clientId=null,t.gridEvents.onGridCreated=null,t.gridEvents.onRowClick=null,t.gridEvents.onRowDropped=null,t.gridEvents.onRowMouseOut=null,t.gridEvents.onRowMouseOver=null},t.onRowMouseOver=function(e,i){vagaro.commonUtils.isFunction(t.gridEvents.onRowMouseOver)&&t.gridEvents.onRowMouseOver(e,i)},t.onRowMouseOut=function(e,i){vagaro.commonUtils.isFunction(t.gridEvents.onRowMouseOut)&&t.gridEvents.onRowMouseOut(e,i)},t.onRowDropped=function(e,i){vagaro.commonUtils.isFunction(t.gridEvents.onRowDropped)&&t.gridEvents.onRowDropped(e,i)},t.onRowClick=function(e,i){vagaro.commonUtils.isFunction(t.gridEvents.onRowClick)&&t.gridEvents.onRowClick(e,i)},t.onGridCreated=function(e,i){vagaro.commonUtils.isFunction(t.gridEvents.onGridCreated)&&t.gridEvents.onGridCreated(e,i)},t.getAllBoundKeyValues=function(){return t.getGrid()._clientKeyValues},t.updateKeyValue=function(e,i,n){var o=t.getAllBoundKeyValues();vagaro.commonUtils.isNullOrUndefined(o)||0==o.length||(o[e][i]=n)},t.showHideItem=function(e,i){var n=t.getMasterTableView();i?n.showItem(e):n.hideItem(e)},t.showHideItems=function(e,i){if(!vagaro.commonUtils.isNullOrUndefined(e)&&0!=e.length)for(var n=t.getMasterTableView(),o=0;o<e.length;o++){var a=e[o];i?n.showItem(a):n.hideItem(a)}},t},function(e){_CustomTooltip={Msg:{FlagshipDisabledMsg:"Cannot edit fields synced from a flagship location."}},e(document).on("mouseenter",".custom-tooltip",function(t){var i=e(this),n=e(this).attr("data-tooltip");void 0!==e(this).data("angular-tooltip")&&null!=e(this).data("angular-tooltip")&&(n=e(this).data("angular-tooltip"));var o=e('<div class="v-tooltip-content tooltip top mllocation-tooltip-content" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner">'+n+"</div></div>");e(this).after(o),e(".v-tooltip-content").position({of:i,at:"center top",my:"center bottom",collision:"flipfit"}),e(".custom-tooltip-left").next(".v-tooltip-content").find(".tooltip-arrow").position({of:i,at:"center top",my:"center bottom",collision:"flipfit"})}),e(document).on("mouseleave",".custom-tooltip",function(t){e(".v-tooltip-content").remove()})}(jQuery);var gsMonthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December"),gsDayNames=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");String.prototype.times||(String.prototype.times=function(e){for(var t="",i=0;i<e;i++)t+=this;return t}),String.prototype.zp||(String.prototype.zp=function(e){return"0".times(e-this.length)+this}),Number.prototype.zp||(Number.prototype.zp=function(e){return this.toString().zp(e)}),Date.prototype.format||(Date.prototype.format=function(e){if(!this.valueOf())return"&nbsp;";var t=this;return e.replace(/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|ms|a\/p)/gi,function(e){switch(e.toLowerCase()){case"yyyy":return t.getFullYear();case"mmmm":return gsMonthNames[t.getMonth()];case"mmm":return gsMonthNames[t.getMonth()].substr(0,3);case"mm":return(t.getMonth()+1).zp(2);case"dddd":return gsDayNames[t.getDay()];case"ddd":return gsDayNames[t.getDay()].substr(0,3);case"dd":return t.getDate().zp(2);case"hh":return((h=t.getHours()%12)?h:12).zp(2);case"nn":return t.getMinutes().zp(2);case"ss":return t.getSeconds().zp(2);case"ms":return t.getMilliseconds().zp(2);case"a/p":return t.getHours()<12?"AM":"PM"}})}),Date.prototype.formatdate||(Date.prototype.formatdate=function(e){if(!this.valueOf())return"&nbsp;";var t=this;return e.replace(/(yyyy|mmmm|mmm|mm|dddd|ddd|dd|hh|nn|ss|ms|a\/p)/gi,function(e){switch(e.toLowerCase()){case"yyyy":return t.getFullYear();case"mmmm":return gsMonthNames[t.getMonth()];case"mmm":return gsMonthNames[t.getMonth()].substr(0,3);case"mm":return(t.getMonth()+1).zp(2);case"dddd":return gsDayNames[t.getDay()];case"ddd":return gsDayNames[t.getDay()].substr(0,3);case"dd":return t.getDate().zp(2);case"hh":return((h=t.getHours()%12)?h:12).zp(2);case"nn":return t.getMinutes().zp(2);case"ss":return t.getSeconds().zp(2);case"ms":return t.getMilliseconds().zp(2);case"a/p":return t.getHours()<12?"AM":"PM"}})}),String.format||(String.format=function(){for(var e=arguments[0],t=1;t<arguments.length;t++){var i=new RegExp("\\{"+(t-1)+"\\}","gm");e=e.replace(i,arguments[t])}return e});var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","^":"&#94;",$:"&#36;"},functionentityMap={'"':'\\"',"'":"\\'"};function addCommas(e){x=(e+="").split("."),x1=x[0],x2=x.length>1?"."+x[1]:"";for(var t=/(\d+)(\d{3})/;t.test(x1);)x1=x1.replace(t,"$1,$2");return x1+x2}String.prototype.escapeHtml||(String.prototype.escapeHtml=function(){return String(this).replace(/[&<>\"'\/^$]/g,function(e){return entityMap[e]}).toString()}),String.isNullOrUndefineOrBlank||(String.isNullOrUndefineOrBlank=function(e){return void 0===e||null==e||""==e||null==e}),String.isNullOrUndefine||(String.isNullOrUndefine=function(e){return void 0===e||null==e||null==e}),RegExp.escape=function(e){return String(e).replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")},Number.prototype.formatMoney||(Number.prototype.formatMoney=function(e,t,i,n){e=isNaN(e=Math.abs(e))?2:e,i=i||",",n=n||".";var o=this,a=o<0?"-":"",s=parseInt(o=Math.abs(+o||0).toFixed(e),10)+"",r=(r=s.length)>3?r%3:0;return a+(r?s.substr(0,r)+i:"")+s.substr(r).replace(/(\d{3})(?=\d)/g,"$1"+i)+(e?n+Math.abs(o-s).toFixed(e).slice(2):"")}),Number.prototype.format||(Number.prototype.format=function(e){var t=this,i=e.match(/^[-+]?[\#]+\.[##]+$/);if(i){return(i=e.match(/^#.##$/))?addCommas(t.toFixed(2)):4==(t=t.toFixed(2)).toString().length?"0"+t:addCommas(t)}return addCommas(t)}),String.prototype.escapeParamHtml||(String.prototype.escapeParamHtml=function(){return String(this).replace(/["']/g,function(e){return functionentityMap[e]}).toString()}),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),i=this,n=function(){},o=function(){return i.apply(this instanceof n&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,o.prototype=new n,o}),Array.prototype.keySort||(Array.prototype.keySort=function(e){var t=function(e,t){var i,n=0;for(i in e)if(e.hasOwnProperty(i)){if(n==t)return i;n++}return!1},i=function(e,t,i){return i=null!==i?i:1,e==t?0:e>t?1*i:-1*i},n=function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i}(e=e||{});if(!n)return this.sort(i);for(var o in e)e[o]="desc"==e[o]||-1==e[o]?-1:"skip"==e[o]||0===e[o]?0:1;return this.sort(function(o,a){for(var s=0,r=0;0===s&&r<n;){var l=t(e,r);if(l){var c=e[l];s=i(o[l],a[l],c),r++}}return s}),this});var userAgent=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase(),iOS=/iPad|iPhone|iPod|iTouch/.test(navigator.userAgent)&&!window.MSStream;!function(e,t){currentscrollpager=null;var i=function(e,i){this.$elem=t(e),this.options=i,this.isInitalize=0};i.scrollPaginators={},i.frozen=!1,i.prototype={defaults:{Token:null,Data:{},LocalData:{},templateName:null,beforeLoad:null,afterLoad:null,onRowLoad:null,heightOffset:10,pageIndex:1,PageSize:12,totalPages:1,NoDataFoundDiv:null,Loader:null,WallWidth:null,Wall:null,Slick:null,SlickNext:!0,SlickDots:!1,SlickAuto:!1,SlideWidth:null,AfterSlickChange:!1,EnablePagescroll:!1,ScrollTarget:t(e),templateClass:null,IsAjaxQue:!1,checkTab:!1,lastcall:null,removeElement:null,ItemIndex:0,callbackclass:null,async:!0,initialpageData:null,pageName:"",slickOptions:null,isScrollInProgress:!1,data_error:null,lazyLoadClass:"lazy",isShowIntials:!1,intialsname:".intialsname",IsNewVagaroAPI:!1,prevHeight:0},init:function(){if(this.config=t.extend({},this.defaults,this.options),this.config.pageIndex=1,this.$elem.removeAttr("style"),this.isInitalize=0,this.options.Data.currentPageIndex=this.config.pageIndex,this.options.Data.PageSize=this.config.PageSize,null!=this.config.ScrollTarget&&(this.config.ScrollTarget=t(this.config.ScrollTarget)),this.config.EnablePagescroll){var e=this;this.config.ScrollTarget.bind("scroll",function(){0==e.config.isScrollInProgress&&(e.config.isScrollInProgress=!0,e.targetScroll())})}return this},initelem:function(e){this.$elem=t(e),this.init()},scroll:function(){return 0==this.isInitalize&&(this.config=t.extend({},this.defaults,this.options),this.config.pageIndex=1,0==this.isServerResponse(this)&&this.$elem.html(""),this.$elem.attr("scrollPagination","enabled"),this.isInitalize=1),null!=this.config.NoDataFoundDiv&&this.config.NoDataFoundDiv.hide(),0==i.frozen&&this.loadContent(),this},disableScroll:function(){t(".scrollme").removeClass("scrollme")},enableScroll:function(){this.config.EnablePagescroll?(t(".scrollme").removeClass("scrollme"),t("#"+this.config.templateName).addClass("scrollme"),currentscrollpager=this,this.config.isScrollInProgress=!1):(t(".scrollme").removeClass("scrollme"),currentscrollpager=this),t("#dvPageContent").length>0&&t("html,body,#page-content-wrapper").animate({scrollTop:0},1e3)},click:function(e,t,i,n){1==e.currentDirection&&this.scroll()},targetScroll:function(){if(this.config.EnablePagescroll&&t("#"+this.config.templateName).hasClass("scrollme")){if(1==this.config.pageIndex)return void(this.config.isScrollInProgress=!1);var e=0,i=0;if(t(this.config.ScrollTarget).is("div"))t("#footerdiv:visible").length>0&&t(this.config.ScrollTarget).find("#footerdiv").length>0&&(i=t("#footerdiv").height()),void 0!==this.config.BestSalon&&null!=this.config.BestSalon&&this.config.BestSalon.length>0&&1==this.config.BestSalon.is(":visible")&&(i=i=t("#footerdiv").height(),this.config.BestSalon.height()),e=this.config.ScrollTarget[0].scrollHeight-(i+100);else{i=0;if(t("#footerdiv:visible").length>0&&(i=t("#footerdiv").height()),t("#divBestSaloonHead:visible").length>0&&(i+=t("#divBestSaloonHead").height()),t("#divMoresalloncities:visible").length>0&&(i+=t("#divMoresalloncities").height()),t("#divFAQSearchServiceHead:visible").length>0&&(i+=t("#divFAQSearchServiceHead").height()),t(this.config.ScrollTarget).is("body")){var n=this.config.ScrollTarget[0].scrollHeight;t("#page-wrapper").length>0&&(n=t("#page-wrapper")[0].scrollHeight)}else n=this.config.ScrollTarget[0].document.body.scrollHeight;e=n-(i+150)}var o=this.config.ScrollTarget.scrollTop()+this.config.ScrollTarget.innerHeight()>=e;if(t(this.config.ScrollTarget).is("body")&&t("#page-wrapper").length>0&&(o=-1*t("#page-wrapper").position().top+this.config.ScrollTarget.innerHeight()>=e),o){try{"ulFeatureBusiness"==this.$elem.attr("id")&&(this.config.prevHeight=this.$elem.innerHeight())}catch(e){}this.scroll()}else this.config.isScrollInProgress=!1}else this.config.isScrollInProgress=!1},hasScrollBar:function(i){if(1==i.config.EnablePagescroll&&null!=i.config.ScrollTarget){if(i.config.ScrollTarget.get(0)==e)return t("body").get(0).scrollHeight>=t("body").height();var n=i.config.ScrollTarget.get(0).scrollHeight;return t(i.config.ScrollTarget).is("body")&&t("#page-wrapper").length>0&&(n=i.config.ScrollTarget[0].scrollHeight,0==t(i.config.ScrollTarget).is("div")&&t("#page-wrapper").length>0&&(n=t("#page-wrapper")[0].scrollHeight-10)),n>i.config.ScrollTarget.height()}return!0},isServerResponse:function(e){return null!=e.options.initialpageData&&e.config.pageIndex==e.options.initialpageData.PageIndex&&e.options.initialpageData.tabName==e.options.pageName},loadContent:function(){if(this.$elem=t("#"+this.$elem.attr("id")),"disabled"!=this.$elem.attr("scrollPagination")){if(this.$elem.attr("scrollPagination","disabled"),this.config.pageIndex>this.config.totalPages&&this.config.pageIndex>1)return this.config.isScrollInProgress=!1,void t(this.config.Loader).hide();if(this.config.lastcall=(new Date).format("yyyy-mm-dd hh:nn:ss:ms a/p")+this.$elem.attr("id"),this.$elem.attr("lastcall",this.config.lastcall),t(this.config.Loader).show(),"function"==typeof this.config.CallbackOnLoderShow&&this.config.CallbackOnLoderShow(),showLoadingCenter(".loader-imgNew"),null!=this.config.beforeLoad&&this.config.beforeLoad(),this.$elem.children().attr("rel","loaded"),this.options.Data.currentPageIndex=this.config.pageIndex,this.options.Data.PageSize=this.config.PageSize,this.isServerResponse(this))this.CallbackResponse(null);else{var e=new vagaro.ajax;if(e.datamodel.Token=this.config.Token,e.datamodel.data=this.config.Data,e.datamodel.callback=this.CallbackResponse.bind(this),e.datamodel.Error=this.ErrorResponse.bind(this),e.datamodel.IsNewVagaroAPI=this.config.IsNewVagaroAPI,null!=this.config&&"divmyPayrollHistorytemplate"==this.config.templateName&&null!=this.config.Data){var i={};i.PageSize=this.config.Data.PageSize,i.currentPageIndex=this.config.Data.currentPageIndex,i.SPagingDetails="",e.datamodel.userId=this.config.Data.userId,e.datamodel.data=i}0==this.options.async&&(e.datamodel.async=!1),this.options.IsAjaxQue?e.PostQue():e.Post()}}else this.config.isScrollInProgress=!1},CallbackResponse:function(e){if(void 0!==e&&null!=e&&void 0!==e.Data&&void 0!==e.CustomCode&&void 0!==e.Message&&(e=(this.config.Token.indexOf("getusermembershiphistory")>-1||this.config.Token.indexOf("getmembershipdetails")>-1||this.config.Token.indexOf("getsoldmemberhipforcustomer")>-1||this.config.Token.indexOf("getgiftcertificatehistory")>-1||this.config.Token.indexOf("getpackagedetailsforcustomer")>-1)&&e.CustomCode==vagaro.VagaroCoreApiResponseCode.UnderMaintanance?[{UnderMaintanance:vagaro.VagaroCoreApiResponseCode.UnderMaintanance}]:e.Data),this.config.isScrollInProgress=!1,this.getLastcallTime()==this.config.lastcall){t("#"+this.config.templateName).html();var i=this;if(null!=this.config.NoDataFoundDiv&&(this.config.NoDataFoundDiv.hide(),null!=this.config.removeElement&&this.config.removeElement.show()),null==e||1===i.config.pageIndex&&0==e.length||null!=e.data&&0==e.data.length){if((null!=this.config.NoDataFoundDiv&&0==this.isServerResponse(this)||1==this.isServerResponse(this)&&0==this.options.initialpageData.totalPages)&&(this.$elem.removeAttr("style"),this.config.NoDataFoundDiv.show(),null!=this.config.removeElement&&this.config.removeElement.hide()),t(this.config.Loader).hide(),(null!=this.config.afterLoad&&0==this.isServerResponse(this)||1==this.isServerResponse(this)&&null!=this.options.initialpageData.afterLoad&&null!=this.options.initialpageData.afterLoad)&&this.config.afterLoad(e),0==this.isServerResponse(this)||1==this.isServerResponse(this)&&0==this.options.initialpageData.totalPages)return void(this.options.initialpageData=null)}else 1===i.config.pageIndex&&0==this.isServerResponse(this)&&this.$elem.html("");this.config.checkTab&&!i.$elem.closest("div.tab-pane").hasClass("active")?i.CheckTab(e):this.ResponseProcess(e)}},CheckTab:function(e){var t=this;setTimeout(function(){t.$elem.closest("div.tab-pane").hasClass("active")?t.ResponseProcess(e):t.CheckTab(e)},50)},getLastcallTime:function(){return t("#"+this.$elem.attr("id")).attr("lastcall")},getScrollTab:function(){return void 0===t("#"+this.$elem.attr("id")).data("scrollTab")||"true"==t("#"+this.$elem.attr("id")).data("scrollTab")},RefreshWall:function(){var e=this;null!=e.config.Wall&&setTimeout(function(){e.config.Wall.refresh()},50)},ErrorResponse:function(e){this.config.isScrollInProgress=!1,this.$elem.attr("scrollPagination","enabled"),t(this.config.Loader).hide()},setWallandSlick:function(e,i,n,o){if(null!=n.config.WallWidth?(1===n.config.pageIndex&&0===o&&(n.config.Wall=new freewall(n.$elem),n.config.Wall.reset({selector:".gallery-solo-image",cellW:n.config.WallWidth,cellH:"auto",gutterX:5,gutterY:15,animate:!1,onResize:function(){n.config.Wall.refresh()}})),0==n.isServerResponse(n)&&(n.getLastcallTime(),n.config.lastcall),(1==n.isServerResponse(n)&&1===n.config.pageIndex||o===e.length-1&&1===n.config.pageIndex)&&n.config.Wall.fitWidth()):n.$elem.parent().addClass("listing-wrapper").removeClass("gallery-wrapper"),null!=n.config.Slick&&0==iPadAndroid)if(1===n.config.pageIndex&&0===o){"object"==typeof n.config.Slick.getSlick()&&n.config.Slick.unslick(),0==n.isServerResponse(n)&&n.$elem.append(i);var a=6,s=5;null!=n.config.slickOptions?(a=3,s=1,n.config.slickOptions):(null!=n.config.SlideWidth&&(a=Math.ceil(n.$elem.width()/n.config.SlideWidth)),a>=n.config.PageSize&&n.config.totalPages>1&&(a=n.config.PageSize-1),a<=1&&(a=1),(s=a-1)<1&&(s=1));var r=null;1==n.config.AfterSlickChange&&(r=n.click.bind(n)),n.config.Slick.slick({lazyLoad:"ondemand",dots:n.config.SlickDots,arrows:n.config.SlickNext,infinite:!1,speed:300,autoplay:n.config.SlickAuto,slidesToShow:a,slidesToScroll:s,onAfterChange:r,responsive:n.config.slickOptions})}else 0==n.isServerResponse(n)&&n.getLastcallTime()==n.config.lastcall&&n.config.Slick.slickAdd(i);else null==n.config.WallWidth&&0==n.isServerResponse(n)&&n.getLastcallTime()==n.config.lastcall&&n.$elem.append(i);if(0==n.isServerResponse(n)&&null!=n.config.onRowLoad){var l=e[o];i=n.config.onRowLoad(l,i)}if(null!=n.config.Wall){if(0==n.isServerResponse(n)){var c=i.find(".walllazy");(c=t(c)).length>0&&t("<img />").bind("load",function(){var e=c.attr("data-original");c.is("img")?(c.attr("src",e),c.removeAttr("height")):c.css("background-image","url('"+e+"')"),setTimeout(function(){n.getLastcallTime()==n.config.lastcall&&n.config.Wall.appendBlock(i)},100),c.fadeIn}).bind("error",function(){c.fadeIn,setTimeout(function(){n.getLastcallTime()==n.config.lastcall&&n.config.Wall.appendBlock(i)},100)}).attr("src",c.attr("data-original"))}else{var d=!1;n.$elem.find(".walllazy").each(function(){var e=t(this);t("<img />").bind("load",function(){var t=e.attr("data-original");e.is("img")?e.attr("src",t):e.css("background-image","url('"+t+"')"),e.fadeIn,0==d&&(d=!0,setTimeout(function(){n.config.Wall.refresh()},1e3))}).bind("error",function(){e.fadeIn,0==d&&(d=!0,setTimeout(function(){n.config.Wall.fitWidth()},2e3))}).attr("src",e.attr("data-original"))})}var u=t(".WallSec2:last",n.$elem);u.length>0&&(u.outerHeight()>60?u.css("height",u.outerHeight()):u.css("height","60px"))}n.options.initialpageData=null},ResponseProcess:function(i){var n,o=t("#"+this.config.templateName).html(),a=this,s=i=null!=i&&i.hasOwnProperty("data")&&Array.isArray(i.data)?i.data:i,r=(navigator.userAgent||navigator.vendor||e.opera).toLowerCase(),l=r.match(/ipad/i)||r.match(/iphone/i)||r.match(/itouch/i)||r.match(/android/i)||!1;if(null!=this.config.callbackclass&&null!=i&&(s=i[this.config.callbackclass]),this.isServerResponse(a)){var c=a.options.initialpageData.totalPages;a.config.totalPages=Math.ceil(c/a.config.PageSize+parseInt(c%(a.config.PageSize>0?1:0))),this.setWallandSlick(s,null,a,0,l)}else if("CustomerPayment"==Object.keys(i)[0]){var d=s.CustomerPayment;if(void 0!==d&&null!=d&&t.each(d,function(e){if(a.getLastcallTime()==a.config.lastcall){var i=d[e];if(null!=a.config.LocalData&&(i=t.extend({},i,a.config.LocalData)),1===a.config.pageIndex&&0===e){var r=i.TotalPage;a.config.totalPages=Math.ceil(r/a.config.PageSize+parseInt(r%(a.config.PageSize>0?1:0)))}0===e&&(n=Object.keys(i));for(var c=o,u=0;u<n.length;u++){var p=n[u],h=new RegExp("{{"+p+"}}","gi");if(null!=i[p]&&null!=i[p]){var m=new RegExp("{{"+p+"[|]Datemmddyyyy}}","gi"),g=new RegExp("{{"+p+"[|]Timehhmmtt}}","gi"),v=new RegExp("{{"+p+"[|]removeQuote}}","gi");if(m.test(c)){var f=new Date(parseFloat(i[p].replace(/\/Date\((\d+)\)\//gi,"$1"))).format("mmm dd,yyyy");c=c.replace(m,f)}if(g.test(c)){var C="";try{C=new Date(parseFloat(i[p].replace(/\/Date\((\d+)\)\//gi,"$1")))}catch(e){(C=new Date).setMinutes(i[p].Minutes),C.setHours(i[p].Hours)}C=C.format("hh:nn a/p");c=c.replace(g,C)}v.test(c)&&(c=c.replace(v,i[p].replace(/\'/g,"\\'").replace(/"/g,"\\'\\'")));try{c="string"==typeof i[p]?c.replace(h,i[p].escapeHtml()):c.replace(h,i[p])}catch(e){}}else null!=c&&(c=c.replace(h,""))}c=t(c).attr("ItemIndex",a.config.ItemIndex),a.setWallandSlick(s,c,a,e,l),null!=a.config.templateClass&&t(c,a.$elem).addClass(a.config.templateClass),a.config.ItemIndex++}}),"divMyPaymentMethodstemplate"==this.config.templateName){var u=s.CustomerBank;void 0!==u&&null!=u&&0!=u.length?(t(".vpl-payment").hide(),t(".vpl-bank-sub-text").hide(),t("#vplBankText").html(t("#divMyBankDetailTemplate").tmpl(u))):null!=t("#hdncountryid").val()&&void 0!==t("#hdncountryid").val()&&1==parseInt(t("#hdncountryid").val())?(t(".vpl-payment").hide(),t(".vpl-bank-sub-text").show(),t(".vpl-bank-sub-text").show()):(t(".vpl-payment").hide(),t(".vpl-bank-sub-text").hide(),t(".vpl-bank-sub-text").hide())}}else t.each(s,function(e){var i=s.length-1;if(a.getLastcallTime()==a.config.lastcall){var r=s[e];if(null!=a.config.LocalData&&(r=t.extend({},r,a.config.LocalData)),1===a.config.pageIndex&&0===e){var c=null!=a.config&&null!=a.config.templateName&&"divmyPayrollHistorytemplate"==a.config.templateName?r.totalPage:r.TotalPage;a.config.totalPages=Math.ceil(c/a.config.PageSize+parseInt(c%(a.config.PageSize>0?1:0)))}0===e&&(n=Object.keys(r));for(var d=o,u=0;u<n.length;u++){var p=n[u],h=new RegExp("{{"+p+"}}","gi");if(null!=r[p]&&null!=r[p]){var m=new RegExp("{{"+p+"[|]Datemmddyyyy}}","gi"),g=new RegExp("{{"+p+"[|]Timehhmmtt}}","gi"),v=new RegExp("{{"+p+"[|]removeQuote}}","gi");if(m.test(d)){var f=new Date(parseFloat(r[p].replace(/\/Date\((\d+)\)\//gi,"$1"))).format("mmm dd,yyyy");d=d.replace(m,f)}if(g.test(d)){var C="";try{C=new Date(parseFloat(r[p].replace(/\/Date\((\d+)\)\//gi,"$1")))}catch(e){(C=new Date).setMinutes(r[p].Minutes),C.setHours(r[p].Hours)}C=C.format("hh:nn a/p");d=d.replace(g,C)}v.test(d)&&(d=d.replace(v,r[p].replace(/\'/g,"\\'").replace(/"/g,"\\'\\'")));try{d="string"==typeof r[p]?d.replace(h,r[p].escapeHtml()):d.replace(h,r[p])}catch(e){}}else null!=d&&(d=d.replace(h,""))}d=t(d).attr("ItemIndex",a.config.ItemIndex),a.setWallandSlick(s,d,a,e,l),null!=a.config.templateClass&&t(d,a.$elem).addClass(a.config.templateClass),a.config.ItemIndex++,e===i&&a.config.prevHeight>0&&a.config.ScrollTarget.scrollTop(a.config.prevHeight)}});if(null!=this.config.Wall&&t("img[data-type='wallimg']",a.$elem).removeAttr("height"),1===a.config.pageIndex&&null==a.config.Wall&&(a.$elem.removeData("wall"),a.$elem.removeAttr("style")),this.config.pageIndex++,this.config.totalPages=a.config.totalPages,(null!=this.config.afterLoad&&null!=i||1==this.isServerResponse(this)&&null!=this.options.initialpageData.afterLoad&&null!=this.options.initialpageData.afterLoad)&&this.config.afterLoad(i),null==a.config.Slick||0!=l&&null!=a.config.Slick)try{setTimeout(function(){a.config.pageIndex<=2?t("."+a.config.lazyLoadClass,a.$elem).lazyload({event:"lazyload",effect:"fadeIn",failure_limit:5e4,container:a.config.ScrollTarget[0],data_error:a.config.data_error,isShowIntials:a.config.isShowIntials,intial_selecter:a.config.intialsname}).trigger("lazyload"):t("."+a.config.lazyLoadClass,a.$elem).lazyload({effect:"fadeIn",failure_limit:5e4,container:a.config.ScrollTarget[0],data_error:a.config.data_error,isShowIntials:a.config.isShowIntials,intial_selecter:a.config.intialsname}),t("."+a.config.lazyLoadClass,a.$elem).removeClass(a.config.lazyLoadClass)},500)}catch(e){}this.$elem.attr("scrollPagination","enabled"),t(this.config.Loader).hide(),0==iOS&&setTimeout(function(){!(t("#"+a.config.templateName).hasClass("scrollme")&&a.config.totalPages>1)||"undefined"!=typeof isFacebook&&"true"==isFacebook||"undefined"!=typeof isWidget&&"true"==isWidget||0!=a.hasScrollBar(a)||a.getLastcallTime()!=a.config.lastcall||1!=a.getScrollTab()||a.scroll()},2e3)}},i.defaults=i.prototype.defaults,t.fn.Pagination=function(e){return this.each(function(){new i(this,e).scroll()})},e.Pagination=i}(window,jQuery),
/*!
 * jQuery Cookie Plugin v1.4.1
 * https://github.com/carhartl/jquery-cookie
 *
 * Copyright 2006, 2014 Klaus Hartl
 * Released under the MIT license
 */
function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(e){var t=/\+/g;function i(e){return s.raw?e:encodeURIComponent(e)}function n(e){return s.raw?e:decodeURIComponent(e)}function o(e){return i(s.json?JSON.stringify(e):String(e))}function a(i,n){var o=s.raw?i:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(t," ")),s.json?JSON.parse(e):e}catch(e){}}(i);return e.isFunction(n)?n(o):o}var s=e.cookie=function(t,r,l,c){if(e.cookie.json=!0,arguments.length>1&&!e.isFunction(r)){if("number"==typeof(l=e.extend({},s.defaults,l)).expires){var d=l.expires,u=l.expires=new Date;u.setTime(+u+864e5*d)}return document.cookie=[i(t),"=",void 0!==l.rawCookie&&1==l.rawCookie?String(r):o(r),l.expires?"; expires="+l.expires.toUTCString():"",l.path?"; path="+l.path:"",l.domain?"; domain="+l.domain:"",l.secure?"; secure="+l.secure:""].join("")}for(var p=t?void 0:{},h=document.cookie?document.cookie.split("; "):[],m=0,g=h.length;m<g;m++){var v=h[m].split("="),f=n(v.shift()),C=v.join("=");if(t&&t===f){p=a(C,r);break}t||void 0===(C=a(C))||(p[f]=C)}return p};s.defaults={},e.removeCookie=function(t,i){return void 0!==e.cookie(t)&&(e.cookie(t,"",e.extend({},i,{expires:-1})),!e.cookie(t))}});var eSelectedValue,Custom$searchbox,cookieManager=function(e){var t={defaultDomain:"",defaultPath:"/",pageType:"",setCookie:function(t,i,n,o,a,s,r){var l=!(void 0===a||null==a||""==a),c=!(void 0===n||null==n||""==n);c||l?!c&&l&&!(void 0===s||null==s||""==s)?e.cookie(t,i,{path:o,domain:a,secure:s}):!c&&l?e.cookie(t,i,{path:o,domain:a}):c&&!l?e.cookie(t,i,{expires:n,path:o}):e.cookie(t,i,{expires:n,path:o,domain:a,secure:s,rawCookie:r}):e.cookie(t,i,{path:o})},getCookie:function(t){return e.cookie(t)},getAllCookies:function(){return e.cookie()},removeCookie:function(t,i,n){return!(void 0===n||null==n||""==n)?e.removeCookie(t,{path:i,domain:n}):e.removeCookie(t,{path:i})},init:function(e,i){t.defaultDomain=e,t.pageType=i}};return t}(jQuery),objApplicationType={CustomerApp:1,CheckinApp:2},GeoMarker=null,BrandedAppWithAppleCallback=0,fnLogoutwithoutConfirm=void 0,ApiURLEnumMobile={getlocationsearchbyplaceid:(ApiPath="websiteapi/homepage/")+"getlocationsearchbyplaceid"};null!=navigator.userAgent&&navigator.userAgent.indexOf("com.vagaro.customerios")>-1&&(window.EasyJS={__callbacks:{},invokeCallback:function(e,t){var i=Array.prototype.slice.call(arguments);i.shift(),i.shift();for(var n=0,o=i.length;n<o;n++)i[n]=decodeURIComponent(i[n]);var a=EasyJS.__callbacks[e];return t&&(EasyJS.__callbacks[e]=void 0),a.apply(null,i)},call:function(e,t,i){for(var n=[],o=0,a=i.length;o<a;o++)if("function"==typeof i[o]){n.push("f");var s="__cb"+ +new Date;EasyJS.__callbacks[s]=i[o],n.push(s)}else n.push("s"),n.push(encodeURIComponent(i[o]));if(0==IsSwiftCustomerApp()){var r=n.length>0?":"+encodeURIComponent(n.join(":")):"",l=document.createElement("IFRAME");l.setAttribute("src","easy-js:"+e+":"+encodeURIComponent(t)+r),document.documentElement.appendChild(l),l.parentNode.removeChild(l),l=null}else{r=n.length>0?":"+encodeURIComponent(n.join(":")):"";window.webkit.messageHandlers.Listener.postMessage(e+":"+encodeURIComponent(t)+r);var c=EasyJS.retValue;if(EasyJS.retValue=void 0,c)return decodeURIComponent(c)}},inject:function(e,t){window[e]={};for(var i=window[e],n=0,o=t.length;n<o;n++)(function(){var o=t[n],a=o.replace(new RegExp(":","g"),"");i[a]=function(){return EasyJS.call(e,o,Array.prototype.slice.call(arguments))}})()}},EasyJS.inject("JSInterface",["setObjReqView:","objReqView","CallWSMethod:",".cxx_destruct"]));try{var strUserAgent=null!=navigator.userAgent?navigator.userAgent:"";strUserAgent.toLowerCase().indexOf("com.vagaro.customer")>-1&&(vgAppicationType=1),(strUserAgent.toLowerCase().indexOf("com.vagaro.androidcheckin")>-1||strUserAgent.toLowerCase().indexOf("com.vagaro.ioscheckin")>-1)&&(vgAppicationType=2)}catch(e){}function IsSwiftCustomerApp(){return null!=navigator.userAgent&&navigator.userAgent.indexOf("swiftApp")>-1}if("undefined"==typeof vgAppicationType||vgAppicationType!=objApplicationType.CheckinApp&&vgAppicationType!=objApplicationType.CustomerApp){if(void 0===CallbackforMobileAppPro&&"undefined"!=typeof vgAppicationType&&0==vgAppicationType&&navigator.userAgent.indexOf("com.vagaro.iospro")>-1)function CallbackforMobileAppPro(e,t,i,n,o,a,s){if($("#divtwofactorauthentication").is(":visible")&&1==a)return $("#dvPhoneVerify").hide(),$("#dvEmailVerify").hide(),void $("#divtwofactorauthentication").modal("hide");var r={};r.navType=e,r.screenType=t,r.screenTitle=i,r.message=n,r.messageType=o,r.action=a,r.jsonData=s,objData="5006||~||"+JSON.stringify(r),window.location="js-call:myObjectiveCFunction:"+objData}}else{var glbDataCheckIn={};if(vgAppicationType==objApplicationType.CheckinApp){window.setInterval(CheckIdleTime,1e3);var checkInAppProgessTime=10,IDLE_TIMEOUT=60,_idleSecondsCounter=0,isDisplayProgress=!1,isEventOccur=!1;function onFocusInCallback(e){_idleSecondsCounter=0,isEventOccur=!0}function CheckIdleTime(){_idleSecondsCounter++,isDisplayProgress&&isEventOccur?(_idleSecondsCounter=0,hideProgress()):_idleSecondsCounter>=IDLE_TIMEOUT&&!isDisplayProgress&&(isEventOccur=!1,displayProgress())}function displayProgress(){isDisplayProgress=!0,$("#divProgress").show(),progressBarDisplay(checkInAppProgessTime,checkInAppProgessTime,$("#divProgress"))}function hideProgress(){isDisplayProgress=!1,clearTimeout(timer),$("#divProgress").hide()}function progressBarDisplay(e,t,i){var n=(t-e)*(i.width()/t);i.find("div").animate({width:n},e==t?0:1e3,"linear"),e>0?timer=setTimeout(function(){progressBarDisplay(e-1,t,i)},1e3):(fnLogoutNoConfirm(),CallbackforMobileScreenFromBookNow(null))}document.onclick=function(){_idleSecondsCounter=0,isEventOccur=!0},document.ontouchend=function(){_idleSecondsCounter=0,isEventOccur=!0},document.onmousemove=function(){_idleSecondsCounter=0,isEventOccur=!0},document.onkeypress=function(){_idleSecondsCounter=0,isEventOccur=!0}}function CallbackForMobileToGoBack(e){if($("#dvOnlineBooking").is(":visible"))_shopdetail.HidePopup();else{var t="";"undefined"!=typeof strcheckinAppThemeColor&&null!=strcheckinAppThemeColor&&""!=strcheckinAppThemeColor&&(t="&ThemeColor="+strcheckinAppThemeColor.replace("#","")),location.href="/CheckInApp/checkInSuccess.aspx?BusinessID="+businessID+t+"&DisplayFormFromLogin=false"}return!1}function CallbackforMobileScreenFromBookNow(e){$("html").removeClass("stopscroll"),setTimeout("CallbackforMobileApp('0', '0','' ,'' , '0', '1')",1e3)}function CallbackforMobileApp(e,t,i,n,o,a,s){var r=a;"string"==typeof a&&(r=a.replace(/\\\"/g,'"').replace(/"/g,'\\"'));var l="";if(void 0!==s&&1==s)l=a;else{if($("#divtwofactorauthentication").is(":visible")&&1==a)return $("#dvPhoneVerify").hide(),$("#dvEmailVerify").hide(),void $("#divtwofactorauthentication").modal("hide");l='{"navType": '+e+',"screenType": '+t+',"screenTitle" : "'+i+'","message": "'+n+'","messageType": '+o+',"action" : "'+r+'"}'}null!=window.JSInterface&&window.JSInterface.CallWSMethod(l)}function CallbackforMobileAppPro(e,t,i,n,o,a,s){if($("#divtwofactorauthentication").is(":visible")&&1==a)return $("#dvPhoneVerify").hide(),$("#dvEmailVerify").hide(),void $("#divtwofactorauthentication").modal("hide");var r={};r.navType=e,r.screenType=t,r.screenTitle=i,r.message=n,r.messageType=o,r.action=a,r.jsonData=s,objData="5006||~||"+JSON.stringify(r),window.location="js-call:myObjectiveCFunction:"+objData}function CallbackforMobile(){vgAppicationType==objApplicationType.CustomerApp?(CallbackforMobileApp(0,0,"","",0,"4|~|12"),setTimeout(function(){CallbackforMobileApp(0,0,"","",0,"4|~|1")},200)):CallbackforMobileApp(0,0,"","",0,"2|~|3")}function logoutScanUserSession(){fnLogoutNoConfirm()}function setMobileData(e){var t={},i="";if((t=1==IsSwiftCustomerApp()?e:JSON.parse(e)).hasOwnProperty("callbackIndex")){if("2"==(i=t.callbackIndex))glbDataCheckIn.userId=t.userID;else if("3"==i){var n={};if(n=1==IsSwiftCustomerApp()?t.loginObject:JSON.parse(t.loginObject),glbDataCheckIn.userID=n.userID,glbDataCheckIn.businessID=n.businessID,glbDataCheckIn.currency="undefined"!=n.currency?n.currency:"$",glbDataCheckIn.checkInColor=n.checkInThemeColors,glbDataCheckIn.scanUserID=n.scanUserID,UserID="undefined"!=typeof UserID&&""!=UserID?UserID:0,void 0!==n.scanUserID&&""!=n.scanUserID&&void 0!==n.emailId&&""!=n.emailId&&void 0!==n.scanPassword&&""!=n.scanPassword&&UserID!=n.scanUserID){var o=void 0===n.accessToken?"":n.accessToken;APPSignIn(n.scanUserID,n.scanUserName,n.scanPassword,o)}else void 0!==$("#CheckinpUserName")&&$("#CheckinpUserName").html("Welcome, "+UserName.slice(0,-2)),void 0!==$("#CheckinImgUserProfile")&&(""!=CheckinUserPhoto?$("#CheckinImgUserProfile").addClass("lazy").css("background-image","url('"+CheckinUserPhoto+"')").lazyload():$("#CheckinImgUserProfile").html(FindInitials(UserName,"SP")));"undefined"!=n.idleTimeout&&(glbDataCheckIn.idleTimeout=n.idleTimeout,IDLE_TIMEOUT=n.idleTimeout)}else if("4|~|1"==i||"4|~|13"==i){if(void 0!==(n=1==IsSwiftCustomerApp()?t.loginObject:JSON.parse(t.loginObject)).EmailId&&""!=n.EmailId||(n.EmailId=n.Username),UserID="undefined"!=typeof UserID&&""!=UserID?UserID:0,void 0!==n.DeviceID&&(dInfoValue=n.DeviceID),void 0!==n.UserID&&""!=n.UserID&&void 0!==n.EmailId&&""!=n.EmailId&&UserID!=n.UserID){var a=n.EmailId;void 0!==n.Username&&""!=n.Username&&(a=n.Username);var s=_vggactkn();APPSignIn(n.UserID,a,n.Password.replace("|~~|",'"'),s)}"undefined"!=n.UserID&&""!=n.UserID&&null!=n.UserID&&0!=n.UserID&&null!=navigator.userAgent&&navigator.userAgent.indexOf("com.vagaro.customerios")>-1&&(0==$("#scBookMarkSection").is(":visible")&&setTimeout(function(){_home.loadFavoriteBusinesses()},2e3),0==$("#scUpcomingApptMnts").is(":visible")&&setTimeout(function(){_home.loadUpComingAppointments()},2e3))}else if("4|~|2"==i)fnLogoutwithoutConfirm="undefined"!=typeof UserID&&UserID>0,setTimeout(function(){fnLogoutNoConfirm()},100);else if("4|~|4"==i){if(void 0!==flagSetGeoLocationForApp&&1==flagSetGeoLocationForApp)return setTimeout(function(){flagSetGeoLocationForApp=!1},2e3),void(null!=(c=1==IsSwiftCustomerApp()||"undefined"!=typeof IsBrandedApp&&1==IsBrandedApp?t.locationObject:JSON.parse(t.locationObject))&&void 0!==c.latitude&&void 0!==c.longitude&&(null!=GeoMarker&&GeoMarker.setMap(null),(GeoMarker=new GeolocationMarker(null,null,null,null,c.latitude,c.longitude)).setCircleOptions({fillColor:"#555555"}),GeoMarker.setMap(map)));var r=!0,l=!1;1==parseInt($("#btnBackHomeSearch:visible").data("iscustomerappsearch"))?$("#btnBackHomeSearch:visible").click():$("#btnBackHomeSearch").is(":visible")&&(r=!1),$("#txtLiveStreamLocationSearch").is(":visible")&&(l=!0);var c=1==IsSwiftCustomerApp()||"undefined"!=typeof IsBrandedApp&&1==IsBrandedApp?t.locationObject:JSON.parse(t.locationObject),d="";if(d=$(l?"#txtLiveStreamLocationSearch":r?"#txtLocationSearch":"#txtBusinessLocationSearch"),null!=c&&void 0!==c.placeId&&null!=c.placeId&&""!=c.placeId){var u=new vagaro.ajax;u.datamodel.Token=ApiURLEnumMobile.getlocationsearchbyplaceid,u.datamodel.IsNewVagaroAPI=!0,u.datamodel.data={placeID:c.placeId},u.datamodel.callback=function(e){if(null!=e)if(r){var t=!0;"undefined"!=typeof tabSegment&&null!=tabSegment&&(t="home"==tabSegment.toLowerCase()||"/"==tabSegment||""==tabSegment),onSearchClick("locationSearch",{target:d},e,!0,t)}else e.id="location",e.text=_common.SetCityState(e.city,e.stateCode.toUpperCase()),_common.SetChoiceForSeleect2(d,e),ManageProximityState(e,e.text,!1)},u.datamodel.Error=function(e){},u.Post()}else if(null!=c&&void 0!==c.latitude&&void 0!==c.longitude){var p={coords:{latitude:c.latitude,longitude:c.longitude}};r||$("#txtBusinessLocationSearch").data("selectedid","location"),setCurrentLocationFromDatabase(p,d,"locationSearch",{target:d},{text:c.cityName},"applocationchange",tabSegment)}userAgent&&(userAgent.indexOf("vagaroandroidtablet")>-1||userAgent.indexOf("ipad")>-1)||HideBannerOnHomepage()}else if("4|~|5"==i){var h=0;switch(void 0!==t.tabIndex&&parseInt(t.tabIndex)>0&&(h=parseInt(t.tabIndex)),BrandedAppWithAppleCallback=0,void 0!==t.BrandedAppWithAppleCallback&&parseInt(t.BrandedAppWithAppleCallback)>0&&(BrandedAppWithAppleCallback=parseInt(t.BrandedAppWithAppleCallback)),h){case 0:$(document).ajaxStop(function(){$(this).unbind("ajaxStop"),CallbackforMobileApp(0,0,"","",0,"25")}),hidePopUps();var m=getCookie(ProximityCookieName);m=getCookie(ProximityCookieName);"undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CustomerApp&&(null!=m&&"2"==m.countryid?$("body").addClass("business-grow-bnr"):$("body").removeClass("business-grow-bnr")),_common.loadHome(null),"True"!=isDisplayGiftCardbanner&&1!=isDisplayGiftCardbanner||ShowBannerOnHomepage();break;case 1:var g="listings";if(void 0!==t.serviceName&&null!=t.serviceName&&""!=t.serviceName&&(service=t.serviceName,g="book"),void 0!==t.serviceDateTime&&null!=t.serviceDateTime&&""!=t.serviceDateTime&&(serviceDateTime=moment(t.serviceDateTime,"YYYY-MM-DD--HH:mm").toDate(),serviceDate=serviceDateTime.format("MMM DD,YYYY"),serviceTime=serviceDateTime.format("hh:nn a/p")),void 0!==t.businessType&&null!=t.businessType&&""!=t.businessType)businesstypes=t.businessType,null!=(m=getCookie(ProximityCookieName))&&(m.businesstypes=businesstypes,setCookie(ProximityCookieName,m));void 0!==t.searchMode&&null!=t.searchMode&&parseInt(t.searchMode)>0&&(businessSearchMode=t.searchMode),hidePopUps(),_common.AddState(g),loadData(g,!0),_common.setGeoLocationMarker(g);break;case 2:if(hidePopUps(),$("#mobile-check").is(":visible"))_common.loadSectionsFromMobile("deals",null);else{setdefaultSortingOption("listSort","deals"),$("#ulFeatureBusiness").html('<section class="cards-parent-div-flex daily" id="dealListing">').removeAttr("style"),$("#ulFeatureBusiness").removeAttr("lastcall");_common.loadSections("deals")}break;case 3:try{m=getCookie(ProximityCookieName);$("#spnAppLocationSearch").html(_common.SetCityState(m.city,m.state.toUpperCase()))}catch(e){}hidePopUps(),"undefined"!=typeof tabSegment&&null!=tabSegment&&("home"!=tabSegment.toLowerCase()&&"/"!=tabSegment||$("#mobileBack").hide()),"True"!=isDisplayGiftCardbanner&&1!=isDisplayGiftCardbanner||ShowBannerOnHomepage();break;case 4:$("#divLoginNew").is(":visible")||(hidePopUps(),showLogin("true"))}CallbackforMobileApp(0,0,"","",0,"4|~|12")}else if("4|~|6"==i){h=0,g="profile";var v=null,f=0,C=0,S=["profile","appointments","products","bookmarks","points","reviews","gift","packages","memberships","invoices","paymentmethods","familyfriends","notification","vagaropaylater","payrollhistory"];void 0!==t.tabIndex&&parseInt(t.tabIndex)>0&&(h=parseInt(t.tabIndex)),void 0!==t.appbid&&null!=t.appbid&&parseInt(t.appbid)>0&&(f=parseInt(t.appbid)),void 0!==t.appuid&&null!=t.appuid&&parseInt(t.appuid)>0&&(C=parseInt(t.appuid)),h>0&&h<S.length&&(g=S[h]),"appointments"!=g&&"products"!=g&&"invoices"!=g&&"payrollhistory"!=g||(v=0),"appointments"==g?($("html, body").removeClass("overflowHidden"),"undefined"!=typeof _myAccount&&void 0!==_myAccount.scrollPosition&&_myAccount.scrollPosition>0&&$("html, body").scrollTop(_myAccount.scrollPosition),$(".vg-dropdown-parent").each(function(e,t){$(t).hide().removeClass("active-drop-vg").removeClass("active-vg-dropdown")})):($("#mobileBack").hide(),$("#custmobileBack").show()),f>0&&(g=g+"&appbid&"+f+"&appuid&"+C),"undefined"!=typeof _myAccount&&void 0!==_myAccount.LoadData&&void 0!==_myAccount.backButtonClick?(_myAccount.LoadData(null,g,v,null),_myAccount.backButtonClick()):window.location.href="/myaccount/"+g}else if("4|~|7"==i)$("#divRateDialog").show();else if("4|~|8"==i){if(hidePopUps(!0),"undefined"!=typeof tabSegment&&""!=tabSegment&&"home"!=tabSegment.toLowerCase()&&"/"!=tabSegment){if($("#pageSection").removeAttr("class"),$("#dvHome").show(),0==$("#mobile-check").is(":visible")){$("#dvAdvanceFilter").hide(),$("#pageSection").attr("style","display:none;"),$("#customerAppLocationSearch").show();var y={basepage:"Home",sectionName:"/"};history.replaceState(y,"home","/")}}else if($("#dvDailyDealsDetail").is(":visible")&&($("#dvDailyDealsDetail").hide(),$("#dvHome").show(),$("#btnBackHomeSearch").data("isdealdetailpage","1"),0==$("#mobile-check").is(":visible"))){$("#customerAppLocationSearch").show();y={basepage:"Home",sectionName:"/"};history.replaceState(y,"home","/")}$("#mobile-check").is(":visible")&&$("#divFilterModeMobile").is(":visible")&&HasIdExists(3)&&$("body").removeClass("livestreampage"),$("#mobile-check").is(":visible")?openMobileSearch():($("#dvBusinessLocationSearch").find(".select2-input").click(),$("#dvBusinessLocationSearch").find(".select2-input").get(0).setSelectionRange(0,9999),$("#mobileBack").hide(),$("#custmobileBack").hide()),HasIdExists(1)?($(".mobile-tabs-menu #aBusinessTab").removeClass("w--current"),$(".mobile-tabs-menu #aMobileTab").addClass("w--current"),$(".mobile-tabs-menu #aStreamTab").removeClass("w--current")):HasIdExists(2)?($(".mobile-tabs-menu #aBusinessTab").addClass("w--current"),$(".mobile-tabs-menu #aMobileTab").removeClass("w--current"),$(".mobile-tabs-menu #aStreamTab").removeClass("w--current")):HasIdExists(3)&&($(".mobile-tabs-menu #aBusinessTab").removeClass("w--current"),$(".mobile-tabs-menu #aMobileTab").removeClass("w--current"),$(".mobile-tabs-menu #aStreamTab").addClass("w--current"))}else if("4|~|9"==i){try{$("#covidReadnessPopup").length>0&&$("#covidReadnessPopup").is(":visible")&&$("#covidReadnessPopup").modal("hide")}catch(e){}$("#custmobileBack").is(":visible")?$("#custmobileBack").click():$("#mobileBack").is(":visible")?$("#mobileBack").click():$("#btnBackHomeSearch").is(":visible")?$("#btnBackHomeSearch").click():CallbackforMobileApp(0,0,"","",0,1)}else if("4|~|10"==i){var b;b=1==IsSwiftCustomerApp()?t.reviewData:JSON.parse(t.reviewData),_myAccount.onReviewClick(b.AppointmentID,"true",b.Serviceprovidername,b.ServiceProviderID,b.ReviewPoint,null,b.BusinessID,b.ShopName,null,b.BusinessImage,null,b.sGroup,null,null,b.overAllRating,!0)}else if("4|~|11"==i){var k;void 0!==(k=1==IsSwiftCustomerApp()?t.bubbleCount:JSON.parse(t.bubbleCount))&&void 0!==k.InvoiceCount&&"-1"==k.InvoiceCount&&void 0!==k.UserGroup&&null!=k.UserGroup&&""!=k.UserGroup&&setTimeout(function(){_home.GetOutStandingReviewAndInvoiceCntForMobileApp(k.UserGroup)},2e3)}else if("4|~|12"==i)n=1==IsSwiftCustomerApp()?t.userDeviceInfoObject:JSON.parse(t.userDeviceInfoObject),dInfoValue=n.DeviceID;else if("69"==i||"45"==i)_vgLiveStream.SetMobileData(t);else if("49|~|2"==i){if("1"==(w=JSON.parse(t.returnObject)).CallFrom)_shopdetail.SetBookData(w.ServiceID,w.providerID,w.styleID,w.styleName,w.bookingDateTime,w.PromotionID,w.EventType,w.isdeeplinkentry,w.PromotionProviderIds);else if("2"==w.CallFrom)_shopdetail.SetBookData(w.ServiceID,0,0,"","","",w.EventType,!1,w.PromotionProviderIds);else if("3"==w.CallFrom){for(var _=_shopdetail.VisibleControlLength("#dvSections .dvSectionDynamic")+1,D=1;D<=_;D++){var I=$(P="#cboServiceProviderWaitlist_Search"+D).data("PromotionProviderID");void 0!==I&&null!=I&&($(P).val(I.split(",")),$(P).trigger("change"))}LoadDatawithCheckOutcall("rebind")}}else if("49|~|1"==i){var w;if("1"==(w=JSON.parse(t.returnObject)).CallFrom)_shopdetail.SetBookData(w.ServiceID,w.providerID,w.styleID,w.styleName,w.bookingDateTime,w.PromotionID,w.EventType,w.isdeeplinkentry);else if("2"==w.CallFrom)_shopdetail.SetBookData(w.ServiceID,0,0,"","","",w.EventType,!1,null);else if("3"==w.CallFrom){for(_=_shopdetail.VisibleControlLength("#dvSections .dvSectionDynamic")+1,D=1;D<=_;D++){var P;$(P="#cboServiceProviderWaitlist_Search"+D).val(""),$(P).trigger("change")}LoadDatawithCheckOutcall("rebind")}}else if("50|~|2"==i){var A;try{A=JSON.parse(t.returnObject)}catch(e){A=t.returnObject}$(A.ControlId).select2("close")}if("52|~|2"==i){if(_shopdetail.customerBrowserdetails.TIME_ZONE=OnlindBookingResponse.clsTimeZone.TIME_ZONE,_shopdetail.customerBrowserdetails.CUSTOM_DAY_LIGHT_SAVING=OnlindBookingResponse.clsTimeZone.CUSTOM_DAY_LIGHT_SAVING,_shopdetail.customerBrowserdetails.CountryID=OnlindBookingResponse.clsTimeZone.CountryID,_shopdetail.customerBrowserdetails.CustomerTimezone=parseFloat(t.CustomerTimezone),navigator.userAgent.indexOf("com.vagaro.customerios")>-1){var T=$.grep(timeZoneOffSetArrayBooking,function(e){if(e.Id==_shopdetail.customerBrowserdetails.CustomerTimezone)return e.TimeZoneId});T.length>0&&(_shopdetail.customerBrowserdetails.Customerzoneid=T[0].TimeZoneId)}else _shopdetail.customerBrowserdetails.Customerzoneid=t.Customerzoneid;_shopdetail.customerBrowserdetails.CustomerCulture=t.CustomerCulture}}}function fnLogoutNoConfirm(){"undefined"!=typeof _vgClassSessionSelection&&(_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.ExceptionStorage)),"undefined"!=typeof _onlineCheckout&&_onlineCheckout.GetCartItemCount(0),"undefined"!=typeof _shopdetail&&"function"==typeof _shopdetail.GetRescheduleDetail&&null!=_shopdetail.GetRescheduleDetail()&&_shopdetail.ClearClassControls(!0),"undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart&&(onlineShoppingCart={}),"undefined"!=typeof onlineShoppingCartmain&&null!=onlineShoppingCartmain&&(onlineShoppingCartmain={}),CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed)}function APPSignIn(e,t,i,n){var o={fNam:null,lNam:null,gendr:null};o.uNam=t,o.pwrd=void 0!==i&&""!==i?EncPV(i):"",o.email=null,o.fbUserID=null,o.sCardID=null,o.lType=1,o.bRem=!1,o.bUpdateFTime=!0,o.operatingSystem="",o.clientDate="",o.ky=getek(),o.ki=getei(),o.cap="undefined"==typeof mobileSessionId?"":mobileSessionId,o.wsUserid=e,o.gCapcha="",o.ctype="",o.bid=0,"undefined"==typeof dInfoValue||String.isNullOrUndefineOrBlank(dInfoValue)?(o.vid="",o.fpID=""):(o.vid=dInfoValue,o.fpID=dInfoValue),isFromAppAutoSignIn=!0,o.vid="",o.atCode="",o.isFromCookieLessWidget=!1,o.ssoId="",o.acctkn=n,CallWSJSON("MySampleService.asmx/SignIn",JSON.stringify(o),CallSuccessLoginCtrl,CallFailed)}function hidePopUps(e){($("#divLoginNew").is(":visible")||$("#dvRegister").is(":visible"))&&LoginClosePopup(),$(".cancel-select-service:visible").length>0?($("#btnBackHomeSearch:visible").data("iscustomerappsearch",null),$("#search-bar-wrapper-all").fadeOut(0),$("body").removeClass("banner-hide-custapp"),$("html,body").removeClass("mob-overflow-hidden"),$("#select2-drop-mask").click()):0==(void 0!==e&&1==e)&&$("#btnBackHomeSearch").is(":visible")&&($("#btnBackHomeSearch:visible").data("isdealdetailpage",null),closeMobileSearch()),0==$("#mobile-check").is(":visible")&&($("#dvBusinessLocationSearch").find(".select2-input").trigger("blur"),$("#select2-drop-mask").click()),0==$("#mobile-check").is(":visible")&&($("#dvSearchServiceMain").find(".select2-input").trigger("blur"),$("#select2-drop-mask").click()),$("#dvDailyDealsDetail").is(":visible")?$("#mobile-check").is(":visible")?HideShowdatepicker(!1,{divid:"#divServiceDateMobile",textid:"#txtServiceDateMobile",flagVgMultiMonthDatePicker:!0}):HideShowdatepicker(!1,{divid:"#divServiceDateWeb",textid:"#txtServiceDateWeb"}):HideShowdatepicker(!1,{divid:"#divHomeServicesDate",textid:"#txtHomeServicesDate"}),1==$("#live-stream-classes-popup").is(":visible")&&$("#live-stream-classes-popup").modal("hide")}function GetAppVersion(){var e=null;try{var t=navigator.userAgent.split("(VagaroApp");if(t.length>0){var i=t[1].split(")")[0];if(null!=i&&void 0!==i&&i.length>0){var n=i.replace(")","").replace(" ","");e=n.split(".").length<3?n.replace(".","")+"0":n.replace(".","").replace(".","")}}}catch(e){}return e}if(CallbackforMobile(),"function"!=typeof CallWSJSON)function CallWSJSON(e,t,i,n){if("undefined"==typeof keepAlive&&$("#IsWaitforKeepALive").length>0&&void 0!==$("#IsWaitforKeepALive").val()&&"true"===$("#IsWaitforKeepALive").val().toLowerCase())setTimeout(function(){CallWSJSON(e,t,i,n)},500);else{var o=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";"undefined"!=typeof regionId&&""!=regionId&&(o=o+regionId+"/"),e=o+"WebServices/"+e,$.ajax({type:"POST",contentType:"application/json; charset=utf-8",beforeSend:function(e){if("undefined"!=typeof keepAlive&&e.setRequestHeader("keepAlive",keepAlive),1==$("#hdnToken1").length&&void 0!==$("#hdnToken1").val()&&e.setRequestHeader("token1",$("#hdnToken1").val()),1==$("#hdnToken2").length&&void 0!==$("#hdnToken2").val()&&e.setRequestHeader("token2",$("#hdnToken2").val()),"undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget())"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&e.setRequestHeader("widgetcookievalue",widgetcookievalue);else try{void 0!==window.parent._common&&void 0!==window.parent._common.IsCookieLessWidget&&window.parent._common.IsCookieLessWidget()&&"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&e.setRequestHeader("widgetcookievalue",widgetcookievalue)}catch(e){}},url:e,data:t,dataType:"json",success:i,error:function(e,t,i){try{if(403===e.status)return alert("Your session is expired. Please reload your page."),void location.reload(!0);""!=n&&null!=n&&null!=n&&"function"==typeof n&&n(e,t,i)}catch(e){}}})}}function _vggactkn(){try{for(var e="s_utkn=",t=document.cookie.split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(e))return n.substring(7,n.length)}return""}catch(e){return""}}function ShowBannerOnHomepage(){"undefined"!=typeof vgAppicationType&&vgAppicationType===objApplicationType.CustomerApp&&($("body").addClass("homePageBody"),$("#holidayGcBanner").show()),!$("#holidayGcBanner").is(":visible")||"True"!=isDisplayUkBanner&&1!=isDisplayUkBanner||$("body").addClass("homepageUKBanner")}function HideBannerOnHomepage(){"undefined"!=typeof vgAppicationType&&vgAppicationType===objApplicationType.CustomerApp&&$("#holidayGcBanner").length>0&&($("#holidayGcBanner").hide(),$("body").removeClass("homePageBody"),$("body").removeClass("homepageUKBanner")),setTimeout(function(){"undefined"!=typeof vgAppicationType&&vgAppicationType===objApplicationType.CustomerApp&&$("#holidayGcBanner").length>0&&($("#holidayGcBanner").hide(),$("body").removeClass("homePageBody"),$("body").removeClass("homepageUKBanner"))},1e3)}}userAgent=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase();iPadDevice=null!=userAgent.match(/iPad/i),iPadAndroid=userAgent.match(/ipad/i)||userAgent.match(/iphone/i)||userAgent.match(/itouch/i)||userAgent.match(/android/i)||!1,iPadAndroidNew=!!(userAgent.match(/ipad/i)||userAgent.match(/iphone/i)||userAgent.match(/itouch/i)||userAgent.match(/android/i)),isAndroidMobile=null!=userAgent.match(/Android/i)&&null!=userAgent.match(/Mobile/i)&&null==userAgent.match(/Windows/i)&&$("#mobile-check").is(":visible"),isiPhone=(null!=userAgent.match(/ipad/i)||null!=userAgent.match(/iphone/i))&&$("#mobile-check").is(":visible"),isiPhone4=(null!=userAgent.match(/ipad/i)||null!=userAgent.match(/iphone/i))&&$("#tinymobile-check").is(":visible"),isAndroid=!(!userAgent.match(/Android/i)&&!userAgent.toLowerCase().match(/kf/i)),iMacSafari=userAgent.match(/safari/i)&&userAgent.match(/mac/i)||!1,iMacSafariBrowser=/^((?!chrome|android).)*safari/i.test(userAgent),isWebKit=userAgent.match(/webkit/i)||!1,isEdge=userAgent.match(/edge/i)||!1,isWindowsPhone=/windows phone/i.test(navigator.userAgent.toLowerCase()),isWindowsPhoneTemp=/windows phone/i.test(navigator.userAgent.toLowerCase()),iOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,isiOSPRO=userAgent.match(/com.vagaro.iospro/i),isFromInstagram=userAgent.match(/instagram/i)||!1,isFirefoxBrowser="undefined"!=typeof InstallTrigger,ignoreHistory_IOS=!1,lattitude="",longitude="",isNewIpadVersion=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);var redirecttodevicetabname="",selectedShopId=0,microServiceID=0,PrmotionfreeCode="Free",isFilterScreen=!1,flagBackButton=!1,styleCategoryName="",businesstypes="",h1="",title="",category="",isExceptionCount=0,countryMapping={1:"us",2:"gb",3:"ca",4:"au"},countryMapImage={1:"us-f",2:"uk-f",3:"canada-f",4:"aus-f"},countryNameMapping={1:"United States of America",2:"United Kingdom",3:"Canada",4:"Australia"},IdSearchServiceMain="#txtSearchServiceMain",DocIdSearchServiceMain="txtSearchServiceMain",IsGallerywithsp=!1,IsGallerySp=!1;countryDetailList={USA:1,UK:2,Canada:3,Australia:4};var IdBusinessLocationSearch="#txtBusinessLocationSearch",DocIdBusinessLocationSearch="txtBusinessLocationSearch",IdHomeServicesDate="#txtHomeServicesDate",isMobileBrowserFilterScreen=!1,isBackHomeScreen=!1,NotmobileorIphone=!0,service="";businessName="",UserName=$("#hdnUserName").val(),FullUserName=$("#hdnFullUserName").val(),UserID=$("#hdnUserId").val(),strUserID=$("#hdnStrUserId").val(),UserType=$("#hdnUserType").val(),UserEmail=$("#hdnUserEmail").val(),UserCellNo=$("#hdnUserCellNo").val(),CheckinUserPhoto=$("#hdnUserImage").val();var iosDevices=/iPad|iPhone|iPod|iTouch/.test(navigator.userAgent)&&!window.MSStream,isRedomap=!1,IsDefaultLocation=!0,flagSetGeoLocationForApp=!1,cdnImagePath="",ApiPath="websiteapi/homepage/",IsUserGroupCheck=!1,shopdetailuserGroupId="",BeautyHrefLink="",myLikedStyleUrlValue="/my-liked-styles",MyAccountApiPath="myaccountapi/homepage/",CoreAPIURL="",urlService="";"undefined"!=typeof VagaroCoreAPIUrl&&(CoreAPIURL=VagaroCoreAPIUrl);var ApiURLEnumOnlineCommon={getlocationsearchbyplaceid:ApiPath+"getlocationsearchbyplaceid",geteventdetails:ApiPath+"geteventdetails",getupcominglivestreamclasses:ApiPath+"getupcominglivestreamclasses",getserviceproviderreview:ApiPath+"getserviceproviderreview",getupcomingappintmentdata:ApiPath+"getupcomingappintmentdata",getloginusergroups:ApiPath+"getloginusergroup",getloginusergroup:ApiPath+"getloginusergroupstring",EmployeeExistsInGustoAPI:"vagaropayroll/employeeexistsingusto"};(InPageWidget_Ios=self!==top&&iosDevices)?(ScrollTarget=$("body"),datePicker_contentWindow="body"):(ScrollTarget=$(window),datePicker_contentWindow=window);var refUrl=document.referrer,referrer=null==refUrl||""==refUrl?"false":"true";CommonFromPage="DefaultMaster";var timerIDHomeUpcomingAppnt,_gblUCAppmntCurrentTimeDiff="";"undefined"==typeof initialpageData&&(initialpageData=null),"undefined"==typeof initialReviewpageData&&(initialReviewpageData=null),"undefined"==typeof homeinitialpageData&&(homeinitialpageData=null),"undefined"==typeof initialPromotionData&&(initialPromotionData=null);var appleLoginSourceVar,urlPath,emptyHeartClass="unliked",ApiURLEnumCommon={loadusercontrol:ApiPath+"loadusercontrol",likestyle:ApiPath+"likestyle"},LoadMenuTypeEnum={booknow:1,classes:2,services:3},cookieValue=0,isSignupvar=!1,isLoginvar=!1,LoginTypes={login:1,facebook:3,apple:5,google:2,google_new:4},platform={loginStandard:"vagaro",signUpStandard:"vagaro",loginFacebook:"facebook",signUpFacebook:"facebook",loginGoogle:"google",signUpGoogle:"google",loginApple:"apple",signUpApple:"apple"},isClickForOnlineStore=!1,isClickForOnlineGCStore=!1,isClickForBNPL=!1,ZoomURL="javascript:void(0);",Category_STORE="AdminCategory",DB_NAME="AdminServiceDB",CATEGORY_DB_NAME="AdminCategoryDB",STORE_NAME="AdminServices",TTL_TIME=1728e5;$(window).on("resize",function(){setTimeout(function(){$(".modal:visible").each(function(e,t){centerModal(t)}),"undefined"!=typeof _siteBuilderDetail&&null!=_siteBuilderDetail&&""!=_siteBuilderDetail&&void 0!==_siteBuilderDetail.isRequestFromVagaro&&null!=_siteBuilderDetail.isRequestFromVagaro&&""!=_siteBuilderDetail.isRequestFromVagaro&&"true"==_siteBuilderDetail.isRequestFromVagaro&&"undefined"!=typeof IsNewCustomWebsite&&1==IsNewCustomWebsite&&($("body").find('[data-custom-component="pagemenusection"]').html(""),_siteBuilderDetail.GetnavbarMenuSectionComponent($("body").find('[data-custom-component="pagemenusection"]')))},500),_home.RegisterHomePageSilder(),upcomingSlider_mobile(),$("html").hasClass("loginpopopenHtml")&&setTimeout(function(){$("body, html").scrollTop(0)},500),$("html").hasClass("loginmodalpopup")&&setTimeout(function(){$("body, html").scrollTop(0)},500)});var ctlrSearchService=function(e,t){if(void 0!==t.placeholder&&""!=t||((t={}).dropdownCssClass="",t.isInitSelection=!1,t.isSearchRequire=!1,t.selectOnClick=!0,t.placeholder=""),e.select2({searchInputPlaceholder:void 0!==t.placeholder&&""!=t.placeholder?t.placeholder:"",combobox:t.isSearchRequire,selectOnClick:NotmobileorIphone?t.selectOnClick:NotmobileorIphone,minimumInputLength:void 0===e||"#ddlLiveStreamClass"!=e.selector&&"#ddlServices"!=e.selector&&e.selector!=IdSearchServiceMain&&"#txtMobileService"!=e.selector?0:1,maximumInputLength:void 0!==e&&"#txtSalonServicesForGC"==e.selector?200:100,dropdownCssClass:t.dropdownCssClass,formContainer:"#page-wrapper",formatInputTooShort:!1,formatNoMatches:!1,collapasable:_common.VisibleControlLength("#mobile-check")>0,data:function(){if(void 0!==t.serviceList)return $.extend(!0,[],t.serviceList);var i=$.extend(!0,[],AdminServiceList);if(""!=AdminServiceList){var n=[],o=(n=$.grep($.extend(!0,[],AdminServiceList).results,function(t,i){var n=!1;if(void 0!==t.CountryID&&(0==t.CountryID||t.CountryID==countryid)){var o=$.grep(t.children,function(t,i){return!(void 0===t.CountryID||0!=t.CountryID&&t.CountryID!=countryid||""!=e.val()&&1!=SearchAdminService(e.val(),t.text,t))});o.length>0&&(t.children=o,n=!0)}return n}),[]),a=[];if(0==n.length){var s=$.grep($.extend(!0,[],AdminServiceList).results,function(e,t){if(void 0!==e.CountryID&&(0==e.CountryID||e.CountryID!=countryid)&&-1==o.indexOf(e.text)){e.children=[],o.push(e.text);var i=!1;if($.grep($.extend(!0,[],AdminServiceList).results,function(t,n){$.grep(t.children,function(t,n){void 0===t.CountryID||e.CountryID==countryid||e.CountryID!=t.CountryID&&0!=e.CountryID||t.ParentId!=e.ParentId||-1!=a.indexOf(t.text)||(a.push(t.text),e.children.push(t),i=!0)})}),i)return!0}});n=$.grep(s,function(t,i){var n=!1,o=$.grep(t.children,function(t,i){return 1==SearchAdminService(e.val(),t.text,t)});return o.length>0&&(t.children=o,n=!0),n})}i.results=$.extend(!0,[],n)}try{e.selector!=IdSearchServiceMain&&"#ddlLiveStreamClass"!=e.selector||void 0===i||void 0===i.results||(i.results=$.grep(i.results,function(e,t){return 0!=e.EventType}))}catch(e){}return i},initSelection:function(e,i){1==t.isInitSelection&&i(""==service?{id:service,text:"Select Service"}:{id:service,text:service})},matcher:function(e,t,i){var n=SearchService(e,t,i,!1);return 0==n&&e.length>=3&&(n=SearchService(e,t,i,!0)),n}}).on("select2-loaded",function(t){$("div.select2-result-label > span.select2-match").attr("style","font-weight:bold;/*background-color: gray*/;color: #333;"),""!=$(IdSearchServiceMain).parent().find(".select2-input").val()||""!=$("#ddlServices").parent().find(".select2-input").val()||""!=$("#txtMobileService").parent().find(".select2-input").val()||"ddlLiveStreamClass"==t.target.id&&""!=$("#ddlLiveStreamClass").parent().find(".select2-input").val()?$("#select2-drop.service-what-dropdown").removeClass("service-data-only"):($("#select2-drop.service-what-dropdown").addClass("service-data-only"),("undefined"!=typeof vgAppicationType&&1==vgAppicationType||$("#mobile-check").is(":visible"))&&1==$("#"+$(IdSearchServiceMain).data("select2").containerId).data("isclass")&&($(".service-data-only ul li:first").addClass("parentli-expanded"),$(".service-data-only ul li ul:first li").each(function(){$(this).css("display","list-item")}))),void 0===e||"#ddlLiveStreamClass"!=e.selector&&"#ddlServices"!=e.selector&&e.selector!=IdSearchServiceMain||null==$("#select2-drop ul.select2-results")||(0==$("#select2-drop ul.select2-results").has("li").length?($("#select2-drop ul.select2-results").parent().addClass("selectbox-hide"),e.selector==IdSearchServiceMain&&$("#select2-drop ul.select2-results").parent().addClass("selectbox-hide-border")):($("#select2-drop ul.select2-results").parent().removeClass("selectbox-hide"),e.selector==IdSearchServiceMain&&$("#select2-drop ul.select2-results").parent().removeClass("selectbox-hide-border")))}).on("selected",function(i){if(_common.closeServiceSelection(),$(i.target).data("selectedid",i.choice.id),void 0!==e.data("choice")){if(_common.SetChoiceForSeleect2(e,i.choice),void 0!==i.choice.EventType&&(_eventType=i.choice.EventType,"ddlServices"!=i.target.id&&"txtMobileService"!=i.target.id||(1==_eventType?tabSegment="book":2==_eventType?tabSegment="class":0==_eventType&&(tabSegment="listing"))),"ddlLiveStreamClass"==i.target.id){var n=service;n=$("#ddlLiveStreamClass").data("select2").getVal().toString(),service!=n&&(_common.SetChoiceForSeleect2($("#ddlLiveStreamClass"),i.choice),$("#ddlLiveStreamClass").parent().find(".select2-input").val(n),_common.setLiveStreamSearchFilterVal(i.choice,n),void 0!==_gblLiveStreamSearchServiceName&&""!=_gblLiveStreamSearchServiceName&&(_gblLiveStreamSearchServiceName="",_common.AddState(_common.liveStreamClasses)),ElasticSearchLiveStream())}else if("book"==tabSegment||"class"==tabSegment){$("#divServiceDate").show(),$("#pageSection").addClass("booking-dateshow"),$("#mobileDateChange").removeClass("listing-mapfiler");n=service;n=$("#mobile-check").is(":visible")?$(IdSearchServiceMain).is(":visible")?$(IdSearchServiceMain).data("select2").getVal().toString():$("#txtMobileService").data("select2").getVal().toString():$("#ddlServices").data("select2").getVal().toString(),service!=n&&(bookSearchItemType=[],$("#mobile-check").is(":visible")&&"txtMobileService"==i.target.id&&(ResetBusinessSearchModeMobile(),togglebusinesssearch(2)),_common.SetChoiceForSeleect2($("#ddlServices"),i.choice),$("#ddlServices").parent().find(".select2-input").val(n),_common.SetChoiceForSeleect2($("#txtMobileService"),i.choice),$("#txtMobileService").parent().find(".select2-input").val(n),_common.SetChoiceForSeleect2($(IdSearchServiceMain),i.choice),$(IdSearchServiceMain).parent().find(".select2-input").val(n),_featured.applyServiceFilters()),_common.AddState(tabSegment)}else"listing"==tabSegment?_common.LoadListing():(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&void 0!==i.target&&void 0!==i.target.id&&"txtSalonServicesForGC"!=i.target.id&&"dvDealMobileService"!=i.target.id&&"undefined"!=typeof _eventType&&($("#divBusType").attr("style",""),$("#aMobileTab").show(),$("#btnSearchBuss").removeClass("mob-class-serachspace"),ResetBusinessSearchMode(),togglebusinesssearch(2));void 0!==t.FromGC&&t.FromGC&&_shopdetail.OnSelectionChangeServices()}}).on("select2-close",function(i){if($("html, body").removeClass("searchaddservclass"),_common.closeServiceSelection(),$("#select2-drop-mask").removeClass("hidemask"),setTimeout(function(){$("#select2-drop-mask").off("touchstart.custom")},500),void 0!==e.data("choice"))if(""!=(o=e.data("select2").getVal().toString())){$("#dvSearchServiceMain").removeClass("inputError");var n=_common.GetChoiceForSeleect2(e),o="";o=i.target.id==DocIdSearchServiceMain?$(IdSearchServiceMain)[0].value:"txtMobileService"==i.target.id?$("#txtMobileService")[0].value:"ddlLiveStreamClass"==i.target.id?$("#ddlLiveStreamClass").val():$("#ddlServices").val();var a="",s="",r=1;if(i.target.id==DocIdSearchServiceMain)if(null!=n&&void 0!==n.EventType&&null!=n.EventType&&""!=n.EventType&&n.text==o)r=n.EventType;else{var l=$(IdSearchServiceMain).data("select2").containerId;r=null==$("#"+l).data("isclass")||0==$("#"+l).data("isclass")?1:2,bookSearchItemType=[]}else"ddlServices"==i.target.id||"txtMobileService"==i.target.id?(s=n.text,"class"==tabSegment?r=2:"book"==tabSegment&&(r=1)):"ddlLiveStreamClass"==i.target.id&&(s=n.text,r=2);if(null!=AdminServiceList.results&&AdminServiceList.results.length>0&&"dvDealWebService"!=i.target.id&&"dvDealMobileService"!=i.target.id&&"txtSalonServicesForGC"!=i.target.id){var c,d,u;$.grep(AdminServiceList.results,function(e,t){ChildsResults=$.grep(e.children,function(t,i){if(t.text==o&&t.EventType==r)return a=e.text,c=t.id,d=t.text,void(u=t.EventType)})});if("All Services and Classes"==o&&(a=o),""==a||"Custom Service"==a||"Custom Class"==a){var p=$.grep(AdminServiceList.results,function(e,t){return"Custom Service"==e.text}),h=$.grep(AdminServiceList.results,function(e,t){return"Custom Class"==e.text});if(0==p.length&&AdminServiceList.results.push({text:"Custom Service",EventType:"1",children:[],serviceDisplayClass:"hide-home-servicesclass hide-customserviceclass",IsCustom:"1"}),0==h.length&&AdminServiceList.results.push({text:"Custom Class",EventType:"2",children:[],serviceDisplayClass:"hide-home-servicesclass hide-customserviceclass",IsCustom:"1"}),1==r){o=e.data("select2").getVal().toString();var m=AdminServiceList.results.map(function(e){return e.text}).indexOf("Custom Service");AdminServiceList.results[m].children.length=0,AdminServiceList.results[m].children.push({id:"0",text:o,EventType:"1"}),e.select2("data",{id:"0",text:o});n={id:"0",text:o.replace(/(<([^>]+)>)/gi,"").replace(/</g,"&lt").replace(/>/g,"&gt").replace(/=/g,"&#61"),EventType:"1"};_common.SetChoiceForSeleect2(e,n),"ddlLiveStreamClass"==i.target.id&&s!=o&&_common.setLiveStreamSearchFilterVal(n,o)}else{o=e.data("select2").getVal().toString(),m=AdminServiceList.results.map(function(e){return e.text}).indexOf("Custom Class");AdminServiceList.results[m].children.length=0,AdminServiceList.results[m].children.push({id:"0",text:o,EventType:"2"}),e.select2("data",{id:"0",text:o});n={id:"0",text:o.replace(/(<([^>]+)>)/gi,"").replace(/</g,"&lt").replace(/>/g,"&gt").replace(/=/g,"&#61"),EventType:"2"};_common.SetChoiceForSeleect2(e,n),"ddlLiveStreamClass"==i.target.id&&s!=o&&_common.setLiveStreamSearchFilterVal(n,o)}(""==a||null==service||null!=service&&null!=o&&service.toLowerCase()!=o.toLowerCase())&&("ddlServices"==i.target.id||"txtMobileService"==i.target.id?(s!=o&&(bookSearchItemType=[],$("#mobile-check").is(":visible")&&"txtMobileService"==i.target.id&&(ResetBusinessSearchModeMobile(),togglebusinesssearch(2))),0==n.EventType?tabSegment="listing":1==n.EventType?tabSegment="book":tabSegment="class",_featured.applyCustomServiceFilters(i.target.id,tabSegment)):"ddlLiveStreamClass"==i.target.id&&s!=o&&ElasticSearchLiveStream())}else if("undefined"!=c&&null!=c&&"undefined"!=d&&null!=d&&"undefined"!=u&&null!=u){n={id:c,text:d,EventType:u};void 0!==e.data("choice")&&_common.SetChoiceForSeleect2(e,n)}else e.select2("data",{id:n.id,text:n.text})}else e.select2("data",{id:n.id,text:n.text})}else{"book"!=tabSegment&&"class"!=tabSegment||(service="");var g;if(""!=(g=_common.GetChoiceForSeleect2(e)).text&&(bookSearchItemType=[],$("#mobile-check").is(":visible")&&"txtMobileService"==i.target.id&&(ResetBusinessSearchModeMobile(),togglebusinesssearch(2))),e.select2("data",{id:"",text:""}),_common.SetDefaultForSeleect2(e),void 0!==t.FromGC&&t.FromGC&&_shopdetail.OnSelectionChangeServices(),"ddlLiveStreamClass"==i.target.id){if(""!=g.text){ElasticSearchLiveStream();var v=JSON.stringify({id:"",text:""});_common.setLiveStreamSearchFilterVal(v,"")}}else"book"!=tabSegment&&"class"!=tabSegment||(_common.LoadListing(),$("#ancFilter").focus())}(iPadAndroid||isWindowsPhone)&&$("#btnSearchBuss:visible, #ancFilter:visible, #btnDealsBook:visible, #mobileBack:visible").focus()}).on("select2-opening",function(t){e.select2("data",{id:"",text:""})}).on("select2-open",function(i){var n=_common.GetChoiceForSeleect2(e);if(void 0!==n.id&&e.select2("data",{id:n.id,text:n.text}),void 0===t.selectAllText||t.selectAllText)if("ddlServices"==i.target.id||"txtMobileService"==i.target.id){if("txtMobileService"==i.target.id&&(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&"txtMobileService"==$(i.target).attr("id"))if($(this).val().length>0){var o=$("#mobileServiceChange .select2-input");o.length&&0===o.next("#mobileServiceChange .vg-search-cancel-icon").length?(o.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),$("#mobileServiceChange .vg-search-cancel-icon").show()):o.length&&o.next("#mobileServiceChange .vg-search-cancel-icon").length>0&&$("#mobileServiceChange .vg-search-cancel-icon").show()}else $("#mobileServiceChange .vg-search-cancel-icon").hide();$(i.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)}else if(i.target.id!=DocIdSearchServiceMain&&setTimeout(function(){$(i.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)},100),i.target.id==DocIdSearchServiceMain&&(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&"txtSearchServiceMain"==$(i.target).attr("id"))if($(this).val().length>0){var a=$("#dvSearchServiceMain .select2-container .select2-input");a.length&&0===a.next("#dvSearchServiceMain .vg-search-cancel-icon").length?(a.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),$("#dvSearchServiceMain .vg-search-cancel-icon").show()):a.length&&a.next("#dvSearchServiceMain .vg-search-cancel-icon").length>0&&$("#dvSearchServiceMain .vg-search-cancel-icon").show()}else $("#dvSearchServiceMain .vg-search-cancel-icon").hide();$("#dvInnerGCContainer").length&&$("#dvInnerGCContainer").addClass("gc-transformnone"),$(i.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common"),setTimeout(function(){$("html, body").addClass("moboverflow-hide")},200),$("html, body").addClass("searchaddservclass"),$("#select2-drop-mask").addClass("hidemask"),void 0===t.FromGC&&$("html, body").animate({scrollTop:0}),(void 0===t.scrollTop||t.scrollTop)&&$("html, body").animate({scrollTop:0}),(void 0===t.selectAllText||t.selectAllText)&&("ddlServices"==i.target.id||"txtMobileService"==i.target.id?$(i.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999):i.target.id!=DocIdSearchServiceMain&&setTimeout(function(){$(i.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)},100)),void 0===e||"#ddlLiveStreamClass"!=e.selector&&"#ddlServices"!=e.selector&&e.selector!=IdSearchServiceMain||null==$("#select2-drop ul.select2-results")||(0==$("#select2-drop ul.select2-results").has("li").length?($("#select2-drop ul.select2-results").parent().addClass("selectbox-hide"),e.selector==IdSearchServiceMain&&$("#select2-drop ul.select2-results").parent().addClass("selectbox-hide-border")):($("#select2-drop ul.select2-results").parent().removeClass("selectbox-hide"),e.selector==IdSearchServiceMain&&$("#select2-drop ul.select2-results").parent().removeClass("selectbox-hide-border")))}),e.on("select2-focus",function(e){$("#txtHomeServicesDate_picker").length&&$("#txtHomeServicesDate_picker").is(":visible")&&$("#txtHomeServicesDate_picker").hide(),void 0===e.target||void 0===e.target.id||null==typeof e.target.id||""==typeof e.target.id||"dvDealWebService"!=e.target.id&&"dvDealMobileService"!=e.target.id||$("input.select2-input").attr("autocomplete","off"),setTimeout(function(){$("#dvInnerGCContainer").length&&$("#dvInnerGCContainer").addClass("gc-transformnone"),$(e.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common"),$("html, body").addClass("moboverflow-hide"),$("html, body").addClass("searchaddservclass"),$("#select2-drop-mask").addClass("hidemask"),void 0===t.FromGC&&$("html, body").scrollTop(0),(void 0===t.scrollTop||t.scrollTop)&&$("html, body").scrollTop(0)},200)}),"#dvDealWebService"!=e.selector&&"#dvDealMobileService"!=e.selector&&""!=service){service=htmlDecode(service),e.select2("data",{id:service,text:service});var i={id:service,text:service};void 0!==e.data("choice")&&_common.SetChoiceForSeleect2(e,i)}else e.select2("data",{id:"",text:""}),void 0!==e.data("choice")&&_common.SetDefaultForSeleect2(e);applyJqueryScroll(".select2-results")};function SearchAdminService(e,t,i){var n=SearchService(e,t,i,!1);return 0==n&&e.length>=3&&(n=SearchService(e,t,i,!0)),n}function SearchService(e,t,i,n){for(var o=/\s\s+/g,a=/[^0-9a-zA-Z\" \"]+/gi,s=e.replace(o," "),r=(s=s.toLowerCase().replace(a,"")).split(" "),l="",c=r.length,d=0,u=0;u<=r.length-1;u++){var p=t.replace(o," ");if(p=p.toLowerCase().replace(a,""),(0==n&&(p.match("^"+r[u])||-1!=p.indexOf(" "+r[u]))||n&&p.match(r[u]))&&((""==l||r[u].indexOf(l)<0)&&(d+=1),l=" "+p,d>=c))break}return d>=c&&(i.isShow=!0,!0)}function HasIdExists(e){return-1!=businessSearchModeForSelection.indexOf(e)}function ResetBusinessSearchMode(){$("#divBusType #aStreamTab").hasClass("w--current")||($("body").removeClass("livestreampage"),businessSearchModeForSelection=[0,2],businessSearchMode=2)}function ResetBusinessSearchModeMobile(){businessSearchModeForSelection=[0,2],businessSearchMode=2}function setsTkn(){$("#hdn_s_utkn").length>0&&setLogintkn($("#hdn_s_utkn").val())}function readCookie(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return null}function checkVisible(e){if(void 0!==e&&null!=e&&$(e).is(":visible")){var t=e.getBoundingClientRect(),i=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(t.bottom<0||t.top-i>=0)}return!1}function showMoreContentCommon(e,t){var i=$(e),n=i.parent().find(".elementshowmore"),o=$($(n).selector)[0].scrollHeight;i.hasClass("active")?(setTimeout(function(){$($(n).selector).animate({height:"78px"},300)},50),i.removeClass("active"),i.html("More")):(setTimeout(function(){$($(n).selector).animate({height:o+"px"},300)},50),i.addClass("active"),i.html("Less")),t.stopPropagation(),t.preventDefault()}function showMoreclmsg(e,t){var i=$(e),n=i.parent().find(".class-msg-ul"),o=$($(n).selector)[0].scrollHeight;i.hasClass("active")?($($(n).selector).animate({height:"78px"},200),i.removeClass("active"),i.html("More")):($($(n).selector).animate({height:o+20+"px"},200),i.addClass("active"),i.html("Less")),t.stopPropagation(),t.preventDefault()}function ShowLoader(e){1==e?($("#apgLoading").show(),showLoadingCenter(".loader-imgNew"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,14)):$("#apgLoading").hide()}function centerModal(e){null==e&&(e=this),$(e).css("display","block");var t=$(e).not(".in").find(".modal-dialog");0==t.length&&(t=$(e).find(".modal-dialog"));var i=window;$(e).closest(".modal-dialog").length>0&&(i=$(e).closest(".modal-dialog"));var n=Math.min($(i).height(),screen.availHeight);"undefined"!=typeof window_top&&"number"==typeof window_top||(window_top=0);var o=window_top+(n-t.height())/2;t.css("margin-top",o)}function RemoveAccents(e){var t,i,n=(e=e.split("")).length;for(t=0;t<n;t++)-1!=(i="ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž".indexOf(e[t]))&&(e[t]="AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz"[i]);return e.join("")}function GetPlainTextForLocationSearch(e){for(var t=["/"," "],i=e,n=0;n<e.length;n++)-1!=t.indexOf(e[n])&&(i=" "==e[n]?i.replace(e[n],"-"):i.replace(e[n],""));return i}function callBackLoginToHome(e){if(RedirectToCalendar="no",0==e)_common.reloadstyle=!0;else{if(void 0!==_shopdetail.setLoginControl&&(_shopdetail.setLoginControl(),_shopdetail.setBookTextOnLoginlogout(!0)),($("#photos").hasClass("active")||$("#divstyles").is(":visible")||"undefined"!=typeof _common&&void 0!==_common.isFromLikeStyle&&!0===_common.isFromLikeStyle)&&(_common.reloadstyle?_common.GetUserLike():0==_common.reloadstyle&&_common.SetGalleryData()),"detail"===BasePage.toLowerCase()){null!=_shopdetail.bookmarkonlogin&&1==_shopdetail.bookmarkonlogin?(_shopdetail.addToFavorite(),_shopdetail.bookmarkonlogin=!1):"undefined"!=typeof _shopdetail&&null!=typeof _shopdetail&&null!=typeof _shopdetail&&_shopdetail.showFavorites(),"BookAppointment"!=sFromPage&&_shopdetail.CheckCustomerExists();try{_onlineCheckout.GetCartItemCount()}catch(e){}}document.body.scrollTop=document.documentElement.scrollTop=0}}function successBookmark(e){OnSuccess_Favorite(e),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,"13")}function OnSuccess_Favorite(e){if(null!=e.d&&(e=e.d),e!=parseInt(UnderMaintanance.UnderMaintananceInProgress))if(e!=parseInt(UnderMaintanance.UnderMaintananceComplete)){var t=$(".bannerbookmark");e>=1?(_shopdetail.isFavorite=!0,t.addClass("bookmarked flamingo-button"),t.find(".bookmarkbtntext").text("Bookmarked")):(_shopdetail.isFavorite=!1,t.removeClass("bookmarked flamingo-button"),t.find(".bookmarkbtntext").text("Bookmark")),_home.shouldBMLoad=!0}else location.reload(!0);else vagaro.alert({message:UnderMaintananceMessage,title:"Info"})}function callBackLogout(){if("detail"!==BasePage.toLowerCase()&&"myaccount"!==BasePage.toLowerCase()||$("#divUserName").addClass("custom-theme-nav"),"detail"===BasePage.toLowerCase()){_shopdetail.showFavorites();try{_shopdetail.HidePopup(),_onlineCheckout.GetCartItemCount(0),$(".btncontshoppingtopcls").click(),$("#divWriteReview").is(":visible")&&_siteBuilderDetail.CloseReviewPopup(!0)}catch(e){}}else if("shoppingcartcheckout"===BasePage.toLowerCase()){var e=$(location).attr("href").split("/");"undefined"!=typeof GroupRouteValue&&null!=GroupRouteValue&&""!=GroupRouteValue&&e.length>=5?$(location).attr("href",e.splice(0,5).join("/")+"/"):$(location).attr("href",e.splice(0,4).join("/")+"/")}if(UserID="",RedirectToCalendar="no",void 0!==_shopdetail.setLoginControl&&(_shopdetail.setLoginControl(),_shopdetail.setBookTextOnLoginlogout(!1)),$("#photos").hasClass("active")||$("#divstyles").is(":visible")){"undefined"!=typeof _featured&&(_featured.GalleryPager.options.Data.userid=null);var t=$(".gallery-solo-image",$("#ulFeatureBusiness"));return $(t).find(".btnlike").addClass(emptyHeartClass),void $(t).removeClass("gallery-liked")}$("#divWriteReview").is(":visible")&&(_common.AddState(tabSegment),_siteBuilderDetail.LoadComponentDetails(DefaultTabPage))}function DailyDealsDetail(e,t,i,n,o,a,s){($(".homePageBody").length>0&&$("html body").removeClass("homePageBody"),$(".affirmBannerBody").length>0&&$("html body").removeClass("affirmBannerBody"),_common.ScrollToToZero(),$(".scrollme").removeClass("scrollme"),$("#customerAppLocationSearch").hide(),null!=n)&&(_common.AddState(i+"dealsindividual"+e+"&&"+t)&&n.preventDefault());var r=!1,l="",c="";ShowLoader(!0);try{if(void 0!==a&&null!=a&&(r=a),void 0!==o&&null!=o&&(l=o),void 0!==s&&null!=s&&(c=s),1==r){var d={};Action="Daily Deal",d.PageName="Home",d.BusinessName=l,d.BusinessID=""==t?0:t,d.Action=Action,d.Category="Daily Deal Details",d.DealName=c,_vgLogEvent.LogData(d)}}catch(e){}if($("#dvDailyDealsDetail").html(""),""==$("#dvDailyDealsDetail").html()||null==$("#dvDailyDealsDetail").html()){$("#hdnPromotionId").val(e),$("#dvDailyDealsDetail").show(),$("#dvDailyDealsDetail").html(""),(d={UserControlPath:"~/UserControls/ucDailyDealsDetail.ascx",PageNamePath:"~/Home.aspx",isRemoveFormTag:!1}).Parameters={PromotionID:e,BusinessId:t,IsCustomWebsite:void 0!==_shopdetail.isCustomWebsite&&null!=_shopdetail.isCustomWebsite?_shopdetail.isCustomWebsite:"false",PromotionCodeId:"undefined"!=typeof promotionCodeId&&null!=promotionCodeId?promotionCodeId:""};var u=new vagaro.ajax;u.datamodel.Token=ApiURLEnumCommon.loadusercontrol,u.datamodel.IsNewVagaroAPI=!0,u.datamodel.callback=function(e){var t=$("#dvDailyDealsDetail");t.html(""),t.append(e),lazyloadDeal(),$("#pageSection").hide().removeClass("pagesectionFlex"),$("#professionalFilter").attr("style","display:none;"),$("body").removeClass("listing-like-page"),setTimeout(function(){$(".lazy").lazyload({threshold:200,effect:"fadeIn",failure_limit:50,event:"lazyload"}).trigger("lazyload")},500),_common.ScrollToToZero()},u.datamodel.data=d,u.datamodel.Error=CallFail_LoadUserControlWithProxy,u.Post()}}function spacetodash(e){var t=e;return e.includes(" ")&&(t=e.replace(" ","-")),t}function iOSversion(){try{if(/iP(hone|od|ad)/.test(navigator.platform)){var e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return void 0!==e&&null!=e&&""!=e||(e=navigator.appVersion.match(/OS X (\d+)_(\d+)_?(\d+)?/)),[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||0,10)]}}catch(e){}}function showLogin(e,t){if(currentPage="CustomerSignIn",$("#rfvCaptcha").length>0&&$("#rfvCaptcha").hide(),RedirectToCalendar=e,"function"==typeof IsExistsAlxCookie&&IsExistsAlxCookie())return LoginAlexaUser(),void 0!==t&&1==t&&(event.stopPropagation(),event.preventDefault()),!1;setTimeout(function(){showCommonLoginPopup(CommonFromPage),openPopupVerification(),appleSignInData="",resetCotrolForAppleFNameLName(),hideAppleFNameLNameControls()},100),void 0!==t&&1==t&&(event.stopPropagation(),event.preventDefault()),setTimeout(function(){$("#txtUsernameP").focus()},1e3)}function CallFail_LoadUserControlWithProxy(e){ShowLoader(!1);try{var t=JSON.parse(e.responseText);vagaro.alert(t.Message)}catch(e){vagaro.alert("Something went wrong, Try Again.")}}function applyJqueryScroll(e){}function getCookie(e){return cookieManager.getCookie(e)}function clearCookie(e){return cookieManager.removeCookie(e,cookieManager.defaultPath,cookieManager.defaultDomain)}function FindInitials(e,t){var i=/[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/,n=["ASS","WTF","SEX","SUK","FUK","DIE","BUM","TIT","BCH","DAM","HAH","OUT"];if(null!=e&&""!=e){var o=(e=e.replace("s+","")).split(" "),a="";if(o.length>0){for(var s=0;s<o.length;s++){var r=o[s].substr(0,1);1!=i.test(r)&&r==r.toUpperCase()&&0==is_numeric(r)&&(a+=r)}a.length<=0&&(a=e.substr(0,1))}else a=o[0].substr(0,1);return a.length>=3?(Arrcontains(n,a=a.substr(0,3))&&(a=a.substr(0,a.length-1)),n=null,"SP"==t?a.substr(0,2).toUpperCase():a.toUpperCase()):a.toUpperCase()}return e}function is_numeric(e){return/^\d+$/.test(e)}function setCookie(e,t,i){var n=!1;void 0!==i&&1==i&&(n=!0),cookieManager.setCookie(e,t,365,cookieManager.defaultPath,cookieManager.defaultDomain,!0,n),e==ProximityCookieName&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof isAndroid&&1==isAndroid&&CallbackforMobileApp(0,0,"","","0","33")}function setPublicCookie(e,t,i){var n=new Date;n.setDate(n.getDate()+i);var o=escape(t)+(null==i?"":"; expires="+n.toUTCString())+"; path=/;";document.cookie=e+"="+o}function baIsUndefine(e){return void 0===e||null==e||""===e||null==e}function brandedAppCallBack(){baIsUndefine(IsBrandedApp)||1!=IsBrandedApp||baIsUndefine(IsBrandedAppBusinessActive)||0!=IsBrandedAppBusinessActive||CallbackforMobileApp(0,0,"","",0,"36|~|"+businessID)}function showLoadingCenter(e){$Interframe.centerPopup(e)}function imageErrorReview(){return"https://vagaro.azureedge.net/static-content/Images/user-male-img_155_new.png"}function imageErrorGiftCertificate(){return"https://vagaro.azureedge.net/static-content/PublicImages/Images/gift-certificat-small.png"}function imageErrorProduct(){return"https://vagaro.azureedge.net/static-content/Images/no-shop-image-big-new.gif"}function chkMultiLocParUndefined(){"undefined"==typeof b_themeID&&(b_themeID=0),"undefined"==typeof MultiLocBusinessID&&(MultiLocBusinessID=0),"undefined"==typeof w_type&&(w_type=0),"undefined"==typeof WidgetVersion&&(WidgetVersion=0),"undefined"!=typeof _shopdetail&&void 0===_shopdetail.TabAtLaunch&&(_shopdetail.TabAtLaunch="")}function bappIsUndefine(e){return void 0===e||null==e||""===e||null==e}function SetTopLeft(e){$(e).css("position","absolute");$(document).scrollTop();$(e).css("top",Math.max(0,($(window).height()-$(e).outerHeight())/2+$(window).scrollTop())+"px"),$(e).css("left",Math.max(0,($(window).width()-$(e).outerWidth())/2+$(window).scrollLeft())+"px")}function backButtonClick(e){if("products"==tabSegment.toLowerCase()){if($("#divProductMenus").is(":visible"))return _siteBuilderDetail.OpenCloseMobileFilter(),!1;if($("#divProductPreviewpageOnline").is(":visible"))return _siteBuilderDetail.ShowHideProductDetail(!1),!1;_siteBuilderDetail.ProductTabHeader(!1)}if($("html, body").removeClass("searchaddservclass"),$("body").removeClass("banner-hide-custapp"),isFilterScreen&&0!=$(".select2-container.select2-dropdown-open").length)$("#mobileBack").show(),$("#custmobileBack").hide(),$("#btnBackHomeSearch").data("isFilterclicked","1"),setTimeout(function(){$(".cancel-select-service:visible").trigger("touchstart"),_common.closeServiceSelection()},500);else if(1==parseInt($("#btnBackHomeSearch:visible").data("iscustomerappsearch"))||parseInt(1==$("#btnBackHomeSearch").data("isFilterclicked")))$("#btnBackHomeSearch:visible").data("iscustomerappsearch",null),$("#btnBackHomeSearch").data("isFilterclicked",null),$("#search-bar-wrapper-all").fadeOut(0),$("body").removeClass("banner-hide-custapp"),$("html,body").removeClass("mob-overflow-hidden"),$("#select2-drop-mask").click(),isFilterScreen=!1,isMobileBrowserFilterScreen=!1,""!=tabSegment&&"home"!=tabSegment.toLowerCase()&&"/"!=tabSegment?($("#pageSection").addClass("pagesectionFlex listings-parent-div-100 "+("deals"==tabSegment.toLowerCase()?"daily-deals-wrap":"")),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"listings"==tabSegment.toLowerCase()&&$("#pageSection").addClass("mobile-listing-business listing-mobile-filter"),$("#dvHome").attr("style","display:none;")):$("#mobileBack").hide();else if($("#mobile-check").is(":visible")&&$(".cancel-select-service:visible").length>0)setTimeout(function(){$(".cancel-select-service:visible").trigger("touchstart"),_common.closeServiceSelection()},100);else if($("#mobile-check").is(":visible")&&$(".inMobileFullscreeen:visible").length>0)$(".inMobileFullscreeen").removeClass("inMobileFullscreeen"),setTimeout(function(){$(".cancel-select-service:visible").trigger("touchstart"),_common.closeServiceSelection()},100);else if("detail"==BasePage.toLowerCase()&&$("#mobile-check").is(":visible")&&($("#divClassAppResult").is(":visible")||$("#divSearch").is(":visible")))"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&""!=tabSegment&&"about"==tabSegment.toLowerCase()?CallbackforMobileApp(0,0,"","",0,1):_shopdetail.backpage();else if("detail"==BasePage.toLowerCase()&&$("#mobile-check").is(":visible")&&$("#dvOnlineAppoinmentBooked").is(":visible"))$("#dvOnlineAppoinmentBooked").hide(),$("#pageSection").show().addClass("pagesectionFlex"),_common.LoadBookNowMenu(LoadMenuTypeEnum.booknow,!1);else if(e||isMobileBrowserFilterScreen&&$("#mobile-check").is(":visible")||isBackHomeScreen)isBackHomeScreen=!1,"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(isFilterScreen=!1,CallbackforMobileApp(0,0,"","",0,28),""!=tabSegment&&"home"!=tabSegment.toLowerCase()&&"/"!=tabSegment?($("#pageSection").addClass("pagesectionFlex listings-parent-div-100 "+("deals"==tabSegment.toLowerCase()?"daily-deals-wrap":"")),$("#dvHome").attr("style","display:none;")):1==parseInt($("#btnBackHomeSearch:visible").data("isdealdetailpage"))?($("#btnBackHomeSearch").data("isdealdetailpage",null),$("#dvHome").attr("style","display:none;"),$("#dvDailyDealsDetail").show()):($("#mobileBack").hide(),$("#custmobileBack").hide())),$("#divBusType #aStreamTab").hasClass("w--current")||$("#divBusType #aBusinessTab").hasClass("w--current")||$("#divBusType #aMobileTab").hasClass("w--current")?(window.history.back(),closeMobileSearch()):closeMobileSearch(),"True"!=isDisplayGiftCardbanner&&1!=isDisplayGiftCardbanner||("undefined"!=typeof vgAppicationType&&vgAppicationType===objApplicationType.CustomerApp&&($("body").addClass("homePageBody"),$("#holidayGcBanner").show()),!$("#holidayGcBanner").is(":visible")||"True"!=isDisplayUkBanner&&1!=isDisplayUkBanner||$("body").addClass("homepageUKBanner"));else if("detail"==BasePage.toLowerCase()&&null==history.state)"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&""!=tabSegment&&"about"==tabSegment.toLowerCase()?CallbackforMobileApp(0,0,"","",0,1):$("#mobile-check").is(":visible")?window.history.back():_shopdetail.backpage();else if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&void 0!==$("#AdvanceFilterContent")&&null!=$("#AdvanceFilterContent")&&$("#AdvanceFilterContent").find(":CheckBox").length>0&&_common.VisibleControlLength("#AdvanceFilterContent")>0)$("#AdvanceFilterContent").hide();else if(void 0!==refUrl&&refUrl.length>0&&refUrl.toLowerCase().indexOf("/book/")>0&&"detail"==BasePage.toLowerCase()&&$("#mobile-check").is(":visible")&&$("#divSearch .bookservicecontainer").is(":visible")){var t=location.href.replace("/book-now","");$url=$("<a/>"),$url.attr("href",t),$url[0].click()}else{var i=$("#dvDailyDealsDetail").html(),n=history.state&&history.state.sectionName&&history.state.sectionName.toLowerCase().includes("isdeal");if($("#mobile-check").is(":visible")&&(""!=tabSegment&&"about"==tabSegment.toLowerCase()||"detail"==BasePage.toLowerCase())&&$("#divBookNowMasterPage").length&&!$("#divBookNowMasterPage").is(":visible")&&(""!=i&&null!=i||n)&&$("#divBookNowMasterPage").show(),1==isAndroid&&1==window.history.length&&"detail"==BasePage.toLowerCase()&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType)$("#divClassDetailpopup").length>0&&$("#divClassDetailpopup").removeClass("fade").modal("hide"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&""!=tabSegment&&"about"==tabSegment.toLowerCase()?CallbackforMobileApp(0,0,"","",0,1):_shopdetail.backpage();else if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&""!=tabSegment&&"about"==tabSegment.toLowerCase())-1!=$(location).attr("href").indexOf("/deals")?_shopdetail.backpage():CallbackforMobileApp(0,0,"","",0,1);else window.history.back()}}function addPageHistoryWinApp(e,t,i){isWindowsApp&&window.external.notify("addhistorystate|"+e+"|"+("/"!=t?t:"")+"|"+(void 0!==i&&null!=i?i:""))}function CallWSJSON(e,t,i,n){if("undefined"==typeof keepAlive&&$("#IsWaitforKeepALive").length>0&&void 0!==$("#IsWaitforKeepALive").val()&&"true"===$("#IsWaitforKeepALive").val().toLowerCase())setTimeout(function(){CallWSJSON(e,t,i,n)},500);else{var o=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";"undefined"!=typeof regionId&&""!=regionId&&(o=o+regionId+"/"),e=o+"WebServices/"+e,$.ajax({type:"POST",contentType:"application/json; charset=utf-8",beforeSend:function(e){if("undefined"!=typeof keepAlive&&e.setRequestHeader("keepAlive",keepAlive),1==$("#hdnToken1").length&&void 0!==$("#hdnToken1").val()&&e.setRequestHeader("token1",$("#hdnToken1").val()),1==$("#hdnToken2").length&&void 0!==$("#hdnToken2").val()&&e.setRequestHeader("token2",$("#hdnToken2").val()),"undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget())"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&e.setRequestHeader("widgetcookievalue",widgetcookievalue);else try{void 0!==window.parent._common&&void 0!==window.parent._common.IsCookieLessWidget&&window.parent._common.IsCookieLessWidget()&&"undefined"!=typeof widgetcookievalue&&null!=widgetcookievalue&&""!=widgetcookievalue&&e.setRequestHeader("widgetcookievalue",widgetcookievalue)}catch(e){}},url:e,data:t,dataType:"json",success:i,error:function(e,t,i){try{if(403===e.status)return alert("Your session is expired. Please reload your page."),void location.reload(!0);""!=n&&null!=n&&null!=n&&"function"==typeof n&&n(e,t,i)}catch(e){}}})}}function fnShowSocialMediaIconInMobiles(){var e=$(".customTopSocial"),t=$(".mobile-social-menu"),i=!1,n=$(".wg-soc-list ul"),o="",a=[{DomainSymbol:"&#xf099;",DomainName:"Twitter",href:0==e.find("#ancTwitter").hasClass("d-none")?e.find("#ancTwitter").prop("href"):null},{DomainSymbol:"&#xf082;",DomainName:"Facebook",href:0==e.find("#ancFacebook").hasClass("d-none")?e.find("#ancFacebook").prop("href"):null},{DomainSymbol:"&#xf167;",DomainName:"Youtube",href:0==e.find("#ancYouTube").hasClass("d-none")?e.find("#ancYouTube").prop("href"):null},{DomainSymbol:"&#xf08c;",DomainName:"Linkedin",href:0==e.find("#ancLinkedIn").hasClass("d-none")?e.find("#ancLinkedIn").prop("href"):null},{DomainSymbol:"&#xf1e9;",DomainName:"Yelp",href:0==e.find("#ancYelp").hasClass("d-none")?e.find("#ancYelp").prop("href"):null},{DomainSymbol:"&#xf37c;",DomainName:"Blog",href:0==e.find("#ancBlog").hasClass("d-none")?e.find("#ancBlog").prop("href"):null},{DomainSymbol:"&#xf0d2;",DomainName:"Pinterest",href:0==e.find("#ancPinterest").hasClass("d-none")?e.find("#ancPinterest").prop("href"):null},{DomainSymbol:"&#xf16d;",DomainName:"Instagram",href:0==e.find("#ancInstagram").hasClass("d-none")?e.find("#ancInstagram").prop("href"):null},{DomainSymbol:"&#xf1a0;",DomainName:"GooglePlus",href:0==e.find("#ancGooglePlus").hasClass("d-none")?e.find("#ancGooglePlus").prop("href"):null},{DomainSymbol:"&#xf1a0;",DomainName:"TikTok",href:0==e.find("#ancTikTok").hasClass("d-none")?e.find("#ancTikTok").prop("href"):null},{DomainSymbol:'<img src="'+cdnImagePath+'/Images/myspace-icon-2x.png" width="24" />',DomainName:"Myspace",href:0==e.find("#ancMyspace").hasClass("d-none")?e.find("#ancMyspace").prop("href"):null}];$.grep(a,function(e,t){void 0!==e.href&&null!=e.href&&(i=!0)}),1==i&&"true"==isCustomWebsite&&"false"==isWidget?($(".social-share-popup .wg-soc-list li").each(function(){$(this).hide()}),$.grep(a,function(e,t){void 0!==e.href&&null!=e.href&&(o+="<li><a href='[!HREF]' target='_blank' class='custom-top-social-lnk'><div class='dl-micon-middle'><span class='dl-soc-icon'>[!DomainSymbol]</span><span>[!DomainName]</span></div></a></li>".replace("[!HREF]",e.href).replace("[!DomainSymbol]",e.DomainSymbol).replace("[!DomainName]",e.DomainName))}),$(n).append(o),$(t).css("display","inline-block")):$(t).hide()}function onOutsideClick(e){try{$(".on-search-LocationSearch").select2("destroy"),$("#txtLocationSearch").select2("destroy")}catch(e){}var t=$(".search-box"),i=$(".search-tab"),n=$(".select2-drop-mask"),o=$(".datepicker"),a=$(".timepicker");$($(e.target).context).hasClass("commonvgdropbutton")||$($(e.target).context).hasClass("bookdropicon")||$($(e.target).context).hasClass("vg-dropdown-link")||!$(".vg-dropdown-parent").is(":visible")||($(".booknowdropdown.vg-dropdown-parent").slideUp(250),$(".booknowdropdown.vg-dropdown-parent").parent().removeClass("active-vg-dropdown"),$(".booknowdropdown.vg-dropdown-parent").removeClass("active-drop-vg")),"divClassDetailTooltippopup"!=$($(e.target).context).parent().attr("id")||$($(e.target).context).hasClass("modal-content")||$("#divClassDetailTooltippopup").modal("hide"),t.is(e.target)||t.has(e.target).length>0||i.is(e.target)||i.has(e.target).length>0||n.is(e.target)||n.has(e.target).length>0||o.is(e.target)||o.has(e.target).length>0||a.is(e.target)||a.has(e.target).length>0||0==$(".bootbox-alert").find(".modal-backdrop").length&&($(".search-box").removeClass("openLeft"),$(".search-tab").removeClass("open-search")),$("#page-wrapper").on("click touchstart",function(e){var t=$("#menuBar"),i=$(".mobile-dropdown");t.is(e.target)||0!==t.has(e.target).length||i.is(e.target)||0!==i.has(e.target).length||_common.CloseToggelmobileMenu()});var s=$(".mobile-share-model:visible"),r=s.find(".mobile-share-popup");s.length>0&&!r.is(e.target)&&0===r.has(e.target).length&&($(".mobile-share-model").is(e.target)&&$(".mobile-share-model").hide(),$("#mobile-check").is(":visible")?s.fadeOut():s.slideUp());var l=$("#durationdropdown");l.is(e.target)||0!==l.has(e.target).length||1!=l.is(":visible")||l.hide();var c=$("#LiveStreamClassList"),d=$("#streamclassdropdown");c.is(e.target)||0!==c.has(e.target).length||1!=d.is(":visible")||d.hide();var u=$("#ulLiveStreamCountryDetail");u.is(e.target)||0!==u.has(e.target).length||1!=u.is(":visible")||u.hide()}function onScrolling(e,t,i){var n=$("#"+e).outerWidth(),o=document.getElementById(e).scrollWidth,a=$("#"+e).scrollLeft();a<=0?($("#"+i).addClass("slide-disabled"),$("#"+i).attr("disabled",!0)):($("#"+i).removeClass("slide-disabled"),$("#"+i).removeAttr("disabled")),a+n>=o?($("#"+t).addClass("slide-disabled"),$("#"+t).attr("disabled",!0)):($("#"+t).removeClass("slide-disabled"),$("#"+t).removeAttr("disabled"))}function ShowHideDoneMessage(e,t,i){void 0!==t&&null!=t&&""!=t&&(void 0!==CommonFromPage&&null!=CommonFromPage&&""!=CommonFromPage||i.getLastModifyLabel(t,!1)),$(".banner-success .text-block-28").html(e);var n=Webflow.require("ix"),o=$(".banner-success");n.run({type:"click",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 200ms ease 0",x:"0px",y:"50px",z:"0px"},{wait:"2s"},{transition:"transform 200 ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]},o)}function ShowHideFailedMessage(e){$(".banner-fail .text-block-28").html(e);var t=Webflow.require("ix"),i=$(".banner-fail");t.run({type:"click",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 200ms ease 0",x:"0px",y:"50px",z:"0px"},{wait:"2s"},{transition:"transform 200 ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]},i)}function trim(e){var t=/^(\s*)$/;return t.test(e)&&0==(e=e.replace(t,"")).length||(t=/^(\s*)([\W\w]*)(\b\s*$)/).test(e)&&(e=e.replace(t,"$2")),e}function isDoubleClicked(e){return!!e.data("isclicked")||(e.data("isclicked",!0),setTimeout(function(){e.removeData("isclicked")},1e3),!1)}function GetSlugTabPageName(e){return e.toLowerCase().replace("/","")}function GetSelectedMenuObject(e){return $("#tabs").find("[data-page-slug='"+e+"']")}function IsVagaroDomain(){return"undefined"!=typeof DomainName&&window.location.host.indexOf(DomainName)>-1}function brandedAppbackButtonClick(){""!=document.referrer?setTimeout("window.history.back()",500):CallbackforMobileApp(0,0,"","",0,1)}function _signInWithApple(e){if(bappIsUndefine(IsIOSBrandedApp)||1!=IsIOSBrandedApp&&"true"!=IsIOSBrandedApp||1!==BrandedAppWithAppleCallback||bappIsUndefine(IsOldOSBrandedApp)||0!=IsOldOSBrandedApp&&"false"!=IsOldOSBrandedApp){if("False"!=recaptch.isCapAllowtoShow()&&recaptch.isCapShown()){if(null==c_responce)return $("#pnlLogin [id*=txtCaptcha]").val(""),$("#pnlLogin [id*=rfvCaptcha]").show(),$("#logInPageValidate [id*=rfvCaptcha]").show(),$(".login-bodyfields").animate({scrollTop:$(".login-bodyfields").height()},500),!1;$("#pnlLogin [id*=txtCaptcha]").val(c_responce),$("#pnlLogin [id*=rfvCaptcha]").hide(),$("#logInPageValidate [id*=rfvCaptcha]").hide()}setCookie("appleLoginSource",e),window.open(window.location.protocol+"//"+window.location.host+"/SignInWithApple.aspx?init=true","_blank","location=yes,height=570,width=650,scrollbars=yes,status=yes")}else{var t=navigator.userAgent,i=t.indexOf("(LogicV");if(i>=0&&(i+=8,t.length>=i)){var n=(t=t.substring(i,t.length)).indexOf(")");if(t.length>n)if(2!=t.substring(0,n))CallbackforMobileApp(0,0,"","",0,38);else{if("False"!=recaptch.isCapAllowtoShow()&&recaptch.isCapShown()){if(null==c_responce)return $("#pnlLogin [id*=txtCaptcha]").val(""),$("#pnlLogin [id*=rfvCaptcha]").show(),$("#logInPageValidate [id*=rfvCaptcha]").show(),$(".login-bodyfields").animate({scrollTop:$(".login-bodyfields").height()},500),!1;$("#pnlLogin [id*=txtCaptcha]").val(c_responce),$("#pnlLogin [id*=rfvCaptcha]").hide(),$("#logInPageValidate [id*=rfvCaptcha]").hide()}setCookie("appleLoginSource",e),window.open(window.location.protocol+"//"+window.location.host+"/SignInWithApple.aspx?init=true","_blank","location=yes,height=570,width=650,scrollbars=yes,status=yes")}}}}function _signInWithAppleResponse(e,t,i,n){if((""==t||""==i)&&""!=n&&null!=n){var o=n.split("@");if(""!=o&&null!=o&&o.length>0){var a=o[0].split(".");""!=a&&null!=a&&a.length>0&&(2==a.length&&(t=a[0],i=a[1]),1==a.length&&(t=a[0]))}}void 0!==i&&null!=i&&""!=i.toString().trim()||(i="?"),"undefined"!=typeof SetLoginValues&&SetLoginValues(),signin(t,i,3,null,n,e,null,5,!1,!0,null,"","","")}function CheckToRedirect(e,t){if(!IsVagaroDefaultMaster){null==_shopdetail.PreviewID&&(_shopdetail.PreviewID=0),chkMultiLocParUndefined();return String.isNullOrUndefineOrBlank(_siteBuilderDetail.UserLocationInfo.objUserCustomData.WidgetServiceId)&&(_siteBuilderDetail.UserLocationInfo.objUserCustomData.WidgetServiceId=0),"true"==_shopdetail.isFacebook||"true"==_shopdetail.isWidget||1==_shopdetail.isPromotion?"?BusinessID="+_shopdetail.businessID+"&IsPopup="+_shopdetail.IsPopup+"&IsFacebookPage="+_shopdetail.isFacebook+"&IsBusinessWidgetPage="+_shopdetail.isWidget+"&TabsIncluded="+_shopdetail.TabsIncluded+"&isPromotion="+_shopdetail.isPromotion+"&b_themeID="+b_themeID+"&IsFromMultiLocation=true&MultiLocBusinessID="+MultiLocBusinessID+"&w_type="+w_type+"&widgetversion="+WidgetVersion+"&tabatlaunch="+_shopdetail.TabAtLaunch+"&WidgetSpId="+_shopdetail.WidgetSpId+"&widgetserviceid="+_siteBuilderDetail.UserLocationInfo.objUserCustomData.WidgetServiceId:parseInt(_shopdetail.PreviewID)>0?"?BusinessID="+_shopdetail.businessID+"&IsPopup="+_shopdetail.IsPopup+"&IsFacebookPage="+_shopdetail.isFacebook+"&IsBusinessWidgetPage="+_shopdetail.isWidget+"&TabsIncluded="+_shopdetail.TabsIncluded+"&isPromotion="+_shopdetail.isPromotion+"&PreviewId="+_shopdetail.PreviewID+"&b_themeID="+b_themeID+"&IsFromMultiLocation=true&MultiLocBusinessID="+MultiLocBusinessID+"&w_type="+w_type+"&widgetversion="+WidgetVersion+"&tabatlaunch="+_shopdetail.TabAtLaunch:parseInt(b_themeID)>0?"?BusinessID="+b_themeID+"&IsFacebookPage="+_shopdetail.isFacebook+"&IsBusinessWidgetPage=true&b_themeID="+b_themeID+"&IsFromMultiLocation=false&MultiLocBusinessID="+MultiLocBusinessID+"&w_type="+w_type+"&TabsIncluded="+_shopdetail.TabsIncluded+"&widgetversion="+WidgetVersion+"&tabatlaunch="+_shopdetail.TabAtLaunch:void 0!==_shopdetail.IsBookFromFacebook&&"true"==_shopdetail.IsBookFromFacebook.toLowerCase()?"?ig_fbb=true":void 0!==_shopdetail.isFBExtensions&&"true"==_shopdetail.isFBExtensions.toLowerCase()?"?ig_ix=true":""}CheckWidgetSession()}function htmlEnc(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")}function htmlEncode(e){return null==e?e:e.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&#34;")}function vagaroOnlineTokens(e){return 0==e?$("#hdnToken0").val():2==e?$("#hdnToken2").val():void 0}function CallParentFunction(e,t,i){return vagaro.popup({title:i,message:'<div id="dvAgreementPolicy" class="Loader"> <div id="divAgreementloader" class="loadImg"><span class="loaderimage"></span></div><iframe id="iFrameOther" src="'+t+'" width="100%"  frameborder="0"></iframe> </div>',className:"useraggreement-popup"}),$(".useraggreement-popup").modal().find(".modal-header").find(".close").attr("data-dismiss","#dvAgreementPolicy"),1==IsWebsiteBuilderCommunication?$("#iFrameOther").on("load",function(){$(".useraggreement-popup").addClass("in"),$("#divAgreementloader").hide()}):$("#iFrameOther").load(function(){$("#divAgreementloader").hide()}),!1}function ClosePopup(){$(".useraggreement-popup").modal().find(".modal-header").find(".close").click()}function CallParentFunctionUserAgreement(e,t,i){if(vagaro.popup({title:i,message:'<style>div#iFrameOther{height:calc(100vh - 230px);overflow:auto;text-align:left;margin-bottom: 10px;padding-right:0px;}.useraggreement-popup .modal-dialog{max-width:800px;width:95%}.useraggreement-popup p{font-size:14px;line-height:20px;margin-bottom:20px;color:#1f2937cc}.prose :where(p):not(:where([class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.useraggreement-popup h3{color:#696969;font-weight:400;margin-bottom:15px}.useraggreement-popup ul li{font-size:16px;line-height:30px;margin-bottom:4px;margin-top:8px}.prose :where(strong):not(:where([class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(ul>li):not(:where([class~=not-prose] *))::marker{color:#1f293780}.prose :where(h3):not(:where([class~=not-prose] *)){margin-top:1.6em;margin-bottom:.6em}.useraggreement-popup h1{font-size:60px;padding-bottom:24px;display:none}.useraggreement-popup a{color:#2479c7;text-decoration:none}.popupBottompart {min-height: 62px;clear: both; border-radius: 0 0 5px 5px;}.popupBtnBottom{float:right;min-width:200px;margin-right:0px;margin-top:12px}.grayButtonPlain{background:#fff;border-radius:2px;color:#333;border:1px solid rgba(0,0,0,.15);height:40px;font-weight:400;font-size:16px!important;min-width:95px;padding:8px 10px;-webkit-transition:border .2s;transition:border .2s}@media screen and (max-width: 767px){div#iFrameOther {height: 100%;}.popupBottompart {display: none;}}</style ><div id="dvAgreementPolicy" class="Loader"> <div id="divAgreementloader" class="loadImg"><span class="loaderimage"></span></div><div id="iFrameOther"></div></div>',className:"useraggreement-popup useraggreement-vg-popup modal-bootstrapcommon in"}),$(".useraggreement-popup").modal().find(".modal-header").find(".close").attr("data-dismiss","#dvAgreementPolicy"),$(".modal-body").append("<div class='popupBottompart block'><div class='popupBtnBottom'><input type='submit' name='btnClose' value='Close' onclick='ClosePopup();' id='btnClose' class='grayButtonPlain secondary-button' style='float: right!important;'></div></div>"),$("#btnClose").click(function(){$(".useraggreement-popup").modal("hide")}),1==IsWebsiteBuilderCommunication){var n=$("<iframe>",{src:"https://www.vagaro.com/pro/user-agreement",frameborder:0,scrolling:"auto"});$("#iFrameOther").append(n),$(".useraggreement-popup").addClass("in"),$("#divAgreementloader").hide()}else{n=$("<iframe>",{src:"https://www.vagaro.com/pro/user-agreement",frameborder:0,scrolling:"auto"});$("#iFrameOther").append(n),$("#divAgreementloader").hide()}return!1}function CallParentFunctionPrivacyPolicy(e,t,i){if(vagaro.popup({title:i,message:'<style>div#iFrameOther{height:calc(100vh - 230px);overflow:auto;text-align:left;margin-bottom: 10px;padding-right:0px;}.useraggreement-popup .modal-dialog{max-width:800px;width:95%}.useraggreement-popup p{font-size:14px;line-height:20px;margin-bottom:20px;color:#1f2937cc}.prose :where(p):not(:where([class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.useraggreement-popup h3{color:#696969;font-weight:400;margin-bottom:15px}.useraggreement-popup ul li{font-size:16px;line-height:30px;margin-bottom:4px;margin-top:8px}.prose :where(strong):not(:where([class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(ul>li):not(:where([class~=not-prose] *))::marker{color:#1f293780}.prose :where(h3):not(:where([class~=not-prose] *)){margin-top:1.6em;margin-bottom:.6em}.useraggreement-popup h1{font-size:60px;padding-bottom:24px;display:none}.useraggreement-popup a{color:#2479c7;text-decoration:none}.popupBottompart {min-height: 62px;clear: both; border-radius: 0 0 5px 5px;}.popupBtnBottom{float:right;min-width:200px;margin-right:0px;margin-top:12px}.grayButtonPlain{background:#fff;border-radius:2px;color:#333;border:1px solid rgba(0,0,0,.15);height:40px;font-weight:400;font-size:16px!important;min-width:95px;padding:8px 10px;-webkit-transition:border .2s;transition:border .2s}@media screen and (max-width: 767px){div#iFrameOther {height: 100%;}.popupBottompart {display: none;}}</style ><div id="dvAgreementPolicy" class="Loader"> <div id="divAgreementloader" class="loadImg"><span class="loaderimage"></span></div><div id="iFrameOther"></div></div>',className:"useraggreement-popup useraggreement-vg-popup modal-bootstrapcommon in"}),$(".useraggreement-popup").modal().find(".modal-header").find(".close").attr("data-dismiss","#dvAgreementPolicy"),$(".modal-body").append("<div class='popupBottompart block'><div class='popupBtnBottom'><input type='submit' name='btnClose' value='Close' onclick='ClosePopup();' id='btnClose' class='grayButtonPlain secondary-button' style='float: right!important;'></div></div>"),$("#btnClose").click(function(){$(".useraggreement-popup").modal("hide")}),1==IsWebsiteBuilderCommunication){var n=$("<iframe>",{src:"https://www.vagaro.com/pro/privacy",frameborder:0,scrolling:"auto"});$("#iFrameOther").append(n),$(".useraggreement-popup").addClass("in"),$("#divAgreementloader").hide()}else{n=$("<iframe>",{src:"https://www.vagaro.com/pro/privacy",frameborder:0,scrolling:"auto"});$("#iFrameOther").append(n),$("#divAgreementloader").hide()}return!1}function HidePrivacyPolicy(){$(".useraggreement-popup").modal("hide"),$("#dvRegister").modal("show"),1!=IsWebsiteBuilderCommunication&&($("html").addClass("signuppopopenHtml"),$("body").addClass("signuppopopen signupiframe"))}function RedirecttoApp(e,t){var i="";if(void 0!==redirecttodevicetabname&&""!=redirecttodevicetabname&&("book-now"==redirecttodevicetabname&&(redirecttodevicetabname="online-scheduling"),i="&tab="+redirecttodevicetabname,"online-scheduling"!=redirecttodevicetabname||isNaN(+microServiceID)||0==microServiceID||(i+="&serviceid="+microServiceID+"&Device=Google")),0==selectedShopId){var n=!1,o=$(location).attr("href");$(location).attr("pathname").replace("/","");if(-1!=o.indexOf("/listings")?(i+="&tab=salons",n=!0):-1!=o.indexOf("/deals")?(i+="&tab=salon-coupons",n=!0):-1!=o.indexOf("/book")&&(i+="&tab=salon-appointment",n=!0),1==n){var a=_common.SetCityState(city,stateName);""!=a&&(i+="&Location="+a),""!=lattitude&&""!=longitude&&(i+="&LatLng="+lattitude+","+longitude),""!=countryid&&"0"!=countryid&&(i+="&CID="+countryid),-1!=o.indexOf("/book")&&""!=escape(service)&&(i+="&ServiceName="+escape(service.replace(/ /g,"")))}}i=i.replace(/ /g,""),"Android"==e?(setTimeout(function(){window.location=""!=i?selectedShopId>0?"VagaroApp:///BusinessId="+selectedShopId+i:"VagaroApp:///"+i.substring(1):"VagaroApp:///BusinessId="+selectedShopId},25),void 0!==t&&""!=t||("undefined"!=typeof w_type&&"1"==w_type?window.open("https://play.google.com/store/apps/details?id=com.vagaro","_blank"):window.location.href="https://play.google.com/store/apps/details?id=com.vagaro")):(null!=t&&"undefined"!=t&&""!=t||setTimeout(function(){"undefined"!=typeof w_type&&"1"==w_type?window.open("https://itunes.apple.com/us/app/vagaro/id536110000?mt=8i","_blank"):window.location.href="https://itunes.apple.com/us/app/vagaro/id536110000?mt=8i"},25),""!=i?selectedShopId>0?null!=navigator&&null!=navigator.userAgent&&navigator.userAgent.toLowerCase().indexOf("vagaroapp")>-1?window.location="js-call:myObjectiveCFunction:1001|~|VagaroApp:///BusinessId="+selectedShopId+encodeURIComponent(i):openApp("VagaroApp:///BusinessId="+selectedShopId+i):null!=navigator&&null!=navigator.userAgent&&navigator.userAgent.toLowerCase().indexOf("vagaroapp")>-1?window.location="js-call:myObjectiveCFunction:1001|~|VagaroApp:///"+encodeURIComponent(i.substring(1)):openApp("VagaroApp:///"+i.substring(1)):null!=navigator&&null!=navigator.userAgent&&navigator.userAgent.toLowerCase().indexOf("vagaroapp")>-1?window.location="js-call:myObjectiveCFunction:1001|~|VagaroApp:///BusinessId="+selectedShopId:openApp("VagaroApp:///BusinessId="+selectedShopId))}function openApp(e){$("<iframe />").attr("src",e).attr("style","display:none;").appendTo("body")}function ClassSignupPublic(e,t,i){ShowLoader(!0),$("#divApplyisPointApply").hide(),$("#divApplyDailyDeal").hide(),$("#divApplyGC").hide(),$("#divOuterApplyPkg").hide(),$("#divApplyisMembershipApply").hide(),"undefined"!=typeof groupID&&(groupID=void 0);var n=null;if(void 0!==$("#tr"+e).data("data-value")&&null==(n=JSON.parse($("#tr"+e).data("data-value"))).objEventDetails&&(n=null),null!=n&&null!=n.objEventDetails&&0!=n.objEventDetails.LoginUserID&&""!==n.objEventDetails.LoginUserID)ShowLoader(!1),ClassSignupPublicSuccess(n,i,!1);else{var o={};o.AppointmentID=e,o.loginUserID=UserID,o.businessID=t;var a=new vagaro.ajax;a.datamodel.Token=ApiURLEnumOnlineCommon.geteventdetails,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.data=o,a.datamodel.callback=function(t){ShowLoader(!1),null!=t&&1==t.UnderMaintanance?vagaro.alert({message:"Business is under maintenance. This won't take long",title:"info"}):null!=t&&($("#tr"+e).data("data-value",JSON.stringify(t)),$("#tr"+e).data("data-valueTime",new Date),ClassSignupPublicSuccess(t,i,!0))},a.datamodel.Error=function(e){console.log(e),ShowLoader(!1)},a.Post()}}function ClassSignupPublicSuccess(e,t,i){if(null!=e.objEventDetails){var n=e.objEventDetails;try{var o={},a="";o.PageName="Home",a=1==n.IsEnrolled?n.DurationRemainMin>5||n.EventDurationRemainMin<-5?"You're Signed Up":"Join Now":n.EventDurationRemainMin<6?"Join Now":"Sign Up",o.Action=a,o.ClassPrice="Free"==n.StreamingSellPrice?0:n.StreamingSellPrice,o.Category="Live Stream",o.BusinessName=n.BusinessName,o.BusinessID=n.BusinessID,o.ClassName=n.ServiceTitle;var s=n.StrStartTime.split("/"),r=s[2].split(" ");o.ClassStartDate=s[0]+"-"+s[1]+"-"+r[0],o.ClassTime=n.StrStartTime.toString().split(" ")[1]+" "+n.StrStartTime.toString().split(" ")[2],o.ClassDuration=n.Duration+" mins",o.ClassBy=n.FirstName,_vgLogEvent.LogData(o)}catch(e){}if(0==i){var l=$("#tr"+n.AppointmentID).data("data-valueTime");DateDiff=getDateDiff(l,new Date,!0),n.EventDurationRemain=n.EventDurationRemain-DateDiff}if(8==n.AppStatus||12==n.AppStatus)return void vagaro.alert({message:"This class not available for booking, Class is cancel or delete by business. ",title:"Class Not Available"});if(n.EventDurationRemain<-5)return void vagaro.alert({message:"This class is already live.",title:"Class Not Available"});var c=n.IsWorkShop?n.StreamingSellPrice:_vgClassSessionSelection.CalcSessionPrice(n.SessionDetail,1,1,!0,!0);$("#PopupEventPrice").html(BindEventPrice($("#tr"+n.AppointmentID).attr("data-countryid"),c)),_publicEvent=e,UserID>0&&1!=t&&1!=n.IsEnrolled&&_vgClassSessionSelection.GetEventCartDetail_ShowDiscountPublic(),0!=n.LoginUserID&&(ZoomURL=n.ZoomURL);var d="undefined"!=typeof vgAppicationType&&1==vgAppicationType?_common.GetAppVersion():null;if(null!=d&&d>=381&&null!=navigator.userAgent&&navigator.userAgent.indexOf("com.vagaro.customerios")>-1?$("#live-stream-classes-popup .enroll-visits").attr("onclick","javascript:CallbackforMobileApp(0, 0, '', '', '0', '38|~|"+ZoomURL+"');"):$("#live-stream-classes-popup .enroll-visits").attr("href",ZoomURL),1==t&&1==n.IsEnrolled)n.EventDurationRemain<6&&n.EventDurationRemain>-5&&$("#live-stream-classes-popup .enroll-visits")[0].click(),$("#live-stream-classes-popup .signup-enroll").hide(),$("#live-stream-classes-popup .signup-enroll-done").show(),n.EventDurationRemain>5||n.EventDurationRemain<-5?($("#signupViewmyclasses").removeAttr("href").removeAttr("target").removeAttr("onclick"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType?$("#signupViewmyclasses").on("click",function(){CallbackforMobileApp(0,0,"","",0,12)}):$("#signupViewmyclasses").attr("href","/myaccount/appointments").attr("target","_blank"),$("#live-stream-classes-popup .enroll-view").show(),$("#divJoinNow").hide()):($("#live-stream-classes-popup .enroll-view").hide(),$("#divJoinNow").show());else{$("#PopupServicePhoto").hide(),$("#live-stream-classes-popup").addClass("noclassImg"),String.isNullOrUndefineOrBlank(n.ServicePhoto)||($("#PopupServicePhoto").show(),$("#live-stream-classes-popup").removeClass("noclassImg"),$("#PopupServicePhoto").attr("data-original",n.ServicePhoto).addClass("lazylivestreamserviceimg"),$(".lazylivestreamserviceimg").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:ServiceImageError(),isShowIntials:!1,intial_selecter:""}).trigger("lazyload"),imageExists(n.ServicePhoto,function(e){0==e&&$("#live-stream-classes-popup").addClass("noclassImg")})),$("#PopupServiceProviderInitial").html(FindInitials(n.ServiceProviderName,"")),$("#PopupServiceProviderPhoto").attr("data-original",n.SpPhoto).addClass("lazylivestreamimg"),$(".lazylivestreamimg").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".initialspusername"}).trigger("lazyload"),$("#PopupReviewCount").html("<span aria-hidden='true'>("+n.ReviewCount+")</span>").attr("aria-label",Math.round(n.ReviewRank)+" star ratting having total "+n.ReviewCount+" reviews.").attr("role","banner");var u,p=null!=n.ReviewCount?Number(n.ReviewCount):0,h=1===p?"Review":"Reviews",m=parseFloat(n.ReviewRank),g=isNaN(m)?"0.0":m.toFixed(1);$("#PopupReviewCount").html("<span aria-hidden='true'>"+g+" ("+p+" "+h+")</span>").attr("aria-label",g+" star rating having total "+p+" "+h+".").attr("role","banner"),u="undefined"!=typeof vgAppicationType&&1==vgAppicationType?"<a id='signup-businessname' class='web-body-font-blue' href='/"+n.VagaroURL+"'>":"<a id='signup-businessname' class='web-body-font-blue' href='/"+n.VagaroURL+"' target='_blank'>",$("#PopupBusinessName").html(u+n.BusinessName+" in "+n.City+", "+n.StateCode+"</a>"),$("#PopupClassName").html(n.ServiceTitle),$("#PopupServiceProvider").html(n.ServiceProviderName);var v=n.IsDayLight;if(void 0!==$("#tr"+n.AppointmentID).attr("data-appointmentstarttime")){var f=new Date($("#tr"+n.AppointmentID).attr("data-appointmentstarttime").replace(/(\d{2})-(\d{2})-(\d{4})/,"$2/$1/$3"));f=countryDateFormat(moment(f),VagaroCountryDateFormat.LargeDateWithTime),$("#PopupClassDate").html(f+" ("+GetTimeZoneIDFromCookies(1,v)+")")}if($("#PopupClassDuration").html(n.EventDuration).attr("aria-label",n.EventDuration.indexOf("hr")>=0?n.EventDuration.replace("hr","hour"):n.EventDuration.replace("min","minute")),n.ReviewRank>0){var C=(100*n.ReviewRank/5).toFixed(2)+"%";$("#dvSPRatingStart").css("width",C)}else $("#dvSPRatingStart").css("width","0%");if($("#PopupClassDescMain").hide(),String.isNullOrUndefineOrBlank(n.ServiceDesc)||($("#PopupClassDesc").html(n.ServiceDesc),$("#PopupClassDescMain").show()),1==n.IsEnrolled?($("#live-stream-classes-popup .signup-enroll").hide(),$("#live-stream-classes-popup .signup-enroll-done").show(),n.EventDurationRemain>5||n.EventDurationRemain<-5?($("#signupViewmyclasses").removeAttr("href").removeAttr("target").removeAttr("onclick"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType?$("#signupViewmyclasses").on("click",function(){CallbackforMobileApp(0,0,"","",0,12)}):$("#signupViewmyclasses").attr("href","/myaccount/appointments").attr("target","_blank"),$("#live-stream-classes-popup .enroll-view").show(),$("#divJoinNow").hide()):($("#live-stream-classes-popup .enroll-view").hide(),$("#divJoinNow").show())):($("#PopupBtnSignUp").data("appID",n.AppointmentID),$("#PopupBtnSignUp").data("busID",n.BusinessID),$("#PopupBtnSignUp").removeClass("btn-flamigo flamingo-button").removeClass("btn-purchase"),n.EventDurationRemain>5?$("#PopupBtnSignUp").html('Sign Up <span class="mobile-event-price"> - '+$("#PopupEventPrice").html()+"</span>").addClass("btn-purchase"):$("#PopupBtnSignUp").html('Join Now <span class="mobile-event-price"> - '+$("#PopupEventPrice").html()+"</span>").addClass("btn-flamigo flamingo-button"),$("#live-stream-classes-popup .signup-enroll").show(),$("#live-stream-classes-popup .signup-enroll-done").hide()),1==n.IsWorkShop&&null!=e.lstEventAvailableDate){var S=_vgClassSessionSelection.GetWorkshopDates(e.lstEventAvailableDate);$("#live-stream-classes-popup .WorkshopDateDetails").show(),$("#live-stream-classes-popup .WorkshopDateDetails-Desc").html(S);var y=e.objWorkshopvalidateData;null==y?vagaro.alert({message:"This workshop started. Workshops are a series of sessions that must be attended from the beginning.",title:"Workshop in Progress"}):y.IsFirstDate?1==t&&0==n.IsEnrolled?0==n.IsLimitOnlineBooking?AddEventFromPublic():LiveStreamSignUpWithLimitOnlineBooking(n):$("#live-stream-classes-popup").modal("show"):null==y.FutureStartDate?vagaro.alert({message:"This workshop started on "+moment(new Date(y.strCurrentStartDate.replace(new RegExp("-","g")," "))).format("MMM DD, YYYY").replace(/ 0+/g," ")+". Workshops are a series of sessions that must be attended from the beginning.",title:"Workshop in Progress"}):"undefined"!=typeof bootbox&&bootbox.confirm({title:"Workshop in Progress",message:"This workshop started on "+moment(new Date(y.strCurrentStartDate.replace(new RegExp("-","g")," "))).format("MMM DD, YYYY").replace(/ 0+/g," ")+". Workshops are a series of sessions that must be attended from the beginning. Would you like to join the next workshop on "+moment(new Date(y.strFutureStartDate.replace(new RegExp("-","g")," "))).format("MMM DD, YYYY").replace(/ 0+/g," ")+"?",buttons:{cancel:{label:"Cancel"},confirm:{label:"Continue"}},callback:function(e){e&&(1==t&&0==n.IsEnrolled?0==n.IsLimitOnlineBooking?AddEventFromPublic():LiveStreamSignUpWithLimitOnlineBooking(n):$("#live-stream-classes-popup").modal("show"))}})}else $("#live-stream-classes-popup .WorkshopDateDetails").hide(),1==t&&0==n.IsEnrolled?0==n.IsLimitOnlineBooking?AddEventFromPublic():LiveStreamSignUpWithLimitOnlineBooking(n):$("#live-stream-classes-popup").modal("show");$("#live-stream-classes-popup .modal-body").animate({scrollTop:0},500)}}}function LiveStreamSignUpWithLimitOnlineBooking(e){if(2==e.IsRedirectToCheckOut){if(null!=e&&void 0!==e.VagaroURL&&null!=e.VagaroURL){var t={},i=e.SessionDetail.split(","),n=1,o=0;return i.length>0&&(n=parseInt(i[0].split("-")[1]),o=i[0].split("-")[3]),t.BusinessID=e.BusinessID,t.AppointmentID=e.AppointmentID,t.Session=n,t.Amount=o,t.ServiceID=e.ServiceID,t.ServiceProviderID=e.ServiceProviderID,t.StrStartTime=e.StrStartTime,setCookie("LiveStreamSignUp",t),void(window.location.href=e.VagaroURL+"/classes")}}else if(1==e.IsRedirectToCheckOut)return void vagaro.alert({message:"Live stream sign up is not possible for this class as logged in user or friends/family are not existing customers. ",title:"Live Stream Sign Up"})}function ServiceImageError(){$("#PopupServicePhoto").hide()}function imageExists(e,t){var i=new Image;i.onload=function(){t(!0)},i.onerror=function(){t(!1)},i.src=e}function AddEventFromPublic(e,t){if(UserID>0&&void 0!==e&&void 0!==t){var i=$(e.currentTarget).data("appID");if(null!=i){var n=$("#tr"+i).data("data-value"),o=JSON.parse(n);if(null!=o.objEventDetails&&1==o.objEventDetails.IsLimitOnlineBooking)return void LiveStreamSignUpWithLimitOnlineBooking(o.objEventDetails)}}if(UserID>0){var a=!1;void 0!==t&&null!=t&&(a=t),_vgClassSessionSelection.ClassAddToCartPublic(a)}else ClassSignupPublicButton(e,$("#PopupBtnSignUp").data("appID"),$("#PopupBtnSignUp").data("busID"),$("#PopupBtnSignUp").data("ServiceName"))}function ClassSignupPublicButton(e,t,i){if(e.stopPropagation(),e.preventDefault(),objLiveStreamSignupPublic={},objLiveStreamSignupPublic.appID=t,objLiveStreamSignupPublic.busID=i,!(UserID>0))return window.location.href.indexOf(_common.liveStreamClasses)>0?_common.AddState(_common.liveStreamClasses):_common.AddState("home"),showCommonLoginPopup("LiveStreamEventAddToCart"),!1;ClassSignupPublic(t,i,!0)}function AddLogEventDataInFirebase(e){IsGallerySp=!1,IsGallerywithsp=!1;var t=!0;null!=e.IsFiltered&&void 0!==e.IsFiltered&&void 0!==isDealFilterApplied&&null!=isDealFilterApplied&&(e.IsFiltered=isDealFilterApplied),null!=e.IsFromBusinessDetailPage&&void 0!==e.IsFromBusinessDetailPage&&e.IsFromBusinessDetailPage&&IsServiceTab&&IsClassTab&&(t=!1),t&&_vgLogEvent.LogEventData(e)}function upcomingSlider(){$("#divUpcomingApptMnts").slick({infinite:!1,speed:600,slidesToShow:4,leftMode:!0,variableWidth:!0,responsive:[{breakpoint:1679,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:1200,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:767,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:660,settings:{slidesToShow:1,slidesToScroll:1,arrows:!1}}]})}function upcomingSlider_mobile(){var e=$(window).width();setTimeout(function(){e<=767?$("#divUpcomingApptMnts").unslick():e>=767&&upcomingSlider()},60)}function ShowHideDoneMessageCommon(e,t){void 0!==t&&""!=t||(t=4e3),$(".banner-success-master .text-block-28").html(e),$(".banner-success-master").addClass("showmsgTop"),setTimeout(function(){$(".banner-success-master").removeClass("showmsgTop")},t)}function ShowHideWarningMessageCommon(e,t){void 0!==t&&""!=t||(t=4e3),$(".banner-warning-master .text-block-28").html(e),$(".banner-warning-master").addClass("showmsgTop"),setTimeout(function(){$(".banner-warning-master").removeClass("showmsgTop")},t)}function ShowHideFailedMessageCommon(e,t){void 0!==t&&""!=t||(t=4e3),$(".banner-fail-master .text-block-28").html(e),$(".banner-fail-master").addClass("showmsgTop"),setTimeout(function(){$(".banner-fail-master").removeClass("showmsgTop")},t)}function SaveReviewCommon(){"undefined"!=typeof _vgLiveStreamReview?_vgLiveStreamReview.SaveReview():_siteBuilderDetail.saveReview()}function EmptyStarCommon(e){"undefined"!=typeof _vgLiveStreamReview?_vgLiveStreamReview.Emptystar(e):_siteBuilderDetail.emptystar(e)}function FillStarCommon(e){"undefined"!=typeof _vgLiveStreamReview?_vgLiveStreamReview.Fillstar(e):_siteBuilderDetail.fillstar(e)}function ClickStarCommon(e){"undefined"!=typeof _vgLiveStreamReview?_vgLiveStreamReview.Clickstar(e):_siteBuilderDetail.clickstar(e),$("#imgReviewBusinessLogo").removeAttr("tabindex"),$(e).attr("tabindex","0"),$(e).focus(),$.grep($(e).parent("div").find("div").siblings("div.rating-symbol.glyphicon-star-empty.glyphicon"),function(e,t){var i=$(e).parent("div").find("div").siblings(".selected").length,n=t+1;i<n?$(e).attr("aria-label",n+" Star").attr("aria-live","polite"):$(e).attr("aria-label",i+" out of 5 stars Selected").attr("aria-live","polite")})}function DeleteReviewImageCommon(e){"undefined"!=typeof _vgLiveStreamReview?_vgLiveStreamReview.DeleteReviewImage(e):_siteBuilderDetail.DeleteReviewImage(e)}function CloseReviewPopupCommon(){"undefined"!=typeof _vgLiveStreamReview?_vgLiveStreamReview.AttendeeCloseButton():_siteBuilderDetail.CloseReviewPopup(),$("#imgReviewBusinessLogo").removeAttr("tabindex"),$("#divSelect2Parent").removeAttr("tabindex")}function KeyUpCommon(e){"undefined"!=typeof _vgLiveStreamReview?_vgLiveStreamReview.keyup(e):_siteBuilderDetail.keyup(e)}function FocusPolicy(e){try{document.getElementById("iFrameSignUp")&&void 0!==document.getElementById("iFrameSignUp").contentWindow.focusPolicy&&document.getElementById("iFrameSignUp").contentWindow.focusPolicy(e)}catch(e){}}togglesearchmodeforselection=function(e,t,i){var n=businessSearchModeForSelection.indexOf(e);try{"undefined"!=typeof _ServiceData&&null!=_ServiceData&&"undefined"!=_ServiceData.VagaroServiceIDs&&null!=_ServiceData.VagaroServiceIDs&&""!=_ServiceData.VagaroServiceIDs&&(_ServiceData.VagaroServiceIDs="")}catch(e){}if(-1==n?(businessSearchModeForSelection=[0,e],void 0===i||1!=i||e!=searchFilterEnum.LiveStream||"undefined"==typeof tabSegment||"class"!=tabSegment&&"listings"!=tabSegment&&"book"!=tabSegment?$("body").removeClass("livestreampage"):$("body").hasClass("livestreampage")||($("body").addClass("livestreampage"),LoadLiveStreamPage())):0!=e&&($(t).removeClass("active").attr("aria-checked",!1),businessSearchModeForSelection.splice(n,1),void 0!==i&&1==i&&e==searchFilterEnum.LiveStream&&"book"!=tabSegment&&window.history.go(-1)),3==e){if(0!=$(".listigBusiness-wrapper").find(".liststream-filter-top").length)return!1;if($(".listigBusiness-wrapper").append('<div id="listStreamFilterId" class="liststream-filter-top" style="" role="none" runat="server"><div class="livestreamfilter" role="none"><div class="pos-relative marginleft20" role="none"><div id="dvDurationText" class="white-roundbox duration-text font-awesome-5pro-light filter-button filter-button-icon" aria-label="Duration combobox" aria-controls="ul_durationdropdown" aria-live="polite"><span class="font-awesome-5pro-light bookmark-text14" aria-hidden="true">&#xf017;</span></div><div class="dropdown-class-stream positionLeft vagaro-dropdown-multiselect" id="durationdropdown" role="none"><ul id="ul_durationdropdown" role="listbox"><li aria-label="Less than 30 minutes"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="1" id="Lessthan30min"><label for="Lessthan30min" role="checkbox" aria-live="polite" aria-checked="false">Less than 30 minutes</label></div></li><li aria-label="30 min"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="2" id="30min"><label for="30min" role="checkbox" aria-live="polite" aria-checked="false">30 min</label></div></li><li aria-label="1 hour"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="3" id="1hour"><label for="1hour" role="checkbox" aria-live="polite" aria-checked="false">1 hour</label></div></li><li aria-label="1+ hours"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="4" id="1+hours"><label for="1+hours" role="checkbox" aria-live="polite" aria-checked="false">1+ hours</label></div></li></ul></div></div><div class="marginleft20"><div class="white-roundbox LiveStreamBookmarkClass filter-button filter-button-icon" id="LiveStreamBookmark" aria-label="Live Stream Bookmark Class" aria-live="polite" role="link"><span class="font-awesome-5pro-light bookmark-text14" aria-hidden="true">&#xf02e;</span></div></div></div><div class="prof-right-padding streamfilterclass"><div class="filteradded" id="divStreamListingFilters"><div id="divStreamFirstSlide" class="w-inline-block" aria-hidden="true">&nbsp;</div><a href="javascript:void(0);" onclick="SearviceFilter(this,1)" id="LiveStreamyoga" data-livestreamid="1" data-livestream="yoga" class="LiveStreamYoga fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Yoga</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,2)" id="LiveStreampilates" data-livestreamid="2" data-livestream="pilates" class="LiveStreamPilates fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro pilates" aria-hidden="true"></span>Pilates</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,3)" id="LiveStreamcardio" data-livestreamid="3" data-livestream="cardio" class="LiveStreamCrossfit fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Cardio</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,4)" id="LiveStreamcycling" data-livestreamid="4" data-livestream="cycling" class="LiveStreamCycle fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Cycling</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,5)" id="LiveStreamstrength" data-livestreamid="5" data-livestream="strength" class="LiveStreamStrength fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Strength</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,6)" id="LiveStreambootcamp" data-livestreamid="6" data-livestream="bootcamp" class="LiveStreamCrossfit fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Boot Camp</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,7)" id="LiveStreammartialarts" data-livestreamid="7" data-livestream="martialarts" class="LiveStreamStrength fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Martial Arts</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,8)" id="LiveStreamboxing" data-livestreamid="8" data-livestream="boxing" class="LiveStreamBoxing fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Boxing</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,9)" id="LiveStreamdance" data-livestreamid="9" data-livestream="dance" class="LiveStreamBoxing fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Dance</div></a><div id="divStreamLastSlide" class="w-inline-block" style="">&nbsp;</div></div><div class="font-awesome left-slide-arrow" id="divStreamPrevFilter" onclick=\'_common.nextPreviousFilters("divStreamListingFilters",0,"divStreamNextFilter","divStreamPrevFilter")\'><span>&#xf104;</span></div><div class="font-awesome right-slide-arrow" id="divStreamNextFilter" onclick=\'_common.nextPreviousFilters("divStreamListingFilters",1,"divStreamNextFilter","divStreamPrevFilter")\'><span>&#xf105;</span></div></div><div class="dropdown-stream"><div class="pos-relative"><div class="dropdown-stream-div stream-more filter-button" aria-label="more combobox" aria-controls="LiveStreamClassList"><span class="font-awesome-light-pro margin-right4"></span><span aria-hidden="true">More</span><span class="font-awesome-solid-pro margin-left4" aria-hidden="true"></span></div><div class="dropdown-class-stream default-scrollbar vagaro-dropdown-share-content" id="streamclassdropdown" role="none"><ul class="share-content-ul" id="LiveStreamClassList" role="listbox"><li class="LiveStreamClassListCss p-0"><a href="javascript:void(0);" onclick="SearviceFilter(this,1)" id="liLiveStreamyoga" data-livestreamid="1" data-livestream="yoga" class="LiveStreamYoga w-inline-block" role="option" aria-label="Yoga"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Yoga</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,2)" id="liLiveStreampilates" data-livestreamid="2" data-livestream="pilates" class="LiveStreamPilates w-inline-block" role="option" aria-label="Pilates"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro pilates"></span>Pilates</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,3)" id="liLiveStreamcardio" data-livestreamid="3" data-livestream="cardio" class="LiveStreamCrossfit w-inline-block" role="option" aria-label="Cardio"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Cardio</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,4)" id="liLiveStreamcycling" data-livestreamid="4" data-livestream="cycling" class="LiveStreamCycle w-inline-block" aria-label="Cycling"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Cycling</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,5)" id="liLiveStreamstrength" data-livestreamid="5" data-livestream="strength" class="LiveStreamStrength w-inline-block" aria-label="Strength"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Strength</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,6)" id="liLiveStreambootcamp" data-livestreamid="6" data-livestream="bootcamp" class="LiveStreamCrossfit w-inline-block" aria-label="Boot Camp"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Boot Camp</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,7)" id="liLiveStreammartialarts" data-livestreamid="7" data-livestream="martialarts" class="LiveStreamStrength w-inline-block" aria-label="Martial Arts"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Martial Arts</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,8)" id="liLiveStreamboxing" data-livestreamid="8" data-livestream="boxing" class="LiveStreamBoxing w-inline-block" aria-label="Boxing"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Boxing</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,9)" id="liLiveStreamdance" data-livestreamid="9" data-livestream="dance" class="LiveStreamBoxing w-inline-block" aria-label="Dance"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Dance</div></a></li></ul><ul id="streamclassdropdownlist" style="display : none"><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Gyrontonic" id="Gyrontonic"><label for="Gyrontonic">Gyrontonic</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Gyrokinesis" id="Gyrokinesis"><label for="Gyrokinesis">Gyrokinesis</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Aerobics" id="Aerobics"><label for="Aerobics">Aerobics</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Zumba" id="Zumba"><label for="Zumba">Zumba</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Spinning" id="Spinning"><label for="Spinning">Cycle / Spinning</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Step Classes" id="StepClasses"><label for="StepClasses">Step Classes</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Weight Training" id="WeightTraining"><label for="WeightTraining">Weight Training</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Strength Training" id="StrengthTraining"><label for="StrengthTraining">Strength Training</label></div></li></ul><script id="StreamClassDropdownTemplate" type="text/x-jQuery-tmpl"><li><div><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" name="StreamClassDropdownCheckbox" value="${HSBusinessTypeId}" data-hsbusinesstype="${HSBusinessType}" id="${HeroSliderID}"><label for="${HeroSliderID}">${PopularCategoryName}</label></div></div></li><\/script><script id="StreamClassCategoryDropdownTemplate" type="text/x-jQuery-tmpl"><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="javascript:SearviceFilter(this);" id="${ServiceId}">${CategoryName}</a></li><\/script></div></div></div></div>'),$(".LiveStreamBookmarkClass").on("click",function(e){ManagaBusinessBookmark(this)}),$(".stream-more").on("click",function(){$("#streamclassdropdown").slideToggle("600"),$(window).width()<767&&$(this).closest(".livestreampage").find(".mobile-classmore-links").toggle()}),$(".duration-text").on("click",function(){$("#durationdropdown").slideToggle("600")}),_gblLiveStreamSearchServiceId.length>0||_gblLiveStreamSearchServiceId>0)for(var o in _gblLiveStreamSearchServiceId=_gblLiveStreamSearchServiceId.toString()){t=parseInt(_gblLiveStreamSearchServiceId[o]);$("#divStreamListingFilters a").each(function(){$(this).data("livestreamid")===t&&$(this).addClass("selected")}),$("#LiveStreamClassList li a").each(function(){$(this).data("livestreamid")===t&&$(this.parentElement).addClass("active")})}setCategoryWidthheight()}else $(".listigBusiness-wrapper").find(".liststream-filter-top").length>0&&$(".listigBusiness-wrapper").find(".liststream-filter-top").remove();return!1},togglebusinesssearch=function(e){var t,i,n,o=service;if(void 0!==o&&""!=o){var a=AdminServiceList.results;if(a&&a.length>0){var s=findObjectBytext(a,o);urlService=null!=s?s.url:service}}if($("#aBusinessTab").removeClass("active"),$("#aMobileTab").removeClass("active"),$("#aStreamTab").removeClass("active"),$("#aBusinessTab").removeClass("vg-filter-mobile-tab"),$("#aMobileTab").removeClass("vg-filter-mobile-tab"),$("#aStreamTab").removeClass("vg-filter-mobile-tab"),$(".business-toggle").removeClass("w--current"),$(".mobile-toggle").removeClass("w--current"),$(".stream-toggle").removeClass("w--current"),$("#aBusinessTab").removeClass("w--current"),$("#aMobileTab").removeClass("w--current"),$("#aStreamTab").removeClass("w--current"),$("#btnLiveStream").removeClass("w--current"),$("#btnLiveStreamMobile").removeClass("w--current"),$(".business-toggle").removeClass("active").attr("aria-checked",!1),$(".mobile-toggle").removeClass("active").attr("aria-checked",!1),$(".stream-toggle").removeClass("active").attr("aria-checked",!1),$("#aBusinessTab").removeClass("active").attr("aria-checked",!1),$("#aMobileTab").removeClass("active").attr("aria-checked",!1),$("#aStreamTab").removeClass("active").attr("aria-checked",!1),$("#btnAtBusiness").removeClass("active").attr("aria-checked",!1),$("#btnMobile").removeClass("active").attr("aria-checked",!1),$("#btnLiveStream").removeClass("active").attr("aria-checked",!1),$("#btnMobileForMobile").removeClass("active").attr("aria-checked",!1),$("#btnAtBusinessMobile").removeClass("active").attr("aria-checked",!1),$("#btnLiveStreamMobile").removeClass("active").attr("aria-checked",!1),HasIdExists(1)){$(".mobile-toggle").addClass("active").attr("aria-checked",!0),$("#aMobileTab").addClass("active").attr("aria-checked",!0),$("#aMobileTab").addClass("vg-filter-mobile-tab");var r=$("#btnMobile");r.addClass("active"),r.is(":visible")&&r.attr("aria-checked",!0).focus();var l=$("#btnMobileForMobile");l.addClass("active"),l.is(":visible")&&l.attr("aria-checked",!0).focus();var c=$("#divAdOtheLocation");c.is(":visible")&&c.focus()}HasIdExists(2)&&($(".business-toggle").addClass("active").attr("aria-checked",!0),$("#aBusinessTab").addClass("active").attr("aria-checked",!0),$("#aBusinessTab").addClass("vg-filter-mobile-tab"),(t=$("#btnAtBusiness")).addClass("active"),t.is(":visible")&&t.attr("aria-checked",!0).focus(),(i=$("#btnAtBusinessMobile")).addClass("active"),i.is(":visible")&&i.attr("aria-checked",!0).focus(),(n=$("#divAdBusiness")).is(":visible")&&n.focus());if(HasIdExists(3)){$(".stream-toggle").addClass("active").attr("aria-checked",!0),$("#aStreamTab").addClass("active").attr("aria-checked",!0),$("#aStreamTab").addClass("vg-filter-mobile-tab");var d=$("#btnLiveStream");d.addClass("active"),d.is(":visible")&&d.attr("aria-checked",!0).focus();var u=$("#btnLiveStreamMobile");u.addClass("active"),u.is(":visible")&&u.attr("aria-checked",!0).focus(),$(".stream-toggle").focus();var p=$("#divAdOnlineStream");p.is(":visible")&&p.focus()}HasIdExists(2)&&($(".business-toggle").addClass("active").attr("aria-checked",!0),$("#aBusinessTab").addClass("active").attr("aria-checked",!0),(t=$("#btnAtBusiness")).addClass("active").attr("aria-checked",!0),t.is(":visible")&&t.attr("aria-checked",!0).focus(),(i=$("#btnAtBusinessMobile")).addClass("active").attr("aria-checked",!0),i.is(":visible")&&i.attr("aria-checked",!0).focus(),(n=$("#divAdBusiness")).is(":visible")&&n.focus());businessSearchMode=e,$("#btnLiveStream").on("click",function(e){var t=window.location.pathname;$("#btnLiveStream").attr("href",t),e.preventDefault()}),$("#btnLiveStreamMobile").on("click",function(e){var t=window.location.pathname;$("#btnLiveStreamMobile").attr("href",t),e.preventDefault()})},window.history&&window.history.pushState&&$(window).on("popstate",function(){try{$("input.selectfocusout-back").each(function(){$(this).select2("close")})}catch(e){}if("undefined"==typeof ignoreHistory_IOS||1!=ignoreHistory_IOS||1==localStorage.getItem("isAdvanceSearchMenu"))if("object"==typeof $(".select2-drop")&&$(".select2-drop").hide(),"Home"==BasePage){if(""!=$("#dvSignupNew").html()&&null!=$("#dvSignupNew").html()&&1==$("#dvSignupNew").is(":visible")&&LoginClosePopup(!0),$("#btnBackHomeSearch").is(":visible")&&$("#btnBackHomeSearch").click(),history.state)if(history.state.sectionName.indexOf("dealsindividual")>=0){var e=(o=history.state.sectionName.split("dealsindividual"))[0];DailyDealsDetail(o[1].split("&&")[0],o[1].split("&&")[1],e,null)}else{if("detail"!=history.state.basepage.toLowerCase()&&"myaccount"!=history.state.basepage.toLowerCase()||1==localStorage.getItem("isAdvanceSearchMenu")&&(localStorage.setItem("isAdvanceSearchMenu",0),window.location.reload(!0)),"deals"==history.state.sectionName.toLowerCase()&&($("#ulFeatureBusiness").html('<section class="cards-parent-div-flex daily" id="dealListing">').removeAttr("style"),$("#ulFeatureBusiness").removeAttr("lastcall")),-1!=history.state.sectionName.indexOf("/")&&(history.state.sectionName=history.state.sectionName.split("/")[0]),history.state.sectionName.toLowerCase()==_common.liveStreamClasses)_common.SelectLiveStreamClasses(history.state);else if("listings"==history.state.sectionName.toLowerCase()||"class"==history.state.sectionName.toLowerCase()||"book"==history.state.sectionName.toLowerCase()){-1!=businessSearchModeForSelection.indexOf(searchFilterEnum.LiveStream)&&($("#divBusType #aStreamTab").hasClass("w--current")||$("#divBusType #aBusinessTab").hasClass("w--current")||$("#divBusType #aMobileTab").hasClass("w--current")?window.history.back():(ResetBusinessSearchMode(),resetAllCheckBox()))}history.state.sectionName.toLowerCase()!=_common.liveStreamClasses&&$("body").hasClass("livestreampage")&&$("body").removeClass("livestreampage"),loadData(history.state.sectionName,!0),_common.setGeoLocationMarker(history.state.sectionName)}else if(null==history.state){var t="home";try{t=window.location.pathname.split("/")[1]}catch(e){}"deals"==(t=void 0!==t?t:"home").toLowerCase()&&($("#ulFeatureBusiness").html('<section class="cards-parent-div-flex daily" id="dealListing">').removeAttr("style"),$("#ulFeatureBusiness").removeAttr("lastcall")),loadData(t,!0),_common.setGeoLocationMarker(t),1==localStorage.getItem("isAdvanceSearchMenu")&&(localStorage.setItem("isAdvanceSearchMenu",0),window.location.reload(!0))}}else if("detail"==BasePage.toLowerCase()){if($("#divLoginNew").is(":visible")&&setTimeout(function(){LoginClosePopup()},300),$("#mobile-check").is(":visible")||"undefined"!=typeof vgAppicationType&&1==vgAppicationType)document.referrer.toLowerCase().indexOf("customerapprule.html")>-1&&$("#divSearch").is(":visible")&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,1),$("#divClassDetailpopup").length>0&&$("#divClassDetailpopup").removeClass("fade").modal("hide"),_shopdetail.backpage();else if($("#dvOnlineAppoinmentBooked").is(":visible"))$("#dvOnlineAppoinmentBooked").hide(),_common.LoadBookNowMenu(LoadMenuTypeEnum.booknow,!0);else if(history.state){var i=GetSelectedMenuObject(history.state.subTab);if(history.state.sectionName.indexOf("dealsindividual")>=0){$("#dvDailyDealsDetail").show(),$("#pageSection").hide().removeClass("pagesectionFlex");e=(o=history.state.sectionName.split("dealsindividual"))[0];DailyDealsDetail(o[1].split("&&")[0],o[1].split("&&")[1],e,null)}else if("addreview"==history.state.subTab)$("#btnAboutAddReview").attr("data-addstate","false"),_siteBuilderDetail.OpenReviewPopup();else{"about"==history.state.subTab||"reviews"==history.state.subTab||"products"==history.state.subTab?($("#dvDailyDealsDetail").hide(),$("#divWriteReview").hide()):"staff"!=history.state.subTab&&"services"!=history.state.subTab&&"classes"!=history.state.subTab&&"gift-certificates"!=history.state.subTab&&"memberships"!=history.state.subTab&&"book-now"!=history.state.subTab&&"styles"!=history.state.subTab||$("#dvDailyDealsDetail").hide();try{$(i[0]).attr("data-addstate","false"),"shopping-bag"==history.state.subTab.toLowerCase()&&$(i[0]).attr("data-isbypass","false"),$(i[0]).click()}catch(e){tabOb.attr("data-addstate","false"),"shopping-bag"==history.state.subTab.toLowerCase()&&i.attr("data-isbypass","false"),i.click()}}}else if(null==history.state){$("#dvDailyDealsDetail").hide();t=tabSegment;try{t=IsVagaroDomain()?window.location.pathname.split("/")[2]:window.location.pathname.split("/")[1]}catch(e){}var n=GetSelectedMenuObject(t=void 0!==t&&""!=t&&null!=t?t:DefaultTabPage);try{$(n[0]).attr("data-addstate","false"),"shopping-bag"==t.toLowerCase()&&$(n[0]).attr("data-isbypass","true"),$(n[0]).click()}catch(e){n.attr("data-addstate","false"),"shopping-bag"==t.toLowerCase()&&n.attr("data-isbypass","true"),n.click()}}}else if("dailydeal"==BasePage.toLowerCase())if(history.state)if(history.state.sectionName.indexOf("dealsindividual")>=0){var o;e=(o=history.state.sectionName.split("dealsindividual"))[0];DailyDealsDetail(o[1].split("&&")[0],o[1].split("&&")[1],e,null)}else loadData(history.state.sectionName,!0),_common.setGeoLocationMarker(history.state.sectionName);else null==history.state&&window.location.reload(!0);else null==history.state&&window.location.reload(!0);else ignoreHistory_IOS=!1}),iosDevices?$(document).bind("touchstart",function(e){onOutsideClick(e)}):$(document).mousedown(function(e){onOutsideClick(e)}),function(e,t){var i=iOSversion();function n(e){for(var t=null==e?"":e.toLowerCase().split(" "),i=0;i<t.length;i++)t[i]=t[i].charAt(0).toUpperCase()+t[i].substring(1);return t.join(" ")}_common={},_common.reloadstyle=!0,_common.likestyle=null,_common.liveStreamClasses="live-stream-classes",_common.getscrollTop=function(t){e(t).scrollTop();return InPageWidget_Ios?-1*e("#page-wrapper").position().top:e(window).scrollTop()},_common.nestedHiddenElement=function(t){return e(t).filter(function(){return"none"!==e(this).css("display")}).length},_common.checkiOSversion=function(){try{if(/iP(hone|od|ad)/.test(navigator.platform)){var e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return void 0!==e&&null!=e&&""!=e||(e=navigator.appVersion.match(/OS X (\d+)_(\d+)_?(\d+)?/)),[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||0,10)]}}catch(e){}},_common.showHideCart=function(t){t&&_common.VisibleControlLength("#mobile-check")>0?e("#mobileCart").show():e("#mobileCart").hide()},_common.showHideBackandCart=function(e){_common.showHideCart(e)},_common.SetCityState=function(e,t,i){return void 0!==t&&null!=t||(t=""),void 0!==e&&null!=e&&""!=e?e+", "+(null!=i&&""!=i&&null!=i&&2==i?t:t.toUpperCase()):null!=i&&""!=i&&null!=i&&2==i?t:t.toUpperCase()},_common.nextPrevious=function(t,i,n,o){var a=e("#"+t).width();e("#"+n).removeClass("slide-disabled"),e("#"+n).removeAttr("disabled"),e("#"+o).removeClass("slide-disabled"),e("#"+o).removeAttr("disabled");var s,r=document.getElementById(t).scrollWidth,l=e("#"+t).scrollLeft();0==i?((s=l-a)<0&&(s=0),s<=0&&e("#"+n).addClass("slide-disabled"),e("#"+t).animate({scrollLeft:s},500)):((s=l+a)>r&&(s=r),s+a>=r&&e("#"+o).addClass("slide-disabled"),e("#"+t).animate({scrollLeft:s},500));return!1},_common.nextPreviousFilters=function(t,i,n,o){var a=e("#"+t).width();e("#"+o).show(),e("#"+n).show();var s,r=document.getElementById(t).scrollWidth,l=e("#"+t).scrollLeft();0==i?((s=l-a)<0&&(s=0),s<=0&&e("#"+o).hide(),e("#"+t).animate({scrollLeft:s},500)):((s=l+a)>r&&(s=r),s+a>=r&&e("#"+n).hide(),e("#"+t).animate({scrollLeft:s},500));return!1},_common.SetChoiceForSeleect2=function(e,t){e.data("choice",JSON.stringify(t))},_common.GetChoiceForSeleect2=function(e){try{return JSON.parse(e.data("choice"))}catch(e){return{}}},_common.SetDefaultForSeleect2=function(e){e.data("choice",JSON.stringify({id:"",text:""}))},_common.focusonLocationControl=function(t){if(e("#txtLocationSearch").click(),0==("undefined"!=typeof vgAppicationType&&1==vgAppicationType)){var i=e("#txtBusinessLocationSearch1").data("select2");i.val(e("#txtLocationSearch").val()),setTimeout(function(){i.opened()||(1==t&&e("#txtBusinessLocationSearch1").parent().find(".select2-input").val(""),i.open())},0)}},_common.LiveStreamLocationSearchControl=function(){e("#divLiveStreamLocationSearchPopUp").modal("show"),e(".modal-backdrop").last().css("z-index","1003"),e("#txtLiveStreamLocationSearch").select2("destroy"),e("#txtLiveStreamLocationSearch").off("selected"),e("#txtLiveStreamLocationSearch").off("select2-close");new ProximitySearch(e("#txtLiveStreamLocationSearch"),e("#hdngblCountryId"),e("#navCountryList")).init("service-where-dropdown mobcommon-dropdown liveStreamSearchClass",!1);e("#txtLiveStreamLocationSearch").parent().find(".select2-input").val(""),e(".liveStreamSearchClass").css("z-index","99999"),e("#txtLiveStreamLocationSearch").parent().find(".select2-input").attr("placeholder","Search for a Location"),e("input.select2-input").attr("autocomplete","off"),setTimeout(function(){null!=e("#divLiveStreamLocationSearchPopUp").css("display")&&"none"!=e("#divLiveStreamLocationSearchPopUp").css("display")&&e("#txtLiveStreamLocationSearch").parent().find(".select2-input").click()},500)},_common.focusonMobileLocationControl=function(){if(0==("undefined"!=typeof vgAppicationType&&1==vgAppicationType)){var t=e("#txtMobileCityState").data("select2");setTimeout(function(){t.opened()||(e("#txtMobileCityState").parent().find(".select2-input").val(""),t.open())},0)}},_common.MobileSctollTop=function(t){if(_common.VisibleControlLength("#mobile-check")>0){e("html,body").animate({scrollTop:e(t).offset().top+0},"slow")}},_common.ScrollToTopShopDetail=function(t){if(1==_shopdetail.isTabLoaded)if(0==e("#mobile-check").is(":visible")){var i=e("#topHeadSection").height()+31;void 0!==_shopdetail.isCustomWebsite&&"true"==_shopdetail.isCustomWebsite&&(i=e("#divCustombanner").height()+81),setTimeout(function(){e("html, body").animate({scrollTop:i},"slow",function(){e("#backtotop").css("display","none")})},500)}else _common.ScrollToToZero()},_common.ScrollToTopAnchor=function(t){var i=0;InPageWidget_Ios&&(i=_common.getscrollTop(ScrollTarget)),e("html,body").animate({scrollTop:e(t).offset().top+i-74},"slow")},_common.ScrollToToZero=function(){InPageWidget_Ios?(e("body").css("height","auto"),e("body").css("height","100%")):e("html, body").animate({scrollTop:0},"slow",function(){e("#backtotop").length&&e("#backtotop").css("display","none")})},_common.ScrollToToZeroReview=function(){e("html, body").animate({scrollTop:0},"slow","linear",function(){e("#backtotop").length&&e("#backtotop").css("display","none")})},_common.backtoTopHide=function(){e("#backtotop").css("display","none")},_common.PassiveAlertClass=function(t,i){var n=e(".passive-alert-parent .passive-alert");n.attr("class","passive-alert"),n.addClass(t),n.find(".image-27").attr("src",i)},_common.ADAPassiveAlert=function(t,i){var n=document.activeElement,o=null;(n=e(void 0!==i&&null!=i?i:n)).length>0&&void 0!==n.attr("aria-label")&&n.attr("aria-label")!=t&&(o=n.attr("aria-label")),n.attr("aria-label",t).focus(),setTimeout(function(e,t){e.removeAttr("aria-label"),null!=t&&e.attr("aria-label",t)},5e3,n,o)},_common.PassiveAlertSuccess=function(t,n){var o=Webflow.require("ix"),a=e(".passive-alert-parent");if(e(".passive-alert").hasClass("passive-warn")&&e(".passive-alert").removeClass("passive-warn"),a.find(".passive-msg").html(t),void 0!==i&&i[0]<=8){var s={type:"click",selector:".passive-alert-parent",preserve3d:!0,stepsA:[{display:"-webkit-flex",transition:"transform 400ms ease 0",x:"0px",y:"55px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){o.run(s,a),_common.ADAPassiveAlert(t,n)},500)}else{s={type:"click",selector:".passive-alert-parent",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 400ms ease 0",x:"0px",y:"55px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){o.run(s,a),_common.ADAPassiveAlert(t,n)},500)}},_common.PassiveAlertSuccessgreen=function(t,n){if("Builder"==getQueryStringData("Type"))wbc._postMessage('{"eventType": "passiveAlert","type": "success", "message":"'+t+'"}');else{var o=Webflow.require("ix"),a=e(".passive-alert-green");if(a.find(".passive-tex-msg").html(t),void 0!==i&&i[0]<=8){var s={type:"click",selector:".passive-alert-green",preserve3d:!0,stepsA:[{display:"-webkit-flex",transition:"transform 400ms ease 0",x:"0px",y:"0px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"-50px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){o.run(s,a),_common.ADAPassiveAlert(t,n)},500)}else{s={type:"click",selector:".passive-alert-green",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 400ms ease 0",x:"0px",y:"0px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"-50px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){o.run(s,a),_common.ADAPassiveAlert(t,n)},500)}}},_common.PassiveAlertfail=function(t,n){if("OnBoarding"==getQueryStringData("Type")){var o=e(".passive-banner-fail");o.length>0&&(o.css({display:"block",top:"300px"}),e(".scrptbody").scrollTop(1))}var a=Webflow.require("ix"),s=e(".passive-banner-fail");if(s.find(".passive-tex-msg").html(t),void 0!==i&&i[0]<=8){var r={type:"click",selector:".passive-banner-fail",preserve3d:!0,stepsA:[{display:"-webkit-flex",transition:"transform 400ms ease 0",x:"0px",y:"0px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"-50px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){a.run(r,s),_common.ADAPassiveAlert(t,n)},500)}else{r={type:"click",selector:".passive-banner-fail",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 400ms ease 0",x:"0px",y:"0px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"-50px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){a.run(r,s),_common.ADAPassiveAlert(t,n)},500)}},_common.PassiveAlertwarning=function(t,n){if("Builder"==getQueryStringData("Type"))wbc._postMessage('{"eventType": "passiveAlert","type": "warning", "message":"'+t+'"}');else{var o=Webflow.require("ix"),a=e(".passive-banner-warning");if(a.find(".passive-tex-msg").html(t),void 0!==i&&i[0]<=8){var s={type:"click",selector:".passive-banner-fail",preserve3d:!0,stepsA:[{display:"-webkit-flex",transition:"transform 400ms ease 0",x:"0px",y:"0px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"-50px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){o.run(s,a),_common.ADAPassiveAlert(t,n)},500)}else{s={type:"click",selector:".passive-banner-warning",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 400ms ease 0",x:"0px",y:"0px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"-50px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){o.run(s,a),_common.ADAPassiveAlert(t,n)},500)}}},_common.PassiveAlertFailed=function(t,i){var n=Webflow.require("ix"),o=e(".passive-alert-parent");_common.PassiveAlertClass("passive-fail",cdnImagePath+"/PublicImages/Images/alert-fail-mark@2x.png"),o.find(".passive-msg").html(t);var a={type:"click",selector:".passive-alert-parent",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 400ms ease 0",x:"0px",y:"129px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){n.run(a,o),_common.ADAPassiveAlert(t,i)},500)},_common.PassiveAlertWarning=function(t,i){var n=Webflow.require("ix"),o=e(".passive-alert-parent");_common.PassiveAlertClass("passive-warn",cdnImagePath+"/PublicImages/Images/passive-warning.svg"),o.find(".passive-msg").html(t),o.removeClass("vagaro-passive-green"),o.find(".passive-alert").addClass("vagaro-passive-warning");var a={type:"click",selector:".passive-alert-parent",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 400ms ease 0",x:"0px",y:"129px",z:"0px"},{wait:"2s"},{transition:"transform 300ms ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]};setTimeout(function(){n.run(a,o),_common.ADAPassiveAlert(t,i)},500)},_common.vgBookNowDropDown=function(t){if(IsServiceTab||IsClassTab)if(IsServiceTab&&IsClassTab)e(".vgtabs > div").show(),_common.vgBookNowDropDownToggle(t);else if(IsServiceTab){if(e(".vgtabs > div").hide(),e(".vgtabs").closest(".vg-dropdown-parent").hide(),0==("detail"==BasePage.toLowerCase()&&void 0!==_shopdetail.activeTabName&&"details"==_shopdetail.activeTabName.toLowerCase()))try{"undefined"!=typeof isWidget&&null!=isWidget&&"false"===isWidget.toString().toLowerCase()?_common.LoadBookNowMenu(LoadMenuTypeEnum.services,!1,!0):_common.LoadBookNowMenu(LoadMenuTypeEnum.booknow,!1,!0)}catch(e){_common.LoadBookNowMenu(LoadMenuTypeEnum.booknow,!1,!0)}}else IsClassTab&&(e(".vgtabs > div").hide(),e(".vgtabs").closest(".vg-dropdown-parent").hide(),_common.LoadBookNowMenu(LoadMenuTypeEnum.classes,!1,!0));else e(".vgtabs > div").hide(),e(".vgtabs").closest(".vg-dropdown-parent").hide(),0==("detail"==BasePage.toLowerCase()&&void 0!==_shopdetail.activeTabName&&"staff"==_shopdetail.activeTabName.toLowerCase())&&_common.LoadBookNowMenu(LoadMenuTypeEnum.booknow,!1,!0)},_common.vgBookNowDropDownToggle=function(t){var i=e(t).parent().find(".vg-dropdown-parent");i.hasClass("active-drop-vg")?(i.slideUp(250),i.removeClass("active-drop-vg"),e(t).parent().removeClass("active-vg-dropdown")):(i.slideDown(250),i.addClass("active-drop-vg"),e(t).parent().addClass("active-vg-dropdown"))},_common.vgBookNowmenuClick=function(t){var i=e(t).parent().parent();i.hasClass("active-drop-vg")?(i.slideUp(250),i.removeClass("active-drop-vg"),e(t).closest(".active-vg-dropdown").removeClass("active-vg-dropdown"),e(t).children("a").attr("aria-expanded",!1)):(i.slideDown(250),i.addClass("active-drop-vg"),e(t).closest(".active-vg-dropdown").addClass("active-vg-dropdown"),e(t).children("a").attr("aria-expanded",!0))},_common.IsWidgetForServiceProvider=function(e){return!String.isNullOrUndefineOrBlank(_shopdetail.isWidget)&&"true"==_shopdetail.isWidget&&!String.isNullOrUndefineOrBlank(_shopdetail.WidgetSpId)&&_shopdetail.WidgetSpId>0&&(1==e||(_shopdetail.WidgetSpOnline=_shopdetail.WidgetSpOnline,_shopdetail.WidgetSpId))},_common.IsWidgetForServiceProviderOnline=function(e){return!String.isNullOrUndefineOrBlank(_shopdetail.isWidget)&&"true"==_shopdetail.isWidget&&!String.isNullOrUndefineOrBlank(_shopdetail.WidgetSpId)&&_shopdetail.WidgetSpId>0&&(1==e||_shopdetail.WidgetSpOnline)},_common.setPageSatructure=function(t,i){e("#divBusTitle").hide(),t?(e("#pageSection").hide().removeClass("pagesectionFlex"),e("#dvAdvanceFilter").hide(),e("#divGalleryFilter").hide(),e(".mobileAdvancefilter").hide()):(e("#pageSection").show().addClass("pagesectionFlex"),i?(e(".mobileAdvancefilter").show(),e("#pageSection").addClass("listings-parent-div-100"),e("#divListing").addClass("listings-60").removeClass("gallery-content"),e("#sectionheader").addClass("listing-header").removeClass("div-block-97"),e("#sectionheader h1").addClass("listing-h1").removeClass("business-heading with-paragraph web-display-large"),e("#sectionheader p").addClass("paragraph-2").removeClass("title-paragraph"),e("#divBusTitle").show().css("display","flex"),e("#ulFeatureBusiness").removeClass("gallery page w-clearfix"),e("#map_canvas").attr("style","display:block;"),e("#map_list_optiondiv").addClass("map-optionshow")):(e(".mobileAdvancefilter").hide().removeClass("w-hidden-main w-hidden-medium"),e("#pageSection").removeClass("listings-parent-div-100"),e("#divListing").removeClass("listings-60").addClass("gallery-content"),e("#sectionheader").removeClass("listing-header").addClass("div-block-97"),e("#sectionheader h1").removeClass("listing-h1 web-display-small").addClass("business-heading with-paragraph web-display-large"),e("#sectionheader p").removeClass("paragraph-2").addClass("title-paragraph"),e("#divBusTitle").hide(),e("#ulFeatureBusiness").addClass("gallery page w-clearfix"),e("#map_canvas").hide().removeClass("showMap"),e("#map_list_optiondiv").removeClass("map-optionshow")),e("#sectionheader").attr("style","display:block;")),e("body").removeClass("no-loc-fixed"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(e("#mobilefilterChange").hide().removeClass("mapfilter").removeClass("listing-mapfiler"),"listings"!=tabSegment.toLowerCase()&&"deals"!=tabSegment.toLowerCase()||e("body").addClass("no-loc-fixed"))},_common.LoadAddToThisSmartLayer=function(){var t="true"==_shopdetail.isCustomWebsite?"left":"right";e.getScript("//s7.addthis.com/js/300/addthis_widget.js#pubid=fredhelou",function(i,n,o){"success"==n&&200==o.status&&addthis.layers({theme:"transparent",share:{position:t,numPreferredServices:5},follow:{services:"false"==_shopdetail.isCustomWebsite?[{service:"facebook",id:"vagaro"},{service:"twitter",id:"vagaro"},{service:"pinterest",id:"VagaroPins"}]:[]}},function(t){if("false"==_shopdetail.isCustomWebsite){var i=e(".shopdetail-wrapper").offset();e(".atss").offset({top:348,left:i.left-48}),e(".atss").css("z-index","5"),e("div").finish()}})})},HideMailPopup=function(t){e("#"+t).modal("hide"),e("html, body").removeClass("hide-bgscrollappoint"),iosDevices&&e("html, body").scrollTop(scrollPos)},_common.calculateDistance=function(e,t,i,n){var o=_common.deg2rad(i-e),a=_common.deg2rad(n-t),s=Math.sin(o/2)*Math.sin(o/2)+Math.cos(_common.deg2rad(e))*Math.cos(_common.deg2rad(i))*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))},_common.UpdateCustomListingCityinLocalStorage=function(){if("undefined"!=typeof promotionCodeId&&!String.isNullOrUndefineOrBlank(promotionCodeId)){var e=new vagaro.ajax;e.datamodel.Token="GetCustomListingCity",e.datamodel.data=[promotionCodeId],e.datamodel.callback=function(e){String.isNullOrUndefineOrBlank(e)||(localStorage.removeItem("custfvrcity"),localStorage.setItem("custfvrcity",JSON.stringify(e)))},e.Post()}},_common.getLocationsByCityState=function(t){"undefined"!=typeof regionId&&""!=regionId&&(regionName="/"+regionId);var i={};i.searchText=t.choice.cityState.replace("‘","'").replace("’","'").replace("“",'"').replace("”",'"'),i.countryId="undefined"!=typeof countryId&&""!=countryId&&null!=countryId?countryId:1,i.businesspromoid=lBusinessPromoCodeID,i.latitude=""!=t.choice.latitude?parseFloat(t.choice.latitude):0,i.longitude=""!=t.choice.longitude?parseFloat(t.choice.longitude):0,i.currentlocation="",i.pagenumber=1,i.countryName=e("#divCountryName").text(),CallWSJSON("CommonWebService.asmx/GetLocationPlaceIdForCustomDesign",JSON.stringify(i),_common.GetBusinessLocationSearchCallback,function(e,t){})},_common.GetBusinessLocationSearchCallback=function(t,i){var n=e.grep(t.d,function(e){return e.cityState===eSelectedValue.choice.cityState});n&&!String.isNullOrUndefineOrBlank(eSelectedValue)&&(eSelectedValue.choice.id=n[0].place_id,eSelectedValue.choice.text=eSelectedValue.choice.cityState,e(eSelectedValue.target).data("selectedid",n[0].place_id).data("isselected",!0),String.isNullOrUndefineOrBlank(Custom$searchbox)||(_common.SetChoiceForSeleect2(Custom$searchbox,eSelectedValue.choice),e(eSelectedValue.target).data("response",JSON.stringify(eSelectedValue.choice))),Custom$searchbox=null)},_common.deg2rad=function(e){return e*(Math.PI/180)},ProximitySearch=function(t,i,n){this.$searchelement=t,this.$countrycomboelement=i,this.$countrylistelement=n,this.$select2object={},this.$searchelement.on("select2-focus",function(t){setTimeout(function(){e(t.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common"),e("html, body").addClass("moboverflow-hide"),e("#select2-drop-mask").addClass("hidemask"),e("html, body").scrollTop(0)},200)}),this.$searchelement.on("select2-open",function(t){if(e(t.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common"),e(t.target).data("isselected",!1),e("html, body").addClass("moboverflow-hide"),e("#select2-drop-mask").addClass("hidemask"),e("html, body").scrollTop(0),(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&("txtBusinessLocationSearch"==e(t.target).attr("id")||"txtSearchServiceMain"==e(t.target).attr("id")||"txtMobileCityState"==e(t.target).attr("id")||"txtMobileService"==e(t.target).attr("id")))if(e(this).val().length>0){var i=e("#dvBusinessLocationSearch .select2-input"),n=e("#dvSearchServiceMain.select2-input"),o=e("#mobilefilterChange .select2-input"),a=e("#mobileServiceChange .select2-input");!i.length||0!==i.next("#dvBusinessLocationSearch .vg-search-cancel-icon").length&&0!==i.next("#dvSearchServiceMain .vg-search-cancel-icon").length&&0!==i.next("#dvSearchServiceMain .vg-search-cancel-icon").length&&0!==i.next("#mobilefilterChange .vg-search-cancel-icon").length&&0!==i.next("#mobileServiceChange .vg-search-cancel-icon").length||(i.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),e("#dvBusinessLocationSearch .vg-search-cancel-icon").show()),n.length&&0===n.next("#dvSearchServiceMain .vg-search-cancel-icon").length&&(n.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),e("#dvSearchServiceMain .vg-search-cancel-icon").show()),o.length&&0===o.next("#mobilefilterChange .vg-search-cancel-icon").length?(o.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),e("#mobilefilterChange .vg-search-cancel-icon").show()):o.length&&o.next("#mobilefilterChange .vg-search-cancel-icon").length>0&&e("#mobilefilterChange .vg-search-cancel-icon").show(),a.length&&0===a.next("#mobileServiceChange .vg-search-cancel-icon").length&&(a.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),e("#mobileServiceChange .vg-search-cancel-icon").show())}else e("#dvBusinessLocationSearch .vg-search-cancel-icon").hide(),e("#dvSearchServiceMain .vg-search-cancel-icon").hide(),e("#mobilefilterChange .vg-search-cancel-icon").hide(),e("#mobileServiceChange .vg-search-cancel-icon").hide()}),this.$searchelement.on("selected",function(i){"txtLiveStreamLocationSearch"!=e(i.target).attr("id")||iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone||ShowLoader(!0),0==("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&1==parseInt(e("#btnBackHomeSearch:visible").data("iscustomerappsearch")))&&_common.closeServiceSelection(),i.choice.text=i.choice.cityState;var n=!1,o=1==e(i.target).data().instantsearch;if(isLocationByDefault=!1,isSetIsCurrentLocationCookie=!1,"undefined"!=typeof poldservice&&(poldservice=""),2==i.choice.type){if(e(i.target).data("selectedid",""),void 0!==i.choice.vagarourl!=null&&""!=i.choice.vagarourl){n=!0;var a=window.location.href.split("/"),s=a[0]+"//"+a[2]+i.choice.vagarourl;$url=e("<a/>"),$url.attr("href",s),$url[0].click()}}else{if("location"==i.choice.type){if((1==o||iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone||"undefined"!=typeof vgAppicationType&&1==vgAppicationType)&&(isSetIsCurrentLocationCookie=!0),"undefined"!=typeof vgAppicationType&&1==vgAppicationType)return void CallbackforMobileApp(0,1,"","",0,27);e(i.target).data("selectedid",i.choice.id).data("isselected",!0);var r=e(i.target).data().purpose;return findCurrentLocation(t,r,l=i,i.choice,"onlocationchange"),void i.stopPropagation()}"locationByCityState"==i.choice.type?(eSelectedValue=i,Custom$searchbox=t,_common.getLocationsByCityState(i)):e(i.target).data("selectedid",i.choice.id).data("isselected",!0)}(_common.SetChoiceForSeleect2(t,i.choice),e(i.target).data("response",JSON.stringify(i.choice)),1==parseInt(e("#btnBackHomeSearch:visible").data("iscustomerappsearch"))&&(e("#btnBackHomeSearch:visible").click(),o=!0),e(i.target).attr("id").toLowerCase()!=DocIdBusinessLocationSearch&&e(IdBusinessLocationSearch).length>0)&&(0==(c=/^\d+$/.test(i.choice.id))&&e(IdBusinessLocationSearch).data("selectedid",i.choice.id),e(IdBusinessLocationSearch).data("response",JSON.stringify(i.choice)));if(o&&0==n){r=e(i.target).data().purpose;var l=i,c=/^\d+$/.test(i.choice.id),d=!0;if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(d="home"==tabSegment.toLowerCase()||"/"==tabSegment||""==tabSegment||"listings"==tabSegment,e(IdSearchServiceMain).select2("close")),1==c)onSearchClick(r,l,i.choice,!1,d);else{var u=new vagaro.ajax;u.datamodel.Token=ApiURLEnumOnlineCommon.getlocationsearchbyplaceid,u.datamodel.IsNewVagaroAPI=!0,u.datamodel.data={placeID:i.choice.id},u.datamodel.callback=function(e){null!=e&&(onSearchClick(r,l,e,!1,d),void 0!==isSetIsCurrentLocationCookie&&setCookie(ProximityIsCurrentLocation,isSetIsCurrentLocationCookie))},u.datamodel.Error=function(e){},u.Post()}}"txtLiveStreamLocationSearch"==e(i.target).attr("id")&&_common.SetLocationBySearch(i,!0),i.stopPropagation()}),this.$searchelement.on("select2-blur",function(t){t.preventDefault(),1==e(t.currentTarget).data().instantsearch&&""==e(t.currentTarget).val()&&ProxymityValueChaning(),isAndroidMobile&&e(t.currentTarget).select2("close")}),this.$searchelement.on("select2-close",function(i){if(0==("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&1==parseInt(e("#btnBackHomeSearch:visible").data("iscustomerappsearch")))||"current location"!=t.parent().find(".select2-input").val().toLowerCase()){_common.closeServiceSelection(),e("#select2-drop-mask").removeClass("hidemask"),setTimeout(function(){e("#select2-drop-mask").off("touchstart.custom")},500);var n=t.data("select2").getVal().toString(),o=_common.GetChoiceForSeleect2(t);if(null!=typeof o&&null!=o&&null!=o.city){var a=EmptyProximityValue();a.countryid=o.countryID,a.currencysymbol="2"==o.countryID?"£":"$",a.lat=o.latitude,a.long=o.longitude,a.zip=o.zipCode,a.city=o.city.toLowerCase(),a.state=o.stateCode.toLowerCase(),state=o.stateCode.toLowerCase(),lattitude=o.latitude,longitude=o.longitude,setCookie(ProximityCookieName,a),e("#txtLocationSearch").val(o.city+", "+o.stateCode+", "+o.countryName),_common.AddState("listings"),_home.loadHeroList()}""!=n&&void 0!==o.id?1==e(i.currentTarget).data().instantsearch?"txtlocationsearch"!=e(i.currentTarget).attr("id").toLowerCase()||void 0===e(i.currentTarget).data("isselected")||1!=e(i.currentTarget).data("isselected")||"undefined"!=typeof vgAppicationType&&0!=vgAppicationType||0!=_common.VisibleControlLength("#mobile-check")?t.select2("val",o.id):void 0!==o.text&&null!=typeof o.text&&(void 0!==o.countryName&&null!=typeof o.countryName?t.select2("data",{id:"",text:o.text+", "+o.countryName}):t.select2("data",{id:"",text:o.text})):(e("#dvBusinessLocationSearch").removeClass("inputError"),t.select2("data",{id:o.id,text:o.text})):1==e(i.currentTarget).data().instantsearch?ProxymityValueChaning():(t.select2("data",{id:"",text:""}),_common.SetDefaultForSeleect2(t)),(iPadAndroid||isWindowsPhone)&&e("#btnSearchBuss:visible, #ancFilter:visible, #btnDealsBook:visible, #mobileBack:visible").focus(),e(".select2-more-pager").remove()}else t.parent().find(".select2-input").click()}),null!=this.$countrylistelement&&this.$countrylistelement.find("a").click(function(){e("#divCountryName").html(e(this).html()),e("#hdngblCountryId").data("countryid",e(this).data("countryid")),e("#navCountryList").trigger("w-close.w-dropdown")})},ProximitySearch.prototype={CountrySelected:function(t,i,n,o){n.data("countryid",e(t).attr("data-countryid")),n.data("currencysymbol",e(t).attr("data-currencysymbol")),e("#divCountryName").html(e(t).html()),o.data("selectedid","");var a=getCookie(ProximityCookieName);null!=a&&(a.countryid==e(t).attr("data-countryid")||"#txtLiveStreamLocationSearch"!=o.selector&&"#txtLocationSearch"!=o.selector&&"#txtBusinessLocationSearch1"!=o.selector&&"#txtMobileCityState"!=o.selector&&_featured.clearAdvanceSearch("proxysearch"),i&&(o.val(""),o.closest("#divSelect2Parent").find(".select2-input").val(""),e(IdBusinessLocationSearch).closest("#dvBusinessLocationSearch").find(".select2-input").val(""),_common.SetChoiceForSeleect2(e(IdBusinessLocationSearch),{})))},init:function(t,i){var n=this.$countrycomboelement,o=0,a=20;this.$searchelement.val("");var s="";if("undefined"!=typeof regionId&&""!=regionId&&(s="/"+regionId),void 0===this.$searchelement.data("select2")&&(this.$select2object=this.$searchelement.select2({searchInputPlaceholder:1==i?"Business Name or Location":"City, Zip / Postal code",minimumInputLength:0,maximumInputLength:100,combobox:!0,formContainer:"#page-wrapper",dropdownCssClass:t,selectOnClick:NotmobileorIphone,formatInputTooShort:!1,ajax:{type:"POST",contentType:"application/json; charset=utf-8",url:s+"/WebServices/CommonWebService.asmx/GetBusinessLocationSearch",dataType:"json",quietMillis:300,minimumInputLengthForAjaxCall:3,transport:function(t){return t.beforeSend=function(t){try{"function"==typeof EncH&&t.setRequestHeader("H",EncH())}catch(e){}t.setRequestHeader("K",getek()),t.setRequestHeader("I",getei()),t.setRequestHeader("Val",EncIV()),"undefined"!=typeof keepAlive&&t.setRequestHeader("keepAlive",keepAlive),1==e("#hdnToken1").length&&void 0!==e("#hdnToken1").val()&&t.setRequestHeader("token1",e("#hdnToken1").val()),1==e("#hdnToken2").length&&void 0!==e("#hdnToken2").val()&&t.setRequestHeader("token2",e("#hdnToken2").val()),1==e("#hdnToken0").length&&void 0!==e("#hdnToken0").val()&&t.setRequestHeader("token0",e("#hdnToken0").val())},e.ajax(t)},data:function(t,o){return{searchText:t.replace("‘","'").replace("’","'").replace("“",'"').replace("”",'"'),countryId:parseInt(n.data("countryid")),businesspromoid:lBusinessPromoCodeID,latitude:""!=lattitude?parseFloat(lattitude):0,longitude:""!=longitude?parseFloat(longitude):0,includebusiness:i,currentlocation:CurrentLocation,pagenumber:o,countryName:e("#divCountryName").text()}},results:function(t,i){if(arrresults=[],null!=t&&t.length>0){if(arrBusiness=[],arrLocation=[],e.grep(t,function(e,t){if(1==e.type&&null!=e.cityState&&""!=e.cityState)(i={}).countryID=e.countryID,null!=e.place_id&&""!=e.place_id?(i.id=e.place_id,i.text=e.cityState+', <span class="countrygreycolor">'+e.countryName+"</span>",i.cityState=e.cityState):(i.id=t+1,i.text=e.cityState,i.latitude=e.latitude,i.longitude=e.longitude,i.state=e.state,i.zipCode=e.zipCode,i.currencySymbol=e.currencySymbol,1!=e.countryID?i.stateCode=e.stateCode.replace("AU-","").replace("GB-","").replace("CA-",""):i.stateCode=e.stateCode,i.city=e.city,i.cityState=_common.SetCityState(i.city,i.state,i.countryID)),i.countryName=e.countryName,i.type=e.type,i.cssClass="parent-text location-icon-select",arrLocation.push(i);else if(2==e.type){var i;(i={}).id=e.vagaroURL+"|"+e.businessID,i.text=e.businessName,i.cssClass="parent-text",i.appendText=e.cityState,i.childCssClass="child-text ",i.type=e.type,i.vagarourl=e.vagaroURL,arrBusiness.push(i)}}),t.length>0&&1==t[0].includebusiness){var n={};"1"==i?(arrLocation.length>0&&((n={}).id="Locations",n.text="Locations",n.cssClass="selectlocation-icon ",n.disabled=!0,n.children=arrLocation,arrresults.push(n)),arrBusiness.length>0&&((n={}).id="Businesses",n.text="Businesses",n.cssClass="selectbusiness-icon ",n.disabled=!0,n.children=arrBusiness,arrresults.push(n))):arrresults=arrBusiness}else arrresults=arrLocation;var s=20;if("1"==i){s=25;var r={id:"location",text:"Current Location",cssClass:"currentlocation-icon web-subheading-font-blue",type:"location"};arrresults.splice(0,0,r)}o=t.length>0?t[0].totalCount:0;var l=Math.ceil(o/s);a=s*i,i==l&&(a=o);var c=!1;return a<o&&(c=!0),{results:arrresults,more:c}}r={id:"location",text:"Current Location",cssClass:"currentlocation-icon web-subheading-font-blue",type:"location"};if(arrresults.splice(0,0,r),"undefined"!=typeof promotionCodeId&&!String.isNullOrUndefineOrBlank(promotionCodeId)){var d=localStorage.getItem("custfvrcity");if(!String.isNullOrUndefineOrBlank(d)){d=JSON.parse(d),e.each(d,function(e,t){t.type="locationByCityState",t.text=t.City+", "+t.StateCode,t.cityState=t.City+", "+t.StateCode,t.latitude=t.Latitude,t.longitude=t.Longitude,t.id=""});var u=getCookie(ProximityCookieName);null!=u?(e.each(d,function(e,t){t.Distance=_common.calculateDistance(t.Latitude,t.Longitude,u.lat,u.long)}),d.sort(function(e,t){return e.Distance-t.Distance})):d.sort(function(e,t){return e.text<t.text?-1:e.text>t.text?1:0});for(var p=0;p<d.length;p++)arrresults.push(d[p])}}return{results:arrresults,more:!1}},params:{error:function(e){try{if(403===e.status)return void location.reload(!0)}catch(e){}}},cache:!1},initSelection:function(e,t){var i=getCookie(ProximityCookieName);if(null!=i&&""!=i.state){var n={},o=null==i.state?"":2==i.countryid?i.stateName:i.state.toUpperCase();if(void 0!==i.city&&null!=i.city&&""!=i.city)n={id:"",text:i.city+", "+o+", "+(null!=i.countryid&&""!=i.countryid?CountryNames[parseInt(i.countryid)]:"United States")};else n={id:"",text:(String.isNullOrUndefineOrBlank(i.stateName)?o:i.stateName)+", "+(null!=i.countryid&&""!=i.countryid?CountryNames[parseInt(i.countryid)]:"United States")};t(n)}},formatResult:function(e){var t="",i=e.text;(t=1==e.hasOwnProperty("cssClass")?'<div class="'+e.cssClass+'">'+i+"</div>":"<div>"+i+"</div>",1==e.hasOwnProperty("appendText")&&""!=e.appendText)&&(t=t+"<span"+(e.hasOwnProperty("childCssClass")?' class="'+e.childCssClass+'"':"")+">"+e.appendText+"</span>");return t},formatSelection:function(e){return e.text},sortResults:function(e,t,i){return e},formatPager:function(e){return e>1&&(a+=5)>o?"Items 1 - "+(a-=5)+" out of "+o:"Items 1 - "+a+" out of "+o}})),null!=this.$countrylistelement&&(this.CountrySelected(this.$countrylistelement.find("a[data-countryid='"+countryid+"']").get(0),!1,this.$countrycomboelement,this.$searchelement),null!=state&&""!=state)){var r="";r=void 0!==city&&null!=city&&""!=city?lattitude+"#"+longitude+"#"+zip+"#"+city.toLowerCase()+"#"+state.toLowerCase():lattitude+"#"+longitude+"#"+zip+"#"+state.toLowerCase(),this.$searchelement.select2("val",r);var l={id:r};if(_common.SetChoiceForSeleect2(this.$searchelement,l),this.$searchelement.data("selectedid",r),e(IdBusinessLocationSearch).length>0){var c={id:"",text:_common.SetCityState(city,state,countryid)};e(IdBusinessLocationSearch).select2("data",c),_common.SetChoiceForSeleect2(e(IdBusinessLocationSearch),c)}if(e("#h2LocationName").length>0&&(null!=countryid&&"undefined"!=countryid&&"2"==countryid?e("#h2LocationName").text("Sponsored in "+city).attr("aria-label",city):e("#h2LocationName").text("Sponsored in "+_common.SetCityState(city,state,countryid)).attr("aria-label",_common.SetCityState(city,state,countryid))),!StringisNullOrUndefineOrBlank(city)&&city&&state){var d=city.toString().trim().toLowerCase().replace(/\s+/g,"-"),u=state.toString().trim().toLowerCase().replace(/\s+/g,"-"),p="";if(!StringisNullOrUndefineOrBlank(countryid)&&("2"==countryid?p="gb":"3"==countryid?p="ca":"4"==countryid&&(p="au"),"2"==countryid)){var h=getCookie(ProximityCookieName)||{};if(!StringisNullOrUndefineOrBlank(h))if(StringisNullOrUndefineOrBlank(h.stateName)){var m=getStateName();StringisNullOrUndefineOrBlank(m)||(u=m.toString().trim().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().replace(/\s+/g,"-"))}else StringisNullOrUndefineOrBlank(h.stateName)||""===h.stateName.trim()||(u=h.stateName.toString().trim().toLowerCase().replace(/\s+/g,"-"))}var g=d+"--"+u;""!=p&&(g+="--"+p);[{selector:"#aSeeAllPopularBusiness",path:"/listings/"},{selector:"#aSeeAllDeals",path:"/deals/"}].forEach(function(t){var i=e(t.selector);i.length>0&&i.attr("href",t.path+g)})}}return applyJqueryScroll(".select2-results"),this}},AdminServiceList="",AdminServiceopenDB=function(e){var t=indexedDB.open(DB_NAME,1);t.onupgradeneeded=function(e){e.target.result.createObjectStore(STORE_NAME,{keyPath:"id"})},t.onsuccess=function(t){e(t.target.result)}},saveAdminServicesToDB=function(e){AdminServiceopenDB(function(t){t.transaction(STORE_NAME,"readwrite").objectStore(STORE_NAME).put({id:"adminServices",data:e,timestamp:Date.now()})})},getAdminServicesFromDB=function(e){AdminServiceopenDB(function(t){let i=t.transaction(STORE_NAME,"readonly").objectStore(STORE_NAME).get("adminServices");i.onsuccess=function(){let t=i.result;t&&Date.now()-t.timestamp<TTL_TIME?e(t.data):e(null)},i.onerror=function(){e(null)}})},InitAdminServices=function(){try{_home.IsIndexedDBSupported()?getAdminServicesFromDB(function(e){e?(AdminServiceList=e,LoadAdminServicesKeyphrase(),processAdminServices()):LoadAdminServices()}):LoadAdminServices()}catch(e){LoadAdminServices()}},processAdminServices=function(){var t={dropdownCssClass:"home-serch-service-height service-what-dropdown service-data-only",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Search Services and Classes"};new ctlrSearchService(e(IdSearchServiceMain),t),new ctlrSearchService(e("#txtSearchServiceMain1"),t);_common.UpdateCustomListingCityinLocalStorage(),"undefined"!=typeof _featured&&void 0!==_featured.GetAdminFAQServiceClass&&_featured.GetAdminFAQServiceClass()},LoadAdminServices=function(){var e=new vagaro.ajax;e.datamodel.Token="GetAdminServices",e.datamodel.callback=GetAdminServices_Success,e.datamodel.data=[],e.datamodel.async=!1,e.datamodel.Error=function(e){ShowLoader(!1)},e.Post()},GetAdminServices_Success=function(t){ShowLoader(!1),AdminServiceList=JSON.parse(t),"select service"==AdminServiceList.results[0].text.toLowerCase()&&AdminServiceList.results.shift(),"undefined"!=typeof AdminServiceList&&void 0!==AdminServiceList.results&&AdminServiceList.results.splice(0,0,{text:"All Services and Classes",EventType:"0",ServiceOrder:"0",IsDefault:"true",id:"0",children:[]});var i=e.grep(AdminServiceList.results,function(e,t){return 0==e.EventType}),n=e.grep(AdminServiceList.results,function(e,t){return 2==e.EventType}),o={serviceDisplayClass:"hide-home-servicesclass"};e.each(n,function(t){e.extend(n[t],o)});var a=e.grep(AdminServiceList.results,function(e,t){return 1==e.EventType});e.merge(i,a),e.merge(i,n),AdminServiceList.results=i;var s=e.grep(AdminServiceList.results,function(e,t){return 1==e.IsCustom});e.each(s,function(t){e.extend(s[t],o)});try{_home.IsIndexedDBSupported()&&saveAdminServicesToDB(AdminServiceList)}catch(e){}processAdminServices()},findObjectBytext=function(e,t){for(var i=0;i<e.length;i++){if(e[i].text===t)return e[i];if(e[i].url===t)return e[i];if(e[i].children&&e[i].children.length>0){var n=this.findObjectBytext(e[i].children,t);if(n)return n}}return null},_common.setBookAService=function(){if(!e("#"+(e("#mobile-check").is(":visible")?"txtMobileService":"ddlServices")).data("select2")){var t={dropdownCssClass:"home-serch-service-height bookaservice-select service-what-dropdown",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Search Services and Classes"};new ctlrSearchService(e("#ddlServices"),t),new ctlrSearchService(e("#txtMobileService"),t)}if(null!=service&&""!=service){void 0!==p&&null!=typeof p||(p="");var i=service;void 0!==htmlDecode&&(i=htmlDecode(service)),e("#ddlServices").select2("data",{id:service,text:i,EventType:p});var n={id:service,text:i,EventType:p};if(void 0!==e("#ddlServices").data("choice")){_common.SetChoiceForSeleect2(e("#ddlServices"),n),e("#ddlServices").parent().find(".select2-input").val(i),_common.SetChoiceForSeleect2(e("#txtMobileService"),n),e("#txtMobileService").parent().find(".select2-input").val(i);try{_common.SetChoiceForSeleect2(e("#txtSearchServiceMain1"),n),e("#txtSearchServiceMain1").parent().find(".select2-input").val(i),e("#txtSearchServiceMain1").val(i).trigger("change"),_common.SetChoiceForSeleect2(e("#txtSearchServiceMain"),n),e("#txtSearchServiceMain").parent().find(".select2-input").val(i),e("#txtSearchServiceMain").val(i).trigger("change");var o=e("#txtServiceDate").val();if(void 0!==o&&null!=o&&""!=o)if("Anytime"==o)e("#txtHomeServicesDate1").val(o).trigger("change");else if(/^[A-Z][a-z]{2}\s\d{1,2}\sat\s\d{1,2}:\d{2}\s(AM|PM)$/.test(o))e("#txtHomeServicesDate1").val(o).trigger("change");else{var a=new Date(o).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}).replace(","," at");e("#txtHomeServicesDate1").val(a).trigger("change")}}catch(e){}}}},_common.setLiveStreamSearchFilterVal=function(t,i){_common.SetChoiceForSeleect2(e("#ddlServices"),t),e("#ddlServices").parent().find(".select2-input").val(i),_common.SetChoiceForSeleect2(e("#txtMobileService"),t),e("#txtMobileService").parent().find(".select2-input").val(i),_common.SetChoiceForSeleect2(e(IdSearchServiceMain),t),e(IdSearchServiceMain).parent().find(".select2-input").val(i),String.isNullOrUndefineOrBlank(i)?(service="",tabSegment="listings"):"book"==tabSegment||"listings"==tabSegment?_common.SetVariablesForBookAService():"class"==tabSegment&&_common.SetVariablesForBookAClass()},_common.LoadListing=function(){service="",closeMobileSearch(),_common.ClearService(),setdefaultSortingOption("listSort","listings"),_common.loadSectionsFromMobile("listings",null)},_common.ClearService=function(){e("#ddlServices").select2("data",{id:service,text:service,EventType:p});var t={id:service,text:service,EventType:p};void 0!==e("#ddlServices").data("choice")&&(_common.SetChoiceForSeleect2(e("#ddlServices"),t),e("#ddlServices").parent().find(".select2-input").val(service),_common.SetChoiceForSeleect2(e("#txtMobileService"),t),e("#txtMobileService").parent().find(".select2-input").val(service)),e("#divServiceDate").hide(),e("#ddlBusMode").hide()},_common.setTitlePage=function(e){var t={1:"us",2:"gb",3:"ca",4:"au"},i="",o="";if(void 0!==city&&null!=city&&""!=city&&(i=city+","),void 0!==state&&null!=state&&""!=state&&(o=1!=countryid?state+",":state),"undefined"!=typeof PublicPagetitles&&null!=PublicPagetitles)switch(e){case"professionals":if(null!=(r=PublicPagetitles.filter(function(t){return t.Url=="/"+e}))){var a=r[0];document.title=a.City_StateTitle.replace("[Business-Type]",n(businesstypes.split(",")[0])).replace("[City],",n(i)).replace("[State],",o.toUpperCase()).replace("[Country]",1==countryid?"":n(t[countryid]))}break;case"photos":if(null!=(r=PublicPagetitles.filter(function(t){return t.Url=="/"+e}))){a=r[0];document.title=a.City_StateTitle.replace("[Portfolio-Type]",n(portfolioTypes)).replace("[City],",n(i)).replace("[State],",o.toUpperCase()).replace("[Country]",1==countryid?"":n(t[countryid]))}break;case"deals":if(null!=(r=PublicPagetitles.filter(function(t){return t.Url=="/"+e}))){a=r[0];null!=serviceName&&null!=serviceName&&""!=serviceName?document.title=a.City_StateTitle.replace("[Service-Category]",n(serviceName)).replace("[City],",n(i)).replace("[State],",o.toUpperCase()).replace("[Country]",1==countryid?"":n(t[countryid])):document.title=a.City_StateTitle.replace("[Service-Category]",n(businesstypes.split(",")[0])).replace("[City],",n(i)).replace("[State],",o.toUpperCase()).replace("[Country]",1==countryid?"":n(t[countryid]))}break;case"dailydealdetail":if(null!=(r=PublicPagetitles.filter(function(t){return t.Url=="/"+e}))){a=r[0];document.title=n(a.City_StateTitle.replace("[deal-title]",dealtitle).replace("[business-name] ",businessnamed))}break;case"listings":var s=void 0!==title&&null!=title&&""!=title?title:"";if(void 0===title||null==title||""==title||""==title)s=void 0!==businesstypes&&null!=businesstypes&&""!=businesstypes?businesstypes:"salon";title="";var r=PublicPagetitles.filter(function(t){return t.Url=="/"+e});if(null!=BusinessTypeTitles)BusinessTypeTitles.filter(function(e){return e.Type==s});break;case"book":r=PublicPagetitles.filter(function(t){return t.Url=="/"+e});break;default:null!=(r=PublicPagetitles.filter(function(e){return"/Home.aspx"==e.Url}))&&(document.title=n(r[0].City_StateTitle))}},_common.getPager=function(t){return _common.setTitlePage(t),e("#pageSection").removeClass("professional-mobile-filter listing-mobile-filter photoslisting"),"professionals"==t?(e("body").addClass("listing-like-page"),e("#mobile-check").is(":visible")&&e("#pageSection").addClass("professional-mobile-filter"),_common.setPageSatructure(!1,!1),_featured.ProfessionalsPager):"photos"==t?(e("#mobile-check").is(":visible")&&e("#pageSection").addClass("photoslisting"),_common.setPageSatructure(!1,!1),_featured.GalleryPager):"deals"==t?(e("body").addClass("listing-like-page"),_common.setPageSatructure(!1,!0),_featured.PromotionsPager):"book"==t?(e("#mobile-check").is(":visible")&&e("#pageSection").addClass("listing-mobile-filter"),_common.setPageSatructure(!1,!0),_featured.ServicesPager):"class"==t?(e("#mobile-check").is(":visible")&&e("#pageSection").addClass("listing-mobile-filter"),_common.setPageSatructure(!1,!0),_featured.ClassPager):"listings"==t?(e("#mobile-check").is(":visible")&&e("#pageSection").addClass("listing-mobile-filter"),_common.setPageSatructure(!1,!0),_featured.BusinessPager):(_common.setPageSatructure(!0,!1),e("body").removeClass("listing-like-page"),"")};var o=!1;if(null!=typeof getQueryStringData_Wb){String.isNullOrUndefineOrBlank(e("#hdnLoginQueryString").val())||(QueryStringValue=e("#hdnLoginQueryString").val()),String.isNullOrUndefineOrBlank(QueryStringValue)&&(QueryStringValue=""!=window.QueryStringValue?window.QueryStringValue:window.document.URL);var a=getQueryStringData_Wb("Type");"Builder"==a&&(o=!0)}0!=o||0!=IsCookieEnabled()&&1!=IsCookieEnabled()||showCoockiePopup(),_common.getShortNameForDesign=function(e,t,i){return String(e).length>t?e.substr(0,i)+"...":e},_common.ShowFeaturedPromotionPopup=function(i,n,o,a){e("#OldServicePriceHome,#NewServicePriceHome").empty(),ShowLoader(!0);e("#ulServicesCombo").validate().resetForm(),e("#ddlPromotionService").parent().removeClass("errorInput"),"detail"==BasePage.toLowerCase()&&null!=a&&e("#btnFeaturedPromotionPopupBook",".promocustompopup").text(a.innerHTML);var s="Detail"!=BasePage;e("#hdPromoBusinessID",".promocustompopup").val(o);var r=new vagaro.ajax;r.datamodel.Token="GetPromotionDetailByPromotionID",r.datamodel.callback=function(o){if(null!=o){if(null!=o.PromoDetails&&o.PromoDetails.length>0){var a=o.PromoDetails[0];e("#btnFeaturedPromotionPopupBook",".promocustompopup").attr("onclick","_common.RedirectToShopDetailPage('"+n+"' , '"+i+"',"+a.IsForNewCustomer+","+a.IsNewCustomer+")"),e("#PromotionTitleHome",".promocustompopup").text(_common.getShortNameForDesign(a.PromotionTitle,67,64)),e("#PromotionTitleHome",".promocustompopup").attr("title",a.PromotionTitle);var s=new Date(parseFloat(a.StartDate.replace(/\/Date\((\d+)\)\//gi,"$1"))).format("mmm dd,yyyy"),r=new Date(parseFloat(a.EndDate.replace(/\/Date\((\d+)\)\//gi,"$1"))).format("mmm dd,yyyy");if(e("#PromotionPeriodHome",".promocustompopup").text(s+" - "+r),e("#PromotionDesHome",".promocustompopup").text(a.PromotionDesc),null!==a.FinePrint&&""!==a.FinePrint?(e("#PromotionLimitHome",".promocustompopup").text(a.FinePrint),e("#PromotionLimitTitle",".promocustompopup").css("display","block")):(e("#PromotionLimitHome",".promocustompopup").text(""),e("#PromotionLimitTitle",".promocustompopup").css("display","none")),null!==a.Image&&""!==a.Image&&e("#PromotionImage",".promocustompopup").css("background-image","url("+a.Image+")"),null!==a.IsForNewCustomer&&!0===a.IsForNewCustomer?e("#imgNewCustomerOnly",".promocustompopup").css("display","block"):e("#imgNewCustomerOnly",".promocustompopup").css("display","none"),null!==a.ServiceOldPrice&&""!==a.ServiceOldPrice){var l="Detail"==BasePage?_shopdetail.currencySymbol:currencysymbol;e("#OldServicePriceHome",".promocustompopup").text(a.ServiceOldPrice).prepend(l),0==a.PromotionDiscount?e("#NewServicePriceHome",".promocustompopup").text(PrmotionfreeCode).removeClass("orange-text"):e("#NewServicePriceHome",".promocustompopup").text(a.PromotionDiscount).prepend(l).removeClass("orange-text")}null!==a.ServiceOldPrice&&""!==a.ServiceOldPrice||null===a.PromotionDiscount||""===a.PromotionDiscount||(e("#OldServicePriceHome",".promocustompopup").text(""),e("#NewServicePriceHome",".promocustompopup").text(a.PromotionDiscount+"% off").addClass("orange-text")),e("#hdnSalontime").val(a.SalonTime)}if("Detail"!=BasePage){if(null!=o.PromoBusinessDetail){e("#PromoBusinessDetails",".promocustompopup").css("display","block");var c=o.PromoBusinessDetail;if(e(".promoBusinessName a").text(c.BusinessName).attr("href",t.location.protocol+"//"+t.location.host+"/"+c.VagaroURL),e(".BusinessDescription").text(null!=c.Description?c.Description:""),e(".promoOverallRating").text(parseFloat(c.VenueRank).toFixed(1)),_common.clearRating(e(".promoOverallRatingStar")),e(".promoReviewText").text(c.ReviewCount+(c.ReviewCount>1?" reviews":" review")),_common.clearRating(e(".promoOverall")),_common.clearRating(e(".promoPunct")),_common.clearRating(e(".promoValue")),_common.clearRating(e(".promoService")),e(".promoOverallRatingStar").prop("value",Math.round(c.VenueRank)-1).rating(),e(".promoOverall").prop("value",Math.round(c.VenueRank)-1).rating(),e(".promoPunct").prop("value",Math.round(c.PunctualityRank)-1).rating(),e(".promoValue").prop("value",Math.round(c.ValueRank)-1).rating(),e(".promoService").prop("value",Math.round(c.ServiceRank)-1).rating(),address=(null!=c.Street?c.Street.replace("  "," ")+", ":"")+(null!=c.City?c.City.replace("'","\\'")+", ":"")+(null!=c.StateName?c.StateName.replace("'","\\'")+" ":"")+(null!=c.Zip?c.Zip:""),e(".BusinessAddress").text(address),address=address.replace("#"," No "),",46583,30840,98,20400,50339,50400,63412,".indexOf(","+c.BusinessID+",")>-1&&null!=c.LATITUDE&&0!=c.LATITUDE&&null!=c.LONGITUDE&&0!=c.LONGITUDE){var d=c.LATITUDE+","+c.LONGITUDE;e("#hdnBusinessAddress").val(d),e(".staticAddressImg").attr("src","https://maps.googleapis.com/maps/api/staticmap?center="+d+"&zoom=12&size=635x220&style=feature:poi|visibility:off&markers=icon:https://vagaro.azureedge.net/static-content/Images/flamingo-map-newicon-new@2x.png|"+d+"&key="+googleKeyFormap)}else e("#hdnBusinessAddress").val(address),e(".staticAddressImg").attr("src","https://maps.googleapis.com/maps/api/staticmap?center="+address+"&zoom=12&size=635x220&style=feature:poi|visibility:off&markers=icon:https://vagaro.azureedge.net/static-content/Images/flamingo-map-newicon-new@2x.png|"+address+"&key="+googleKeyFormap);""!=lattitude&&""!=longitude&&null!=lattitude&&null!=longitude?(e(".promo-mile-col").css("display","block"),e(".BusinessMiles").text(c.DistanceToCentroid+" "+c.distanceUnit+".")):(e(".promo-mile-col").css("display","none"),e(".BusinessMiles").text("0 "+c.distanceUnit+"."))}else e("#PromoBusinessDetails",".promocustompopup").css("display","none");if(null!=o.PromoReviewDetail){var u=o.PromoReviewDetail,p=e(".ulReviewBar",".promocustompopup");u.length>0&&(p.html(""),e(u).each(function(){e("<li><label>"+this.Review+' stars</label><div class="promo-review-per-col"><div style="width: '+this.ReviewPercent+'%"><span>'+this.ReviewAvg+"</span></div></div></li>").appendTo(p)}))}}e(".promo-scrollbox").scrollTop(e(".promo-scrollbox")[0].scrollHeight),e(".promo-scrollbox").enscroll({showOnHover:!1,verticalTrackClass:"promoslidertrack",verticalHandleClass:"promosliderhandle"});var h=new vagaro.ajax;h.datamodel.Token="GetPromotionDataWithServicesByPromotionID",h.datamodel.callback=_common.GetPromotionsByPromotionIDCallback,h.datamodel.data=[a.PromotionID,a.BusinessID],h.datamodel.Error=function(e){},h.Post()}},r.datamodel.data=[i,lattitude,longitude,UserID,s],r.datamodel.Error=function(e){},r.Post()},_common.clearRating=function(t){e(t).prev().html(""),e(t).val(-1)};var s=e("<optGroup />");function r(t,i){e("[id$='btnbookService']").focus()}_common.GetPromotionsByPromotionIDCallback=function(t){var i=e("#ddlPromotionService",".promocustompopup");i.html(""),e("<option />",{val:"",text:"Select Service"}).appendTo(i),t.length>0?(e("#ulServicesCombo",".promocustompopup").css("display","block"),i.children("option:not(:first)").remove(),e(t).each(function(n){(0==n||n>0&&void 0!==this.ParentServiceID&&this.ParentServiceID!=t[n-1].ParentServiceID)&&(s=e("<optGroup />")).attr("label",this.ParentServiceTitle).appendTo(i),e("<option />",{val:this.ServiceID,text:this.ServiceTitle}).appendTo(s)})):(e("#ulServicesCombo",".promocustompopup").css("display","none"),i.val("0"),i.children("option:not(:first)").remove());var n='"lBusinessID" :"'+e("#hdPromoBusinessID",".promocustompopup").val()+'"';CallWebServicehed("MySampleService.asmx/GetAvailableDates",n+=',"spID" :""',_common.GetCalendarAvailableDatesCallback,_common.CallFailed)},_common.CallFailed=function(){vagaro.alert("Some Error occured")},_common.RedirectToShopDetailPage=function(t,i,n,o,a,s){var r,c,d=0,u=0;if(_common.VisibleControlLength("#dvDelasFromMobile")>0?e("#dvDelasFromMobile").is(":visible")?(r=_common.GetChoiceForSeleect2(e("#dvDealMobileService")),c=getdatepickervalue("#txtServiceDateMobile",null,!0)):swal({title:"",text:e("#hdnDealBusinessName").val()+" does not accept online appointments.Please call "+e("#hdnDealBusinessPhoneNumber").val()+" to make an appointment by phone.",showCancelButton:!1}):e("#dvDealWebService").is(":visible")?(r=_common.GetChoiceForSeleect2(e("#dvDealWebService")),c=getdatepickervalue("#txtServiceDateWeb")):swal({title:"",text:e("#hdnDealBusinessName").val()+" does not accept online appointments.Please call "+e("#hdnDealBusinessPhoneNumber").val()+" to make an appointment by phone.",showCancelButton:!1}),void 0!==r.id&&""!=r.id){if(e(".select2-container.ddlPromotionService").removeClass("errorInput"),d=r.id,"undefined"==r||String.isNullOrUndefineOrBlank(r.ItemTypeID)||(u=r.ItemTypeID),void 0!==l&&1==l&&(i=""),""!=r.id){var p,h;p=c.format("mmm dd,yyyy"),h=c.format("hh:nn");var m=_common.SetMessageForConfirm(a,o,n);return""!==UserID&&UserID>0&&""!=m?bootbox.confirm({title:"Confirm",message:m,buttons:{cancel:{label:"Cancel"},confirm:{label:"Continue"}},callback:function(e){e&&_common.ConfirmRedirectToShopDetailPage(t,"",d,p,h,u,s)}}):_common.ConfirmRedirectToShopDetailPage(t,i,d,p,h,u,s),!1}}else e(".select2-container.ddlPromotionService").addClass("errorInput")},_common.RedirectToShopDetailPageFromGC=function(t,i,n,o,a){var s,r=0,c=0;if(_common.VisibleControlLength("#dvDelasFromMobile")>0?e("#dvDelasFromMobile").is(":visible")?s=_common.GetChoiceForSeleect2(e("#dvDealMobileGC")):swal({title:"",text:e("#hdnDealBusinessName").val()+" does not accept online appointments.Please call "+e("#hdnDealBusinessPhoneNumber").val()+" to make an appointment by phone.",showCancelButton:!1}):e("#dvGCPurchase").is(":visible")?s=_common.GetChoiceForSeleect2(e("#dvGCPurchase")):swal({title:"",text:e("#hdnDealBusinessName").val()+" does not accept online appointments.Please call "+e("#hdnDealBusinessPhoneNumber").val()+" to make an appointment by phone.",showCancelButton:!1}),void 0!==s.id&&""!=s.id){if(e(".select2-container.gc-service-select").removeClass("errorInput"),r=s.id,"undefined"==s||String.isNullOrUndefineOrBlank(s.ItemTypeID)||(c=s.ItemTypeID),void 0!==l&&1==l&&(i=""),""!=s.id){var d=_common.SetMessageForConfirm(a,o,n);return""!==UserID&&UserID>0&&""!=d?bootbox.confirm({title:"Confirm",message:d,buttons:{cancel:{label:"Cancel"},confirm:{label:"Continue"}},callback:function(e){e&&_common.ConfirmRedirectToShopDetailPage(t,"",r,"","",c)}}):_common.ConfirmRedirectToShopDetailPage(t,i,r,"","",c),!1}}else e(".select2-container.gc-service-select").addClass("errorInput")},_common.SetMessageForConfirm=function(e,t,i){var n="";return void 0!==e?"2"===e&&!1===t?n="This promotion is for new clients only. It won't be applicable for you.<br/>Are you sure want to continue?":"1"===e&&!0===t&&(n="This promotion is for existing clients only. It won't be applicable for you.<br/>Are you sure want to continue?"):!0===i&&!1===t&&(n="This promotion is for new clients only. It won't be applicable for you.<br/>Are you sure want to continue?"),n},_common.ConfirmRedirectToShopDetailPage=function(i,n,o,a,s,r,l){if("Home"==BasePage||"MyAccount"==BasePage||"DailyDeal"==BasePage||"Detail"==BasePage)if(setCookie("PromotionID",n),cookieManager.setCookie("Referral",BasePage,.0833,cookieManager.defaultPath,cookieManager.defaultDomain,!0,!1),5==r?setCookie("gcAmount",o):(setCookie("BookingDate",a),setCookie("ServiceID",o),setCookie("BookingTime",s),void 0!==l&&null!=l&&""!=l&&setCookie("PromotionPIds",l)),8==r||20==r)"MyAccount"==BasePage&&(null!=isWidget&&"true"==isWidget||null!=isFacebook&&"true"==isFacebook)?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/classes?IsFacebookPage="+(null!=isFacebook&&"true"==isFacebook?"true":"false")+"&IsBusinessWidgetPage="+(null!=isWidget&&"true"==isWidget?"true":"false")+"&TabsIncluded="+_shopdetail.TabsIncluded+"&IsFromMyAccount=1":void 0!==getQueryStringData&&String.isNullOrUndefineOrBlank(0==getQueryStringData("connectai"))&&"true"==getQueryStringData("connectai")?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/classes/connectai":void 0!==getQueryStringData&&String.isNullOrUndefineOrBlank(0==getQueryStringData("connect"))&&"true"==getQueryStringData("connect")?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/classes/connect":window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/classes";else if(5==r)"MyAccount"==BasePage&&(null!=isWidget&&"true"==isWidget||null!=isFacebook&&"true"==isFacebook)?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/gift-certificates?IsFacebookPage="+(null!=isFacebook&&"true"==isFacebook?"true":"false")+"&IsBusinessWidgetPage="+(null!=isWidget&&"true"==isWidget?"true":"false")+"&TabsIncluded="+_shopdetail.TabsIncluded+"&IsFromMyAccount=1":void 0!==getQueryStringData&&String.isNullOrUndefineOrBlank(0==getQueryStringData("connectai"))&&"true"==getQueryStringData("connectai")?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/gift-certificates/connectai":void 0!==getQueryStringData&&String.isNullOrUndefineOrBlank(0==getQueryStringData("connect"))&&"true"==getQueryStringData("connect")?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/gift-certificates/connect":window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/gift-certificates";else if("MyAccount"==BasePage&&(null!=isWidget&&"true"==isWidget||null!=isFacebook&&"true"==isFacebook))window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/book-now?IsFacebookPage="+(null!=isFacebook&&"true"==isFacebook?"true":"false")+"&IsBusinessWidgetPage="+(null!=isWidget&&"true"==isWidget?"true":"false")+"&TabsIncluded="+_shopdetail.TabsIncluded+"&IsFromMyAccount=1";else{try{var c={Action:"Book Now",Category:"Deal",PageName:"Deal"};null!=e("#lblSalonName")&&null!=e("#lblSalonName").text()&&(c.BusinessName=e("#lblSalonName").text()),null!=e("#hdnBusinessId")&&null!=e("#hdnBusinessId").val()&&(c.BusinessID=parseInt(""==e("#hdnBusinessId").val()?"0":e("#hdnBusinessId").val())),c.isDealDetails=!0,c.IsListPage=!0,c.IsMapPage=!1,c.isFiltered=!1,null!=e("#lblPromotionTitleHome")&&null!=e("#lblPromotionTitleHome").text()&&(c.DealName=e("#lblPromotionTitleHome").text()),_vgLogEvent.LogData(c)}catch(e){}void 0!==getQueryStringData&&String.isNullOrUndefineOrBlank(0==getQueryStringData("connectai"))&&"true"==getQueryStringData("connectai")?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/book-now/connectai":void 0!==getQueryStringData&&String.isNullOrUndefineOrBlank(0==getQueryStringData("connect"))&&"true"==getQueryStringData("connect")?window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/book-now/connect":window.location=t.location.protocol+"//"+t.location.host+"/"+i+"/book-now"}else{e("#dvDailyDealsDetail").hide(),e("#pageSection").show().addClass("pagesectionFlex");var d=a;_shopdetail.SetBookData(o,"","","",d,n)}bootbox.hideAll()},_common.hideSocialIcons=function(t){e(".share-popup").hide(),e(".gallery-solo-image").removeClass("active")},e("#dvAdvanceFilter").mouseup(function(t){var i=e("#professionalFilter"),n=e(".filters-div");n.is(t.target)||0!==n.has(t.target).length||i.is(t.target)||0!==i.has(t.target).length||(e(".filter-background").hide(),e("html, body").removeClass("overflowHidden"))}),e("#divGalleryFilter").mouseup(function(t){var i=e("#divFilterSection"),n=e(".filters-div");n.is(t.target)||0!==n.has(t.target).length||i.is(t.target)||0!==i.has(t.target).length||(e(".filter-background").hide(),e("html, body").removeClass("overflowHidden"))}),_common.ShowHideSocialIcons=function(t){var i=e(t).closest(".gallery-solo-image");_featured.fetchStylistName(i,t)},_common.PostonFacebook=function(t,i,n){var o=e(t).closest(".brick"),a="",s="",r="",l="",c="",d="",u="",p="";if("Stylist"==i)a=e("#spnProviderName_"+_common.businessID+"_"+_common.curtemp.data().spid,o).html(unescape(escape(i.Spname))),c=e(o).find("#spnAddress").data().businessname,s=e(o).find("#spnAddress").data().address,r=location.protocol+"//"+location.host+"/"+e("#arating",o).attr("href"),l=e("#imgServiceProvider",o).attr("src"),p="Service Provider has been posted.";else if("Photos"==i)(void 0===(o=e(t).parents(".cust-img-popup-slider"))||null==o||o.length<=0)&&(o=e(img).parents(".gallery-solo-image")),l=e("#imgServiceImage_"+_common.curtemp.data().styleid,o).attr("src"),c=e("#divSalonName_"+_common.curtemp.data().styleid.styleid,o).html(),d=o.data().servicetitle,u=o.data().styletitle,r=location.protocol+"//"+location.host+"/"+o.data().vagarourl.toLowerCase()+"/styles",p="Portfolio has been posted.";else if("Deals"==i){c=e("#lblPromotionTitleHome").text();var h=e("#hdnScTitletimestamp").val(),m=e("#hdnScVagarourl").val();u=e("#promotionDesHome",".deals-text-cont").text(),l=e("#imgPromotion").attr("src"),r=location.protocol+"//"+location.host+"/"+m+"/deals/"+h,p="Deals has been posted."}else"BusinessDetail"==i&&(l=n.imageUrl,c=n.BusinessName,r=location.protocol+"//"+location.host+"/"+n.vagaroUrl.toLowerCase(),p="Business has been posted.");if("undefined"!=typeof isWindowsApp&&isWindowsApp)try{window.external.notify("promotionsharefacebook|"+r+"|"+d)}catch(e){}else $FacebookLoader(function(){FBAPP.funcPostfeature(unescape(c),a,s,r,d,u,l,i,function(e){null!=e.id&&null!=e.id&&vagaro.alert(p)})})},_common.PostOnTwitter=function(e){var t="https://twitter.com/intent/tweet?url="+(e=unescape(e).replace(/<br *\/?>/gi,"\n"));if(t=encodeURI(t),"undefined"!=typeof isWindowsApp&&isWindowsApp)try{window.external.notify("promotionsharetwitter|"+t)}catch(e){}else{var i=screen.width/2-300,n=screen.height/2-160,o=window.open(t,"shareWindow","toolbar=no,location=no,status=no, menubar=no,scrollbars=yes,resizable=no,width=600,height=320,left="+i+",top="+n);o&&!o.closed&&void 0!==o&&void 0!==o.closed||vagaro.alert("Window cannot be opened as popup is blocked in your browser")}return!1},_common.DealDetailPage=function(){_siteBuilderSocialMedia.PostOnPint(PinUrl)},_common.setviewport=function(t){var i=window.orientation,n=0===i||180==i,o=n?e(window).outerHeight():e(window).outerWidth(),a=e(window).outerHeight(),s=Math.min(o,a);n&&(s=Math.max(o,a)),"page-content-wrapper"==ScrollTarget.attr("id")&&(e("#dvPageContent").hasClass("paddingtop50")?ScrollTarget.css("height",s-45-50):ScrollTarget.css("height",s-45));e("#page-content-wrapper").height();var r,l,c=parseInt(e("#divServiceMap").height())+parseInt(e("#divServicePromotions").height()),d=e("#footer").outerHeight(),u=parseInt(a)-(parseInt(0)+parseInt(d)),p=parseInt(c)+15;if(parseInt(p)>parseInt(u)?e("#divServicePromotions").hide():e("#servicePromotion div").length>0?e("#divServicePromotions").show():e("#divServicePromotions").hide(),navigator.userAgent.match(/iPad/i)&&e("html").addClass("ipad"),e("#map_canvas").css("height",u),e("#contact-min-height").length,e("#page-height-min").length>0&&e("#page-height-min").css("min-height",s-46),"detail"==t)if("true"==_shopdetail.isCustomWebsite)r=e("#imgCustomBanner").height();else{r=e("#imgStandardBanner").height();var h=e("#tabs").height();l=parseInt(a)-(parseInt(r)+parseInt(h)+parseInt(d)),1==_shopdetail.isWidget&&(l-=55),l>600?e("#my-tab-content").css("min-height",l):e("#my-tab-content").css("min-height","200px")}0==_common.hasLatLongCookie()&&centerModal(e("#locationpopup")),window.location.href.indexOf(_common.liveStreamClasses)>=0&&setTimeout(function(){setCategoryWidthheight()},1500)},_common.removeEmojis=function(t){try{var i=e(t);void 0===i||String.isNullOrUndefineOrBlank(i.val())||i.val(i.val().replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g,""))}catch(e){}},_common.numeric=function(e,t,i,n){parseInt(t,10)<n||isNaN(t)?e.value=t:parseInt(t,10)>n?e.value=n:e.value=t},_common.toggleGCEmailRequired=function(){var t=e("#txtfullname").val().trim(),i=e("#txtGCEmail");""===t?(i.prop("required",!1),i.removeClass("errorInput"),i.parent().removeClass("form-row-invalid"),e("#txtGCEmail-error").hide()):i.prop("required",!0)},_common.GetCalendarAvailableDatesCallback=function(t){e("#hdnSalonstime").val();var i=t.d[0]+" "+e("#hdnSalonstime").val(),n=moment(i,"MMM DD,YYYY hh:mm a")._d,o=new Date(n),a=o.format("nn"),s=parseInt(parseInt(a)%5);s>0&&(a=a-s+5,o.setMinutes(a)),applydatepicker({divid:"#divServiceDateWeb",textid:"#txtServiceDateWeb",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),defaultDateTime:o,arrValidDates:t.d,pickTime:!1,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,callBackOnChange:c,callBackOnHide:r}),applydatepicker({divid:"#divServiceDateMobile",textid:"#txtServiceDateMobile",flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),defaultDateTime:o,arrValidDates:t.d,pickTime:!1,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,callBackOnChange:c}),ShowLoader(!1)};var l=!1;function c(t){var i=e("#hdnPromotionStartDate").val(),n=e("#hdnPromotionEndDate").val();if(void 0!==i&&""!=i&&void 0!==n){var o=moment(t.formatdate("MMM DD, YYYY")),a=moment(moment(i).format("MMM DD, YYYY")),s=!1,r="";if(""!=n){var c=moment(moment(n).format("MMM DD, YYYY"));(a.diff(o,"min")>0||o.diff(c,"min")>0)&&(s=!0,r="The date selected is outside of "+a.format(DatePickerFormat(VagaroCountryDateFormat.MiniDate))+" - "+c.format(DatePickerFormat(VagaroCountryDateFormat.MiniDate))+". If you continue, the daily deal will not be applied.")}else a.diff(o,"min")>0&&(s=!0,r="The deal will be applicable from "+a.format("MMM")+" "+a.format("D")+". If you continue, the daily deal will not be applied.");l=!1,1==s&&bootbox.dialog({title:"Regular Price",className:"checkout-center-modal bootbox-confirm",message:r,buttons:{ok:{label:"Continue",className:"thm-greyButton book-daily-btn w-button thm-contentButton flamingo-button",callback:function(){l=!0,e(".booknow").click()}}}})}}function d(e){var t,i,n=(e=e.split("")).length;for(t=0;t<n;t++)-1!=(i="ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž".indexOf(e[t]))&&(e[t]="AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz"[i]);return e.join("")}function u(e){for(var t=["/"," "],i=e,n=0;n<e.length;n++)-1!=t.indexOf(e[n])&&(i=" "==e[n]?i.replace(e[n],"-"):i.replace(e[n],""));return i}_common.destroyDateTimePicker=function(e){null!=e&&e.length>0&&e.data("DateTimePicker").destroy()},_common.isTouchDevice=function(){return"ontouchstart"in document.documentElement},_common.AddState=function(t,i){var n="";null!=promotionalURL&&null!=promotionalURL&&promotionalURL.length>0&&(n="/"+promotionalURL);var o=!0,a="",s={1:"us",2:"--gb",3:"--ca",4:"--au"},r=getCookie(ProximityCookieName),l="",c="",p="",h="";null!=r&&void 0!==r&&LoadCitiesAndServices(r.countryid);var m="";if(void 0!==getCookie("connectroute")&&null!=getCookie("connectroute")&&getCookie("connectroute")?m="/connect":void 0!==getCookie("connectairoute")&&null!=getCookie("connectairoute")&&getCookie("connectairoute")?m="/connectai":"undefined"!=typeof PromotionAppointmentID&&null!=PromotionAppointmentID&&""!=PromotionAppointmentID&&"undefined"!=typeof isFromTextMarketing&&isFromTextMarketing&&window.location.pathname.indexOf("/promotiontm/")>0&&window.location.pathname.indexOf(PromotionAppointmentID)>0?m=window.location.pathname.substring(window.location.pathname.indexOf("/promotiontm/")):"undefined"!=typeof PromotionAppointmentID&&null!=PromotionAppointmentID&&""!=PromotionAppointmentID&&"undefined"!=typeof isFromTextMarketing&&!isFromTextMarketing&&window.location.pathname.indexOf("/promotion/")>0&&window.location.pathname.indexOf(PromotionAppointmentID)>0&&(m=window.location.pathname.substring(window.location.pathname.indexOf("/promotion/"))),null!=r&&void 0!==r&&(null!=r.city&&void 0!==r.city&&""!=r.city&&(l=r.city.toLowerCase().replace(" ","-").trim()+"--",c=r.city.toLowerCase().trim().replace(/\s+/g,"-")),null!=r.state&&void 0!==r.state&&""!=r.state&&(p=2==r.countryid?r.stateName.toLowerCase().replace(" ","-").trim():r.state.toLowerCase().trim()),null!=r.countryid&&void 0!==r.countryid&&""!=r.countryid&&(h=r.countryid)),l=d(u(l)),c=d(u(c)),window.history&&history.pushState)if("Home"==BasePage){var g={basepage:BasePage,sectionName:t};if("home"==t||"/"==t||""==t)history.pushState(g,t,"/");else if(t.indexOf("dealsindividual")>=0)t=t.split("dealsindividual")[0],history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t);else if("book"==t||"class"==t){var v=window.location.pathname;if(""!=service&&void 0!==service&&null!=service&&v.endsWith("/listings")||e("#hdnSelectedBusinessType").val())if(""!=urlService&&null!=urlService){var f=/\s\s+/g,C=/[^0-9a-zA-Z\" \"]+/gi;window.location.href=(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",urlService.toLowerCase().trim().replace(f," ").replace(C,"").replace(/ /g,"-"),"/",l,p,1==h?"":s[h])}else{f=/\s\s+/g,C=/[^0-9a-zA-Z\" \"]+/gi;window.location.href=(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",service.toLowerCase().trim().replace(f," ").replace(C,"").replace(/ /g,"-"),"/",l,p,1==h?"":s[h])}else if(void 0!==urlService&&""!=urlService&&null!=urlService){var S="",y=service;if(void 0!==y&&""!=y){var b=AdminServiceList.results;if(b&&b.length>0){var k=findObjectBytext(b,y);S=null!=k?k.url:service}}if(void 0===S||""==S||v.endsWith("/login")||v.endsWith("/pro-login"))if(v.endsWith("/login")||v.endsWith("/pro-login")){f=/\s\s+/g,C=/[^0-9a-zA-Z\" \"]+/gi;window.location.href=(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",service.toLowerCase().trim().replace(f," ").replace(C,"").replace(/ /g,"-"),"/",l,p,1==h?"":s[h])}else{f=/\s\s+/g,C=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",service.toLowerCase().trim().replace(f," ").replace(C,"").replace(/ /g,"-"),"/",l,p,1==h?"":s[h]))}else{t="book";var f=/\s\s+/g,C=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",S.toLowerCase().trim().replace(f," ").replace(C,"").replace(/ /g,"-"),"/",l,p,1==h?"":s[h]))}}else{t="book";f=/\s\s+/g,C=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",service.toLowerCase().trim().replace(f," ").replace(C,"").replace(/ /g,"-"),"/",l,p,1==h?"":s[h]))}}else if("photos"==t)e(".nDropDownMenusFilterMyLikes #aMyLikesOption_filter_1").hasClass("myLikeAll-active")?history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+myLikedStyleUrlValue):""!=styleCategoryName&&void 0!==styleCategoryName&&null!=styleCategoryName?history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",styleCategoryName.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",l,p,1==h?"":s[h])):history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",l,p,1==h?"":s[h]));else if(t==_common.liveStreamClasses){g={basepage:BasePage,sectionName:t,subTab:_gblLiveStreamSearchServiceName};void 0!==_gblLiveStreamSearchServiceName&&null!=_gblLiveStreamSearchServiceName&&""!=_gblLiveStreamSearchServiceName?history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+a.concat("/",_gblLiveStreamSearchServiceName.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"))):history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t)}else{v=window.location.pathname;void 0!==category&&""!=category&&null!=category?history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",category.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",c,"--",p,1==h?"":s[h])):v.endsWith("/listings")||e("#hdnSelectedBusinessType").val()||v.endsWith("/login")||v.endsWith("/pro-login")?window.location.href=(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",l,p,1==h?"":s[h]):history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+n+a.concat("/",l,p,1==h?"":s[h])),category=""}}else if("MyAccount"==BasePage){if(t.indexOf("dealsindividual")>=0)t=t.split("dealsindividual")[0],history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t);else if("home"!=t&&"photos"!=t&&"professionals"!=t&&"deals"!=t){g={basepage:BasePage,sectionName:t,subTab:i};var _="";(D=location.href.split("?")).length>=2&&(_="?"+D[1]),document.referrer.indexOf("/cl/")>=0||window.location.href.indexOf("/cl/")>=0||document.referrer.indexOf("partner=fb")>=0||window.location.href.indexOf("partner=fb")>=0?history.pushState(g,t,document.referrer.indexOf("/cl/")>=0||window.location.href.indexOf("/cl/")>=0?document.referrer.split("?")[0]:document.referrer):history.pushState(g,t,(window.location.href.match("/$")?"../":"/myaccount/")+t+_)}}else if("detail"==BasePage.toLowerCase()){if(null!=t&&null!=t&&""!=t&&GetSelectedMenuObject(t).length<0&&t.indexOf("dealsindividual")<0)return;var D;_="";(D=location.href.split("?")).length>=2&&(_="?"+D[1]);g={basepage:BasePage,sectionName:t,subTab:i};if(window.location.href.indexOf("BusinessWidget.aspx")>=0||window.location.href.indexOf("/cl/")>=0||document.referrer.indexOf("partner=fb")>=0||window.location.href.indexOf("partner=fb")>=0)history.pushState(g,t,window.location.href);else if(null!=t&&null!=t&&""!=t&&t.indexOf("dealsindividual")>=0)(t=t.split("dealsindividual")[0]).indexOf("isdeal")>=0&&_.indexOf("isdeal")>=0&&(t=t.split("?")[0]),history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t+m+_);else if(null!=t&&null!==t&&""!==t&&t.indexOf("shopping-bag")>=0&&window.location.href.indexOf("invoice")>=0)history.pushState(g,t,window.location.href);else if(window.location.href.indexOf("?qsp")>=0&&"addreview"!=t){var I=window.location.toString(),w=I.substring(0,I.indexOf("?"));window.history.replaceState({},document.title,w),history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+(IsVagaroDomain()?vagaroUrl.toLowerCase()+"/":"")+t+m)}else history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+(IsVagaroDomain()?"about"==g.subTab.trim()?vagaroUrl.toLowerCase():vagaroUrl.toLowerCase()+"/":"")+t+m+_)}else if("dailydeal"==BasePage.toLowerCase()){g={basepage:BasePage,sectionName:t,subTab:"dailydeal"};void 0!==t&&null!=t&&""!=t&&t.indexOf("dealsindividual")>=0&&(t=t.split("dealsindividual")[0],history.pushState(g,t,(window.location.href.match("/$")?"../":"/")+t))}else{if("businesstypecategory"!=BasePage.toLowerCase())return!1;g={basepage:BasePage,sectionName:t,subTab:"BusinessTypeCategory"};if(void 0!==t&&null!=t&&""!=t&&t.indexOf("listings")>=0){var P=window.location.href+a.concat("/",l,p,1==h?"":s[h]);return $url=e("<a/>"),$url.attr("href",P),$url[0].click(),!0}}else o=!1;if(""!=styleCategoryName&&void 0!==styleCategoryName&&null!=styleCategoryName?e("#photos").attr("href",(window.location.href.match("/$")?"../":"/")+"photos"+n+a.concat("/",styleCategoryName.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",l,p,1==h?"":s[h])):e("#photos").attr("href",(window.location.href.match("/$")?"../":"/")+"photos"+n+a.concat("/",l,p,1==h?"":s[h])),""!=businesstypes&&void 0!==businesstypes&&null!=businesstypes?(e("#listings").attr("href",(window.location.href.match("/$")?"../":"/")+"listings"+n+a.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",c,"--",p,1==h?"":s[h])),e("#aSeeAllPopularBusiness").attr("href","/listings"+n+a.concat("/",l,p,1==h?"":s[h])),e("#professionals").attr("href",(window.location.href.match("/$")?"../":"/")+"professionals"+n+a.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",c,"--",p,1==h?"":s[h])),e("#deals").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+a.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",c,"--",p,1==h?"":s[h])),e("#aSeeAllDeals").attr("href","/deals"+n+a.concat("/",l,p,1==h?"":s[h])),e("#dailyDealsFooter").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+a.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",c,"--",p,1==h?"":s[h])),null!=r&&void 0!==r&&(null!=r.countryid&&void 0!==r.countryid&&"2"==r.countryid?(l=(l=l.replace(/--+/g,"").replace(/-/g," ")).replace(/\b\w/g,function(e){return e.toUpperCase()}),e("#h2LocationName").text("Sponsored in "+l).attr("aria-label",l)):(l=(l=l.replace(/--+/g,"").replace(/-/g," ")).replace(/\b\w/g,function(e){return e.toUpperCase()}),e("#h2LocationName").text("Sponsored in "+_common.SetCityState(l,p,h)).attr("aria-label",_common.SetCityState(l,p,h))))):(e("#listings").attr("href",(window.location.href.match("/$")?"../":"/")+"listings"+n+a.concat("/",l,p,1==h?"":s[h])),e("#aSeeAllPopularBusiness").attr("href","/listings"+n+a.concat("/",l,p,1==h?"":s[h])),e("#professionals").attr("href",(window.location.href.match("/$")?"../":"/")+"professionals"+n+a.concat("/",l,p,1==h?"":s[h])),e("#deals").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+a.concat("/",l,p,1==h?"":s[h])),e("#aSeeAllDeals").attr("href","/deals"+n+a.concat("/",l,p,1==h?"":s[h])),e("#dailyDealsFooter").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+a.concat("/",l,p,1==h?"":s[h])),null!=r&&void 0!==r&&(null!=r.countryid&&void 0!==r.countryid&&"2"==r.countryid?(l=(l=l.replace(/--+/g,"").replace(/-/g," ")).replace(/\b\w/g,function(e){return e.toUpperCase()}),e("#h2LocationName").text("Sponsored in "+l).attr("aria-label",l)):(l=(l=l.replace(/--+/g,"").replace(/-/g," ")).replace(/\b\w/g,function(e){return e.toUpperCase()}),e("#h2LocationName").text("Sponsored in "+_common.SetCityState(l,p,h)).attr("aria-label",_common.SetCityState(l,p,h))))),"detail"!=BasePage.toLowerCase()&&"home"!=BasePage.toLowerCase()){e.each(["hair","spa","med-spa","barber","deals"],function(t,i){var n="";if("deals"===i)n="/deals"+a.concat("/",l,p,1==h?"":s[h]);else{var o=a;n=0===o.indexOf("/listings/"+i)?o:"/listings/"+i+a.concat("/",l,p,1==h?"":s[h])}e('[data-path="'+i+'"]').attr("href",n)})}return o},_common.Getbeautylink=function(t,i){var n="";null!=promotionalURL&&null!=promotionalURL&&promotionalURL.length>0&&(n="/"+promotionalURL);var o="",a={1:"us",2:"--gb",3:"--ca",4:"--au"},s=getCookie(ProximityCookieName),r="",l="",c="",p="";if(null!=s&&void 0!==s&&(null!=s.city&&void 0!==s.city&&""!=s.city&&(r=s.city.toLowerCase().replace(" ","-").trim()+"--",l=s.city.toLowerCase().trim().replace(/\s+/g,"-")),null!=s.state&&void 0!==s.state&&""!=s.state&&(c=2==s.countryid?s.stateName.toLowerCase().replace(" ","-").trim():s.state.toLowerCase().trim()),null!=s.countryid&&void 0!==s.countryid&&""!=s.countryid&&(p=s.countryid)),r=d(u(r)),l=d(u(l)),window.history&&history.pushState)if("Home"==BasePage){var h={basepage:BasePage,sectionName:t};if("home"==t||"/"==t||""==t)BeautyHrefLink="/";else if(t.indexOf("dealsindividual")>=0)t=t.split("dealsindividual")[0],BeautyHrefLink=(window.location.href.match("/$")?"../":"/")+t;else if("book"==t||"class"==t){if(""!=service&&void 0!==service&&null!=service){BeautyHrefLink=(window.location.href.match("/$")?"../":"/")+t+n+o.concat("/",service.toLowerCase().trim().replace(/\s\s+/g," ").replace(/[^0-9a-zA-Z\" \"]+/gi,"").replace(/ /g,"-"),"/",r,c,1==p?"":a[p])}}else if("photos"==t)BeautyHrefLink=""!=styleCategoryName&&void 0!==styleCategoryName&&null!=styleCategoryName?(window.location.href.match("/$")?"../":"/")+t+n+o.concat("/",styleCategoryName.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",r,c,1==p?"":a[p]):(window.location.href.match("/$")?"../":"/")+t+n+o.concat("/",r,c,1==p?"":a[p]);else if(t==_common.liveStreamClasses){h={basepage:BasePage,sectionName:t,subTab:_gblLiveStreamSearchServiceName};BeautyHrefLink=void 0!==_gblLiveStreamSearchServiceName&&null!=_gblLiveStreamSearchServiceName&&""!=_gblLiveStreamSearchServiceName?(window.location.href.match("/$")?"../":"/")+t+o.concat("/",_gblLiveStreamSearchServiceName.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-")):(window.location.href.match("/$")?"../":"/")+t}else BeautyHrefLink=""!=businesstypes&&void 0!==businesstypes&&null!=businesstypes?(window.location.href.match("/$")?"../":"/")+t+n+o.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",l,"--",c,1==p?"":a[p]):(window.location.href.match("/$")?"../":"/")+t+n+o.concat("/",r,c,1==p?"":a[p])}else if("MyAccount"==BasePage){if(t.indexOf("dealsindividual")>=0)t=t.split("dealsindividual")[0],BeautyHrefLink=(window.location.href.match("/$")?"../":"/")+t;else if("home"!=t&&"photos"!=t&&"professionals"!=t&&"deals"!=t){h={basepage:BasePage,sectionName:t,subTab:i};var m="";(g=location.href.split("?")).length>=2&&(m="?"+g[1]),BeautyHrefLink=(window.location.href.match("/$")?"../":"/myaccount/")+t+m}}else if("detail"==BasePage.toLowerCase()){if(null!=t&&null!=t&&""!=t&&GetSelectedMenuObject(t).length<0&&t.indexOf("dealsindividual")<0)return;var g;m="";(g=location.href.split("?")).length>=2&&(m="?"+g[1]);h={basepage:BasePage,sectionName:t,subTab:i};if(window.location.href.indexOf("BusinessWidget.aspx")>=0)BeautyHrefLink=window.location.href;else if(null!=t&&null!=t&&""!=t&&t.indexOf("dealsindividual")>=0)(t=t.split("dealsindividual")[0]).indexOf("isdeal")>=0&&m.indexOf("isdeal")>=0&&(t=t.split("?")[0]),BeautyHrefLink=(window.location.href.match("/$")?"../":"/")+t+m;else if(null!=t&&null!==t&&""!==t&&t.indexOf("shopping-bag")>=0&&window.location.href.indexOf("invoice")>=0)BeautyHrefLink=window.location.href;else if(window.location.href.indexOf("?qsp")>=0&&"addreview"!=t){var v=window.location.toString(),f=v.substring(0,v.indexOf("?"));window.history.replaceState({},document.title,f),BeautyHrefLink=(window.location.href.match("/$")?"../":"/")+(IsVagaroDomain()?vagaroUrl.toLowerCase()+"/":"")+t}else BeautyHrefLink=(window.location.href.match("/$")?"../":"/")+(IsVagaroDomain()?"about"==h.subTab.trim()?vagaroUrl.toLowerCase():vagaroUrl.toLowerCase()+"/":"")+t+m}else{if("dailydeal"!=BasePage.toLowerCase())return BeautyHrefLink;h={basepage:BasePage,sectionName:t,subTab:"dailydeal"};void 0!==t&&null!=t&&""!=t&&t.indexOf("dealsindividual")>=0&&(t=t.split("dealsindividual")[0],BeautyHrefLink=(window.location.href.match("/$")?"../":"/")+t)}return""!=styleCategoryName&&void 0!==styleCategoryName&&null!=styleCategoryName?e("#photos").attr("href",(window.location.href.match("/$")?"../":"/")+"photos"+n+o.concat("/",styleCategoryName.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",r,c,1==p?"":a[p])):e("#photos").attr("href",(window.location.href.match("/$")?"../":"/")+"photos"+n+o.concat("/",r,c,1==p?"":a[p])),""!=businesstypes&&void 0!==businesstypes&&null!=businesstypes?(e("#listings").attr("href",(window.location.href.match("/$")?"../":"/")+"listings"+n+o.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",l,"--",c,1==p?"":a[p])),e("#professionals").attr("href",(window.location.href.match("/$")?"../":"/")+"professionals"+n+o.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",l,"--",c,1==p?"":a[p])),e("#deals").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+o.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",l,"--",c,1==p?"":a[p])),e("#dailyDealsFooter").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+o.concat("/",businesstypes.toLowerCase().trim().split(/[,]+/).slice()[0].replace(/\s+/g,"-"),"/",l,"--",c,1==p?"":a[p]))):(e("#listings").attr("href",(window.location.href.match("/$")?"../":"/")+"listings"+n+o.concat("/",r,c,1==p?"":a[p])),e("#professionals").attr("href",(window.location.href.match("/$")?"../":"/")+"professionals"+n+o.concat("/",r,c,1==p?"":a[p])),e("#deals").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+o.concat("/",r,c,1==p?"":a[p])),e("#dailyDealsFooter").attr("href",(window.location.href.match("/$")?"../":"/")+"deals"+n+o.concat("/",r,c,1==p?"":a[p]))),BeautyHrefLink},_common.loadSections=function(t){var i=_common.AddState(t);return t==_common.liveStreamClasses&&(t="listings"),_common.CloseToggelmobileMenu(),"Home"!=BasePage?i=!1:(-1!=t.indexOf("/")&&(t=t.split("/")[0]),loadData(t,!0),_common.setGeoLocationMarker(t)),e("#s2id_ddlServices").find("ul").attr("role","none"),i},_common.ToggelmobileMenu=function(t){if(HideAdvanceSearchModel(),e("#mobilemenutoggle").hasClass("active")||"undefined"!=typeof vgAppicationType&&1==vgAppicationType)_common.CloseToggelmobileMenu();else{e("#mobile-menu").addClass("mobile_menu_open"),e("html, body").addClass("overflowHidden mobile_menu_show"),e("#mobilemenutoggle").addClass("active");var i=Webflow.require("ix"),n=e(".dropdown-arrow");i.run({type:"click",selector:".dropdown-arrow",preserve3d:!0,stepsA:[{transition:"transform 300ms ease 0",rotateX:"0deg",rotateY:"0deg",rotateZ:"180deg"}]},n)}},_common.loadHome=function(t){try{HideAdvanceSearchModel();var i=e(".vagaro-logo");if(1==i.length){if(i.hasClass("clickednow")&&null!=t)return void t.preventDefault();i.addClass("clickednow"),setTimeout(function(){i.removeClass("clickednow")},2e3)}}catch(t){}setdefaultSortingOption("",""),_common.loadSections("home")&&null!=t&&t.preventDefault(),_common.isCreateclearCookie()},_common.setGeoLocationMarker=function(e){"undefined"==typeof vgAppicationType||1!=vgAppicationType||void 0===e||null==e||"listings"!=e.toLowerCase()&&"deals"!=e.toLowerCase()&&"book"!=e.toLowerCase()&&"class"!=e.toLowerCase()||(flagSetGeoLocationForApp=!0,CallbackforMobileApp(0,0,"","",0,27))},_common.CloseToggelmobileMenu=function(){e("#mobile-menu").removeClass("mobile_menu_open"),e("html, body").removeClass("overflowHidden mobile_menu_show"),e("#mobilemenutoggle").removeClass("active");var t=Webflow.require("ix"),i=e(".dropdown-arrow");t.run({type:"click",selector:".dropdown-arrow",preserve3d:!0,stepsA:[{transition:"transform 300ms ease 0",rotateX:"0deg",rotateY:"0deg",rotateZ:"0deg"}]},i)},_common.setTouchEvents=function(){var t=iPadAndroid?"touchstart":"click";window.location.pathname;e(".LiveStreamBookmarkClass").bind(t,function(e){ManagaBusinessBookmark(this)}),e("#aSeeAllLiveStream").bind(t,function(t){try{var i={Action:"See All",Category:"Live Stream",PageName:"Home"};_vgLogEvent.LogData(i)}catch(t){}ResetBusinessSearchMode(),resetAllCheckBox(),e("body").addClass("livestreampage"),setTimeout(function(){_common.SelectLiveStreamClasses(),CheckLiveStreamCategoryNextPrevious()},50);var n=_common.loadSections(_common.liveStreamClasses);if("Live Stream"===i.Category){if(0!=e(".listigBusiness-wrapper").find(".liststream-filter-top").length)return!1;e(".listigBusiness-wrapper").append('<div id="listStreamFilterId" class="liststream-filter-top" style="" role="none" ><div class="livestreamfilter" role="none"><div class="pos-relative marginleft20" role="none"><div id="dvDurationText" class="white-roundbox duration-text font-awesome-5pro-light filter-button filter-button-icon" aria-label="Duration combobox" aria-controls="ul_durationdropdown" aria-live="polite"><span class="font-awesome-5pro-light bookmark-text14" aria-hidden="true">&#xf017;</span></div><div class="dropdown-class-stream positionLeft vagaro-dropdown-multiselect" id="durationdropdown" role="none"><ul id="ul_durationdropdown" role="listbox"><li aria-label="Less than 30 minutes"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="1" id="Lessthan30min"><label for="Lessthan30min" role="checkbox" aria-live="polite" aria-checked="false">Less than 30 minutes</label></div></li><li aria-label="30 min"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="2" id="30min"><label for="30min" role="checkbox" aria-live="polite" aria-checked="false">30 min</label></div></li><li aria-label="1 hour"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="3" id="1hour"><label for="1hour" role="checkbox" aria-live="polite" aria-checked="false">1 hour</label></div></li><li aria-label="1+ hours"><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" onchange="CallSearchWithFilter()" name="liveStreamDuration" value="4" id="1+hours"><label for="1+hours" role="checkbox" aria-live="polite" aria-checked="false">1+ hours</label></div></li></ul></div></div><div class="marginleft20"><div class="white-roundbox LiveStreamBookmarkClass filter-button filter-button-icon" id="LiveStreamBookmark" aria-label="Live Stream Bookmark Class" aria-live="polite" role="link"><span class="font-awesome-5pro-light bookmark-text14" aria-hidden="true">&#xf02e;</span></div></div></div><div class="prof-right-padding streamfilterclass" style = "padding-right: 0px;"><div class="filteradded" id="divStreamListingFilters"><div id="divStreamFirstSlide" class="w-inline-block" aria-hidden="true">&nbsp;</div><a href="javascript:void(0);" onclick="SearviceFilter(this,1)" id="LiveStreamyoga" data-livestreamid="1" data-livestream="yoga" class="LiveStreamYoga fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Yoga</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,2)" id="LiveStreampilates" data-livestreamid="2" data-livestream="pilates" class="LiveStreamPilates fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro pilates" aria-hidden="true"></span>Pilates</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,3)" id="LiveStreamcardio" data-livestreamid="3" data-livestream="cardio" class="LiveStreamCrossfit fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Cardio</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,4)" id="LiveStreamcycling" data-livestreamid="4" data-livestream="cycling" class="LiveStreamCycle fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Cycling</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,5)" id="LiveStreamstrength" data-livestreamid="5" data-livestream="strength" class="LiveStreamStrength fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Strength</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,6)" id="LiveStreambootcamp" data-livestreamid="6" data-livestream="bootcamp" class="LiveStreamCrossfit fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Boot Camp</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,7)" id="LiveStreammartialarts" data-livestreamid="7" data-livestream="martialarts" class="LiveStreamStrength fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Martial Arts</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,8)" id="LiveStreamboxing" data-livestreamid="8" data-livestream="boxing" class="LiveStreamBoxing fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Boxing</div></a><a href="javascript:void(0);" onclick="SearviceFilter(this,9)" id="LiveStreamdance" data-livestreamid="9" data-livestream="dance" class="LiveStreamBoxing fliter-class-name w-inline-block filter-button"><div class="filter-pill-text"><span class="filter-icon font-awesome-light-pro" aria-hidden="true"></span>Dance</div></a><div id="divStreamLastSlide" class="w-inline-block" style="">&nbsp;</div></div><div class="font-awesome left-slide-arrow" id="divStreamPrevFilter" onclick=\'_common.nextPreviousFilters("divStreamListingFilters",0,"divStreamNextFilter","divStreamPrevFilter")\'><span>&#xf104;</span></div><div class="font-awesome right-slide-arrow" id="divStreamNextFilter" onclick=\'_common.nextPreviousFilters("divStreamListingFilters",1,"divStreamNextFilter","divStreamPrevFilter")\'><span>&#xf105;</span></div></div><div class="dropdown-stream"><div class="pos-relative"><div class="dropdown-stream-div stream-more filter-button" aria-label="more combobox" aria-controls="LiveStreamClassList"><span class="font-awesome-light-pro margin-right4"></span><span aria-hidden="true">More</span><span class="font-awesome-solid-pro margin-left4" aria-hidden="true"></span></div><div class="dropdown-class-stream default-scrollbar vagaro-dropdown-share-content" id="streamclassdropdown" role="none"><ul class="share-content-ul" id="LiveStreamClassList" role="listbox"><li class="LiveStreamClassListCss p-0"><a href="javascript:void(0);" onclick="SearviceFilter(this,1)" id="liLiveStreamyoga" data-livestreamid="1" data-livestream="yoga" class="LiveStreamYoga w-inline-block" role="option" aria-label="Yoga"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Yoga</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,2)" id="liLiveStreampilates" data-livestreamid="2" data-livestream="pilates" class="LiveStreamPilates w-inline-block" role="option" aria-label="Pilates"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro pilates"></span>Pilates</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,3)" id="liLiveStreamcardio" data-livestreamid="3" data-livestream="cardio" class="LiveStreamCrossfit w-inline-block" role="option" aria-label="Cardio"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Cardio</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,4)" id="liLiveStreamcycling" data-livestreamid="4" data-livestream="cycling" class="LiveStreamCycle w-inline-block" aria-label="Cycling"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Cycling</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,5)" id="liLiveStreamstrength" data-livestreamid="5" data-livestream="strength" class="LiveStreamStrength w-inline-block" aria-label="Strength"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Strength</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,6)" id="liLiveStreambootcamp" data-livestreamid="6" data-livestream="bootcamp" class="LiveStreamCrossfit w-inline-block" aria-label="Boot Camp"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Boot Camp</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,7)" id="liLiveStreammartialarts" data-livestreamid="7" data-livestream="martialarts" class="LiveStreamStrength w-inline-block" aria-label="Martial Arts"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Martial Arts</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,8)" id="liLiveStreamboxing" data-livestreamid="8" data-livestream="boxing" class="LiveStreamBoxing w-inline-block" aria-label="Boxing"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Boxing</div></a></li><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="SearviceFilter(this,9)" id="liLiveStreamdance" data-livestreamid="9" data-livestream="dance" class="LiveStreamBoxing w-inline-block" aria-label="Dance"><div class="filter-pill-text web-body-font" aria-hidden="true"><span class="filter-icon font-awesome-light-pro"></span>Dance</div></a></li></ul><ul id="streamclassdropdownlist" style="display : none"><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Gyrontonic" id="Gyrontonic"><label for="Gyrontonic">Gyrontonic</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Gyrokinesis" id="Gyrokinesis"><label for="Gyrokinesis">Gyrokinesis</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Aerobics" id="Aerobics"><label for="Aerobics">Aerobics</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Zumba" id="Zumba"><label for="Zumba">Zumba</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Spinning" id="Spinning"><label for="Spinning">Cycle / Spinning</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Step Classes" id="StepClasses"><label for="StepClasses">Step Classes</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Weight Training" id="WeightTraining"><label for="WeightTraining">Weight Training</label></div></li><li><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" value="Strength Training" id="StrengthTraining"><label for="StrengthTraining">Strength Training</label></div></li></ul><script id="StreamClassDropdownTemplate" type="text/x-jQuery-tmpl"><li><div><div class="checkbox-custom-black vagaro-checkbox"><input type="checkbox" name="StreamClassDropdownCheckbox" value="${HSBusinessTypeId}" data-hsbusinesstype="${HSBusinessType}" id="${HeroSliderID}"><label for="${HeroSliderID}">${PopularCategoryName}</label></div></div></li><\/script><script id="StreamClassCategoryDropdownTemplate" type="text/x-jQuery-tmpl"><li class="LiveStreamClassListCss"><a href="javascript:void(0);" onclick="javascript:SearviceFilter(this);" id="${ServiceId}">${CategoryName}</a></li><\/script></div></div></div></div>'),e(".LiveStreamBookmarkClass").on("click",function(e){ManagaBusinessBookmark(this)}),e(".stream-more").on("click",function(){e("#streamclassdropdown").slideToggle("600"),e(window).width()<767&&e(this).closest(".livestreampage").find(".mobile-classmore-links").toggle()}),e(".duration-text").on("click",function(){e("#durationdropdown").slideToggle("600")}),setCategoryWidthheight()}else e(".listigBusiness-wrapper").find(".liststream-filter-top").length>0&&e(".listigBusiness-wrapper").find(".liststream-filter-top").remove();n&&t.preventDefault()}),e("#aSeeAllLiveStream").length>0&&e("#aSeeAllLiveStream").attr("href","/live-stream-classes"),e("#aSeeAllPopularBusiness").bind(t,function(e){try{var t={Action:"See All",PageName:"Home",Category:"Popular Businesses"};_vgLogEvent.LogData(t)}catch(e){}_common.aSeeallPopularBusiness(e)}),e("#aSeeAllDeals").bind(t,function(e){try{var t={Action:"See All",Category:"Daily Deal",PageName:"Home"};_vgLogEvent.LogData(t)}catch(e){}}),e("#aSeeAllCovidBusinesses").bind(t,function(e){ResetBusinessSearchMode(),isClickForOnlineStore=!1,isClickForOnlineGCStore=!0,pserviceid="",resetAllCheckBox(),setdefaultSortingOption("listSort","listings"),_common.loadSections("listings")&&e.preventDefault()}),e("#aSeeAllAffirmBusinesses").bind(t,function(e){ResetBusinessSearchMode(),isClickForOnlineStore=!1,isClickForOnlineGCStore=!1,isClickForBNPL=!0,pserviceid="",resetAllCheckBox(),setdefaultSortingOption("listSort","listings"),_common.loadSections("listings")&&e.preventDefault()}),e("#professionals").bind(t,function(t){HideAdvanceSearchModel(),ResetBusinessSearchMode(),resetAllCheckBox(),e("#hdnChkProfessional").val("true"),setdefaultSortingOption("professionalSort","listings"),_common.loadSections("professionals")&&t.preventDefault()}),e("#photos").bind(t,function(t){HideAdvanceSearchModel(),ResetBusinessSearchMode(),resetAllCheckBox(),setdefaultSortingOption("gallerySort","listings"),_common.loadSections("photos")&&t.preventDefault(),setTimeout(function(){e("#dDropDownMenusFilterMyLikes").attr("tabindex",-1).focus()},700)}),e("#deals, #dailyDealsFooter, #aSeeAllDeals").bind(t,function(t){HideAdvanceSearchModel(),ResetBusinessSearchMode(),resetAllCheckBox(),setdefaultSortingOption("listSort","deals"),e("#ulFeatureBusiness").html('<section class="cards-parent-div-flex daily" id="dealListing">').removeAttr("style"),e("#ulFeatureBusiness").removeAttr("lastcall"),_common.loadSections("deals")&&t.preventDefault()})};var p=null;_common.aSeeallPopularBusiness=function(e){ResetBusinessSearchMode(),resetAllCheckBox(),setdefaultSortingOption("listSort","listings"),_common.loadSections("listings")&&!String.isNullOrUndefineOrBlank(e)&&e.preventDefault()},_common.SelectLiveStreamClasses=function(t){if(businessSearchModeForSelection=[0,3],togglebusinesssearch(searchFilterEnum.LiveStream),0==String.isNullOrUndefineOrBlank(t))if(0==String.isNullOrUndefineOrBlank(t.subTab)){var i=e("#LiveStream"+t.subTab);i.length>=0&&selectClassCategory(i,!1)}else e("#divStreamListingFilters a").removeClass("selected"),e(".LiveStreamClassListCss").removeClass("active"),_gblLiveStreamSearchServiceId=0,_gblLiveStreamSearchServiceName="";setdefaultSortingOption("listSort","listingsLive"),setCategoryWidthheight()},_common.SetLocationBySearch=function(t,i){e("body").removeClass("banner-hide-custapp");var n=e(IdSearchServiceMain).data("select2").getVal().toString();if(void 0!==n&&""!=n){var o=AdminServiceList.results;if(o&&o.length>0){var a=findObjectBytext(o,n);urlService=null!=a?a.url:n}}void 0!==i&&null!=i&&1==i&&(isDealFilterApplied=!0),setAdvSearchDefaultName(),"txtLiveStreamLocationSearch"==e(t.target).attr("id")?(e("#txtLiveStreamLocationSearch").select2("destroy"),e("#txtLiveStreamLocationSearch").off("selected"),e("#txtLiveStreamLocationSearch").off("select2-close"),e("#divLiveStreamLocationSearchPopUp").modal("hide"),setCookie("eventType",3)):resetAllCheckBox();var s=!1;void 0===(p=1)||""==p?p=getCookie("eventType"):setCookie("eventType",p),e("#mobile-check").is(":visible")&&e("#mobilemenutoggle").show();var r=e(IdBusinessLocationSearch).data("select2").getVal().toString(),l=e(IdSearchServiceMain).data("select2").getVal().toString();e("#btnBackHomeSearch:visible").data("isdealdetailpage",null),e("#btnBackHomeSearch").data("isFilterclicked",null),isFilterScreen=!1;var c=e(IdBusinessLocationSearch);1!=isLocationByDefault&&null!=c.data("response")||""==r||(r=""),e(IdHomeServicesDate).val().toLowerCase()==AnyTime.toLowerCase()?(isServiceAnyTime=!0,e("#txtMobileServiceDate").val(AnyTime),e("#txtServiceDate").val(AnyTime),serviceDateTime=getLocationDate(),1==isAdvanceSearch&&localStorage.setItem("serviceDateTime",AnyTime.toLowerCase())):(isServiceAnyTime=!1,serviceDateTime=getdatepickervalue(IdHomeServicesDate),e("#txtServiceDate").val(serviceDateTime),1==isAdvanceSearch&&localStorage.setItem("serviceDateTime",serviceDateTime)),isBackHomeScreen=!1;var d=!0;if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(d="home"==tabSegment.toLowerCase()||"/"==tabSegment||""==tabSegment||"listings"==tabSegment),""==c.data("selectedid")&&(String.isNullOrUndefineOrBlank(e(t.target).attr("id"))||"txtLiveStreamLocationSearch"!=e(t.target).attr("id")||e(c).data("selectedid",location)),""!=r&&""!=c.data("selectedid")){var u=c.data().purpose,h=t,m=void 0!==t.choice&&"txtLiveStreamLocationSearch"==t.currentTarget.id&&"location"==t.choice.id;if("location"==c.data("selectedid")||m)closeMobileSearch(),(g=JSON.parse(c.data("response"))).locationDetail=g.latitude+"#"+g.longitude+"#"+g.zipCode+"#"+g.city+"#"+g.stateCode,""!=l&&p>0?(_common.SetVariablesForLiveStream(1==p?"book":"class"),_common.SetVariablesForBookAService(),onSearchClick(u,h,g,!1,d)):(service="",tabSegment="listings",_common.SetVariablesForLiveStream("listings"),onSearchClick(u,h,g,!1,d));else{s=!0;var g=null;try{if(null!=(g=JSON.parse(c.data("response"))))if(1==/^\d+$/.test(g.id))closeMobileSearch(),""!=l&&p>0?(1==p?(_common.SetVariablesForLiveStream("book"),_common.SetVariablesForBookAService()):2==p&&(_common.SetVariablesForLiveStream("class"),_common.SetVariablesForBookAClass()),onSearchClick(u,h,g,!1,d)):(service="",tabSegment="listings",_common.SetVariablesForLiveStream("listings"),onSearchClick(u,h,g,!1,d));else{var v=new vagaro.ajax;v.datamodel.Token=ApiURLEnumOnlineCommon.getlocationsearchbyplaceid,v.datamodel.IsNewVagaroAPI=!0,v.datamodel.data={placeID:c.data("selectedid")},v.datamodel.callback=function(e){null!=e?(void 0!==isSetIsCurrentLocationCookie&&setCookie(ProximityIsCurrentLocation,isSetIsCurrentLocationCookie),closeMobileSearch(),""!=l&&p>0?(1==p?(_common.SetVariablesForLiveStream("book"),_common.SetVariablesForBookAService()):2==p&&(_common.SetVariablesForLiveStream("class"),_common.SetVariablesForBookAClass()),onSearchClick(u,h,e,!1,d)):(service="",tabSegment="listings",_common.SetVariablesForLiveStream("listings"),onSearchClick(u,h,e,!1,d))):closeMobileSearch()},v.datamodel.Error=function(e){},v.Post()}else closeMobileSearch()}catch(e){}}}else""!=l&&p>0?(closeMobileSearch(),setdefaultSortingOption("listSort","book"),1==p?(_common.SetVariablesForBookAService(),_common.SetVariablesForLiveStream("book"),_common.loadSectionsFromMobile("book",t)):2==p&&(_common.SetVariablesForBookAClass(),_common.SetVariablesForLiveStream("class"),_common.loadSectionsFromMobile("class",t))):(service="",_common.SetVariablesForBusinessListing(),closeMobileSearch(),setdefaultSortingOption("listSort","listings"),_common.SetVariablesForLiveStream("listings"),_common.loadSectionsFromMobile("listings",t));void 0!==e("#hdnAtBusiness").val()&&"isHomepage"==e("#hdnAtBusiness").val()&&(e("#btnAtBusiness").focus(),e("#hdnAtBusiness").val("")),0==s&&pageReload()},_common.SetVariablesForLiveStream=function(t){1==e("#mobile-check").is(":visible")&&(businessSearchModeForSelection.indexOf(3)>-1&&void 0!==t&&("class"==t||"listings"==t||0==bookSearchItemType.length&&"book"==t)?e("body").hasClass("livestreampage")||(e("body").addClass("livestreampage"),LoadLiveStreamPage()):e("body").removeClass("livestreampage"))},_common.SetVariablesForBookAService=function(){service=_common.GetChoiceForSeleect2(e(IdSearchServiceMain)).text,serviceDate=serviceDateTime.format("MMM DD,YYYY"),serviceTime=serviceDateTime.format("hh:nn a/p"),tabSegment="book"},_common.SetVariablesForBookAClass=function(){service=_common.GetChoiceForSeleect2(e(IdSearchServiceMain)).text,serviceDate=serviceDateTime.format("MMM DD,YYYY"),serviceTime=serviceDateTime.format("hh:nn a/p"),tabSegment="class"},_common.SetVariablesForBusinessListing=function(){service=_common.GetChoiceForSeleect2(e(IdSearchServiceMain)).text,serviceDate=serviceDateTime.format("MMM DD,YYYY"),serviceTime=serviceDateTime.format("hh:nn a/p")},_common.loadSectionsFromMobile=function(t,i){"book"==t||"class"==t||"listings"==t||3==businessSearchMode&&ResetBusinessSearchMode(),"deals"==t.toLowerCase()&&(e("#ulFeatureBusiness").html('<section class="cards-parent-div-flex daily" id="dealListing">').removeAttr("style"),e("#ulFeatureBusiness").removeAttr("lastcall")),_common.loadSections(t)&&void 0!==i&&null!=i&&(String.isNullOrUndefineOrBlank(e(i.target).attr("id"))||"txtLiveStreamLocationSearch"==e(i.target).attr("id")||i.preventDefault())},_common.hasLatLongCookie=function(e){if("home"==BasePage.toLowerCase()){var t=getCookie(ProximityCookieName);return!(null==t||"undefined"==t||String.isNullOrUndefineOrBlank(t.lat)&&String.isNullOrUndefineOrBlank(t.long))}},_common.isTouchOrClick=function(e){return!e.ctrlKey},_common.CheckPromoBusinessID=function(){null!=strBusinessPromoURL&&""!==strBusinessPromoURL||(clearCookie("PromotionUIDetails"),clearCookie("promotionalurl"))},_common.onBookmarkRowLoad=function(t,i){var n=e(i);if(t.intRating>0){var o=100*t.intRating/5;e("#divBookMarksRating_"+t.FavoriteID,n).css("width",o+"%")}return e("#divBookmarksBusName_"+t.FavoriteID,n).text(_common.getShortNameForDesign(t.BusinessName,30,27)),n},_common.afterBookmarkRowLoad=function(t){e("#btnBookNext").hide(),e("#btnBookPre").hide(),e("#divBookmarks").removeAttr("ondragend"),null==t||0==t.length?e("#scBookMarkSection").hide():(e("#scBookMarkSection").show(),t.length>=4&&(e("#btnBookNext").show(),e("#btnBookNext").removeClass("slide-disabled"),e("#btnBookNext").removeAttr("disabled"),e("#btnBookPre").show(),e("#btnBookPre").addClass("slide-disabled"),e("#btnBookPre").attr("disabled",!0),e("#divBookmarks").attr("ondragend","javascript:dragOnSlider(event, 'divBookmarks', 'btnBookPre', 'btnBookNext');")),_common.AddEndSpaceInSlider("#divBookmarks"))},_common.AddEndSpaceInSlider=function(t){var i=e(t+" .divSlider-Content");i.length>0&&i.last().after("<a href='javascript:void(0)' class='end-div-space'></a>")},_common.SetDefaultLocation=function(t,i){var n=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";n.indexOf("webcache.googleusercontent.com")>-1&&"vagaro.com"==DomainName&&(n="https://www.vagaro.com/"),e.ajax({url:n+"WebServices/MySampleService.asmx/GetLocation",type:"POST",contentType:"application/json; charset=utf-8"}).success(function(e){var n=EmptyProximityValue();if(void 0!==e&&null!=e&&"success"==e.status.toLowerCase()){var o={us:"1",gb:"2",ca:"3",au:"4"}[e.countryCode.toLowerCase()];void 0===o?n=_common.SetDefaultCookie(i):(n.countryid=o,n.currencysymbol="2"==o?"£":"$",n.lat=e.lat,n.long=e.lon,n.zip=e.zip,n.city=e.city,n.state=e.region),ipLocation=e.lat+","+e.lon}else n=_common.SetDefaultCookie(i);setCookie(ProximityCookieName,n),SetProximityVariables(),setDropDown(),loadData(t,!0)})},_common.SetUserLocation=function(){var t=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";e.ajax({url:t+"WebServices/MySampleService.asmx/GetLocation",type:"POST",contentType:"application/json; charset=utf-8"}).success(function(e){EmptyProximityValue();CurrentLocation=void 0!==e&&null!=e&&"success"==e.status.toLowerCase()?e.lat+","+e.lon:"37.78222,-122.46178"})},_common.SetDefaultCookie=function(e){var t=EmptyProximityValue();return t.countryid="1",t.currencysymbol="$",t.lat="37.78222",t.long="-122.46178",t.zip="",t.city="San Francisco",t.state="CA",t.stateName="California",void 0!==e&&void 0!==e.businesstypes&&(t.businesstypes=e.businesstypes),t},_common.mapListToggle=function(t){if(!(e("#divFeatureBusinessLoader:visible").length>0))if(t){e("#pageSection").addClass("map-viewonly"),e(".listings-60").addClass("hideList"),e(".listings-map-40").addClass("showMap"),e(".map-pill-pkg").hide(),e(".filter-pill-pkg").hide(),e(".list-pill-pkg").show();try{var i={Action:"Deal Details",PageName:"Deal",Category:"Deal",BusinessName:"",BusinessID:"",isDealDetails:!1,IsListPage:!1,IsMapPage:!0,isFiltered:!1,DealName:""};_vgLogEvent.LogData(i)}catch(e){}}else{e("#pageSection").removeClass("map-viewonly"),e(".listings-60").removeClass("hideList"),e(".listings-map-40").removeClass("showMap"),e(".list-pill-pkg").hide(),e(".map-pill-pkg").removeAttr("style"),e(".filter-pill-pkg").removeAttr("style"),e("#mobile-check").is(":visible")&&e(".redo-search-btn").hide();try{i={Action:"Deal Details",PageName:"Deal",Category:"Deal",BusinessName:"",BusinessID:"",isDealDetails:!1,IsListPage:!0,IsMapPage:!1,isFiltered:!1,DealName:""};_vgLogEvent.LogData(i)}catch(e){}}},_common.ApplyEnScroll=function(e){iPadAndroid||iMacSafari||isWindowsPhone||isWebKit&&!isEdge||Ps.initialize(document.querySelector(e),{suppressScrollY:!1})},_common.GetAppVersion=function(){var e=null,t=userAgent.split("(vagaroapp");if(t.length>0){var i=t[1].split(")")[0];if(null!=i&&void 0!==i&&i.length>0){var n=i.replace(")","").replace(" ","");e=n.split(".").length<3?n.replace(".","")+"0":n.replace(".","").replace(".","")}}return e},_common.FeaturedBusinessTooltip=function(t){if(1!=isWindowsPhone){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(1==isAndroidMobile||"android"==iPadAndroid)){var i=_common.GetAppVersion();if(null!=i&&i<=450)return}if(void 0!==t&&"login"==t&&("undefined"==typeof UserType||null==UserType||""==UserType)){var n=new vagaro.ajax;n.datamodel.Token="GetLoggedinUserType",n.datamodel.callback=function(e){""!=e&&null!=e&&(UserType=e,_common.FeaturedBusinessTooltip(t))},n.datamodel.Error=function(e){},n.datamodel.data=[],n.Post()}"undefined"!=typeof UserID&&null!=UserID&&""!=UserID&&parseInt(UserID)>0&&"undefined"!=typeof UserType&&null!=UserType&&""!=UserType&&(5==parseInt(UserType)||6==parseInt(UserType))?e(".ad-text").length&&(iPadAndroid?(e(".ad-text").off("click"),e(".ad-text").on("click",function(){e(this).hasClass("hover")?(e(".ad-text").removeClass("hover"),event.stopPropagation(),event.preventDefault()):(event.stopPropagation(),event.preventDefault(),e(".ad-text").removeClass("hover"),e(this).addClass("hover"))}),e(".ad-text .featured-whitebutton").off("click"),e(".ad-text .featured-whitebutton").on("click",function(e){e.stopPropagation(),e.preventDefault(),RedirectToShopOwnerPage()})):(e(".ad-text").off("click"),e(".ad-text").on("click",function(e){e.stopPropagation(),e.preventDefault()}),e(".ad-text .featured-whitebutton").off("click"),e(".ad-text .featured-whitebutton").on("click",function(e){e.stopPropagation(),e.preventDefault(),RedirectToShopOwnerPage()}),e(".ad-text").addClass("cusrerpointer"),e(".ad-text").hover(function(){e(this).addClass("hover")},function(){e(this).removeClass("hover")}),e(".ad-text").each(function(){"ad"===e(this).text().trim().toLowerCase()?e(this).show():e(this).is(":visible")?e(this).text("Ad").show():e(this).hide()}))):(e(".ad-text").removeClass("cusrerpointer"),e(".ad-text").off("click"),e(".ad-text .featured-whitebutton").off("click"),e(".ad-text").off("hover"),e(".ad-text").hover(function(){e(this).removeClass("hover")},function(){e(this).removeClass("hover")}),e(".ad-text").each(function(){"ad"===e(this).text().trim().toLowerCase()?e(this).show():e(this).is(":visible")?e(this).text("Ad").show():e(this).hide()}))}},_common.RedirectBusinessDetailPage=function(t){e("#ancbus_"+t).removeAttr("onClick"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("#ancbus_"+t).removeAttr("target"),"undefined"!=typeof event&&(event.stopPropagation(),event.preventDefault()),document.getElementById("ancbus_"+t).click()},_common.RedirectToBook24=function(i,n){if(i.serviceid>0&&e("#divPromotion_"+i.serviceid).length>0){var o=e(n.target),s=e("#divPromotion_"+i.serviceid),r=e("#aSerivceBusPromotion",s),l=r.children();if(o.is(l)||o.is(r))return!0}n.stopPropagation(),n.preventDefault(),e("html, body").removeClass("overflowHidden"),1==e("#galleryPopup").length&&e("#galleryPopup").hide(),void 0!==i.styleid&&null!=i.styleid&&i.styleid>0&&"undefined"!=typeof businessID&&(IsGallerySp=!0,function(t,i,n){var o={ServiceId:parseInt(t),BusinessID:parseInt(i)},a=new vagaro.ajax;a.datamodel.Token=_shopdetail.GetCoreAPIURLWithToken(ApiURLEnumBooking.GetPhotoGalleryService,groupID),a.datamodel.data=o,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.callback=function(o){var a={ServiceId:parseInt(t),BusinessID:parseInt(i),ServiceProviderID:"undefined"!=typeof isWidget&&"undefined"!=typeof WidgetSpId&&null!=WidgetSpId&&isWidget&&WidgetSpId>0?WidgetSpId:0,IsBundle:0,LastMinDealHours:LastMinuteBookingDays},s=new vagaro.ajax;s.datamodel.Token=_shopdetail.GetCoreAPIURLWithToken(ApiURLEnumBooking.GetAddOnService,groupID),s.datamodel.data=a,s.datamodel.IsNewVagaroAPI=!0;var r=t,l=o.Data[0].Photo,c=o.Data[0].EventType,d=o.Data[0].ServiceTitle,u=o.Data[0].ServiceDesc,p=o.Data[0].Price,h=o.Data[0].IsShowPriceOnline.toString();if(0!=o.Data[0].DiscountValue&&0==o.Data[0].IsAmount)var m=p-p*o.Data[0].DiscountValue/100,g=p-p*o.Data[0].DiscountValue/100,v=o.Data[0].ServiceProviderID,f=o.Data[0].DiscountValue+"% OFF";else 0!=o.Data[0].DiscountValue&&1==o.Data[0].IsAmount?(m=p-o.Data[0].DiscountValue,g=p-o.Data[0].DiscountValue,v=o.Data[0].ServiceProviderID,f=o.Data[0].DiscountValue+"$ OFF"):(m="0",g="0",v="",f="");var C=!0;if(1==_shopdetail.IsIncludeTaxInOnlinePricing&&0!=o.Data[0].ServiceNewPriceWithTax)var S=o.Data[0].ServiceNewPriceWithTax;else S=1==_shopdetail.IsIncludeTaxInOnlinePricing&&0==o.Data[0].ServiceNewPriceWithTax?o.Data[0].Price:"0";o.Data[0].Taxes,s.datamodel.callback=function(t){if(1e3==t.ResponseCode)if(ShowLoader(!1),t.Data.length>0&&null!=t.Data[0]){_shopdetail.ShowAddOnService(),e("#divSuggestedAddon").text("Suggested Add-Ons Available"),SelectedAddonService=[],_shopdetail.localData.AddonsList=t.Data,e(_shopdetail.Controls.AddOnList).empty(),e(_shopdetail.Controls.ParentService).empty(),null==l||"null"==l||""==l?(e("#divServiceImage").css("display","none"),e(".addon-service-description").addClass("no-image-data")):(e("#divServiceImage").css("display","block"),e(".addon-service-description").removeClass("no-image-data"),e("#divServiceImage").css("background-image","url("+l+")")),e("#divServiceName").text(d),e("#divServiceDes").text(u),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.IsIncludeTaxInOnlinePricing&&null!=_shopdetail.IsIncludeTaxInOnlinePricing&&1==_shopdetail.IsIncludeTaxInOnlinePricing&&g<=0&&(p=S),void 0!==p&&null!=p&&"string"!=typeof p&&(p=p.toString()),"$0.00"==p||"0.00"==p||"0"==p?"true"==h?(e("#divFreeServicePrice").css("display","block"),e("#divServicePrice").css("display","none"),e("#divServicePrice").text(_onlineCheckout.parseTodecimal(p.replace(_shopdetail.currencySymbol,""),2).format("#.##"))):(e("#divFreeServicePrice").css("display","none"),e("#divServicePrice").css("display","none"),e("#divServicePrice").text(_onlineCheckout.parseTodecimal(p.replace(_shopdetail.currencySymbol,""),2).format("#.##"))):"true"==h?(e("#divFreeServicePrice").css("display","none"),e("#divServicePrice").css("display","block"),e("#divServicePrice").text(_shopdetail.currencySymbol+_onlineCheckout.parseTodecimal(p.replace(_shopdetail.currencySymbol,""),2).format("#.##"))):(e("#divFreeServicePrice").css("display","none"),e("#divServicePrice").css("display","none"),e("#divServicePrice").text(_onlineCheckout.parseTodecimal(0,2).format("#.##"))),e("#hdnServiceId").val(r),e("#hdnEventType").val(c);var i=e.grep(t.Data,function(e){return 0==e.ServiceLevel});e.each(i,function(n){var o=e.grep(t.Data,function(e){return e.Price=_onlineCheckout.parseTodecimal(e.Price,2),e.ParentServiceID==i[n].ServiceId});i[n].MinItem=i[n].MinItem>o.length?o.length:i[n].MinItem,i[n].MaxItem=i[n].MaxItem>o.length?o.length:i[n].MaxItem,o=o.map(function(e){if(e.IsRequired=i[n].IsRequired,e.MinItem=i[n].MinItem,e.MaxItem=i[n].MaxItem,e.Photo=e.Photo.indexOf("no-shop-image-big.")>0?"":e.Photo,e.CurrencySymbol=_shopdetail.currencySymbol,e.OnlinePrice=1==e.IsShowPriceOnline?e.Price:"0.00",e.OnlinePricewithtax=1==e.IsShowPriceOnline?e.Price:"0.00",e.IsIncludeTaxInOnlinePricing=!1,e.NewPricewithTax=e.Price,null!=e.PromotionDetail&&""!=e.PromotionDetail){var t=_shopdetail.GetAddonDailyDealData(e.PromotionDetail,e.OnlinePrice,e.ServiceId,0,!0,e.BusinessTax);t.PromotionID>0?(e.IsDealApplied=!0,e.PromotionID=t.PromotionID,e.NewPrice=t.NewPrice,e.NewPricewithTax=e.NewPrice):(e.IsDealApplied=!1,e.PromotionID=0,e.NewPrice=0)}else e.IsDealApplied=!1,e.PromotionID=0,e.NewPrice=0;try{"undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.IsIncludeTaxInOnlinePricing&&null!=_shopdetail.IsIncludeTaxInOnlinePricing&&1==_shopdetail.IsIncludeTaxInOnlinePricing&&(e.IsIncludeTaxInOnlinePricing=!0,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.TaxesValues&&""!=_shopdetail.TaxesValues&&null!=_shopdetail.TaxesValues&&""!=e.BusinessTax&&null!=e.BusinessTax&&null!=e.BusinessTax&&""!=e.BusinessTax&&null!=e.PromotionDetail&&e.PromotionDetail)}catch(e){}return e}),_shopdetail.CreateNoneOTAboveObject(o),e(_shopdetail.Controls.tmplAddOnCategory).tmpl(i[n]).appendTo(_shopdetail.Controls.AddOnList),e(_shopdetail.Controls.tmplAddOnService).tmpl(o).appendTo("#Service_"+o[0].ParentServiceID),e(".modal:visible").each(function(e,t){centerModal(t)}),e("#addonspopupclose.close").css({visibility:"hidden"})}),_shopdetail.BindSelectedAddon(r,1,"0"),_shopdetail.CheckboxAddOnService(),0!=o.Data[0].DiscountValue&&(e(".s-sub-heading.TotalServicePrice").text(currencySymbol+""+m),e("#divServicePrice").text(currencySymbol+""+m)),e("#btnClose").css("display","none"),e(".classfooter-btn-row").addClass("backremove"),e("#servicenamepopup").removeClass("single-button"),e("#btnback").css("display","none"),e("#btnNext").css("display","none"),e("#btnContinue").css("display","block"),void 0!==n&&""!=n&&null!=n?e("#btnContinue").attr("onclick","_shopdetail.AddAddOnServiceDetailForBookNow("+r+", "+n+", 0, '', '', '', "+c+", false,0,'"+l+"','"+ReplaceSpecialCharacters(u)+"','"+v+"', '"+f+"','"+C+"');"):e("#btnContinue").attr("onclick","_shopdetail.AddAddOnServiceDetailForBookNow("+r+", 0, 0, '', '', '', "+c+", false,0,'"+l+"','"+ReplaceSpecialCharacters(u)+"','"+v+"', '"+f+"','"+C+"');"),2==t.Data.length?e(".addon-group-row1").css("border-bottom","none"):e(".addon-group-row1").css("border-bottom","solid #E7E7E7 1px")}else e(_vgClassSessionSelection.Controls.AddOnList).empty(),_shopdetail.HideAddOnService(),_shopdetail.SetBookData(r,0,0,"","","",c,!1,null)},s.datamodel.Error=_common.CallFailed,s.Post()},a.datamodel.Error=_common.CallFailed,a.Post()}(i.serviceid,businessID,i.spid));var c,d,u="",p="",h="",m="",g="",v="",f="";if(void 0!==i.serviceid&&"0"!=i.serviceid&&(u=i.serviceid),void 0!==i.spid&&"0"!=i.spid&&(p=i.spid),void 0!==i.styleid&&"0"!=i.styleid&&(h=i.styleid),void 0!==i.styletitle&&null!=i.styletitle&&""!=i.styletitle&&(m=i.styletitle),void 0!==i.bookingDateTime&&null!=i.bookingDateTime&&""!=i.bookingDateTime&&(g=i.bookingDateTime),void 0!==i.vagarourl&&null!=i.vagarourl&&""!=i.vagarourl&&(i.vagarourl=i.vagarourl.toLowerCase()),void 0!==i.AddonServicIds&&null!=i.AddonServicIds&&""!=i.AddonServicIds&&(v=i.AddonServicIds),void 0!==i.HouseCallGroupID&&null!=i.HouseCallGroupID&&""!=i.HouseCallGroupID&&(f=i.HouseCallGroupID),"Home"==BasePage||"MyAccount"==BasePage)if(setCookie("StyleID",h),setCookie("StyleName",m),setCookie("BookingDate",g),setCookie("IsReBookAppointment","True"),"MyAccount"==BasePage)if(setCookie("strServiceID",u),setCookie("strProviderID",p),setCookie("strAddonServicIds",v),setCookie("HouseCallGroupID",f),c="undefined"!=typeof widgetcookievalue&&""!=widgetcookievalue&&null!=widgetcookievalue&&"undefined"!=widgetcookievalue?"ServiceId="+u+"&ServiceProviderId="+p+"&wid='"+widgetcookievalue+"'&encrypted=true":"ServiceId="+u+"&ServiceProviderId="+p+"&encrypted=true&rebook=true",void 0!==i.Type&&null!=i.Type&&""!=i.Type&&(d="?Type="+i.Type),"Builder"==a&&"?Type=Builder"!=d&&(c+="&Type=Builder"),null!=isWidget&&"true"==isWidget||null!=isFacebook&&"true"==isFacebook)if(c="&"+c,_common.IsWidgetForServiceProvider(!0)){var C=_common.IsWidgetForServiceProvider(!1);window.location=t.location.protocol+"//"+t.location.host+"/"+i.vagarourl+"/book-now?IsFacebookPage="+(null!=isFacebook&&"true"==isFacebook?"true":"false")+"&IsBusinessWidgetPage="+(null!=isWidget&&"true"==isWidget?"true":"false")+"&TabsIncluded="+_shopdetail.TabsIncluded+"&IsFromMyAccount=1&b_themeID="+b_themeID+"&IsFromMultiLocation=true&MultiLocBusinessID="+MultiLocBusinessID+"&w_type="+w_type+"&IsFromWidgetMenu=true&widgetversion="+WidgetVersion+"&tab=1&tabatlaunch="+_shopdetail.TabAtLaunch+"&WidgetSpId="+C+c}else window.location=t.location.protocol+"//"+t.location.host+"/"+i.vagarourl+"/book-now?IsFacebookPage="+(null!=isFacebook&&"true"==isFacebook?"true":"false")+"&IsBusinessWidgetPage="+(null!=isWidget&&"true"==isWidget?"true":"false")+"&TabsIncluded="+_shopdetail.TabsIncluded+"&IsFromMyAccount=1&b_themeID="+b_themeID+"&IsFromMultiLocation=true&MultiLocBusinessID="+MultiLocBusinessID+"&w_type="+w_type+"&IsFromWidgetMenu=true&widgetversion="+WidgetVersion+"&tab=1&tabatlaunch="+_shopdetail.TabAtLaunch+c;else if(void 0!==_shopdetail.IsBookFromFacebook&&"true"==_shopdetail.IsBookFromFacebook.toLowerCase())c="&"+c,window.location=t.location.protocol+"//"+t.location.host+"/"+i.vagarourl+"/book-now?ig_fbb=true"+c;else if(void 0!==_shopdetail.isFBExtensions&&"true"==_shopdetail.isFBExtensions.toLowerCase())c="&"+c,window.location=t.location.protocol+"//"+t.location.host+"/"+i.vagarourl+"/book-now?ig_ix=true"+c;else if(null!=i.Type&&null!=i.Type&&""!=i.Type){c="&"+c;var S=t.location.protocol+"//"+t.location.host+"/"+i.vagarourl+"/book-now"+((document.referrer.indexOf("partner=fb")>=0||window.location.href.indexOf("partner=fb")>=0)&&1==_common.isCreateLinkPreserve(!0)?S.search:"")+d+c;$url=e("<a/>"),$url.attr("href",S),$url[0].click()}else{c="?"+c;var y=t.location.protocol+"//"+t.location.host+"/"+i.vagarourl+"/book-now"+((document.referrer.indexOf("partner=fb")>=0||window.location.href.indexOf("partner=fb")>=0)&&1==_common.isCreateLinkPreserve(!0)?S.search:"")+c;$url=e("<a/>"),$url.attr("href",y),$url[0].click()}else if(setCookie("ServiceID",u),setCookie("ProviderID",p),setCookie("AddonServicIds",v),void 0!==i.serviceid&&null!==i.serviceid&&"0"!==i.serviceid&&localStorage.setItem("RedirectSource","HomeBtn"),"undefined"!=e(s).parent().data("frombooknow")&&1==e(s).parent().data("frombooknow")){e("#anc_"+i.serviceid).removeAttr("onClick"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("#anc_"+i.serviceid).removeAttr("target");var b=document.getElementById("anc_"+i.serviceid);e("#mobile-check").is(":visible")&&"undefined"!=typeof vgAppicationType&&0==vgAppicationType&&b&&b.href&&"#"!==b.href&&!b.href.includes("javascript")?window.location.href=b.href:b.click()}else window.location="/"+i.vagarourl+"/book-now";else _shopdetail.SetBookData(u,p,h,m,g,"")},_common.centerGalleryPopup=function(){var t=e("#galleryPopup:visible").height();e(".gallery-popup-white-overall").css("max-height",t)},_common.checkHeart=function(t){return 0==e(t).find(".btnlike").hasClass(emptyHeartClass)},_common.clickToLikeStyle=function(t){var i=e(t).parents(".cust-img-popup-slider");if((void 0===i||null==i||i.length<=0)&&(i=e(t).parents(".gallery-solo-image")),e(t).parents(".gallery-solo-image").resize(),i.find(".share-popup").hide(),!(UserID>0))return _common.reloadstyle=!1,_common.likestyle=t,showLogin(),!1;var n=_common.checkHeart(i)?0:1,o=i.data();_common.likestyle=t;var a=new vagaro.ajax;a.datamodel.IsNewVagaroAPI=!0,a.datamodel.Token=ApiURLEnumCommon.likestyle,a.datamodel.callback=_common.LikeStyleSuccess,Data={},Data.styleId=o.styleid,Data.isLike=n,Data.ReceiverName=i.find("#divSalonName_"+o.styleid).html(),Data.Mailto=o.businessemail,Data.Body="User "+UserName+" liked the style",Data.Image=i.find("#imgServiceImage_"+o.styleid).attr("src"),Data.StyleTitle=o.styletitle,Data.Address=i.find("#divAddress_"+o.styleid).html(),Data.BusinessName=i.find("#divSalonName_"+o.styleid).html(),Data.Service=o.servicetitle,Data.businessUrl=o.vagarourl,Data.UserLike=e("#hdnLikeCount_"+o.styleid,i).val(),Data.groupID=o.group,0==_common.reloadstyle&&(n=2),a.datamodel.data=Data,a.datamodel.Error=function(t){_common.checkHeart(i)?(e(i).find(".btnlike").addClass(emptyHeartClass),e(i).removeClass("gallery-liked")):(e(i).find(".btnlike").removeClass(emptyHeartClass),e(i).addClass("gallery-liked"))},a.Post();var s=0;null!=e("#divGalleryLikeCount",i).html()&&"undefined"!=e("#divGalleryLikeCount",i).html()&&(s=parseInt(e("#divGalleryLikeCount",i).html().trim().split(" ")[0])),_common.checkHeart(i)?(e(i).find(".btnlike").addClass(emptyHeartClass),e(i).removeClass("gallery-liked"),e("#divGalleryLikeCount:visible",i).length>0?1==(s-=1)?e("#divGalleryLikeCount",i).html(s+" Like"):0==s?(e("#divGalleryLikeCount",i).css("display","none"),e("#divGalleryLikeCount",i).html("")):e("#divGalleryLikeCount",i).html(s+" Likes"):(e("#divGalleryLikeCount",i).css("display","none"),e("#divGalleryLikeCount",i).html("")),e("#imgLikePopUp").addClass(emptyHeartClass).attr("aria-label","Click to like")):(e(i).find(".btnlike").removeClass(emptyHeartClass),e(i).addClass("gallery-liked"),e("#imgLikePopUp").removeClass(emptyHeartClass).attr("aria-label","Click to unlike"),e("#divGalleryLikeCount:visible",i).length>0?(s+=1,e("#divGalleryLikeCount",i).html(s+" Likes")):(s=1,e("#divGalleryLikeCount",i).show(),e("#divGalleryLikeCount",i).html(s+" Like")),e(t).parents(".gallery-solo-image").resize())},_common.LikeStyleSuccess=function(t){if(null==t)return showLogin(),!1;if(t.length>0){var i,n=e(_common.likestyle).parents(".cust-img-popup-slider");if((void 0===n||null==n||n.length<=0)&&(n=e(_common.likestyle).parents(".gallery-solo-image")),_common.isFromLikeStyle=!1,_common.checkHeart(n))(i=parseInt(e("#hdnLikeCount_"+n.data().styleid,n).val()))>0?e("#hdnLikeCount_"+n.data().styleid,n).val(i-1):e("#hdnLikeCount_"+n.data().styleid,n).val(0);else(i=parseInt(e("#hdnLikeCount_"+n.data().styleid,n).val()))>0?e("#hdnLikeCount_"+n.data().styleid,n).val(i+1):e("#hdnLikeCount_"+n.data().styleid,n).val(1);e(".gallery-solo-image",e("#ulFeatureBusiness")).each(function(){var i=e(this).data().styleid;e.inArray(parseInt(i),t)>-1&&(e(this).prop("title","You liked this portfolio"),e(this).find(".btnlike").removeClass(emptyHeartClass),e(this).addClass("gallery-liked"))}),window.location.href.includes(myLikedStyleUrlValue)&&(n.detach(),setTimeout(function(){_featured.GalleryPager.RefreshWall(),1==e("#ulFeatureBusiness").attr("data-total-col")&&setMylikesGalleryFilterValue(1,"aMyLikesOption_filter_1",0,1)},150))}},_common.GetUserLike=function(){var t=new vagaro.ajax;t.datamodel.Token=ApiURLEnumCommon.likestyle,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.data=[0,3,"","","","","","","","","","0"],t.datamodel.callback=function(t){e(".gallery-solo-image",e("#ulFeatureBusiness")).each(function(){var i=e(this).data().styleid;e.inArray(parseInt(i),t)>-1&&(e(this).prop("title","You liked this portfolio"),e(this).find(".btnlike").removeClass(emptyHeartClass),e(this).addClass("gallery-liked"))})},t.datamodel.Error=function(e){},t.Post()},_common.SetGalleryData=function(t){0==_common.reloadstyle&&(t&&(_featured.GalleryPager.options.Data.userid=UserID),_common.clickToLikeStyle(_common.likestyle),e("div.slick-active","#detailstyleboot").length>0&&e("div.slick-active","#detailstyleboot").closest(".bootbox").show()),_common.reloadstyle=!0,ShowLoader(!1)},_common.clearCovidReviewRating=function(t,i){try{for(var n,o=0,a=e(t).children().children(".rating-symbol").length,s=0;s<a;s++){var r=e(t).children().children(".rating-symbol")[s];if(e(r).hasClass("glyphicon-star-empty")){n=e(t).children().children(".rating-symbol")[s-1],o=s-1;break}}null!=n&&null!=n||(n=e(t).children().children(".rating-symbol")[a-1],o=a-1);for(var l=0;l<a;l++)covid=e(t).children().children(".rating-symbol")[l],l!=o&&e(covid).removeClass("select");if(e(t).parent().parent().length>0&&e(t).parent().parent()[0].id.toString().toLowerCase().indexOf("covid")>-1&&e(n).hasClass("select")){e(n).removeClass("select");for(var c=0;c<=o;c++){r=e(t).children().children(".rating-symbol")[c];e(r).hasClass("glyphicon-star-empty")||e(r).addClass("glyphicon-star-empty"),e(r).hasClass("glyphicon-star")&&e(r).removeClass("glyphicon-star")}return void e(i,e(t)).val("")}e(n).addClass("select"),""!=e(i,e(t)).val()&&"-1"!=e("#rating-input",e(t)).val()||(e(".rating-symbol",e(t)).addClass("glyphicon-star-empty"),e(i,e(t)).val(""))}catch(e){}},_common.clearReviewRating=function(t,i){""!=e(i,e(t)).val()&&"-1"!=e("#rating-input",e(t)).val()||(e(".rating-symbol",e(t)).addClass("glyphicon-star-empty"),e(i,e(t)).val(""))},_common.setServiceCancelButtonMobile=function(t){e(".cancel-select-service").on("touchstart click",function(t){t.preventDefault(),t.stopPropagation(),void 0!==isFilterScreen&&isFilterScreen?(e("#select2-drop-mask").click(),e(IdSearchServiceMain).select2("close")):1==parseInt(e("#btnBackHomeSearch:visible").data("iscustomerappsearch"))?(e(this).parent().find(".select2-input").blur(),e("#btnBackHomeSearch:visible").click()):e("#select2-drop-mask").click(),e("html, body").removeClass("searchaddservclass")})},_common.imageErrorStyle=function(e){e.src="https://vagaro.azureedge.net/static-content/Images/no-shop-image-big-new.gif"},_common.DeleteReviewImage=function(t){var i=t.target,n=e(i).closest(".review-editpic"),o=e(i).closest(".review-gallery-image"),a=e(o).attr("img_name"),s=e(o).attr("img_upload_name"),r=e(o).attr("position");e(o).css("background-image","none"),e(i).closest(".review-editpic").hide(),null!=a&&null==s||null!=a&&null==s?(ReviewPhotoArray[r].ActionName="Delete",ReviewPhotoArray[r].temp_delete=!0):_shopdetail.deleteImage(s,r),!(null!=navigator.userAgent.match(/iPad/i))&&iosDevices||isAndroidMobile||isWindowsPhone?e(".add-reviewbtn-bg").show():e("div.reviewProfile").css("display","flex"),e(".reviewProfile-bg").append(e(n))},_common.GetCurrencySymbol=function(){return currencySymbol},_common.HeaderTopfixed=function(){e(_siteBuilderDetail.componentInfo[2]).removeClass("tab-fixednav"),e(".pagebodycontainer").removeClass("giveNavspace"),e("body").removeClass("detailnavfixed"),footerBottomfixed()},_common.CheckFacebookControllRenders=function(){if(e("#dvFaceBookControl").length<=0){objReqFacebookData={},objReqFacebookData.UserControlPath="~/UserControls/General/ucFacebookLoader.ascx",objReqFacebookData.PageNamePath="~/Home.aspx",objReqFacebookData.isRemoveFormTag=!0;var t=new vagaro.ajax;t.datamodel.IsNewVagaroAPI=!0,t.datamodel.Token="websiteapi/homepage/loadusercontrol",t.datamodel.data=objReqFacebookData,t.datamodel.callback=function(t){null!=t&&e("body").append(t)},t.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert({message:"An Error Has Occurred ucFacebookLoader",title:"Oops!"})},t.Post()}},_common.VisibleControlLength=function(t){return e(t).filter(function(){return"none"!==e(this).css("display")}).length},_common.GetGoogleToken=function(e){var t=getCookie("GoogleMap_"+e);return String.isNullOrUndefineOrBlank(t)?null:t},_common.GooglePostCall=function(e){if("true"==isGoogle){var t=_common.GetGoogleToken(e);if(String.isNullOrUndefineOrBlank(t))_common.getGoogleMapCookie();else{var i=t;fetch(GoogleEndPointUrl,{mode:"no-cors",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversion_partner_id:GooglePartnerId,rwg_token:i,merchant_changed:2})})}}else _common.getGoogleMapCookie()},_common.getGoogleMapCookie=function(){var e=_common.getAllCookies();if(!String.isNullOrUndefineOrBlank(e)){var t=_common.getFirstPropertyName(e);String.isNullOrUndefineOrBlank(t)||(BusinessId=t.split("_")[1]);var i=_common.GetGoogleToken(BusinessId);if(!String.isNullOrUndefineOrBlank(i)){var n=i;fetch(GoogleEndPointUrl,{mode:"no-cors",method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({conversion_partner_id:GooglePartnerId,rwg_token:n,merchant_changed:1})})}}},_common.getFirstPropertyName=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return t;return null},_common.getAllCookies=function(){var e=document.cookie.split(";"),t={},i=!1;return e.forEach(function(e){var n=e.split("="),o=n[0].trim();if(o.includes("GoogleMap_")){var a=decodeURIComponent(n[1]);return t[o]=a,i=!0,t}}),i?t:null},_common.closeServiceSelection=function(){e(".book-service-open").removeClass("book-service-open"),e(".book-service-open-common").removeClass("book-service-open-common"),e(".gc-transformnone").removeClass("gc-transformnone"),e("html, body").removeClass("moboverflow-hide"),setTimeout(function(){"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("html, body").hasClass("moboverflow-hide")&&e("html, body").removeClass("moboverflow-hide")},200),((iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&e("#dvBusinessLocationSearch").is(":visible")||e("#dvSearchServiceMain").is(":visible")||e("#mobilefilterChange").is(":visible")||e("#mobileServiceChange").is(":visible"))&&(e("#dvBusinessLocationSearch .vg-search-cancel-icon").hide(),e("#dvSearchServiceMain .vg-search-cancel-icon").hide(),e("#mobilefilterChange  .vg-search-cancel-icon").hide(),e("#mobileServiceChange .vg-search-cancel-icon").hide())},_common.findNested=function(e,t,i){if(e[t]===i)return e;for(var n=0,o=Object.keys(e).length;n<o;n++)if("object"==typeof e[n]){var a=this.findNested(e[n],t,i);if(a)return a}},_common.DisableComponent=function(t,i){"undefined"!=typeof vgCustomComponentDisableDivAdded&&"undefined"!=typeof vgCustomComponentDisableDivID&&(6!==t&&13!==t&&14!==t&&15!==t||0===e(i).parent().find("#"+vgCustomComponentDisableDivID).length&&(e(i).before(vgCustomComponentDisableDivAdded),e(i).parent().addClass("vgcustom-content-overlay")))},_common.LoadBookNowMenu=function(t,i,n){try{if(void 0!==n&&1==n){var o={};t==LoadMenuTypeEnum.booknow?(o.Action="Book Service",e("#services").focus()):(o.Action="Book Class",e("#classes").focus());var a=e("#busname").text(),s=0;null!=e("#hdnSiteBuilderBusinessID")&&null!=e("#hdnSiteBuilderBusinessID").val()&&(s=parseInt(e("#hdnSiteBuilderBusinessID").val())),o.Category="Book",o.PageName="Business Page",o.BusinessName=null!=a?a:"",o.BusinessID=null!=s?s:"",_vgLogEvent.LogData(o)}}catch(e){}if("undefined"!=typeof IsNewCustomWebsite&&1==IsNewCustomWebsite&&t==LoadMenuTypeEnum.services&&(t=LoadMenuTypeEnum.booknow),t==LoadMenuTypeEnum.booknow&&"undefined"!=typeof IsNewCustomWebsite&&0==IsNewCustomWebsite)_shopdetail.loadbyMenuClick("book-now"),i&&_common.AddState("book-now","book-now");else if(t==LoadMenuTypeEnum.services&&"undefined"!=typeof IsNewCustomWebsite&&0==IsNewCustomWebsite)_shopdetail.loadbyMenuClick("services"),i&&_common.AddState("services","services");else if(t==LoadMenuTypeEnum.classes&&"undefined"!=typeof IsNewCustomWebsite&&0==IsNewCustomWebsite)_shopdetail.loadbyMenuClick("classes"),i&&_common.AddState("classes","classes");else if("undefined"!=typeof IsNewCustomWebsite&&1==IsNewCustomWebsite&&(t==LoadMenuTypeEnum.booknow||t==LoadMenuTypeEnum.classes)){"undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()&&"undefined"!=typeof businessID&&null!=businessID&&(156973===parseInt(businessID)||383713===parseInt(businessID)||377983===parseInt(businessID)||430616===parseInt(businessID)||400713===parseInt(businessID))&&_siteBuilderDetail.templatePagesModal.forEach(function(e){e.isBooknowEnable=t==LoadMenuTypeEnum.booknow||e.isBooknowEnable,e.isClassesEnable=t==LoadMenuTypeEnum.classes||e.isClassesEnable}),_siteBuilderDetail.findNestedWithObj(_siteBuilderDetail.templatePagesModal,null,t);var r=_siteBuilderDetail.FindObj;_siteBuilderDetail.FindObj=null,void 0!==r&&null!=r&&(_shopdetail.loadbyMenuClick(GetSlugTabPageName(r.url_slug)),i&&_common.AddState(GetSlugTabPageName(r.url_slug),GetSlugTabPageName(r.url_slug)))}},_common.ApplySelect2ControlsNew=function(t,i){void 0!==i.placeholder&&""!=i||((i={}).dropdownCssClass="",i.isSearchRequire=!1,i.selectOnClick=!0,i.placeholder="",i.maxInputLen=100),void 0===i.maxInputLen&&(i.maxInputLen=100),t.select2("destroy"),t.off("selected"),t.off("select2-close"),t.select2({searchInputPlaceholder:void 0!==i.placeholder&&""!=i.placeholder?i.placeholder:"",combobox:i.isSearchRequire,collapasable:_common.VisibleControlLength("#mobile-check")>0&&i.collapasable,selectOnClick:!0,minimumInputLength:0,maximumInputLength:100,dropdownCssClass:i.dropdownCssClass,formContainer:"#page-wrapper",data:function(){if(void 0!==i.data){var n=e.extend(!0,[],i.data),o=e.extend(!0,[],i.data);return"GCPromo"==t.data("type")&&t.data("GCPromoList",o),{results:n}}return null},initSelection:function(e,t){},formatResult:function(e){return"GCPromo"==t.data("type")&&void 0!==e.promotext&&""!=e.promotext?markup='<div class="promodigittextrow"> <div class="w-inline-block">'+e.text+' <span class="promo-bold">('+(1==e.isCurrencySymbol?currencySymbol+e.promotext:e.promotext)+")</span></div></div>":markup=e.text,markup},matcher:function(i,n,o){for(var a=/\s\s+/g,s=/[^0-9a-zA-Z\" \"]+/gi,r=/[^0-9a-zA-Z\"\. \"]+/gi,l=i.replace(a," "),c=(l="GCPromo"==t.data("type")?l.toLowerCase().replace(r,""):l.toLowerCase().replace(s,"")).split(" "),d="",u=c.length,p=0,h=0;h<=c.length-1;h++){var m=n.replace(a," ");if(((m="GCPromo"==t.data("type")?m.toLowerCase().replace(r,""):m.toLowerCase().replace(s,"")).match("^"+c[h])||-1!=m.indexOf(" "+c[h]))&&((""==d||c[h].indexOf(d)<0)&&(p+=1),d=" "+m,p>=u))break}return p>=u&&("#txtGCPromoAmount"==t.selector&&e("#select2-drop").show(),o.isShow=!0,!0)},formatNoMatches:function(){if("#txtGCPromoAmount"!=t.selector)return e(".select2-results .select2-no-results").remove(),"No matches found";e("#select2-drop").hide()}}).on("selected",function(i){_common.closeServiceSelection(),"GCPromo"==t.data("type")&&(e(i.target).data("selecteddetail",JSON.stringify(i.choice)),void 0!==t.data("choice")&&_common.SetChoiceForSeleect2(t,i.choice))}).on("select2-opening",function(i){t.select2("data",{id:"",text:""}),"txtGCPromoAmount"==i.currentTarget.id&&e("#"+i.currentTarget.id).data("selecteddetail","")}).on("select2-open",function(n){var o=_common.GetChoiceForSeleect2(t);void 0!==o.id&&"txtGCPromoAmount"!=n.currentTarget.id&&t.select2("data",{id:o.id,text:o.text}),(void 0===i.selectAllText||i.selectAllText)&&setTimeout(function(){e(n.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)},100),"GCPromo"==t.data("type")&&("GCPromo"==t.data("type")&&(e("#dvInnerGCContainer").length&&e("#dvInnerGCContainer").addClass("gc-transformnone"),e(n.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common")),e(n.target).closest(".service-book-what").addClass("book-service-open"),e("html, body").addClass("moboverflow-hide"),e("#select2-drop-mask").addClass("hidemask"),(void 0===i.scrollTop||i.scrollTop)&&e("html, body").animate({scrollTop:0}),(void 0===i.selectAllText||i.selectAllText)&&setTimeout(function(){e(n.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)},100))}).on("change",function(e){}).on("select2-close",function(i){if(_common.closeServiceSelection(),e("#select2-drop-mask").removeClass("hidemask"),setTimeout(function(){e("#select2-drop-mask").off("touchstart.custom")},500),void 0!==t.data("choice")){var n=t.data("select2").getVal().toString(),o=_common.GetChoiceForSeleect2(t);""!=n&&"Select Any Provider"!=n&&"Select Any Instructor"!=n&&"Select Any Class"!=n&&void 0!==o.id?"GCPromo"==t.data("type")?(e(".txtAmounterrortext").hide(),e("#txtGCPromoAmount").removeClass("errorInput"),n==o.text?(t.select2("data",{id:o.id,text:o.text+" ("+o.promotext+")"}),"txtGCPromoAmount"==i.currentTarget.id&&e("#div_amount").html("$"+o.Price.toFixed(2).replace(".00",""))):_common.BindGCpromoPrice(t,n)):t.select2("data",{id:o.id,text:o.text}):("GCPromo"==t.data("type")?_common.BindGCpromoPrice(t,n):t.select2("data",{id:"",text:""}),_common.SetDefaultForSeleect2(t))}(iPadAndroid||isWindowsPhone)&&(1==("undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase())?document.activeElement.blur():e("#ancSearchbook:visible").focus())}),"GCPromo"==t.data("type")&&t.on("select2-focus",function(n){setTimeout(function(){"GCPromo"==t.data("type")&&(e("#dvInnerGCContainer").length&&e("#dvInnerGCContainer").addClass("gc-transformnone"),e(n.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common")),e(n.target).closest(".service-book-what").addClass("book-service-open"),e("#select2-drop-mask").addClass("hidemask"),e("html, body").addClass("moboverflow-hide"),(void 0===i.scrollTop||i.scrollTop)&&e("html, body").animate({scrollTop:0})},200)}),applyJqueryScroll(".select2-results")},_common.BindGCpromoPrice=function(t,i){var n=t.data("GCPromoList"),o=e.grep(n,function(e){return parseFloat(i)==parseFloat(e.Price)});o.length>0?(i=o[0].Price,t.select2("data",{id:o[0].id,text:o[0].text+" ("+o[0].promotext+")"}),e("#div_amount").html("$"+i.toFixed(2).replace(".00",""))):1==e.isNumeric(i)&&parseFloat(i)>0?parseFloat(i)>999999?(t.select2("data",{id:"",text:""}),e("#div_amount").html("")):(i.indexOf(".")>0&&(i=parseFloat(i).toFixed(2)),e("#div_amount").html("$"+i.replace(".00","")),t.select2("data",{id:i,text:i})):(t.select2("data",{id:"",text:""}),e("#div_amount").html(""))}}(jQuery,window,document),function(e){_home={},_home.strBusinessTypes={featured:"featured",newest:"newest",bestrank:"best rank",kids:"kids"},_home.countriesLocation={us:"1",gb:"2",ca:"3",au:"4"},_home.HomePageBannerType={Beauty:1,Fitness:4,Wellness:2},"undefined"!=typeof Pagination&&(_home.FaturedPager=new Pagination(e("#featuredslider"),{Token:"GetHomePageBusinessDetail",Data:{},LocalData:{},PageSize:12,SlideWidthCeil:!0,NoDataFoundDiv:e("#divNoRecordsFeatured"),templateName:"divFeaturedBusinessHomeTemplate",Loader:e("#divFeatureLoader"),initialpageData:initialpageData,pageName:"home",lazyLoadClass:"lazypager",ScrollTarget:e("#featuredslider")}).init(),_home.PromotionsPager=new Pagination(e("#promotionsList"),{Token:"GetFeaturedPromotionListByProximityNew",Data:{},PageSize:12,LocalData:{},SlideWidthCeil:!0,NoDataFoundDiv:e("#divNoRecordsPromotions"),templateName:"divFeaturedPromotionHomeTemplate",Loader:e("#divPromotionLoader"),initialpageData:homeinitialpageData,pageName:"home",lazyLoadClass:"lazypager",ScrollTarget:e("#promotionsList")}).init(),_home.BookmarkPager=new Pagination(e("#divBookmarks"),{Token:"GetFavoriteBusinesses",Data:{},LocalData:{},PageSize:1e3,SlideWidthCeil:!0,NoDataFoundDiv:e("#divNoRecordsBookmarks"),templateName:"divBookmarksTemplate",Loader:e("#divBookmarksLoader"),initialpageData:initialpageData,pageName:"homeBookmark",lazyLoadClass:"lazypager",ScrollTarget:e("#divBookmarks")}).init()),_home.loadData=function(e,t){var i=e;if(i.init(),i.options.ActivateLoading=!0,i.options.Data.intCountryID=countryid,i.options.Data.strlatitude=lattitude,i.options.Data.strlongitude=longitude,i.options.Data.strTabName=t,i.options.Data.strBusinessTypes=businesstypes,i.options.Data.isCrwaler=!1,i.options.onRowLoad=_home.onFeaturedRowLoad,"divFeaturedBusinessHomeTemplate"==e.config.templateName){var n=getCookie(ProximityCookieName),o=getCookie(ProximityIsCurrentLocation);i.options.Data.cityName=n.city,i.options.Data.stateCode=n.state,i.options.Data.isFromMobile=!1,(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&(i.options.Data.isFromMobile=!0),i.options.Data.isCurrentLocation=void 0!==o&&null!=o&&"true"==o.toString().toLowerCase(),i.options.afterLoad=_home.onFeaturedafterLoad,i.options.Data.strBusinessTypes=""}i.scroll()},_home.loadPromotions=function(t,i,n){var o=0;1==i?(t.$elem=e("#servicePromotion"),t.options.templateName="servicePromoTemplate",t.init()):t==_featured.PromotionsPager?(t.options.templateClass="promotion-container",""!==lattitude&&""!==longitude?e("#liNearest,#liEndingSoon").css("display",""):e("#liEndingSoon").css("display",""),o=getSortingValue()):(t.$elem=e("#promotionsList"),t.options.templateName="divFeaturedPromotionHomeTemplate",t.options.templateClass=null,t.init(),""!==lattitude&&""!==longitude&&(o=5)),t.options.ActivateLoading=!0,t.options.Data.intCountryID=countryid,t.options.Data.dLatitude=lattitude,t.options.Data.dLongitude=longitude,t.options.Data.intRadius=distanceRadius,t.options.Data.intSortingValue=o,t.options.Data.strBusinessFacilityValues=null==businesstypeids?"":businesstypeids,t.options.Data.intPromotionCodeID=lBusinessPromoCodeID,t.options.Data.dtFromDate=null,t.options.Data.dtToDate=null,t.options.Data.blIsRandom=n,t.options.onRowLoad=_home.onPromotionsRowLoad;var a="";0==i&&1==n&&t==_home.PromotionsPager?(t.options.Data.isHomePage=!0,t.options.afterLoad=_home.afterHomePromotionRowLoad,t.options.Data.strBusinessFacilityValues="",t.options.Data.sFacilities="[]",t.options.Data.sKidsCondition="",t.options.Data.SearchFilter=2,a="0"):(t.options.Data.isHomePage=!1,t.options.afterLoad=_home.afterPromotionRowLoad,t.options.Data.sFacilities=JSON.stringify(_featured.GetFacilityObject()),t.options.Data.sKidsCondition=kidsFacilities,t.options.Data.SearchFilter=businessSearchMode,a=businessSearchModeForSelection.join()),0==dealserviceId?t.options.Data.ServiceID=null:t.options.Data.ServiceID=dealserviceId;var s=getCookie(ProximityCookieName),r=getCookie(ProximityIsCurrentLocation);t.options.Data.cityName=s.city,t.options.Data.stateCode=s.state,t.options.Data.isFromMobile=!1,(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&(t.options.Data.isFromMobile=!0),t.options.Data.isCurrentLocation=void 0!==r&&null!=r&&"true"==r.toString().toLowerCase(),t.options.Data.ignoreBusinessIds="",t.options.Data.BusinessTypes=null==businesstypes?"":businesstypes,t.options.Data.ArrSearchFilter=a,t.scroll(),t.enableScroll()},_home.onFeaturedRowLoad=function(t,i){var n=e(i),o=t.IsNewBusiness&&(null==t.TotalReview||0==t.TotalReview);o||e("input.addrating",n).prop("value",t.intRating-1).rating();var a=e("#dvFeatureReviews",n);if(o)e(".vagaro-star-rating",n).attr("style","display: none !important"),a.attr("aria-label","New Business").addClass("badgeNewWrap").html("<span class='badge-button-blue'>New</span>");else if(null!=t.TotalReview){var s=parseFloat(t.intRating),r=isNaN(s)?"0.0":s.toFixed(1),l=1==t.TotalReview?"Review":"Reviews";a.text(r+" ("+t.TotalReview+" "+l+")")}if(e("#home_featurebusinesslink_"+t.BusinessID).attr("onclick","javascript:window.location.href='/"+t.VagaroURL+"'"),e("#homefeaturedBusinssName_"+t.BusinessID).attr("onclick","javascript:window.location.href='/"+t.VagaroURL+"'"),t.blnPromotions){var c={};c.BusinessID=t.BusinessID,c.BusinessName=t.BusinessName,c.Street=null!==t.Street?t.Street:"",c.City=t.City,c.Zip=t.Zip,c.StateName=t.StateName,c.VagaroURL=t.VagaroURL,c.TotalPage=t.TotalPage,c.Telephone=t.Telephone,e("#promotion_"+t.BusinessID).attr("style",""),e("#promotion_"+t.BusinessID).attr("onclick","javascript:window.location.href='/"+t.VagaroURL+"/deals/"+t.PromotionTitle+"-"+t.PromotionCreatedDate+"'")}else e("#promotion_"+t.BusinessID).attr("style","display:none");if("featured"==t.CalledtabName){if(e("#homefeaturedBusinssName",n).text(_common.getShortNameForDesign(t.BusinessName,40,37)),!o&&t.intRating>0){var d=100*t.intRating/5;e("#divPopularBusRating_"+t.BusinessID,n).css("width",d+"%")}e(".ad-text",n).hide()}else e(".businesses-thumb h2",n).text(_common.getShortNameForDesign(t.BusinessName,15,12));return n},_home.onFeaturedafterLoad=function(t){_common.FeaturedBusinessTooltip(),null==t||0==t.length?e("#scFeatureBusiness").attr("style","display:none;"):e("#scFeatureBusiness").attr("style","display:block;"),null==t||t.length<4?(e("#btnPopularNext").hide(),e("#btnPopularPre").hide(),e("#aSeeAllPopularBusiness").addClass("no-arrow-slide"),e("#featuredslider").removeAttr("ondragend")):(e("#btnPopularNext").show(),e("#btnPopularNext").removeClass("slide-disabled"),e("#btnPopularNext").removeAttr("disabled"),e("#btnPopularPre").show(),e("#btnPopularPre").addClass("slide-disabled"),e("#btnPopularPre").attr("disabled",!0),e("#aSeeAllPopularBusiness").removeClass("no-arrow-slide"),e("#featuredslider").attr("ondragend","javascript: dragOnSlider(event, 'featuredslider', 'btnPopularPre', 'btnPopularNext');")),_common.AddEndSpaceInSlider("#featuredslider")},_home.featuredLoadmoreClick=function(t,i){if(isDealFilterApplied=!1,_home.HideHomeSliderMoreBusinessTypePopup(),e(".tips-mobile-section-fade").hide(),e(".tips-mobile-section").animate({bottom:"-100%"},200),null!=t){ResetBusinessSearchMode(),resetAllCheckBox(),businesstypes=bussinessTypesByCategoryname[t],businesstypeids=bussinessTypeIdsByCategoryname[t],h1=h1ByCategoryname[t],title=titleByCategoryname[t],category=categoryByCategoryname[t],pserviceid="";var n=getCookie(ProximityCookieName);null!=n&&(1==isAdvanceSearch&&localStorage.setItem("businesstypes",businesstypes),n.businesstypes=businesstypes,n.h1=h1,n.title=title,n.category=category,setCookie(ProximityCookieName,n)),generateCheckboxList(businesstypes,"chkbusiness"),_common.loadSections("listings")&&i.preventDefault()}},_home.GetfeaturedBeautyLink=function(e,t){return null!=e?(businesstypes=bussinessTypesByCategoryname[e],businesstypeids=bussinessTypeIdsByCategoryname[e],_common.Getbeautylink("listings")):(businesstypes="",businesstypeids="",_common.Getbeautylink("listings"))},_home.onPromotionsRowLoad=function(t,i){var n=e(i);0==n.index()&&"deals"==tabSegment&&e("#ulFeatureBusiness").addClass("daily home-page-section");if(e(".ad-text",n).hide(),e("#promotionTitle",n).html(""+_common.getShortNameForDesign(t.PromotionTitle,67,64)),e("#promoBusinessName",n).text(_common.getShortNameForDesign(t.BusinessName,34,31)),e("#promoCity",n).text(_common.getShortNameForDesign(t.City,26,23)+t.StateCode),t.IsNewBusiness)e("#spnRatingStar",n).hide(),e("#reviewTotal",n).html("<span class='badge-button-blue'>New</span>"),e("#reviewTotal",n).attr("aria-label","New Business");else if(0==(a=parseFloat(t.AverageRank)||0))e("#divAverageRank",n).hide();else{e("#divAverageRank",n).show();var o=1==t.ReviewTotal?"Review":"Reviews";e("#divAverageRank",n).attr("title",a.toFixed(1)),e("#reviewTotal",n).text(a.toFixed(1)),e("#reviewTotal",n).attr("aria-label","Has "+a.toFixed(1)+" star rating with total "+t.ReviewTotal+" "+o)}var a,s=parseInt(e("#spnTotalRecords").html());if(null!=t.TotalPage&&t.TotalPage!=s&&e("#spnTotalRecords").html(t.TotalPage),null!==t.ServiceOldPrice&&(e(".spnCurrencySymbol",n).html(currencysymbol),null!==t.PromotionDiscount&&0==t.PromotionDiscount&&(e("#spnDiscount",n).html(PrmotionfreeCode),e("#spnDiscount",n).attr("aria-label","Promotion Discount "+PrmotionfreeCode))),null!=t.Telephone&&""!=t.Telephone&&e("#ddhdnPhone_"+t.BusinessID).val(t.Telephone),t.DealDiscountAmtType>0&&null!==t.PromotionDiscount?1==t.DealDiscountAmtType?(e("#spnDiscount",n).html("UP TO "+currencysymbol+t.PromotionDiscount+" OFF"),e("#spnDiscount",n).attr("aria-label","Promotion Discount UP TO "+currencysymbol+t.PromotionDiscount+" OFF"),e("#spnOldPrice",n).css("display","none")):2==t.DealDiscountAmtType?(e("#spnDiscount",n).text("UP TO "+t.PromotionDiscount+"% OFF"),e("#spnDiscount",n).attr("aria-label","Promotion Discount UP TO "+t.PromotionDiscount+"% OFF"),e("#spnOldPrice",n).css("display","none")):3==t.DealDiscountAmtType&&(e("#spnDiscount",n).html(currencysymbol+t.PromotionDiscount+" OFF"),e("#spnDiscount",n).attr("aria-label","Promotion Discount "+currencysymbol+t.PromotionDiscount+" OFF"),e("#spnOldPrice",n).css("display","none")):null===t.ServiceOldPrice&&null!==t.PromotionDiscount?100==parseInt(t.PromotionDiscount)?(e("#spnDiscount",n).html(PrmotionfreeCode),e("#spnDiscount",n).attr("atia-label","Promotion Discount "+PrmotionfreeCode)):(e("#spnDiscount",n).append("% OFF"),e("#spnOldPrice",n).css("display","none")):t.PromotionDiscount<0?(e("#spnDiscount",n).html(PrmotionfreeCode),e("#spnDiscount",n).attr("aria-label","Promotion Discount "+PrmotionfreeCode)):e("#spnOldPrice",n).css("display","inline-block"),t.TotalUsage>0&&t.UsageLeft<6&&t.UsageLeft>0?e("#spnusageLeft",n).text(t.UsageLeft+" LEFT"):e("#UsageLeft",n).css("display","none"),t.IsNewBusiness)e("#spnRatingStar",n).hide(),e("#reviewTotal",n).html("<span class='badge-button-blue'>New</span>"),e("#reviewTotal",n).attr("aria-label","New Business");else if(0==(a=parseFloat(t.AverageRank)||0))e("#divAverageRank",n).hide();else{e("#divAverageRank",n).show();o=1==t.ReviewTotal?"Review":"Reviews";e("#divAverageRank",n).attr("title",a.toFixed(1)),e("#reviewTotal",n).text(a.toFixed(1)),e("#reviewTotal",n).attr("aria-label","Has "+a.toFixed(1)+" star rating with total "+t.ReviewTotal+" "+o)}return n},_home.loadHomePageData=function(){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){var t=getCookie(ProximityCookieName);e("#spnAppLocationSearch").html(_common.SetCityState(t.city,t.state.toUpperCase())),CallbackforMobileApp(0,0,"","",0,28)}if(null!=UserID&&""!=UserID&&(e("#divBookmarks").empty(),_home.loadFavoriteBusinesses(),_home.loadUpComingAppointments(),_home.GetOutStandingReviewAndInvoiceCnt()),e("#dvFeatureBusiness").hide(),e("#dvHome").attr("style","display:block;"),_home.loadHeroList(),_home.loadStaticContent(),_home.ShowUKHomePageUKJoinVagaroSection(),_home.ShowUKHomePageUKCookiesSection(),null==AdminServiceList.results||0==AdminServiceList.results.length)"undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()?AdminServiceList.results=[]:InitAdminServices();else{var i=service;void 0!==htmlDecode&&(i=htmlDecode(service));var n=e(IdSearchServiceMain);"undefined"!=typeof _eventType&&null!=typeof _eventType||(_eventType=""),n.select2("data",{id:i,text:i,EventType:_eventType});var o={id:i,text:i,EventType:_eventType};void 0!==n.data("choice")&&_common.SetChoiceForSeleect2(n,o)}setDateTimeforServiceNew("divHomeServicesDate"),_home.loadData(_home.FaturedPager,_home.strBusinessTypes.featured),_home.PromotionsPager.init(),_home.loadPromotions(_home.PromotionsPager,!1,1),lazyLoadWithContainer("lazycategory","popular_category"),e(".square-slide-div:nth-child(3) .lazycategory","#popular_category").length&&e(".square-slide-div:nth-child(3) .lazycategory","#popular_category").lazyload({effect:"fadeIn"}),e(IdHomeServicesDate).val(AnyTime),setTimeout(function(){e(IdHomeServicesDate).val(AnyTime)},100),e("#txtHomeServicesDate").val(AnyTime),setTimeout(function(){e("#txtHomeServicesDate").val(AnyTime)},100),_home.RegisterHomePageSilder(),"undefined"==typeof isDisplayGiftCardbanner||null===isDisplayGiftCardbanner||"True"!=isDisplayGiftCardbanner&&1!=isDisplayGiftCardbanner||("undefined"!=typeof vgAppicationType&&vgAppicationType===objApplicationType.CustomerApp&&(e("body").addClass("homePageBody"),e("#holidayGcBanner").show()),!e("#holidayGcBanner").is(":visible")||"True"!=isDisplayUkBanner&&1!=isDisplayUkBanner||e("body").addClass("homepageUKBanner"))},_home.RegisterHomePageSilder=function(){_home.HomePageSlider("promotionsList",".card-link-block"),_home.HomePageSlider("featuredslider",".card-link-block"),_home.HomePageSlider("divBookmarks",".card-link-block"),_home.HomePageSlider("dvLiveStream",".livestreambox"),_home.HomePageSlider("divUpcomingApptMnts",".ucservice-box")},_home.HomePageSlider=function(t,i){window.innerWidth<=660?e("#"+t).hasClass("vbScroll-initialized")||e("#"+t).scroll(function(){e(this).addClass("vbScroll-initialized"),clearTimeout(e.data(this,"scrollCheck")),e.data(this,"scrollCheck",setTimeout(function(){var n=e("#"+t).scrollLeft(),o=e("#"+t+" > "+i).first().outerWidth(),a=o*Math.round(n/o);n!=a&&e("#"+t).animate({scrollLeft:a},200)},400))}):e("#"+t).hasClass("vbScroll-initialized")&&(e("#"+t).off("scroll"),e("#"+t).removeClass("vbScroll-initialized"))},_home.loadStaticContent=function(){e(".slick-fourblockslider .lazy-bgimg").length>0&&e(".slick-fourblockslider .lazy-bgimg").lazyload({event:"lazyload",effect:"fadeIn"}).trigger("lazyload")},_home.openCategoryDB=function(){return new Promise(function(e,t){var i=indexedDB.open(CATEGORY_DB_NAME,1);i.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains(Category_STORE)||t.createObjectStore(Category_STORE,{keyPath:"key"})},i.onsuccess=function(t){e(t.target.result)},i.onerror=function(e){t(e)}})},_home.getCategoryCache=async function(){try{var e=await _home.openCategoryDB();return new Promise(function(t){let i;try{i=e.transaction(Category_STORE,"readonly")}catch(e){try{return indexedDB.deleteDatabase(CATEGORY_DB_NAME),void t(null)}catch(e){return void t(null)}}var n=i.objectStore(Category_STORE).get("adminCategory");n.onsuccess=function(){var e=n.result;if(e){if(Date.now()-e.timestamp>TTL_TIME)return indexedDB.deleteDatabase(CATEGORY_DB_NAME),void t(null);t(e.data)}else t(null)},n.onerror=function(){t(null)}})}catch(e){return null}},_home.setCategoryCache=async function(e){try{var t=await _home.openCategoryDB();return new Promise(function(i,n){var o=t.transaction(Category_STORE,"readwrite").objectStore(Category_STORE).put({key:"adminCategory",data:e,timestamp:Date.now()});o.onsuccess=function(){i(!0)},o.onerror=function(){n(!1)}})}catch(e){return console.log(e),!1}},_home.GetMasterCategoryValues=async function(e){try{let t=null;if(_home.IsIndexedDBSupported&&_home.IsIndexedDBSupported()&&(t=await _home.getCategoryCache(),t&&t.length>0))return void _home.bindCategoryUI(t,e);let i=await new Promise(function(e,t){var i=new vagaro.ajax;i.datamodel.Token="GetMasterCategoryValues",i.datamodel.data={},i.datamodel.callback=function(t){e(t)},i.datamodel.Error=function(e){t(e)},i.Post()});i&&i.length>0?(t=i,_home.IsIndexedDBSupported&&_home.IsIndexedDBSupported()&&await _home.setCategoryCache(i),_home.bindCategoryUI(t,e)):vagaro.alert("Something went wrong, Try Again.")}catch(e){console.log("Error:",e)}},_home.bindCategoryUI=function(t,n){e("#divCategoryPopup").html("");for(var o=0;o<t.length;o++){var a=e.grep(n,function(e){return e.SliderType==t[o].MasterServiceCategoryId});if(!String.isNullOrUndefineOrBlank(a)&&a.length>0){$divMain=e('<div class="main-section-tips"><div class="web-display-small">'+t[o].MasterServiceCategoryName+'</div><div id="divseo_'+o+'" class="body-inner-section"></div></div>'),$divMain.appendTo(e("#divCategoryPopup"));var s=_home.BindHeroSliderycitystate();for(i=0;i<a.length;i++)a[i].cookieCityState=s;e("#homesliderImageMobile").tmpl(a).appendTo("#divseo_"+o)}}},_home.loadHeroList=function(){try{var t=HSnames;if(void 0!==t&&null!=t&&""!=t&&""!=t&&t.length>0){for(var i=0;i<t.length;i++)bussinessTypesByCategoryname[t[i].HeroCategoryName.toLowerCase()]=t[i].HSBusinessType,bussinessTypeIdsByCategoryname[t[i].HeroCategoryName.toLowerCase()]=t[i].HSBusinessTypeId,h1ByCategoryname[t[i].HeroCategoryName.toLowerCase()]=t[i].H1,titleByCategoryname[t[i].HeroCategoryName.toLowerCase()]=t[i].Title,categoryByCategoryname[t[i].HeroCategoryName.toLowerCase()]=t[i].HeroCategoryName;var n=iPadAndroid?"touchstart":"click";e("#aSeeAllBeautyHomeCategory").unbind(n),e("#aSeeAllBeautyHomeCategory").bind(n,function(e){ResetBusinessSearchMode(),resetAllCheckBox(),setdefaultSortingOption("listSort","listings"),_common.loadSections("listings")&&e.preventDefault()}),e("#aSeeAllFitnessHomeCategory").unbind(n),e("#aSeeAllFitnessHomeCategory").bind(n,function(e){ResetBusinessSearchMode(),resetAllCheckBox(),setdefaultSortingOption("listSort","listings"),_common.loadSections("listings")&&e.preventDefault()}),e("#popular-beauty-cat-row").html(""),e("#popular-beauty-cat-row1").html("");var o=e.grep(t,function(e,t){return 1==e.ShowChipOnSlider}),a=!1;try{a=/Macintosh/i.test(navigator.userAgent)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1}catch(e){}o.length>9&&(o=iosDevices||iPadAndroid||isAndroidMobile||isAndroidMobile||a?o.slice(0,6):o.slice(0,9));var s=_home.BindHeroSliderycitystate();for(i=0;i<o.length;i++)o[i].cookieCityState=s;e("#homesliderImageMobile").tmpl(o).appendTo("#popular-beauty-cat-row"),e("#popular-beauty-cat-row").append('<a href="javascript:void(0);" onclick="_home.ShowHomeSliderMoreBusinessTypePopup();" class="filter-button">More...</a>'),e("#homesliderImageMobile").tmpl(o).appendTo("#popular-beauty-cat-row1"),e("#popular-beauty-cat-row1").append('<a href="javascript:void(0);" onclick="_home.ShowHomeSliderMoreBusinessTypePopup();" class="filter-button">More...</a>');var r=e.grep(t,function(e,t){return null!=e.PopularCategoryImage&&""!=e.PopularCategoryImage});r=r.sort(function(e,t){return e.ImageOrder-t.ImageOrder}),e("#spnSliderServicename").text(r[0].BookYourNext),e.trim(e("#sliderHomePageHero").html()).length<=0&&(e("#homesliderImage").tmpl(r).appendTo("#sliderHomePageHero"),e("#sliderHomePageHero .overlay-hero-image:not(:first)").hide()),e("#spnSliderServicename1").text(r[0].BookYourNext),e.trim(e("#sliderHomePageHero1").html()).length<=0&&(e("#homesliderImage").tmpl(r).appendTo("#sliderHomePageHero1"),e("#sliderHomePageHero1 .overlay-hero-image:not(:first)").hide()),"undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()?e("#divCategoryPopup").html(""):_home.GetMasterCategoryValues(t);var l=e.grep(t,function(e,t){return 1==e.ShowChipOnSlider&&e.HSType==_home.HomePageBannerType.Beauty});l=l.sort(function(e,t){return e.ChipOrder-t.ChipOrder});s=_home.BindHeroSliderycitystate();for(i=0;i<l.length;i++)l[i].cookieCityState=s;e(".divHomePageBannerMobileBeautybody").html(""),e("#homesliderImageMobile").tmpl(l).appendTo(".divHomePageBannerMobileBeautybody");var c=e.grep(t,function(e,t){return 1==e.ShowChipOnSlider&&e.HSType==_home.HomePageBannerType.Fitness});c=c.sort(function(e,t){return e.ChipOrder-t.ChipOrder});s=_home.BindHeroSliderycitystate();for(i=0;i<c.length;i++)c[i].cookieCityState=s;e(".divHomePageBannerMobileFitnessbody").html(""),e("#homesliderImageMobile").tmpl(c).appendTo(".divHomePageBannerMobileFitnessbody");var d=e.grep(t,function(e,t){return 1==e.ShowChipOnSlider&&e.HSType==_home.HomePageBannerType.Wellness});d=d.sort(function(e,t){return e.ChipOrder-t.ChipOrder});s=_home.BindHeroSliderycitystate();for(i=0;i<d.length;i++)d[i].cookieCityState=s;e(".divHomePageBannerMobileWellnessbody").html(""),e("#homesliderImageMobile").tmpl(d).appendTo(".divHomePageBannerMobileWellnessbody")}_common.UpdateTimeZoneLocationCookie(!1)}catch(e){}},_home.BindHeroSliderycitystate=function(){void 0===_home.BindHeroSliderycitystate.hasLoadedCities&&(_home.BindHeroSliderycitystate.hasLoadedCities=!1);var e=getCookie(ProximityCookieName);null!=e&&void 0!==e&&(_home.BindHeroSliderycitystate.hasLoadedCities||(LoadCitiesAndServices(e.countryid),_home.BindHeroSliderycitystate.hasLoadedCities=!0));var t="",i="",n="";return null!=e&&void 0!==e&&(null!=e.city&&void 0!==e.city&&""!=e.city&&(t=e.city.toLowerCase().replace(" ","-").trim()+"--",i=e.city.toLowerCase().trim().replace(/\s+/g,"-")),null!=e.state&&void 0!==e.state&&""!=e.state&&(n=2==e.countryid?e.stateName.toLowerCase().replace(" ","-").trim():e.state.toLowerCase().trim()),null!=e.countryid&&void 0!==e.countryid&&""!=e.countryid&&(cookieCountryid=e.countryid)),t=RemoveAccents(GetPlainTextForLocationSearch(t)),i=RemoveAccents(GetPlainTextForLocationSearch(i)),t+n},_home.BindDataWithTemplate=function(t){e("#divUpcomingApptMnts").html(""),e("#divUpcomingApptTemplate").tmpl(t).appendTo("#divUpcomingApptMnts"),e(".upcoming-business-img").lazyload({effect:"fadeIn",failure_limit:5e4,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:""}).trigger("lazyload")},_home.loadUpComingAppointments=function(){try{e("#scUpcomingApptMnts").show(),e("#divUpcomingApptMnts").unslick(),clearInterval(timerIDHomeUpcomingAppnt);var t=null!=UserID&&""!=UserID?parseInt(UserID):0;_home.GetSetIndexedDBForUpComingAppmntDetails(null,t),setTimeout(function(){null!=_home.upcomingAppCache&&_home.upcomingAppCache.length>0&&0==_home.IsRefresh(_home.upcomingAppCache[0].lastSyncTime)?(_home.afterUpcomingApptMntsRowLoad(_home.upcomingAppCache),_home.upcomingAppCache=null):(_home.RemoveDBObject(),setTimeout(function(){var e={pageIndex:1,pageSize:24};e.strLoginUserId=encUid;var t=new vagaro.ajax;t.datamodel.Token=ApiURLEnumOnlineCommon.getupcomingappintmentdata,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.data=e,t.datamodel.callback=function(e){_home.afterUpcomingApptMntsRowLoad(e)},t.datamodel.Error=function(e){_home.ResetUpcomingAppObjDivhide()},t.Post()},250))},500)}catch(e){_home.ResetUpcomingAppObjDivhide()}},_home.redirectToUpComingMyAccount=function(e,t,i,n){"undefined"!=typeof vgAppicationType&&1==vgAppicationType?CallbackforMobileApp(0,0,"","","0","39|~|"+('{\\"appointmentID\\":\\"'+e+'\\",\\"BusinessID\\":\\"'+t+'\\",\\"Group\\":\\"'+i+'\\",\\"EventType\\":\\"'+n+'\\"}')):window.location.href="/myaccount/appointments?isFromHomePage="+e+i;return!1},_home.afterUpcomingApptMntsRowLoad=function(t){if(null==t||0==t.length)_home.ResetUpcomingAppObjDivhide();else{var i;e("#dvUpcomingAppointmentStensil").hide(),e("#scUpcomingApptMnts").show();null!=t&&t.length>0&&null!=t[0].CurrentDateUTC&&(i=new Date(t[0].StrCurrentDateUTC),_gblUCAppmntCurrentTimeDiff=new Date(t[0].StrCurrentDateUTC)-new Date,HomePageUpcomingApptData=e.grep(t,function(e){return!(getDateDiff(i,e.StrEndTimeUTC,!0)<=-1)}),null!=HomePageUpcomingApptData&&HomePageUpcomingApptData.length>0?(_home.BindDataWithTemplate(HomePageUpcomingApptData),_home.GetSetIndexedDBForUpComingAppmntDetails(HomePageUpcomingApptData,null!=UserID&&""!=UserID?parseInt(UserID):0),timerIDHomeUpcomingAppnt=setInterval(function(){_home.RefreshUpcomingAppmntData(UpComingLiveStreamFromType.Home)},3e4)):_home.ResetUpcomingAppObjDivhide())}if(_home.setSlickerUpcomingApptMnts(),"undefined"!=typeof vgAppicationType&&1==vgAppicationType){for(var n=[],o=0;o<t.length;o++){var a=new Object;a.appointmentID=t[o].AppointmentID,a.businessID=t[o].BusinessID,a.sGroup=t[o].sGroup,a.eventType=t[o].EventType,n.push(a)}CallbackforMobileApp(0,0,"","","0","48|~|"+JSON.stringify(n))}},_home.setSlickerUpcomingApptMnts=function(){upcomingSlider(),e(window).width()<=767&&e("#divUpcomingApptMnts").unslick()},_home.RemoveDBObject=function(){try{if(_home.IsIndexedDBSupported()){var e=_home.GetIndexedDB();null!=e?e.deleteDatabase("UpAppDB"):console.log("could not connect index db.")}}catch(e){console.log("Error:"+e)}},_home.RefreshUpcomingAppmntData=function(t){if(t==UpComingLiveStreamFromType.Home)if("undefined"==typeof tabSegment||"/"!=tabSegment&&"home"!=tabSegment.toLowerCase())clearInterval(timerIDHomeUpcomingAppnt),"undefined"!=typeof HomePageUpcomingApptData&&null!=HomePageUpcomingApptData&&(HomePageUpcomingApptData=null);else if("undefined"!=typeof HomePageUpcomingApptData&&null!=HomePageUpcomingApptData&&HomePageUpcomingApptData.length>0){var i=0,n=HomePageUpcomingApptData.length,o=e.grep(HomePageUpcomingApptData,function(t){var n=getDateDiff(moment(new Date).add(_gblUCAppmntCurrentTimeDiff,"milliseconds")._d,t.StrEndTimeUTC,!0),o="#divUpcoming_"+t.AppointmentID;return!(e(o).length>0&&n<=-1)||(i++,e(o).hide(),!1)});i==HomePageUpcomingApptData.length&&(_home.ResetUpcomingAppObj(),clearInterval(timerIDHomeUpcomingAppnt)),o.length>0&&n>o.length&&(HomePageUpcomingApptData=o,_home.RemoveDBObject(),_home.GetSetIndexedDBForUpComingAppmntDetails(o,null!=UserID&&""!=UserID?parseInt(UserID):0))}},_home.IsRefresh=function(e){return 1*getDateDiff(moment(e)._d,new Date,!0)>5},_home.ChangeDate=function(e,t){var i=moment(new Date(e));return t?i.format("DD"):i.format("MMM")},_home.ResetUpcomingAppObj=function(){_home.RemoveDBObject(),_home.ResetUpcomingAppObjDivhide()},_home.ResetUpcomingAppObjDivhide=function(){e("#scUpcomingApptMnts").hide(),e("#dvUpcomingAppointmentStensil").hide()},_home.loadFavoriteBusinesses=function(){var e=_home.BookmarkPager;e.init(),e.options.ActivateLoading=!0,e.options.Data.lUserID=0,e.options.Data.countryID=null!=countryid&&""!=countryid?countryid:1,e.options.Data.latitude=null!=lattitude&&""!=lattitude?parseFloat(lattitude):0,e.options.Data.longitude=null!=longitude&&""!=longitude?parseFloat(longitude):0,e.options.Data.strUserID=isNullOrUndefineOrBlank(strUserID)?"":strUserID,e.options.onRowLoad=_common.onBookmarkRowLoad,e.options.afterLoad=_common.afterBookmarkRowLoad,e.scroll()},_home.afterPromotionRowLoad=function(t){if(e("#spnTotalRecords").show(),_common.FeaturedBusinessTooltip(),null==t){var i=[];e(".daily-deal-link").each(function(){var t=e(this).data(),n={};n.BusinessID=t.businessid,n.BusinessName=t.businessname,n.LATITUDE=t.latitude,n.LONGITUDE=t.longitude,n.PromotionID=t.promotionid,i.push(n)}),google.maps.event.trigger(map,"resize"),loadMarkers(i,"deals")}else 0==t.length&&(e("#spnTotalRecords").html("No"),e(".divSorting").hide(),setTimeout(function(){e("#divNodataFeature").attr("tabindex",-1).attr("role","banner").attr("aria-labelledby","myLikeNoDataMsg").focus(),e("myLikeNoDataMsg").attr("aria-hidden",!0)},600)),t.length>0&&(t.length>1||t[0].TotalPage>1?e(".divSorting").show():e(".divSorting").hide(),google.maps.event.trigger(map,"resize"),loadMarkers(t,"deals"));""!=_featured.PromotionsPager.options.Data.ignoreBusinessIds&&void 0!==_featured.PromotionsPager.options.Data.ignoreBusinessIds||setTimeout(function(){var t="";1==e("#ulFeatureBusiness").is(":visible")&&e("#ulFeatureBusiness:visible").find("section.cards-parent-div-flex .daily-deal-link").slice(0,6).each(function(){var i=e(this);void 0!==i.data("isfeatured")&&"true"==i.data("isfeatured").toString().toLowerCase()&&void 0!==e(this).data("businessid")&&(t+=e(this).data("businessid")+",")}),t=t.replace(/(^[,\s]+)|([,\s]+$)/g,""),_featured.PromotionsPager.options.Data.ignoreBusinessIds=t},500)},_home.afterHomePromotionRowLoad=function(t){_common.FeaturedBusinessTooltip(),null==t||0==t.length?e("#scDailyDeals").attr("style","display:none;"):e("#scDailyDeals").attr("style","display:block;"),e("#btnDealsNext").hide(),e("#btnDealsPre").hide(),e("#promotionsList").removeAttr("ondragend"),e("#aSeeAllDeals").addClass("no-arrow-slide"),null!=t&&t.length>0&&t[0].TotalPage>0?(t.length>=4&&(e("#btnDealsNext").show(),e("#btnDealsNext").removeClass("slide-disabled"),e("#btnDealsNext").removeAttr("disabled"),e("#btnDealsPre").show(),e("#btnDealsPre").addClass("slide-disabled"),e("#btnDealsPre").attr("disabled",!0),e("#aSeeAllDeals").removeClass("no-arrow-slide"),e("#promotionsList").attr("ondragend","javascript:dragOnSlider(event, 'promotionsList', 'btnDealsPre', 'btnDealsNext');")),e("#aSeeAllDeals").attr("style","display:block;"),_common.AddEndSpaceInSlider("#promotionsList")):e("#aSeeAllDeals").attr("style","display:none;")},_home.PromotionLoadmoreClick=function(){loadData("deals",!0),_common.setGeoLocationMarker("deals")},_home.myaccountpaymentmethods=function(e){setTimeout(function(){var t={},i=new vagaro.ajax;"undefined"==typeof strUserID||"undefined"==strUserID||null==strUserID||""==strUserID?(t.LoginUserID=e,i.datamodel.Token=ApiURLEnumOnlineCommon.getloginusergroups):(t.strLoginUserID=strUserID,i.datamodel.Token=ApiURLEnumOnlineCommon.getloginusergroup),i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=t,i.datamodel.callback=function(e){},i.datamodel.Error=function(e){},i.Post()},500)},_home.CommonLogin=function(t,i,n){if(1==t){if(injecthtml(),e(".lnkLogin").hide(),("undefined"!=typeof _siteBuilderDetail&&null!=_siteBuilderDetail.IsCustomWebsite&&1==_siteBuilderDetail.IsCustomWebsite||"undefined"!=typeof IsNewCustomWebsite&&1==IsNewCustomWebsite)&&e("#divUserName").removeClass("custom-theme-nav"),"undefined"!=typeof IsNewCustomWebsite&&1==IsNewCustomWebsite?e("#divUserName").html("Hi,"+i).removeClass("hide-notlogged"):e("#divUserName").html("Welcome, "+i).removeClass("hide-notlogged"),"undefined"!=typeof IsNewCustomWebsite&&1==IsNewCustomWebsite&&e("#dvShoppingCartIcon").is(":visible")?e("#divLoginDetail").hide():e("#divLoginDetail").removeAttr("style"),e("#divLoginDetailCart").removeAttr("style"),"undefined"!=typeof WebsiteBuilderType&&""!=WebsiteBuilderType?"Builder"==WebsiteBuilderType&&"MyAccount"==WebsiteBuilderEvent&&(""!=n?e(".profilesidePic").html("<div id='divUserPhoto' class='nav-profile-photo vagaro-avatar-sm opacity-1' role='link' tabindex='-1' aria-label='Navigation bar' data-original='"+n+"' style=\"display: block; background-image:url('"+n+"');\"><div class='avatar-inital intialsname vg-avatar-inital' aria-hidden='true' style='display: none;'><div class='avatar-inital-inner vg-avatar-inital-inner'><div class='avatar-inital-inner-text loginUserIntials vg-avatar-inital-inner-text'>"+i+"</div></div></div></div>"):e(".profilesidePic").html("<div class='profilesidePic'><div id='divUserPhoto' class='nav-profile-photo vagaro-avatar-sm opacity-1' role='link' tabindex='-1' aria-label='Navigation bar' data-original='' style='display: block; background-image: none;'><div class='avatar-inital intialsname vg-avatar-inital' aria-hidden='true' style='display: block;'><div class='avatar-inital-inner vg-avatar-inital-inner'><div class='avatar-inital-inner-text loginUserIntials vg-avatar-inital-inner-text'>"+i+"</div></div></div></div></div>")):(e("#divUserPhoto").attr("data-original",n),e("#divUserPhoto").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload"),e(".profilesidePic").html(e("#divUserPhoto").clone()).find("#divUserPhoto").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload")),e(".loginlink").show(),void 0!==e("#CheckinpUserName")&&"undefined"!=typeof vgAppicationType&&void 0!==objApplicationType&&vgAppicationType==objApplicationType.CheckinApp)if(""==e("#hdnUserName").val()){var o=new vagaro.ajax;o.datamodel.Token="GetFirstNameForCheckin",o.datamodel.callback=function(t){""!=t?e("#CheckinpUserName").html("Welcome, "+t):e("#CheckinpUserName").html("Welcome, "+i.slice(0,-2))},o.datamodel.Error=function(t){e("#CheckinpUserName").html("Welcome, "+i.slice(0,-2))},o.datamodel.data=[],o.Post()}else e("#CheckinpUserName").html("Welcome, "+e("#hdnUserName").val().slice(0,-2));"undefined"==strUserID||null==strUserID||""==strUserID?_home.myaccountpaymentmethods(UserID):_home.myaccountpaymentmethods(strUserID)}else e(".loginlink").hide(),e(".lnkLogin").show(),e("#divUserName").html("").addClass("hide-notlogged"),e("#divLoginDetail").hide(),e("#divLoginDetailCart").hide(),e("#dvlogindropdown").empty(),e("#mobile-menu").children("#dvlogindropdown").empty(),e("#divbusinesslogin").empty(),e("#desktop-menu").children("#divbusinesslogin").empty(),("undefined"!=typeof _siteBuilderDetail&&null!=_siteBuilderDetail.IsCustomWebsite&&1==_siteBuilderDetail.IsCustomWebsite||"undefined"!=typeof IsNewCustomWebsite&&1==IsNewCustomWebsite)&&e("#divUserName").addClass("custom-theme-nav")},_home.redirecttoStaff=function(t,i,n){if(iPadAndroid||isWindowsPhone){var o=e(n).closest(".gallery-solo-image");e(o).hasClass("hover")?(e(o).removeClass("hover"),location.href="../../../"+t+"/staff"):(i.stopPropagation(),i.preventDefault(),e(".gallery-solo-image").removeClass("hover"),e(o).addClass("hover"))}else location.href="../../../"+t+"/staff"},_home.galleryhover=function(t,i,n,o,a){if((iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&e("#divBookNowMasterPage").removeClass("mobile-book-div"),void 0!==a&&"true"==a&&(o="#"+e(i).closest(".panel-group").attr("id")+" "+o),iPadAndroid||isWindowsPhone){var s=e(i).closest(".cust-img-popup-slider");"false"==n.toLowerCase()&&_featured.openGalleryPopup(i),e(s).hasClass("hover")?(e(s).removeClass("hover"),_featured.openGalleryPopup(i)):(t.stopPropagation(),t.preventDefault(),e(".gallery-solo-image").removeClass("hover"),e(s).addClass("hover"))}else _featured.openGalleryPopup(i);void 0!==o&&""!=o&&""!=o||(o="#ulFeatureBusiness"),(styleCounter=e(".imgstyles",o).index(e(i,o)))==e(".imgstyles",o).length-1?(e("#btnStyleNext").addClass("w-lightbox-inactive"),e("#btnStylePrev").removeClass("w-lightbox-inactive")):0==styleCounter?(e("#btnStylePrev").addClass("w-lightbox-inactive"),e("#btnStyleNext").removeClass("w-lightbox-inactive")):(e("#btnStyleNext").removeClass("w-lightbox-inactive"),e("#btnStylePrev").removeClass("w-lightbox-inactive")),1==e(".imgstyles",o).length&&(e("#btnStyleNext").addClass("w-lightbox-inactive"),e("#btnStylePrev").addClass("w-lightbox-inactive")),e("#btnStyleNext").attr("data-parentdivid",o),e("#btnStylePrev").attr("data-parentdivid",o)},_home.NextStyle=function(t){t.stopPropagation(),t.preventDefault();var i=e("#btnStyleNext").attr("data-parentdivid"),n=e(".imgstyles",i)[styleCounter+1];null!=n?(_featured.openGalleryPopup(n,"N"),(styleCounter+=1)==e(".imgstyles",i).length-1?(e("#btnStyleNext").addClass("w-lightbox-inactive"),e("#btnStylePrev").removeClass("w-lightbox-inactive")):(e("#btnStyleNext").removeClass("w-lightbox-inactive"),e("#btnStylePrev").removeClass("w-lightbox-inactive"))):(e("#btnStyleNext").addClass("w-lightbox-inactive"),e("#btnStylePrev").removeClass("w-lightbox-inactive")),1==e(".imgstyles",i).length&&(e("#btnStyleNext").addClass("w-lightbox-inactive"),e("#btnStylePrev").addClass("w-lightbox-inactive"))},_home.PrevStyle=function(t){t.stopPropagation(),t.preventDefault();var i=e("#btnStylePrev").attr("data-parentdivid"),n=e(".imgstyles",i)[parseInt(styleCounter)-1];null!=n?(_featured.openGalleryPopup(n,"P"),0==(styleCounter-=1)?(e("#btnStylePrev").addClass("w-lightbox-inactive"),e("#btnStyleNext").removeClass("w-lightbox-inactive")):(e("#btnStylePrev").removeClass("w-lightbox-inactive"),e("#btnStyleNext").removeClass("w-lightbox-inactive"))):(e("#btnStylePrev").addClass("w-lightbox-inactive"),e("#btnStyleNext").removeClass("w-lightbox-inactive")),1==e(".imgstyles",i).length&&(e("#btnStyleNext").addClass("w-lightbox-inactive"),e("#btnStylePrev").addClass("w-lightbox-inactive"))},"undefined"!=typeof vgAppicationType&&1==vgAppicationType||("undefined"==typeof UserName||""===UserName?_home.CommonLogin(!1,"",""):(e(".loginUserIntials").html(FindInitials(FullUserName,"SP")),_home.CommonLogin(!0,UserName,e("#hdnUserImage").val()))),e(".hfeed-no-realy").click(function(){e(".home-feedbk-responsce").show(),e(".home-feedbk-enj ").hide()}),e(".hfeed-ys").click(function(){e(".home-feedbk-app").show(),e(".home-feedbk-enj ").hide()}),e(".hfeed-thank , .hfeed-okay").click(function(){e(".home-feedbk-enj ").show(),e(".home-feedbk-responsce").hide()}),e(".hfeed-no-thank ,.hfeed-sur").click(function(){e(".home-feedbk-enj").show(),e(".home-feedbk-app").hide()}),e(".vg-default-tabs .vg-default-tabs-links .vg-default-tab-link a").on("click",function(t){var i=e(this).attr("data-href");e(".vg-default-tab-content "+i).addClass("active").siblings().removeClass("active"),e(".vg-default-tab-content "+i).fadeIn().siblings().hide(),e(this).parent(".vg-default-tab-link").addClass("active").siblings().removeClass("active"),t.preventDefault()}),_home.upcomingAppCache={},_home.bubbleCountCache={},_home.GetSetIndexedDBForUpComingAppmntDetails=function(e,t){try{if(_home.IsIndexedDBSupported()){var n,o=_home.GetIndexedDB(),a=(new Date,t.toString());if(null!=o){if(null!=e&&e.length>0)(s=o.open("UpAppDB",a)).onupgradeneeded=function(t){var n=t.target.result;n.onerror=function(e){console.log("IndexedDB error: "+t.target.error.code)};var o=n.createObjectStore(a,{keyPath:"speciesId",autoIncrement:!0});o.createIndex("text","text",{unique:!1});var s=e.length;for(i in e[0].lastSyncTime=moment(new Date).format("YYYY/MM/DD HH:mm"),e)s>0&&(s--,o.add(e[i]))},s.onsuccess=function(e){n=s.result},s.onerror=function(e){console.log("Error:"+e.target.errorCode)};else if(null==e){var s,r=!1;(s=o.open("UpAppDB",a)).onupgradeneeded=function(e){r=!0},s.onsuccess=function(e){if((n=e.target.result).objectStoreNames.contains(a)&&0==r){var t=n.transaction(a).objectStore(a),i=[];t.openCursor().onsuccess=function(e){var t=e.target.result;t?(i.push(t.value),t.continue()):_home.upcomingAppCache=i},s.onerror=function(e){alert("Unable to retrieve data from database!")}}else n.close(),o.deleteDatabase("UpAppDB")},s.onerror=function(e){console.log("Error:"+e.target.errorCode)}}}else console.log("could not connect index db.")}}catch(e){console.log("Error:"+e.target.message)}},_home.IsIndexedDBSupported=function(){return!!(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.msIndexedDB)},_home.GetIndexedDB=function(){return window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.msIndexedDB},_home.GetOutStandingReviewAndInvoiceCntApiCall=function(e){var t=new vagaro.ajax;t.datamodel.Token="websiteapi/myaccount/getoutstandingreviewandinvoicecount",t.datamodel.IsNewVagaroAPI=!0,t.datamodel.data=e,t.datamodel.data.groupId="",t.datamodel.callback=function(e){_home.RemoveMyAccountGroupId(),e.CustomCode==vagaro.VagaroCoreApiResponseCode.UnderMaintanance?vagaro.alert({message:UnderMaintananceMessage,title:"Info"}):e.CustomCode==vagaro.VagaroCoreApiResponseCode.Error?_home.SetDefaultCountForInvoiceAndReview():e.CustomCode==vagaro.VagaroCoreApiResponseCode.Success&&(e=e.Data,_home.afterGetOutStandingReviewAndInvoiceCntRowLoad(e))},t.datamodel.Error=function(e){_home.RemoveMyAccountGroupId(),_home.SetDefaultCountForInvoiceAndReview()},t.Post()},_home.GetOutStandingReviewAndInvoiceCntForMobileApp=function(e){var t=null!=UserID&&""!=UserID?parseInt(UserID):0;if(t>0&&void 0!==e&&null!=e&&""!=e){var i={};i.LoginUserID=t,baIsUndefine(IsBrandedApp)||1!=IsBrandedApp?(i.BusinessID=0,i.IsFromBrandedApp=!1):(i.BusinessID=parseInt(businessID),i.IsFromBrandedApp=!0),myAccountUserGroupID=e,_home.GetOutStandingReviewAndInvoiceCntApiCall(i)}},_home.IsMobileApp=function(){return"undefined"!=typeof vgAppicationType&&(vgAppicationType==objApplicationType.CustomerApp||vgAppicationType==objApplicationType.CheckinApp)},_home.GetOutStandingReviewAndInvoiceCntCallBack=function(e,t){"undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CustomerApp&&2!=t?CallbackforMobileApp(0,0,"","",0,"4|~|11"):0==_home.IsMobileApp()&&null!=_home.bubbleCountCache&&_home.bubbleCountCache.length>0&&2!=t?(_home.afterGetOutStandingReviewAndInvoiceCntRowLoad(_home.bubbleCountCache[0]),_home.bubbleCountCache=null):(0==_home.IsMobileApp()&&_home.RemoveReviewInvoiceCountDBObject(),setTimeout(function(){var t={};if(""==strUserID?t.LoginUserID=e:t.strLoginUserId=strUserID,baIsUndefine(IsBrandedApp)||1!=IsBrandedApp?(t.strBusinessId="undefined"==typeof strVgBusienssId?0:strVgBusienssId,t.IsFromBrandedApp=!1):(t.strBusinessId=strBrandedBusinessID,t.IsFromBrandedApp=!0),"undefined"!=typeof publicUserGroupID&&"undefined"!=typeof BasePage&&"MyAccount"!=BasePage?myAccountUserGroupID=publicUserGroupID:"undefined"!=typeof _siteBuilderDetail&&void 0!==_siteBuilderDetail.ComponentResponse&&null!=_siteBuilderDetail.ComponentResponse&&void 0!==_siteBuilderDetail.ComponentResponse.lstUserInfo&&null!=_siteBuilderDetail.ComponentResponse.lstUserInfo&&void 0!==_siteBuilderDetail.ComponentResponse.lstUserInfo.GroupID&&null!=_siteBuilderDetail.ComponentResponse.lstUserInfo.GroupID?myAccountUserGroupID=_siteBuilderDetail.ComponentResponse.lstUserInfo.GroupID:void 0!==shopdetailuserGroupId&&null!=shopdetailuserGroupId&&""!=shopdetailuserGroupId&&(myAccountUserGroupID=shopdetailuserGroupId),"undefined"==typeof BasePage||"MyAccount"==BasePage||"undefined"!=typeof myAccountUserGroupID&&""!=myAccountUserGroupID||0!=IsUserGroupCheck)"undefined"!=typeof myAccountUserGroupID&&null!=myAccountUserGroupID&&""!=myAccountUserGroupID?_home.GetOutStandingReviewAndInvoiceCntApiCall(t):(_home.RemoveMyAccountGroupId(),_home.SetDefaultCountForInvoiceAndReview());else{var i={},n=new vagaro.ajax;"undefined"==strUserID||null==strUserID||""==strUserID?(i.LoginUserID=e,n.datamodel.Token=ApiURLEnumOnlineCommon.getloginusergroups):(i.strLoginUserID=strUserID,n.datamodel.Token=ApiURLEnumOnlineCommon.getloginusergroup),n.datamodel.IsNewVagaroAPI=!0,n.datamodel.data=i,n.datamodel.callback=function(e){IsUserGroupCheck=!0,myAccountUserGroupID=e,"undefined"!=typeof publicUserGroupID&&"undefined"!=typeof BasePage&&"MyAccount"!=BasePage?publicUserGroupID=e:"undefined"!=typeof _siteBuilderDetail&&void 0!==_siteBuilderDetail.ComponentResponse&&null!=_siteBuilderDetail.ComponentResponse&&void 0!==_siteBuilderDetail.ComponentResponse.lstUserInfo&&null==_siteBuilderDetail.ComponentResponse.lstUserInfo&&(shopdetailuserGroupId=e),"undefined"!=typeof myAccountUserGroupID&&null!=myAccountUserGroupID&&""!=myAccountUserGroupID?_home.GetOutStandingReviewAndInvoiceCntApiCall(t):(_home.SetDefaultCountForInvoiceAndReview(),_home.RemoveMyAccountGroupId())},n.datamodel.Error=function(e){},n.Post()}},500))},_home.RemoveMyAccountGroupId=function(){"undefined"!=typeof BasePage&&"MyAccount"!=BasePage&&"undefined"!=typeof myAccountUserGroupID&&(myAccountUserGroupID=void 0)},_home.GetOutStandingReviewAndInvoiceCnt=function(t){if("undefined"!=typeof isStopInvoiceReviewcnt&&0==isStopInvoiceReviewcnt||"undefined"!=typeof BasePage&&"MyAccount"==BasePage){1==t&&e("#hdnToken3").val(uencrypt(UserID));try{var i=null!=UserID&&""!=UserID?parseInt(UserID):0;1==_home.IsMobileApp()?_home.GetOutStandingReviewAndInvoiceCntCallBack(i,t):_home.GetSetIndexedDBForBubbleCount(null,i,function(){_home.GetOutStandingReviewAndInvoiceCntCallBack(i,t)})}catch(e){_home.SetDefaultCountForInvoiceAndReview()}}},_home.EmployeeExistsInGusto=function(){try{var t=e("#hdnStrUserIdV2").val();if("undefined"!=t&&null!=t&&""!=t){var i={LoginUserID:""},n=new vagaro.ajax;n.datamodel.userId=t,n.datamodel.Token=_home.GetCoreAPIURLV2WithToken(ApiURLEnumOnlineCommon.EmployeeExistsInGustoAPI,""),n.datamodel.IsNewVagaroAPI=!0,n.datamodel.data=i,n.datamodel.callback=function(t){null!=t&&null!=t&&null!=t.data&&0==t.data.isGustoEnable&&(e("#accpayrollhistory").attr("style","display:none"),"undefined"!=typeof BasePage&&"MyAccount"==BasePage&&e("#lipayrollhisotry").attr("style","display:none"))},n.datamodel.Error=function(e){},n.Post()}}catch(e){}},_home.GetCoreAPIURLV2WithToken=function(e,t){try{var i="",n=CoreAPIURLV2.split("/");if(void 0!==t&&null!=t&&""!=t)n[3]=t,i=n.join("/")+e;else if("undefined"!=typeof myAccountUserGroupID&&null!=myAccountUserGroupID&&""!=myAccountUserGroupID){var o=myAccountUserGroupID.split(",");o.length>0&&(n[3]=o[0],i=n.join("/")+e)}return""==i&&(i=CoreAPIURLV2+e),i}catch(t){return CoreAPIURLV2+e}},_home.GetSetIndexedDBForBubbleCount=function(e,t,i){try{if(_home.IsIndexedDBSupported()){var n,o=_home.GetIndexedDB(),a=t.toString();if(null!=o){if(null!=e)(s=o.open("BubbleCount",a)).onupgradeneeded=function(t){var i=t.target.result;i.onerror=function(e){console.log("IndexedDB error: "+t.target.error.code)};var n=i.createObjectStore(a,{keyPath:"speciesId",autoIncrement:!0});n.createIndex("text","text",{unique:!1}),n.add(e)},s.onsuccess=function(e){n=s.result},s.onerror=function(e){console.log("Error:"+e.target.errorCode)};else if(null==e){var s,r=!1;(s=o.open("BubbleCount",a)).onupgradeneeded=function(e){r=!0},s.onsuccess=function(e){if((n=e.target.result).objectStoreNames.contains(a)&&0==r){var t=n.transaction(a).objectStore(a),l=[];t.openCursor().onsuccess=function(e){var t=e.target.result;t?(l.push(t.value),t.continue()):(_home.bubbleCountCache=l,void 0!==i&&null!=i&&i())},s.onerror=function(e){alert("Unable to retrieve data from database!")}}else n.close(),o.deleteDatabase("BubbleCount"),void 0!==i&&null!=i&&i()},s.onerror=function(e){console.log("Error:"+e.target.errorCode),"VersionError"==e.target.error.name&&isExceptionCount<1&&(isExceptionCount=1,o.deleteDatabase("BubbleCount"),_home.GetSetIndexedDBForBubbleCount(null,t,function(){_home.GetOutStandingReviewAndInvoiceCntCallBack(t,i)}))}}}else console.log("could not connect index db.")}}catch(e){console.log("Error:"+e.target.message)}},_home.RemoveReviewInvoiceCountDBObject=function(){try{if(_home.IsIndexedDBSupported()){var e=_home.GetIndexedDB();null!=e?e.deleteDatabase("BubbleCount"):console.log("could not connect index db.")}}catch(e){console.log("Error:"+e)}},_home.afterGetOutStandingReviewAndInvoiceCntRowLoad=function(t){if(_home.SetDefaultCountForInvoiceAndReview(),null!=t&&null!=t.InvoiceCount&&null!=t.ReviewCount){if("undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CustomerApp)CallbackforMobileApp(0,0,"","","0","40|~|"+('{\\"InvoiceCount\\":\\"'+t.InvoiceCount+'\\",\\"ReviewCount\\":\\"'+t.ReviewCount+'\\",\\"VPLFailCount\\":\\"'+t.VplFailCount+'\\"}'));else 0==_home.IsMobileApp()&&_home.GetSetIndexedDBForBubbleCount(t,null!=UserID&&""!=UserID?parseInt(UserID):0,null);t.InvoiceCount>0&&e(".invcount").html(t.InvoiceCount).show(),t.ReviewCount>0&&e(".revcount").html(t.ReviewCount).show(),t.VplFailCount>0&&e(".fTraCount").html(t.VplFailCount).show()}},_home.SetDefaultCountForInvoiceAndReview=function(){e(".revcount").html(0).hide(),e(".invcount").html(0).hide(),e(".fTraCount").html(0).hide()},_home.ShowHomeSliderMoreBusinessTypePopup=function(){e("#divMoreHomeSliderBusinessTypes").modal("show"),e(".modal-backdrop").addClass("service-modal-zindex")},_home.HideHomeSliderMoreBusinessTypePopup=function(){e("#divMoreHomeSliderBusinessTypes").modal("hide"),e(".modal-backdrop").removeClass("service-modal-zindex"),e("html, body").removeClass("moboverflow-hide"),e(".modal-backdrop").removeAttr("style")},_home.ShowUKHomePageUKJoinVagaroSection=function(){null!=getCookie(ProximityCookieName)&&e("#divHomePageUKJoinVagaroSection").show()},_home.ShowUKHomePageUKCookiesSection=function(){var t=getCookie(ProximityCookieName);if(null!=t&&"2"==t.countryid){var i=getCookie("_vopt");null!=i&&null!=i&&"2"==t.countryid?e("#divHomePageUKCookiesSection").hide():e("#divHomePageUKCookiesSection").show()}else e("#divHomePageUKCookiesSection").hide(),_home.CookieAcceptClicked("_vopt","accepted",365)},_home.CookieDeclineClicked=function(t,i){cookieManager.setCookie(t,i,null,cookieManager.defaultPath,cookieManager.defaultDomain),e("#divHomePageUKCookiesSection").hide()},_home.CookieAcceptClicked=function(t,i,n){cookieManager.setCookie(t,i,n,cookieManager.defaultPath,cookieManager.defaultDomain),e("#divHomePageUKCookiesSection").hide()},_home.ShowHomePageBennerTipsFromBottom=function(t){e(".tips-mobile-section").hide();var i=e("#divHomePageBannerMobileBeauty");t==_home.HomePageBannerType.Beauty?i=e("#divHomePageBannerMobileBeauty"):t==_home.HomePageBannerType.Fitness?i=e("#divHomePageBannerMobileFitness"):t==_home.HomePageBannerType.Wellness&&(i=e("#divHomePageBannerMobileWellness")),i.show().animate({bottom:"0"},{duration:200,complete:function(){e(".tips-mobile-section-fade").show()}})}}(jQuery,window,document),_common.isCreateLinkPreserve=function(e,t){if(e){var i=!1,n=getCookie("UniqueCreateLink");return void 0!==n&&null!=n&&""!=n&&"true"==n.split("~")[0]&&(t&&getCookie("UniqueCreateLink").split("~")[1]!=_siteBuilderDetail.businessID?_common.isCreateclearCookie():i=!0),i}var o=getCookie("MultiProviderID");return void 0!==o&&null!=o&&""!=o?o.split(","):""},_common.isCreateclearCookie=function(){clearCookie("ServiceID"),clearCookie("MultiProviderID"),clearCookie("UniqueCreateLink"),clearCookie("EventType"),"undefined"!=typeof IsFromCreateLink&&1==IsFromCreateLink&&(IsFromCreateLink=!1,_shopdetail.providerID="")},_common.Openswalpopup=function(e){swal({title:"",text:e.swalTextMessage,showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:e.confirmButtonText,cancelButtonText:"OK",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,showConfirmButton:!1,customClass:"sweet-alert-model text-left hideconfirm"},function(e){return swal.close(),!1})},_common.IsInActiveOnlineBooking=function(e){var t=!1;if(e.length>0&&(_common.IsWidgetForServiceProvider(!0)||"undefined"!=typeof IsBookFromFacebookoAuth&&0!=IsBookFromFacebookoAuth&&"undefined"!=typeof isFacebookoAuth&&"true"==IsBookFromFacebookoAuth&&"true"==isFacebookoAuth&&"undefined"!=typeof isWidget&&"true"!=isWidget)){var i=1==_common.isCreateLinkPreserve(!0)&&"true"==IsBookFromFacebookoAuth?_common.isCreateLinkPreserve(!1):1==_common.IsWidgetForServiceProvider(!0)&&"true"==isWidget?String(_common.IsWidgetForServiceProvider(!1)).split(","):null;if(null!=i&&i.length>0&&"-1"!=i[0]){var n=[];$.grep(e,function(e){parseInt(i[0])==parseInt(e.id)&&n.push(e)}),n.length<=0&&(t=!0)}}return t},_common.WidgetTypeEnum={Popup:0,Embedded:1,NewWindow:2},_common.getQueryStringData=function(e){for(var t,i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("&"),n=0;n<i.length;n+=1){var o=(i[n]||"").split("=");if(o[0]===e)if(o.length>2)for(n=1;n<o.length;n++)t?t+="="+o[n]:t=o[n];else t=o[1]}return void 0!==t&&null!=t&&""!=t?decodeURIComponent(t):""},_common.IsCookieLessWidget=function(){try{var e=!1;if(null!=typeof _common.getQueryStringData)String.isNullOrUndefineOrBlank($("#hdnLoginQueryString").val())||(QueryStringValue=$("#hdnLoginQueryString").val()),String.isNullOrUndefineOrBlank(QueryStringValue)&&(QueryStringValue=""!=window.QueryStringValue?window.QueryStringValue:window.document.URL),"Builder"==_common.getQueryStringData("Type")&&(e=!0);if((e||"undefined"!=typeof isWidget&&null!=isWidget&&"true"==isWidget.toLowerCase()&&"undefined"!=typeof w_type&&null!=w_type&&(w_type==_common.WidgetTypeEnum.Embedded||w_type==_common.WidgetTypeEnum.Popup))&&"undefined"!=typeof IsCookieEnabled){var t=IsCookieEnabled();if(0==t||1==t)return!0}}catch(e){}return!1},_common.SetAddonForSeleect2=function(e,t){e.data("addon",JSON.stringify(t))},_common.GenerateRandomNo=function(e,t){for(var i="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<e;o++)i+=n.charAt(Math.floor(62*Math.random()));var a=new Date;return t+"_"+i+a.getDate()+a.getMonth()+a.getFullYear()+a.getHours()+a.getMinutes()+a.getSeconds()},_common.UpdateTimeZoneLocationCookie=function(e){try{if(pageLocation=getCookie(ProximityCookieName),"undefined"==typeof pageLocation||null==pageLocation||void 0!==pageLocation.timeZoneOffSet&&null!=pageLocation.timeZoneOffSet&&""!=pageLocation.timeZoneOffSet&&void 0!==pageLocation.isSupportDayLight&&null!=pageLocation.isSupportDayLight)e&&_shopdetail.RebindAfterLocationChange();else{var t=pageLocation.lat,i=pageLocation.long,n=new vagaro.ajax;n.datamodel.Token="GetCurrentLocation",n.datamodel.data=[t,i,25,!0],n.datamodel.callback=function(t){if(null!=t){var i=EmptyProximityValue();i.businesstypes=businesstypes,i.countryid=t.countryID,i.currencysymbol=t.currencySymbol,i.lat=t.latitude,i.long=t.longitude,i.zip=t.zipCode,i.city=t.city,i.state=t.stateCode,i.stateName=t.state,i.utcOffset=t.utcOffset,i.timeZoneOffSet=t.timeZoneOffSet,i.isSupportDayLight=t.IsSupportDayLight,setCookie(ProximityCookieName,i),String.isNullOrUndefineOrBlank(tabSegment)||"book-now"!=tabSegment||_shopdetail.setLocationCookieData(),e&&_shopdetail.RebindAfterLocationChange()}},n.datamodel.Error=function(e){},n.Post()}}catch(e){}},_common.GetLoginPlatformDetails=function(e,t){var i=getCookie(ProximityCookieName);cookieValue=getCookie("loginTypeValue"),isSignupvar=getCookie("isSignupValue"),isLoginvar=getCookie("isLoginValue"),appleLoginSourceVar=getCookie("appleLoginSource"),urlPath=window.location.href.substring(window.location.href.lastIndexOf("/")+1);var n={},o=e.split("|");4==o.length?(loggedInUserId=o[1],FullUserName=o[0],(null!=o[3]||null!=o[3])&&o[3].split("~").length>0&&(UserEmail=o[3].split("~")[0])):(loggedInUserId=o[3],FullUserName=o[0],UserEmail=o.length>5?o[5]:"");n.PageURL=window.location.href,n.UserAgent=null!=navigator.userAgent.toLowerCase()?navigator.userAgent.toLowerCase():"",n.Licence=localStorage.getItem("NoOfLicences"),n.UserId=loggedInUserId,n.Email=UserEmail,n.UserName=FullUserName,void 0!==i&&null!=i&&(void 0!==i.city&&null!=i.city&&""!=i.city&&(n.City=i.city),void 0!==i.countryid&&null!=i.countryid&&""!=i.countryid&&(n.Country=i.countryid),void 0!==i.stateName&&null!=i.stateName&&""!=i.stateName&&(n.State=i.stateName)),n.Referrer_url=document.referrer,isSignupvar?isSignupvar&&(cookieValue==LoginTypes.google||cookieValue==LoginTypes.google_new?(n.Signup_method=platform.signUpGoogle,n.Step=76):cookieValue==LoginTypes.facebook?(n.Signup_method=platform.signUpFacebook,n.Step=76):cookieValue==LoginTypes.apple?(n.Signup_method=platform.signUpApple,n.Step=76):cookieValue==LoginTypes.login&&(n.Signup_method=platform.signUpStandard,n.Step=76),isSignupvar=!1):cookieValue==LoginTypes.google||cookieValue==LoginTypes.google_new?(n.Login_method=platform.loginGoogle,n.Step=75):cookieValue==LoginTypes.facebook?(n.Login_method=platform.loginFacebook,n.Step=75):cookieValue==LoginTypes.apple?(n.Login_method=platform.loginApple,n.Step=75):cookieValue==LoginTypes.login&&(n.Login_method=platform.loginStandard,n.Step=75);var a={};a.AddLogInAmplitude=n;var s=$("#hdnUserType").val();void 0!==s&&null!=s&&""!=s&&"1"==s&&(a.AddLogInAmplitude.UserId=0),AjaxOld("AddLogInAmplitudeV2",a,this.AddLogInAmplitudeSuccess,this.AddLogInAmplitudeSuccessFail)},AjaxOld=function(e,t,i,n){var o=new vagaro.ajax;o.datamodel.Token=e,o.datamodel.data=t,o.datamodel.callback=i,o.datamodel.Error=n,o.Post()},AddLogInAmplitudeSuccess=function(e){console.log("success")},AddLogInAmplitudeSuccessFail=function(e){console.log("error")};var lstCickElementArray=[];function GatherClickElement(e){try{lstCickElementArray.length>=2&&lstCickElementArray.shift(),$(e.target).length>0?lstCickElementArray.push($(e.target)):$(e).length>0&&lstCickElementArray.push($(e))}catch(e){lstCickElementArray=[]}}function SetControlAttribute(e){if(null!=lstCickElementArray&&lstCickElementArray.length>0)for(var t=1,i=lstCickElementArray.length-1;i>=0;i--){var n=(new Date).getTime().toString();$(e).attr("adaindex"+t.toString(),n),$(lstCickElementArray[i]).addClass(n),t+=1}}function SetFocusOnlastControl(e){for(var t=1;t<=2;t++){var i="adaindex"+t.toString();if(e.length>0&&void 0!==e.attr(i)){var n=$("."+e.attr(i));if(n.length>0&&1==n.is(":visible")){n.attr("tabindex",-1).focus().removeClass(e.attr(i));break}}}lstCickElementArray=[]}function SetAreaAttributeInSweetAlert(e){1==e?($(".gencutom-title").removeAttr("id").removeAttr("tabindex").removeAttr("role"),$(".gencustom-close").removeAttr("aria-hidden"),$(".sa-input-error").removeAttr("aria-hidden"),$(".sa-error-container").removeAttr("aria-hidden")):($(".gencutom-title").attr("tabindex",-1).attr("role","heading").focus(),$(".gencustom-close").attr("aria-hidden",!0),$(".sa-input-error").attr("aria-hidden",!0),$(".sa-error-container").attr("aria-hidden",!0))}function SweetAlertOpenCallback(arguments,e){setTimeout(function(){SetControlAttribute(e),SetAreaAttributeInSweetAlert(!1)},100)}function SweetAlertCloseCallback(e,t){setTimeout(function(){SetFocusOnlastControl($(t))},1),SetAreaAttributeInSweetAlert(!0)}function GetCalculateTaxValue(e){var t=0;return"[]"==e||$.each(e,function(e,i){t+=i.CalculatedTax}),t}function ReplaceSpecialCharacters(e){return escape(e.trim().replace(/(\r\n|\r|\n)/g,""))}function IgnoreScriptTag(e,t){""==t&&(t="<>"),document.all?k=e.keyCode:k=e.which;for(var i=0;i<t.length;i++)if(t.charCodeAt(i)==k)return e.returnValue=null,!1}function ISAndroidOrIOSDevicesAndBrowser(){return/iPhone|iPad|iPod|Android|Tablet/i.test(navigator.userAgent)}function setLogintkn(e){try{if(void 0===e||null==e||""==e)return;localStorage.setItem("s_utkn",e),setFMBFeeEnable()}catch(e){console.error("storeLoginDetailsIndexDb: Error while storing menu details in IndexedDB",e)}}function setFMBFeeEnable(){try{if("undefined"==typeof FMBFeeEnable||!0===FMBFeeEnable)return;if("undefined"==typeof businessID||null==businessID||""==businessID||parseInt(businessID)<=0)return;CallWebServicehed("MySampleService.asmx/GetFMBFeeEnable",'"businessID" : '+parseInt(businessID),function(e){null!=e&&void 0!==e.d&&(FMBFeeEnable=!0===e.d)},function(){})}catch(e){console.error("setFMBFeeEnable: Error while resolving FMB fee flag",e)}}function deleteKeyValue(){try{localStorage.removeItem("s_utkn")}catch(e){console.error("Error deleting previous localStorage item:",e)}}function isNewVersionCustomerAppLogin(e="",t=""){var i=navigator.userAgent;if(i&&i.toLowerCase().includes("com.vagaro.customerios")&&i.toLowerCase().includes("(vagaroapp")&&!i.toLowerCase().includes("brandedapp")){if((n=i.split("(VagaroApp"))&&n.length>=2&&(o=n[1].split(")"))&&o.length>=1)return o[0].replace(/^\.+|\.+$/g,"").split(".").length<3&&(o[0]=o[0].replace(/^\.+|\.+$/g,"")+".0"),(parseInt(o[0].replace(/\./g,"").trim())||0)>(parseInt(t?t.replace(/[.~]/g,""):"357")||0)}else if(i&&i.toLowerCase().includes("com.vagaro.customerandroid")&&i.toLowerCase().includes("(vagaroapp")&&!i.toLowerCase().includes("brandedapp")){var n,o;if((n=i.split("(VagaroApp"))&&n.length>=2)if((o=n[1].split(")"))&&o.length>=1)return o[0].replace(/^\.+|\.+$/g,"").split(".").length<3&&(o[0]=o[0].replace(/^\.+|\.+$/g,"")+".0"),(parseInt(o[0].replace(/\./g,"").trim())||0)>(parseInt(e?e.replace(/[.~]/g,""):"468")||0)}return!1}function StringisNullOrUndefineOrBlank(e){return void 0===e||null==e||""==e||null==e}function getStateName(){var e="";try{if(pageLocation=getCookie(ProximityCookieName),"undefined"!=typeof pageLocation&&null!=pageLocation&&(void 0===pageLocation.timeZoneOffSet||null==pageLocation.timeZoneOffSet||""==pageLocation.timeZoneOffSet||void 0===pageLocation.isSupportDayLight||null==pageLocation.isSupportDayLight)){var t=pageLocation.lat,i=pageLocation.long,n=new vagaro.ajax;n.datamodel.Token="GetCurrentLocation",n.datamodel.data=[t,i,25,!0],n.datamodel.async=!1,n.datamodel.callback=function(t){null!=t&&(e=t.state)},n.datamodel.Error=function(e){},n.Post()}}catch(e){}return e}$(document).on("click",function(e){GatherClickElement(e)}),$(window).on("shown.bs.modal",function(e){var t=$(e.target).find(".modal-title"),i=$(e.target).find(".bootbox-body");t.length>0?"dvDeleteCardDetailsModal"==$(e.target).attr("id")?(setTimeout(function(){$("#dvDeleteCardDetailsModal").attr("tabindex",-1).focus()},1e3),SetControlAttribute($(e.target))):"AppcheckoutModal"==$(e.target).attr("id")?(setTimeout(function(){$("#AppcheckoutModal").find($("#mainTCPoliceHeader")).attr("tabindex",-1).focus()},1e3),SetControlAttribute($(e.target))):($(t).attr("tabindex",-1).focus(),SetControlAttribute($(e.target))):i.length>0?($(i).attr("role","heading").attr("tabindex",-1).focus(),SetControlAttribute($(e.target))):$(e.target).length>0&&("divShoppingcartpopup"==$(e.target).attr("id")?(setTimeout(function(){$(".clsproductname").attr("tabindex",-1).focus()},1e3),SetControlAttribute($(e.target))):"divWaitlistpopup"==$(e.target).attr("id")?(setTimeout(function(){$("#dvwaitlistPopupHeader").attr("tabindex",-1).focus()},500),SetControlAttribute($(e.target))):"divClassDetailpopup"==$(e.target).attr("id")&&(setTimeout(function(){$("#divEventNamePopup").attr("tabindex",-1).focus()},1e3),SetControlAttribute($(e.target)))),"AppcheckoutModal"==$(e.target).attr("id")&&void 0!==setPopupPosi&&void 0!==IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&($(this).addClass("wbbootbox"),setPopupPosi("#AppcheckoutModal"))}),$(window).on("hidden.bs.modal",function(e){SetFocusOnlastControl($(e.target))}),PreventScriptInjection=function(e){var t=e.clipboardData.getData("Text");if(1==/<(.|\n)*?>/g.test(t))return!1},$("#live-stream-classes-popup").on("hidden.bs.modal",function(){ZoomURL="javascript:void(0);",$("#live-stream-classes-popup .enroll-visits").attr("href",ZoomURL)}),$(document).ready(function(){setsTkn()});var countrylist=[{country:1,records:[{city:"New York",slug:"new-york--ny",rank:1},{city:"San Francisco",slug:"san-francisco--ca",rank:2},{city:"Chicago",slug:"chicago--il",rank:3},{city:"Atlanta",slug:"atlanta--ga",rank:4},{city:"Dallas",slug:"dallas--tx",rank:5},{city:"Los Angeles",slug:"los-angeles--ca",rank:6},{city:"Seattle",slug:"seattle--wa",rank:7},{city:"Boston",slug:"boston--ma",rank:8},{city:"Phoenix",slug:"phoenix--az",rank:9},{city:"Miami",slug:"miami--fl",rank:10},{city:"Indianapolis",slug:"indianapolis--in",rank:11},{city:"Minneapolis",slug:"minneapolis--mn",rank:12},{city:"Denver",slug:"denver--co",rank:13},{city:"Charlotte",slug:"charlotte--nc",rank:14},{city:"Houston",slug:"houston--tx",rank:15},{city:"Portland",slug:"portland--or",rank:16},{city:"Philadelphia",slug:"philadelphia--pa",rank:17},{city:"San Jose",slug:"san-jose--ca",rank:18},{city:"Columbus",slug:"columbus--oh",rank:19},{city:"Detroit",slug:"detroit--mi",rank:20}]},{country:2,records:[{city:"London",slug:"london--greater-london--gb",rank:1},{city:"Manchester",slug:"manchester--greater-manchester--gb",rank:2},{city:"Birmingham",slug:"birmingham--west-midlands--gb",rank:3},{city:"Glasgow",slug:"glasgow--glasgow-city--gb",rank:4},{city:"Bristol",slug:"redcliffe--city-of-bristol--gb",rank:5},{city:"Liverpool",slug:"liverpool--merseyside--gb",rank:6},{city:"Southampton",slug:"southampton--hampshire--gb",rank:7},{city:"Southwark",slug:"southwark--greater-london--gb",rank:8},{city:"Croydon",slug:"croydon--greater-london--gb",rank:9},{city:"Bournemouth",slug:"bournemouth--dorset--gb",rank:10},{city:"Cardiff",slug:"cardiff--cardiff--gb",rank:11},{city:"Reading",slug:"reading--berkshire--gb",rank:12},{city:"Hackney",slug:"hackney--derbyshire--gb",rank:13},{city:"Edinburgh",slug:"edinburgh--city-of-edinburgh--gb",rank:14},{city:"Falkirk",slug:"falkirk--falkirk--gb",rank:15},{city:"Oxford",slug:"oxford--oxfordshire--gb",rank:16},{city:"Wrexham",slug:"wrexham--wrexham-principal-area--gb",rank:17},{city:"Sheffield",slug:"sheffield--south-yorkshire--gb",rank:18},{city:"Leeds",slug:"leeds--west-yorkshire--gb",rank:19},{city:"Luton",slug:"luton--luton--gb",rank:20}]},{country:3,records:[{city:"Toronto",slug:"toronto--on--ca",rank:1},{city:"Calgary",slug:"calgary--ab--ca",rank:2},{city:"Vancouver",slug:"vancouver--bc--ca",rank:3},{city:"Edmonton",slug:"edmonton--ab--ca",rank:4},{city:"Winnipeg",slug:"winnipeg--mb--ca",rank:5},{city:"Montreal",slug:"montreal--qc--ca",rank:6},{city:"Lethbridge",slug:"lethbridge--ab--ca",rank:7},{city:"Halifax",slug:"halifax--ns--ca",rank:8},{city:"Regina",slug:"regina--sk--ca",rank:9},{city:"Saskatoon",slug:"saskatoon--sk--ca",rank:10},{city:"St. John's",slug:"st.-john's--nl--ca",rank:11},{city:"Victoria",slug:"victoria--bc--ca",rank:12},{city:"Ottawa",slug:"ottawa--on--ca",rank:13},{city:"Surrey",slug:"surrey--bc--ca",rank:14},{city:"Red Deer",slug:"red-deer--ab--ca",rank:15},{city:"Brampton",slug:"brampton--on--ca",rank:16},{city:"Burnaby",slug:"burnaby--bc--ca",rank:17},{city:"Kamloops",slug:"kamloops--bc--ca",rank:18},{city:"Kitchener",slug:"kitchener--on--ca",rank:19},{city:"Mississauga",slug:"mississauga--on--ca",rank:20}]},{country:4,records:[{city:"Sydney",slug:"sydney--nsw--au",rank:1},{city:"Melbourne",slug:"melbourne--vic--au",rank:2},{city:"Perth",slug:"perth--wa--au",rank:3},{city:"Brisbane",slug:"brisbane-city--qld--au",rank:4},{city:"Adelaide",slug:"adelaide--sa--au",rank:5},{city:"Gold Coast",slug:"gold-coast--qld--au",rank:6},{city:"Canberra",slug:"canberra--act--au",rank:7},{city:"Newcastle",slug:"newcastle--nsw--au",rank:8},{city:"Jordan Springs",slug:"jordan-springs--nsw--au",rank:9},{city:"Sydney Olympic Park",slug:"sydney-olympic-park--nsw--au",rank:10},{city:"Wollongong",slug:"wollongong--nsw--au",rank:11},{city:"Hobart",slug:"hobart--tas--au",rank:12},{city:"Sunshine Coast",slug:"sunshine-coast--qld--au",rank:13},{city:"Geelong",slug:"geelong--vic--au",rank:14},{city:"Central Coast",slug:"central-coast--nsw--au",rank:15},{city:"Lara",slug:"lara--vic--au",rank:16},{city:"Mandurah",slug:"mandurah--wa--au",rank:17},{city:"Quinns Rocks",slug:"quinns-rocks--wa--au",rank:18},{city:"Thirlmere",slug:"thirlmere--nsw--au",rank:19},{city:"Cranbourne East",slug:"cranbourne-east--vic--au",rank:20}]}],BTypelist=[{code:"microblading",displayName:"Microblading",route:"/listings/microblading",rank:9},{code:"sugaring",displayName:"Sugaring",route:"/listings/sugaring",rank:5},{code:"waxing",displayName:"Waxing",route:"/listings/waxing",rank:4},{code:"gym",displayName:"Gym",route:"/listings/gym",rank:13},{code:"nail",displayName:"Nail",route:"/listings/nail",rank:2},{code:"massage",displayName:"Massage",route:"/listings/massage",rank:11},{code:"threading",displayName:"Threading",route:"/listings/threading",rank:8,active:!0},{code:"hair",displayName:"Hair",route:"/listings/hair",rank:1},{code:"personal-trainer",displayName:"Personal Trainer",route:"/listings/personal-trainer",rank:16},{code:"barber",displayName:"Barber",route:"/listings/barber",rank:3},{code:"yoga",displayName:"Yoga",route:"/listings/yoga",rank:15},{code:"lash",displayName:"Lash",route:"/listings/lash-bar",rank:7},{code:"pilates",displayName:"Pilates",route:"/listings/pilates",rank:14},{code:"cryotherapy",displayName:"Cryotherapy",route:"/listings/cryotherapy",rank:12},{code:"tanning",displayName:"Tanning",route:"/listings/tanning",rank:6},{code:"spa",displayName:"Spa",route:"/listings/spa",rank:10}];function LoadCitiesAndServices(e){var t=document.getElementById("hdnIsBotCrawler"),i=!(!t||"string"!=typeof t.value)&&"true"===t.value.toLowerCase();if(e||(e=1),!i||""!=tabSegment&&"home"!=tabSegment&&"/"!=tabSegment){if(""==tabSegment||"home"==tabSegment||"/"==tabSegment)try{o=[];(n=countrylist.find(t=>t.country==e))&&(o=(o=(o=n.records).sort((e,t)=>e.rank-t.rank)).slice(0,20)),renderCityAccordion(o,BTypelist.sort((e,t)=>e.rank-t.rank).slice(0,50))}catch(e){console.error("Unexpected error in LoadCitiesAndServices:",e)}}else try{var n,o=[];(n=countrylist.find(t=>t.country==e))&&(o=(o=(o=n.records).sort((e,t)=>e.rank-t.rank)).slice(0,20)),renderCityAccordion(o,BTypelist.sort((e,t)=>e.rank-t.rank).slice(0,50))}catch(e){console.error("Unexpected error in LoadCitiesAndServices:",e)}}function renderCityAccordion(e,t=[]){const i=$("#webCityContainer"),n=$(".find-a-service-section");n.find("h3.web-display-large");if(!e||0===e.length)return void n.hide();n.show(),i.empty();let o="";e.forEach((i,n)=>{n%5==0&&(o+='<div class="find-service-block">');const a=t.map(e=>`<div>\n            <a href="${e.route}/${i.slug}" class="ghost-button">${e.displayName}</a></div>\n        `).join("");o+=`\n            <div class="service-item" data-country="${i.slug}">\n                <div class="service-sec-header">\n                    <span class="web-display-small">${i.city}</span>\n                    <span class="arrow"><i class="fa-solid fa-caret-down"></i></span>\n                </div>\n                <div class="service-sec-content" style="display: none;">\n                <div class="listingLinkServices">\n                \n                    ${a}\n                    </div>\n                    \n                </div>\n            </div>\n        `,n%5!=4&&n!==e.length-1||(o+="</div>")}),i.html(o),initializeAccordion()}function initializeAccordion(){document.querySelectorAll(".service-sec-header").forEach(e=>{e.replaceWith(e.cloneNode(!0))});const e=document.querySelectorAll(".service-sec-header");e.forEach(t=>{t.addEventListener("click",()=>{e.forEach(e=>{e!==t&&(e.classList.remove("active"),e.nextElementSibling.style.display="none")}),t.classList.toggle("active");t.nextElementSibling.style.display=t.classList.contains("active")?"block":"none"})})}function dummyreleaseonlinecommon(){}$(document).on("keyup","#dvBusinessLocationSearch .select2-input",function(){if(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)if($(this).val().length>0){var e=$("#dvBusinessLocationSearch .select2-input");e.length&&0===e.next("#dvBusinessLocationSearch .vg-search-cancel-icon").length&&e.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),$("#dvBusinessLocationSearch .vg-search-cancel-icon").show()}else $("#dvBusinessLocationSearch .vg-search-cancel-icon").hide()}),$(document).on("keyup","#dvSearchServiceMain .select2-input",function(){if(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)if($(this).val().length>0){var e=$("#dvSearchServiceMain .select2-input");e.length&&0===e.next("#dvSearchServiceMain .vg-search-cancel-icon").length&&e.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),$("#dvSearchServiceMain .vg-search-cancel-icon").show()}else $("#dvSearchServiceMain .vg-search-cancel-icon").hide()}),$(document).on("keyup","#mobilefilterChange .select2-input",function(){if(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)if($(this).val().length>0){var e=$("#mobilefilterChange .select2-input");e.length&&0===e.next("#mobilefilterChange .vg-search-cancel-icon").length&&e.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),$("#mobilefilterChange .vg-search-cancel-icon").show()}else $("#mobilefilterChange .vg-search-cancel-icon").hide()}),$(document).on("keyup","#mobileServiceChange .select2-input",function(){if(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)if($(this).val().length>0){var e=$("#mobileServiceChange .select2-input");e.length&&0===e.next("#mobileServiceChange .vg-search-cancel-icon").length&&e.after('<span class="vg-search-cancel-icon" style="display:none;"><svg id="svgCloseIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M0 8C0 3.59375 3.5625 0 8 0C12.4062 0 16 3.59375 16 8C16 12.4375 12.4062 16 8 16C3.5625 16 0 12.4375 0 8ZM5.46875 6.53125L6.9375 8L5.46875 9.46875C5.15625 9.78125 5.15625 10.25 5.46875 10.5312C5.75 10.8438 6.21875 10.8438 6.5 10.5312L7.96875 9.0625L9.46875 10.5312C9.75 10.8438 10.2188 10.8438 10.5 10.5312C10.8125 10.25 10.8125 9.78125 10.5 9.46875L9.03125 8L10.5 6.53125C10.8125 6.25 10.8125 5.78125 10.5 5.46875C10.2188 5.1875 9.75 5.1875 9.46875 5.46875L7.96875 6.96875L6.5 5.46875C6.21875 5.1875 5.75 5.1875 5.46875 5.46875C5.15625 5.78125 5.15625 6.25 5.46875 6.53125Z" fill="#A2A0A2"></path></svg></span>'),$("#mobileServiceChange .vg-search-cancel-icon").show()}else $("#mobileServiceChange .vg-search-cancel-icon").hide()}),$(document).on("mousedown touchstart click",".vg-search-cancel-icon",function(e){"touchstart"===e.type&&e.preventDefault(),e.stopPropagation();var t=$(this).closest("#dvBusinessLocationSearch"),i=$(this).closest("#dvSearchServiceMain"),n=$(this).closest("#mobilefilterChange"),o=$(this).closest("#mobileServiceChange"),a=t.find(".select2-input"),s=i.find(".select2-input"),r=n.find(".select2-input"),l=o.find(".select2-input"),c=$("#txtBusinessLocationSearch"),d=$("#txtSearchServiceMain"),u=$("#txtMobileCityState"),p=$("#txtMobileService");a.length&&(a.val(""),a.trigger("input").trigger("keyup")),s.length&&(s.val(""),s.trigger("input").trigger("keyup")),r.length&&(r.val(""),r.trigger("input").trigger("keyup")),l.length&&(l.val(""),l.trigger("input").trigger("keyup")),c.length&&(c.select2("val",""),c.data("selectedid",""),c.data("response","")),d.length&&(d.select2("val",""),d.data("selectedid",""),d.data("response","")),u.length&&(u.select2("val",""),u.data("selectedid",""),u.data("response","")),p.length&&(p.select2("val",""),p.data("selectedid",""),p.data("response","")),$(this).hide()});var countryid="",city="";isNotSetByCookie=!1;var homePageBannerCDNURL,businessSearchMode=void 0===businessSearchMode?2:businessSearchMode,businessSearchModeForSelection=[0,2],removeMarkers=[],isFavouriteBusiness=!1,isServiceAnyTime=!1,serviceDateTime="",ProximityIsCurrentLocation="proximityiscurrentLocation",lBusinessPromoCodeID=$("#hdBusinessPromoCodeID").length>0?$("#hdBusinessPromoCodeID").val():null,distanceRadius=105,EmptyProximityValue=function(){return JSON.parse('{"lat":"","long":"","countryid":"1","zip":"","city":"","state":"","currencysymbol":"$","businesstypes":"","service":"","serviceDate":"","serviceTime":""}')},TrakingInfoValue=function(){return JSON.parse('{"Action":"","PageName":"","busionessName":"","businessID":"","Category":"","dealName":""}')},currentSorting=0,IsSetBubbleCount=!1,IsAjaxEnabled="True",strBusinessPromoURL=$("#hdBusinessPromoURL").val(),noDataMsg="No data available for selected location.",state="",serviceDateFormat="MMM D [at] h:mm A",isAdvanceSearch=!1,datePicker_contentWindow="body",bussinessTypesByCategoryname=[],bussinessTypeIdsByCategoryname=[],serviceDate="",serviceTime="",keyphrasedata="",h1ByCategoryname=[],titleByCategoryname=[],categoryByCategoryname=[];function resetAllCheckBox(){$('.filters-div  input[type="checkbox"]').filter(function(){return!0}).prop("checked",!1),businesstypes="",businesstypeids="",category="",h1="",title="",selectClassCategory(null,!1);var e=getCookie(ProximityCookieName);null!=e&&(e.businesstypes="",setCookie(ProximityCookieName,e)),$("#professionalFilter   .filter-result-text ,.mobile-filter-result .filter-result-text").filter(function(){return!0}).remove(),(isPromotionBusiness=_featuredDtl.IsPrmotion())?($(".mobile-filter-result").addClass("promoicon").removeClass("atmobileicon"),$(".imgpromcheck").show()):($(".mobile-filter-result").removeClass("promoicon"),$(".imgpromcheck").hide()),1==$("#mobile-check").is(":visible")?(HasIdExists(3)||HasIdExists(1)||HasIdExists(2))&&togglebusinesssearch(businessSearchMode):($(".business-toggle").click(),ResetBusinessSearchMode(),togglebusinesssearch(2)),$(".atmobilecheck").hide(),$(".atstreamcheck").hide(),$(".athomecheck").hide(),$(".mobile-filter-result").removeClass("atmobileicon"),$("#atBusiness").removeClass("active"),$("#atMobile").removeClass("active"),$("#atStream").removeClass("active"),HasIdExists(1)&&($(".atmobilecheck").show(),$(".mobile-filter-result").addClass("atmobileicon"),$("#atMobile").addClass("active")),HasIdExists(3)&&($(".atstreamcheck").show(),$("#atStream").addClass("active")),HasIdExists(2)&&($(".athomecheck").show(),$("#atBusiness").addClass("active")),businessFacilities="",kidsFacilitiesdata="",kidsFacilities=""}function PageBindAdvSearch(){if(1!=$("#sliderHomePageHero1").hasClass("hideDots")){$("#txtLocationSearch").length>0&&(cltrlLocationSearch=new ProximitySearch($("#txtLocationSearch"),$("#hdngblCountryId"),$("#navCountryList")).init("top-dropdown",!0));try{setTimeout(function(){$("#txtLocationSearch").select2("destroy")},1e3)}catch(e){}$("#txtBusinessLocationSearch1").length>0&&(cltrlLocationSearch=new ProximitySearch($("#txtBusinessLocationSearch1"),$("#hdngblCountryId"),$("#navCountryList")).init("service-where-dropdown mobcommon-dropdown",!0)),null!=AdminServiceList.results&&0!=AdminServiceList.results.length||("undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()?AdminServiceList.results=[]:InitAdminServices());var e="";e=(new Date).getMonth()>6?(new Date).getFullYear()+1:(new Date).getFullYear(),applydatepicker({divid:"#divHomeServicesDate1",textid:"#txtHomeServicesDate1",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.MiniDate)+" [at] h:mm A",defaultDateTime:serviceDateTime,pickTime:!0,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,yearStart:(new Date).getFullYear(),yearEnd:e,callBackOnChange:HomeServicesDateChange}),setTimeout(function(){ClearHomeServicesDate1()},200),_home.loadHeroList(),$("#sliderHomePageHero1").sliderResponsive({hideDots:"on"})}}function HideShowControl(e,t){var i=e.split(",");$.each(i,function(e){""!=i[e]&&(1==t?$('.filters-div  input[value="'+i[e]+'"]').parent().parent().hide():$('.filters-div  input[value="'+i[e]+'"]').parent().parent().show())})}function setDateTimeforServiceNew(e){var t=getLocationDate(),i=e,n=$("#"+e).find("input").attr("id"),o=t.format("nn"),a=iPadAndroid||isWindowsPhone?15:5;if((r=parseInt(parseInt(o)%a))>0&&(o=o-r+a,t.setMinutes(o)),""!=serviceDateTime&&void 0!==serviceDateTime){t>(s=new Date(serviceDateTime))&&(serviceDateTime=t,s=t),setdatepickervalue({divid:"#"+i,textid:"#"+n,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.MiniDate)+" [at] h:mm A"},s)}else{var s,r=0;if(t<(s=getdatepickervalue("#"+n))){var l=s.format("nn");(r=parseInt(parseInt(l)%a))>0&&(l=l-r+a,s.setMinutes(l)),t=s}iPadAndroid||isWindowsPhone||$("#"+n).datetimepicker({minDateTime:new Date(t)}),setdatepickervalue({divid:"#"+i,textid:"#"+n,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.MiniDate)+" [at] h:mm A"},t)}}function CheckLiveStreamCategoryNextPrevious(){checkOverflow("divStreamListingFilters","divStreamLastSlide","N")?$("#divStreamNextFilter").show():$("#divStreamNextFilter").hide(),checkOverflow("divStreamListingFilters","divStreamFirstSlide","P")?$("#divStreamPrevFilter").show():$("#divStreamPrevFilter").hide()}function checkOverflow(e,t,i){if($("#"+e).length>0&&$("#"+t).length>0){var n=$("#"+e).width(),o=$("#"+t).position().left;if("N"==i&&o>n)return!0;if("P"==i&&o<0)return!0}return!1}function selectClassCategory(e,t){null!=e&&$(e).length>0?(1==t?($(e).parent().addClass("active"),$(".stream-more").addClass("selected"),$("#"+e.id.replace("li","")).addClass("selected")):$(e).addClass("selected"),String.isNullOrUndefineOrBlank(_gblLiveStreamSearchServiceName)?(_gblLiveStreamSearchServiceId=$(e).data("livestreamid"),_gblLiveStreamSearchServiceName=$(e).data("livestream")):(_gblLiveStreamSearchServiceId=_gblLiveStreamSearchServiceId+","+$(e).data("livestreamid"),_gblLiveStreamSearchServiceName=_gblLiveStreamSearchServiceName+","+$(e).data("livestream"))):($(".stream-more").removeClass("selected"),$("#divStreamListingFilters a").removeClass("selected"),$(".LiveStreamClassListCss").removeClass("active"),_gblLiveStreamSearchServiceId=0,_gblLiveStreamSearchServiceName="")}function setdefaultSortingOption(e,t){$(".professional-sorting").hide(),$(".gallery-sorting").hide(),$(".listpage-sorting").hide(),"listSort"==e?($(".listpage-sorting").show(),$(".listpage-sorting a").hide(),"listings"==t?$(".listpage-sorting").find(".listings").show():"listingsLive"==t?($("body").addClass("livestreampage"),LoadLiveStreamPage()):"deals"==t?$(".listpage-sorting").find(".deals").show():"book"!=t&&"class"!=t||$(".listpage-sorting").find(".book").show()):"gallerySort"==e?$(".gallery-sorting").show():"professionalSort"==e&&$(".professional-sorting").show()}function loadData(e,t){if("undefined"!=typeof AdminServiceList&&null!=AdminServiceList&&""!=AdminServiceList||("undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()?AdminServiceList.results=[]:InitAdminServices()),!IsSetBubbleCount&&"undefined"!=typeof UserID&&null!=UserID&&""!=UserID&&parseInt(UserID)>0&&(_home.GetOutStandingReviewAndInvoiceCnt(),IsSetBubbleCount=!0),filledHeartIcon=cdnImagePath+"/PublicImages/Images/heart-icon@2x.png",emptyHeartIcon=cdnImagePath+"/PublicImages/Images/heart-icon-empty@2x.png",$("#dvDailyDealsDetail").hide(),$("#ulFeatureBusiness").removeClass("daily home-page-section"),_featuredDtl.HideAdvanceSearch(),_featuredDtl.HideGalleryFilter(),"DailyDeal"!=BasePage){if("Home"==BasePage&&"False"!=IsAjaxEnabled){null!=e&&(-1!=e.indexOf("/")&&-1!=e.indexOf("book")?tabSegment=e.split("/")[0]:tabSegment=e),$(".redo-search-btn").hide(),setMobileLocation(),addPageHistoryWinApp(BasePage,tabSegment,""),(""!=strBusinessPromoURL&&""==tabSegment||tabSegment==_common.liveStreamClasses)&&(tabSegment="listings"),t&&(currentSorting=0,$(".nDropDownMenus").find("a").removeClass("sort-active"),$(".nDropDownMenusFilter").find("a").removeClass("sort-active"),$(".divSorting").hide(),$("#divProfessionalSorting").hide(),$(".divSortingGalleryFilter").hide());var i="book"==tabSegment||"class"==tabSegment?-382:-280;switch(infobox=new InfoBox({content:document.getElementById("infobox"),disableAutoPan:!1,maxWidth:0,pixelOffset:new google.maps.Size(-125,i),zIndex:null,boxStyle:{width:"250px",opacity:"inherit"},closeBoxURL:"",infoBoxClearance:new google.maps.Size(1,1)}),"deals"!=tabSegment&&(dealserviceId=null),"professionals"==tabSegment?$("#divSearchStylist").show():$("#divSearchStylist").hide(),cloneSortoptions(),$(".prof-right-padding").addClass("data-padding-right"),$("#mobileFilter").removeClass("listing-mapfiler"),$("#mobilefilterChange").removeClass("listing-mapfiler"),$("#mobileServiceChange").addClass("listing-mapfiler"),$("#Div1111").addClass("listing-mapfiler"),$("#mobileDateChange").addClass("listing-mapfiler"),$("#ancFilter").attr("style",""),$("#pageSection").removeClass("booking-dateshow"),$("#divFilterMode").hide(),$("#divFilterModeMobile").hide(),$("#dvAdvanceFilter").removeClass("business-type-hide service-dtpick-hide"),$("#map_list_optiondiv").removeClass("with-filterhere"),$("#pageSection").removeClass("mobile-listing-business"),$("#myLikeNoDataMsg").text(noDataMsg),tabSegment){case"book":case"class":case"listings":$("#pHeaderText").html(""),$(".infoBox").hide(),"book"==tabSegment||"class"==tabSegment?$("#divNodataFeature").hide():$("#divNodataFeatureServices").hide(),$("#pageSection").addClass("mobile-listing-business"),$("#mobile-check").is(":visible")?$("#divFilterModeMobile").show():$("#divFilterMode").show(),"listings"==tabSegment&&$("#dvAdvanceFilter").addClass("service-dtpick-hide"),$("#btnMobile").show(),$("#btnMobileForMobile").show(),$(".nDropDownMenus #aSortOption_8").hide(),$(".nDropDownMenus #aSortOption_3").show(),$(".nDropDownMenus #aSortOption_9").hide(),$(".nDropDownMenus #aSortOption_10").hide(),(currentSorting=getSortingValue())>0&&($(".nDropDownMenus").find("a").removeClass("sort-active"),$(".nDropDownMenus #aSortOption_"+currentSorting).addClass("sort-active")),$("body").addClass("listing-like-page"),$("#dealListing").css("display","none"),$("#pageSection").removeClass("daily-deals-wrap"),$("#divListing").removeClass("daily-deals"),$("#dvAdvanceFilter").attr("style","display:block;"),$("#divGalleryFilter").attr("style","display:none;"),$("#professionalFilter").attr("style","display:block;"),$("#mobileServiceChange").removeClass("listing-mapfiler"),$("#mobilefilterChange").removeClass("listing-mapfiler"),$("#mobileFilter").addClass("listing-mapfiler"),$("#map_list_optiondiv").addClass("with-filterhere");var n="",o="",a="";if(null!=(S=getCookie(ProximityCookieName))){var s="";if(void 0!==S.businesstypes&&null!=S.businesstypes&&""!=S.businesstypes){$(".filter-pill-pkg").addClass("applied");for(var r=S.businesstypes.split(","),l=0;l<r.length;l++)s=s+", "+_featuredDtl.GetPluralBusinessType(r[l])}else $(".filter-pill-pkg").removeClass("applied");var c=void 0!==S.category&&void 0!==isDealFilterApplied&&0==isDealFilterApplied?S.category.toLowerCase():S.businesstypes.toLowerCase(),d=jQuery.grep(HSnames,function(e){return e.HeroCategoryName.toLowerCase()==c});!String.isNullOrUndefineOrBlank(d)&&d.length>0&&void 0!==isDealFilterApplied&&0==isDealFilterApplied?(a=d[0].H1,title=d[0].Title):(a="",title=""),n=S.businesstypes&&null!=S.businesstypes?s.replace(/^,|,$/g,"").trim():" Salons",o=null!=countryid&&"undefined"!=countryid&&"2"==countryid?null!=S.city&&null!=S.city&&""!=S.city?" in "+htmlEncode(S.city):"":null!=S.city&&null!=S.city&&""!=S.city?" in "+_common.SetCityState(htmlEncode(S.city),htmlEncode(state)):" in "+htmlEncode(state)}if("book"==tabSegment||"class"==tabSegment){if(void 0!==$("#txtServiceDate")&&null!=$("#txtServiceDate")&&$("#txtServiceDate").length>0&&"anytime"==$("#txtServiceDate").val().toString().toLowerCase()?($(".nDropDownMenus #aSortOption_9").hide(),$(".nDropDownMenus #aSortOption_10").hide()):($(".nDropDownMenus #aSortOption_9").show(),$(".nDropDownMenus #aSortOption_10").show()),$("#pageSection").addClass("booking-dateshow"),$("#mobileDateChange").removeClass("listing-mapfiler"),$("#divServiceDate").show(),businesstypes="","undefined"!=typeof serviceName&&null!=serviceName&&serviceName&&(service=serviceName,serviceName=""),LoadAdminServicesKeyphrase(),null!=keyphrasedata&&""!=keyphrasedata?$("#hHeaderText").html("Best "+keyphrasedata+o):$("#hHeaderText").html("Best "+service+o),"class"==tabSegment?$("#ddlBusMode").hide():($("#ddlBusMode").hide(),$("#ancFilter").attr("style","")),$("#atBusiness").removeClass("active"),$("#atMobile").removeClass("active"),$("#atStream").removeClass("active"),$(".athomecheck").hide(),HasIdExists(1)&&$("#atMobile").addClass("active"),HasIdExists(3)&&$("#atStream").addClass("active"),HasIdExists(2)&&($("#atBusiness").addClass("active"),$(".athomecheck").show()),!String.isNullOrUndefineOrBlank(service)&&!String.isNullOrUndefineOrBlank(S.city)&&$("#hHeaderBestsalon").length>0)if(LoadAdminServicesKeyphrase(),null!=keyphrasedata&&""!=keyphrasedata){var u=$("<div>").text(keyphrasedata).html();$("#hHeaderBestsalon").text("Best "+u+" in Nearby Cities")}else{u=$("<div>").text(service).html();$("#hHeaderBestsalon").text("Best "+u+" in Nearby Cities")}else{$("#hHeaderBestsalon").text("Best Salons in Nearby Cities")}!String.isNullOrUndefineOrBlank(service)&&!String.isNullOrUndefineOrBlank(S.city)&&$("#hHeaderRelatedSearch").length>0?(LoadAdminServicesKeyphrase(),null!=keyphrasedata&&""!=keyphrasedata?$("#hHeaderRelatedSearch").html("Related Searches to "+keyphrasedata):$("#hHeaderRelatedSearch").html("Related Searches to "+service)):$("#hHeaderRelatedSearch").html("Related Searches")}else{null==typeof n&&(n="Salons"),service="",_common.ClearService(),1==localStorage.getItem("isReloadPage")&&(n=localStorage.getItem("setbusinessType"));var p=n.replace(/\w+/g,function(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()});if(1==isAdvanceSearch&&localStorage.setItem("setbusinessType",n),p=p.trim(),void 0!==a&&null!=a&&""!=a&&$("#hHeaderBestsalon").length>0&&0==String.isNullOrUndefineOrBlank(c)){var h=$("<div>").text(a).html();$("#hHeaderBestsalon").html(h+" in Nearby Cities")}else if(void 0!==p&&null!=p&&""!=p&&"salons"!=p.toLowerCase()){u=$("<div>").text(n).html();$("#hHeaderBestsalon").html(u+" in Nearby Cities")}else $("#hHeaderBestsalon").html("Best Salons in Nearby Cities");if(void 0!==a&&null!=a&&""!=a&&$("#hHeaderRelatedSearch").length>0&&0==String.isNullOrUndefineOrBlank(c)?$("#hHeaderRelatedSearch").html("Related Searches to "+a):void 0!==p&&null!=p&&""!=p&&"yoga"!=p.toLowerCase()?$("#hHeaderRelatedSearch").html("Related Searches to "+n):$("#hHeaderRelatedSearch").html("Related Searches"),"undefined"!=a&&null!=a&&""!=a&&null!=p&&"undefined"!=p&&""!=p)$("#hHeaderText").html(a+o);else if($("#hHeaderText").html(n+o),null!=BusinessTypeTitles){var m=BusinessTypeTitles.filter(function(e){return e.HeaderType==p});if(null!=m&&m.length>0){var g=m[0];String.isNullOrUndefineOrBlank(g.City_StateHeader)||$("#hHeaderText").html(g.City_StateHeader.replace("[Business Type]",p).replace("[City]",city).replace("[State]",state.toUpperCase()))}}businesstypes=S.businesstypes,a=""}_common.setBookAService(service),null!=AdminServiceList.results&&0!=AdminServiceList.results.length||("undefined"!=typeof isWidget&&null!=isWidget&&"true"===isWidget.toString().toLowerCase()?AdminServiceList.results=[]:InitAdminServices()),null!=serviceDateTime&&null!=serviceDateTime&&""!=serviceDateTime||(serviceDateTime=getLocationDate());try{1==localStorage.getItem("isReloadPage")&&(localStorage.getItem("serviceDateTime").toLowerCase()==AnyTime.toLowerCase()?(isServiceAnyTime=!0,$("#txtMobileServiceDate").val(AnyTime),$("#txtServiceDate").val(AnyTime),serviceDateTime=getLocationDate()):serviceDateTime=new Date(localStorage.getItem("serviceDateTime")))}catch(e){}if(""!=serviceDate&&null!=serviceDate&&"Date"!=serviceDate||(serviceDate=serviceDateTime.format("MMM dd,yyyy")),""!=serviceTime&&null!=serviceTime&&"Time"!=serviceTime||(serviceTime=serviceDateTime.format("hh:nn a/p")),$("#mobile-check").is(":visible")){var v="";v=(new Date).getMonth()>6?(new Date).getFullYear()+1:(new Date).getFullYear(),applydatepicker({divid:"#mobileDateChange",textid:"#txtMobileServiceDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.LargeDateWithTime),callBackOnHide:onServicedateChange,defaultDateTime:serviceDateTime,pickTime:!0,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,yearStart:(new Date).getFullYear(),yearEnd:v})}else applydatepicker({divid:"#divServiceDate",textid:"#txtServiceDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.MiniDate)+" [at] h:mm A",callBackOnHide:onServicedateChange,defaultDateTime:serviceDateTime,pickTime:!0,formatTime:"h:mm A",contentWindow:datePicker_contentWindow});null!=countryid&&"undefined"!=countryid&&"2"==countryid?$("#aCityState").html(htmlEncode(S.city)):$("#aCityState").html(_common.SetCityState(htmlEncode(S.city),htmlEncode(S.state))),$("#txtMobileCityState").val(_common.SetCityState(htmlEncode(S.city),htmlEncode(S.state))),ScrollTarget.addClass("map-scroll"),$("html, body").animate({scrollTop:0}),$("#spntextlist").html("Businesses Available in ");var f=parseInt($("#spnTotalRecords").html());if((isNaN(f)||0==f)&&$("#spnTotalRecords").html("No").attr("aria-label","No"),""!=S.businesstypes&&isNotSetByCookie){var C=jQuery.grep(HSnames,function(e){return e.HeroCategoryName.toLowerCase()==S.businesstypes.toLowerCase()});String.isNullOrUndefineOrBlank(C[0])||(S.businesstypes=C[0].HSBusinessType),generateCheckboxList(S.businesstypes,"chkbusiness"),isNotSetByCookie=!1}if(1==localStorage.getItem("isReloadPage")&&(generateCheckboxList(localStorage.getItem("businesstypes"),"chkbusiness"),localStorage.setItem("isReloadPage",0)),"listings"==tabSegment&&"undefined"!=typeof isStoreFilterInListing&&"true"==isStoreFilterInListing&&(generateCheckboxList(storeKeyWordForListingWithSpace,"chkFacilities",!0),generateCheckboxList(StoreKeyWordForGCListingWithSpace,"chkFacilities",!0),isStoreFilterInListing="false"),"listings"==tabSegment&&"undefined"!=typeof isCovidFilterInListing&&"true"==isCovidFilterInListing&&(generateCheckboxList(covidKeyWordForListingWithSpace,"chkFacilities",!0),isCovidFilterInListing="false"),"listings"==tabSegment&&"undefined"!=typeof isLiveStreamRoutingURL&&"true"==isLiveStreamRoutingURL){if(!String.isNullOrUndefineOrBlank(liveStreamCategoryName))$("#LiveStream"+liveStreamCategoryName.toLowerCase()).length>=0&&selectClassCategory($("#LiveStream"+liveStreamCategoryName.toLowerCase()),!1);_common.SelectLiveStreamClasses(),isLiveStreamRoutingURL="false"}loadGoogleMaps(!0,"map_canvas"),mapFlag=!0,setdefaultSortingOption("listSort",tabSegment),isServiceAnyTime&&($("#txtMobileServiceDate").val(AnyTime),$("#txtServiceDate").val(AnyTime),setTimeout(function(){$("#txtServiceDate").val(AnyTime),$("#txtMobileServiceDate").val(AnyTime)},100)),void 0!==isClickForOnlineGCStore&&1==isClickForOnlineGCStore&&_featuredDtl.loadAdvanceSearch(),void 0!==isClickForBNPL&&1==isClickForBNPL&&_featuredDtl.loadAdvanceSearch();break;case"professionals":$(".nDropDownMenus #aSortOption_8").hide(),$("#divNodataFeatureServices").hide(),$(".prof-right-padding").removeClass("data-padding-right"),(currentSorting=getSortingValue())>0&&($(".nDropDownMenusFilter").find("a").removeClass("sort-active"),$(".nDropDownMenusFilter #aSortOption_filter_"+currentSorting).addClass("sort-active")),myLikesCurrentValue>0&&setMylikesGalleryDDLSelection("professionals"),""!=(S=getCookie(ProximityCookieName)).businesstypes&&isNotSetByCookie&&(generateCheckboxList(S.businesstypes,"chkbusiness"),isNotSetByCookie=!1),$("#dealListing").css("display","none;"),$("#professionalFilter").attr("style","display:block;"),$("#pageSection").removeClass("daily-deals-wrap"),$("#divListing").removeClass("daily-deals"),$("#dvAdvanceFilter").attr("style","display:block;"),$("#divGalleryFilter").attr("style","display:none;"),setdefaultSortingOption("professionalSort",tabSegment);break;case"photos":$("#divNodataFeatureServices").hide(),$(".nDropDownMenus #aSortOption_8").hide(),$(".prof-right-padding").removeClass("data-padding-right"),(currentSorting=getSortingValue())>0&&($(".nDropDownMenusGalleryFilter").find("a").removeClass("sort-active"),$(".nDropDownMenusGalleryFilter #aSortOption_Galleryfilter_"+currentSorting).addClass("sort-active")),$("body").addClass("listing-like-page"),$("#divGalleryFilter").attr("style","display:block;"),$("#dvAdvanceFilter").attr("style","display:none;"),$("#dealListing").css("display","none"),$("#pageSection").removeClass("daily-deals-wrap"),$("#divListing").removeClass("daily-deals");var S=getCookie(ProximityCookieName);window.location.href.includes(myLikedStyleUrlValue)&&0==isLoadDataCallFromDDL&&(myLikesCurrentValue=1),myLikesCurrentValue>0?(setMylikesGalleryDDLSelection("photos"),$("#sectionheader h1").html((null!=portfolioTypes&&null!=portfolioTypes?portfolioTypes+" ":"")+"My Liked Styles"),$("#sectionheader p").html(null!=portfolioTypes&&null!=portfolioTypes?portfolioTypes+" ":"")):(null!=countryid&&"undefined"!=countryid&&"2"==countryid?$("#sectionheader h1").html((null!=portfolioTypes&&null!=portfolioTypes?portfolioTypes+" ":"")+"Styles"+(htmlEncode(S.city)&&null!=S.city&&""!=S.city?" in "+htmlEncode(S.city):" in "+htmlEncode(state))):$("#sectionheader h1").html((null!=portfolioTypes&&null!=portfolioTypes?portfolioTypes+" ":"")+"Styles"+(htmlEncode(S.city)&&null!=S.city&&""!=S.city?" in "+_common.SetCityState(htmlEncode(S.city),htmlEncode(state)):" in "+htmlEncode(state))),$("#sectionheader p").html("Find a"+(null!=portfolioTypes&&null!=portfolioTypes?" "+portfolioTypes:"")+" salon styles near you. Check out the specialties offered and book an appointment online easily"+(htmlEncode(S.city)&&null!=S.city&&""!=S.city?" in "+_common.SetCityState(htmlEncode(S.city),htmlEncode(state)):" in "+htmlEncode(state))+"! Browse portfolios and check out any products for sale.")),null!=_featured.catchStyleInfo&&0!=_featured.catchStyleInfo.length||_featured.getMainStyleCategory(),setdefaultSortingOption("gallerySort",tabSegment);break;case"deals":$("#divNodataFeatureServices").hide(),$("#divProfessionalSorting").hide(),$(".divSortingGalleryFilter").hide(),$(".divSorting").show(),$(".nDropDownMenus #aSortOption_8").show(),$(".nDropDownMenus #aSortOption_3").hide(),$(".nDropDownMenus #aSortOption_9").hide(),$(".nDropDownMenus #aSortOption_10").hide(),(currentSorting=getSortingValue())>0&&($(".nDropDownMenus").find("a").removeClass("active"),$(".nDropDownMenus #aSortOption_"+currentSorting).addClass("active")),myLikesCurrentValue>0&&setMylikesGalleryDDLSelection("deals"),""!=(S=getCookie(ProximityCookieName)).businesstypes&&isNotSetByCookie&&(generateCheckboxList(S.businesstypes,"chkbusiness"),isNotSetByCookie=!1),$("#dealListing").css("display",""),$("#ulFeatureBusiness").addClass("daily home-page-section"),$(".infoBox").hide(),$("#dvAdvanceFilter").attr("style","display:block;"),$("#divGalleryFilter").attr("style","display:none;"),$("#pageSection").addClass("daily-deals-wrap"),$("#divListing").addClass("daily-deals"),$("#spntextlist").html("daily deals available in "),$("body").addClass("listing-like-page");S=getCookie(ProximityCookieName);null!=countryid&&"undefined"!=countryid&&"2"==countryid?($("#spnCityState").html(htmlEncode(S.city)),$("#aCityState").html(htmlEncode(S.city)),$("#txtMobileCityState").val(htmlEncode(S.city))):($("#spnCityState").html(_common.SetCityState(htmlEncode(S.city),htmlEncode(state))),$("#aCityState").html(_common.SetCityState(htmlEncode(S.city),htmlEncode(state))),$("#txtMobileCityState").val(_common.SetCityState(htmlEncode(S.city),htmlEncode(state)))),ScrollTarget.addClass("map-scroll"),$("html, body").animate({scrollTop:0}),(f=$("#ulFeatureBusiness").find(".listings-business-parent-div").length)>0?loadGoogleMaps(!1,"map_canvas"):(loadGoogleMaps(!0,"map_canvas"),mapFlag=!0,$("#divNodataFeature").hide()),$("#dvDailyDealsDetail").html(""),$("#dvDailyDealsDetail").hide(),$("#pageSection").addClass("pagesectionFlex"),$("#professionalFilter").attr("style","display:block;"),$("#divServiceFilters").hide(),setdefaultSortingOption("listSort",tabSegment);break;case"/":case"home":LoadUpcomingLiveStreamClasses(UpComingLiveStreamFromType.Home),myLikesCurrentValue>0&&setMylikesGalleryDDLSelection("home")}var y=_common.getPager(tabSegment);""!=y?_featuredDtl.ShowFeature(y,"#"+tabSegment.split("/")[0],!0):_featuredDtl.ShowFeature(null,null,!0),""!=tabSegment&&"photos"!=tabSegment?($("#mobileApplyFilter").attr("onclick","_featuredDtl.loadAdvanceSearch();"),checkOverflow("divListingFilters","divLastSlide","N")?$("#divNextFilter").show():$("#divNextFilter").hide(),checkOverflow("divListingFilters","divFirstSlide","P")?$("#divPrevFilter").show():$("#divPrevFilter").hide(),CheckLiveStreamCategoryNextPrevious()):"photos"==tabSegment?($("#mobileApplyFilter").attr("onclick","_featured.loadGalleryFilters();"),checkOverflow("divGalleryFilters","divLastSlideGallery","N")?$("#divNextFilterGallery").show():$("#divNextFilterGallery").hide(),checkOverflow("divGalleryFilters","divFirstSlideGallery","P")?$("#divPrevFilterGallery").show():$("#divPrevFilterGallery").hide()):($("#divNextFilter").hide(),$("#divPrevFilter").hide(),$("#divNextFilterGallery").hide(),$("#divPrevFilterGallery").hide(),$("#divStreamNextFilter").hide(),$("#divStreamPrevFilter").hide()),($("#mobile-check").is(":visible")||"undefined"!=typeof vgAppicationType&&1==vgAppicationType)&&"home"!=tabSegment.toLowerCase()&&"/"!=tabSegment&&""!=tabSegment?("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&null==window.history.state?($("#mobileBack").hide(),$("#custmobileBack").show()):($("#mobileBack").show(),$("#custmobileBack").hide()),$(".atmobilecheck").hide(),$(".atstreamcheck").hide(),$(".athomecheck").hide(),$(".mobile-filter-result").removeClass("atmobileicon"),HasIdExists(1)&&($("#mobileFilter .location-text-mobile").css("display","none"),$(".atmobilecheck").show(),$(".mobile-filter-result").addClass("atmobileicon")),HasIdExists(3)&&$(".atstreamcheck").show(),HasIdExists(2)&&$(".athomecheck").show()):isFilterScreen?($("#mobileBack").show(),$("#custmobileBack").hide()):($("#mobileBack").hide(),$("#custmobileBack").hide())}}else location.href="../../deals"}function setMobileLocation(e){($("#txtMobileCityState").removeAttr("onclick"),$("#txtMobileCityState").removeAttr("readonly"),0==("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"book"==tabSegment.toLowerCase()))&&($("#txtMobileCityState").data("select2")&&1!=e||$("#txtMobileCityState").length>0&&(ctrlMobileCityState=new ProximitySearch($("#txtMobileCityState"),$("#hdngblCountryId"),$("#navCountryList")).init("mob-dropdown mobcommon-dropdown",!0)))}function getSortingValue(){return"photos"==tabSegment&&0==currentSorting&&(currentSorting=3),""!=lattitude&&null!=lattitude&&null!=longitude&&""!=longitude&&0==currentSorting&&(currentSorting=5),currentSorting}function cloneSortoptions(e,t){if(_common.VisibleControlLength("#mobile-check")>0&&0==$(".professional-sorting").length){var i=$(".divSortingFilter").clone(),n=$(".divSortingGalleryFilter").clone(),o=$(".divSorting").clone();i.appendTo("header .nav-bar").addClass("professional-sorting"),n.appendTo("header .nav-bar").addClass("gallery-sorting"),o.appendTo("header .nav-bar").addClass("listpage-sorting"),$(".professional-sorting").hide(),$(".gallery-sorting").hide(),$(".listpage-sorting").hide(),$(Webflow.ready)}}function generateCheckboxList(e,t,i){if(null!=e){var n=document.querySelector("#divListingFilters"),o=document.querySelector(".mobile-filter-result"),a=e.replace("Buy Now, Pay Later","Buy Now| Pay Later").split(",").map(e=>e.trim().replace("Buy Now| Pay Later","Buy Now, Pay Later"));if(!document.querySelector("#divFirstSlide")){var s=document.createElement("div");s.id="divFirstSlide",s.className="w-inline-block",s.setAttribute("aria-hidden","true"),n.appendChild(s)}if(a.forEach(function(e){if(""!==e&&!1===filterHaveValue(e,t)){var a=null;void 0!==i&&!0===i?"undefined"!=typeof storeKeyWordForListingWithSpace&&e.toLowerCase()===storeKeyWordForListingWithSpace.toLowerCase()||"undefined"!=typeof StoreKeyWordForGCListingWithSpace&&e.toLowerCase()===StoreKeyWordForGCListingWithSpace.toLowerCase()?((a=document.createElement("a")).id="ancListingOnlineStore",a.className="filter-result-text w-inline-block "+t,a.href="javascript:void(0);",n.appendChild(a)):"undefined"!=typeof covidKeyWordForListingWithSpace&&e.toLowerCase()===covidKeyWordForListingWithSpace.toLowerCase()&&((a=document.createElement("a")).id="ancListingCovid",a.className="filter-result-text w-inline-block "+t,a.href="javascript:void(0);",n.appendChild(a)):((a=document.createElement("a")).className="filter-result-text w-inline-block "+t+" vagaro-dismiss-tag",a.href="javascript:void(0);",a.setAttribute("aria-label",e),n.appendChild(a)),(s=document.createElement("div")).className="inner-bubble-text vagaro-dismiss-inner-txt",s.setAttribute("aria-hidden","true"),s.innerText=e,a.appendChild(s),(r=document.createElement("div")).className="vagaro-dismiss-img",a.appendChild(r),(l=document.createElement("img")).src=$("#hdcdnImagePath").val()+"PublicImages/Images/vagaro-tag-close-2.svg",l.className="inner-bubble-x",l.title="",l.alt="",l.setAttribute("role","button"),l.setAttribute("aria-label","Close"+e),l.width=10,l.height=10,r.appendChild(l),r.addEventListener("click",function(){removecheckBox(e,t)})}var s,r,l;""!==e&&!1===MobilefilterHaveValue(e,t)&&((a=document.createElement("a")).className="filter-result-text w-inline-block "+t+" vagaro-dismiss-tag",a.href="javascript:void(0);",a.setAttribute("aria-label",e),o.appendChild(a),(s=document.createElement("div")).className="inner-bubble-text vagaro-dismiss-inner-txt",s.setAttribute("aria-hidden","true"),s.innerText=e,a.appendChild(s),(r=document.createElement("div")).className="vagaro-dismiss-img",a.appendChild(r),(l=document.createElement("img")).src=$("#hdcdnImagePath").val()+"PublicImages/Images/vagaro-tag-close-2.svg",l.className="inner-bubble-x",l.title="",l.alt="",l.setAttribute("role","button"),l.setAttribute("aria-label","Close"+e),l.width=10,l.height=10,r.appendChild(l),r.addEventListener("click",function(){removecheckBox(e,t)}))}),document.querySelector("#divLastSlide")&&document.querySelector("#divLastSlide").remove(),!document.querySelector("#divLastSlide")){var r=document.createElement("div");r.id="divLastSlide",r.className="w-inline-block",r.setAttribute("aria-hidden","true"),n.appendChild(r)}nofilterHideShow()}}!function(e){_featured={},_featuredDtl={},_featuredDtl.IsPrmotion=function(){var t=!1;return e("#divEstablishment > div").length>0&&(t=e("#divEstablishment input[data-model=-2]:checkbox").prop("checked")),t},_featuredDtl.GetPluralBusinessType=function(e){if(""!=e&&void 0!==e){return"Acupuncture"==e?"Acupuncturists":"Cycling"==e?"Cyclists":["Cryotherapy","Holistic Therapy","Therapy","Physical Therapy"].indexOf(e.trim())>-1?e=e.substring(0,e.length-1)+"ies":["Barber","Braids","Lash Bar","Makeup","Permanent Makeup","Pilates","Tattoos","Tennis","Electrolysis","Extensions","Gyrotonic","Golf","Martial Arts","Swimming","Waxing","Yoga","Locs","Other","Sugaring","Teeth Whitening","Threading"].indexOf(e.trim())>-1?e:e+"s"}return""},_featuredDtl.ShowFeature=function(t,i){if(e("#divMapView").addClass("hide-map"),e("#alist a").addClass("active"),e("#mapArea a").removeClass("active"),e(".right-nav-div a").removeClass("active"),ScrollTarget.removeClass("map-scroll"),e("#dvServices").hide(),e("#divTopServices").hide(),e("#divServicesMainContainer").hide(),e("#divServicePromotions").hide(),e("#divServiceMap").hide(),"undefined"!=typeof vgAppicationType&&1==vgAppicationType){var n=getCookie(ProximityCookieName);e("#spnAppLocationSearch").html(_common.SetCityState(n.city,n.state.toUpperCase())),e("#customerAppLocationSearch").show()}if(nofilterHideShow(),null!=t&&null!=t){var o=!1;e("#liAdvanceSearch,#liMap,#divServiceProvider").hide(),e("#liNearest,#liMostFar,#liBusinessRank,#liEndingSoon,#liNewest,#liHighestRated,#liLowestRated,#liOldest,#liHighestCost,#liLowestCost,#liAlphabeticSortAsc,#liAlphabeticSortDesc,#mapArea,#alist").css("display","none"),e("#liHighestRated a").html("Highest Rated"),e("#ulFeatureBusiness").show(),e("#dvFeatureBusiness").show(),"#listings"!=i&&e("#divFAQSearchServiceHead").hide(),"#listings"==i?(e(".divSorting").show(),e("#divListing").show(),e("#dvDailyDealsDetail").hide(),e("#divServiceFilters").css("display","flex"),e("#divProfessionalSorting").hide(),e(".divSortingGalleryFilter").hide(),window.location.href.indexOf(_common.liveStreamClasses)>-1&&(o=!0)):"#professionals"==i?(e(".divSorting").hide(),e("#divServiceProvider").show(),e("#divServiceFilters").hide(),e("#divProfessionalSorting").show(),e(".divSortingGalleryFilter").hide()):"#book"==i||"#class"==i?(e(".divSorting").show(),e("#divServiceFilters").css("display","flex"),e("#dvDailyDealsDetail").hide(),e("#divProfessionalSorting").hide(),e(".divSortingGalleryFilter").hide(),window.location.href.indexOf(_common.liveStreamClasses)>-1&&(o=!0)):"#photos"==i&&(e(".divSorting").hide(),e("#dvDailyDealsDetail").hide(),e("#divServiceFilters").hide(),e("#divProfessionalSorting").hide(),e(".divSortingGalleryFilter").show()),e(i).addClass("active"),0==o&&(t.init(),t.enableScroll(),t.load()),e("#dvHome").hide()}else _home.loadHomePageData(),e("#dvHome").show(),e("#dvFeatureBusiness").hide()},_featuredDtl.HideAdvanceSearch=function(){e("#AdvanceFilterContent").hide(),e("html, body").removeClass("overflowHidden")},_featuredDtl.HideGalleryFilter=function(){e("#divGalleryFilterContent").hide(),e("html, body").removeClass("overflowHidden")},_featuredDtl.showHidDistanceRadius=function(){""!=lattitude&&null!=lattitude&&null!=longitude&&""!=longitude?e("#divdistanceMiles").css("display","flex"):e("#divdistanceMiles").css("display","none")},_featuredDtl.loadAdvanceSearch=function(){try{var t={Action:"Deal Details",PageName:"Deal",Category:"Deal",BusinessName:"",BusinessID:"",isDealDetails:!1,IsListPage:!1,IsMapPage:!1,isFiltered:!0,DealName:""};_vgLogEvent.LogData(t)}catch(e){}if(void 0!==isClickForOnlineGCStore&&1==isClickForOnlineGCStore||void 0!==isClickForBNPL&&1==isClickForBNPL?e("#AdvanceFilterContent").hide():e("#AdvanceFilterContent").show(),e("html, body").addClass("overflowHidden"),DistanceText=3==countryid||4==countryid?"km":"mi",e("#divAdOtheLocation").show(),0==e("#divEstablishment > div").size()){e("#adfilterLoader").css("display","");var i=new vagaro.ajax;i.datamodel.Token="GetFacilitiesForAdvanceSearchPublic",i.datamodel.callback=_featuredDtl.loadAdvanceSearchCallback,i.datamodel.data=[],i.datamodel.Error=function(e){},i.Post()}else setCheckBox(businesstypes),void 0!==isClickForOnlineGCStore&&1==isClickForOnlineGCStore&&(setCheckBox("Online GC Store"),_featured.getAdvanceSearchData("homepagestore")),void 0!==isClickForBNPL&&1==isClickForBNPL&&(isClickForBNPL=!1,setCheckBox("Buy Now, Pay Later"),_featured.getAdvanceSearchData()),"undefined"!=typeof isCovidFilterInListing&&"true"==isCovidFilterInListing&&setCheckBox("COVID-19 Ready"),void 0!==countryid&&("undefined"==typeof IsCCSupportedCountry||1!=IsCCSupportedCountry)||"listings"!=tabSegment?HideShowControl("Online Store",!0):HideShowControl("Online Store",!1),"listings"==tabSegment||"book"==tabSegment||"class"==tabSegment?(e("#divAdOnlineStream").show(),e(".filter-tabs-menu").removeClass("filt-lastCurv")):(e("#divAdOnlineStream").hide(),e(".filter-tabs-menu").addClass("filt-lastCurv")),_featuredDtl.showHidUserFavourite();null!=UserID&&""!=UserID?(e("#divEstablishment").removeClass("nthchild-issue"),e("#divEstablishment > div:nth-child(1)").css("display","").addClass("filters-first"),e("#divEstablishment > div:nth-child(2)").removeClass("filters-first")):(e("#divEstablishment").addClass("nthchild-issue"),e("#divEstablishment > div:nth-child(2)").addClass("filters-first")),e("#divMapView").addClass("hide-map"),e("#ulFeatureBusiness").css("display",""),ScrollTarget.removeClass("map-scroll"),e("#alist a").addClass("active"),e("#mapArea a").removeClass("active"),e("html,body,#page-content-wrapper").animate({scrollTop:0},1e3),togglebusinesssearch(businessSearchMode),_featuredDtl.showHidDistanceRadius(),setTimeout(function(){e("#divbt").attr("tabindex","-1").attr("role","heading").focus()},100)},_featuredDtl.loadAdvanceSearchCallback=function(t){_featured.advanceFilterData=t;var i=e("#divEstablishment");i.html("");var n=e("#divLanguage");n.html("");var o=e("#divPayment");o.html("");var a=e("#divBusinessType");a.html("");var s=t;e("#txtBusinessLocationSearch,#professionalFilter,#txtServiceProviderPublicpage,#aSearchStylist,#ancFilter,.athomecheck,#divAdBusiness,#divAdOtheLocation,#divAdOnlineStream,#ulFeatureBusiness,#s2id_autogen1").attr("tabindex",-1),e("#divbt,#divamt,#divlan,#divpay").attr("tabindex",0);var r=jQuery.grep(s,function(e){return e.FacilityHeader.toLowerCase().indexOf("business type")>=0}).sort(function(e,t){return e.FacilityValue.localeCompare(t.FacilityValue)}),l=jQuery.grep(s,function(e){return e.FacilityHeader.toLowerCase().indexOf("payment")<0&&e.FacilityHeader.toLowerCase().indexOf("language")<0&&e.FacilityHeader.toLowerCase().indexOf("business type")&&e.FacilityHeader.toLowerCase().indexOf("highlights")<0}),c=jQuery.grep(s,function(e){return e.FacilityHeader.toLowerCase().indexOf("language")>=0}),d=jQuery.grep(s,function(e){return e.FacilityHeader.toLowerCase().indexOf("payment")>=0}),u="",p="",h="",m="",g="";if(""!=businesstypes)u=","+businesstypes.toLowerCase()+",";else{var v=getCookie(ProximityCookieName);u=v.businesstypes&&null!=v.businesstypes?","+v.businesstypes.replace("-"," ").toLowerCase()+",":""}""!=businessFacilities&&(p=","+businessFacilities.toLowerCase()+","),""!=kidsFacilities&&(h=","+kidsFacilities.toString().toLowerCase()+","),""!=isPromotionBusiness&&(m=isPromotionBusiness),""!=isFavouriteBusiness&&(g=isFavouriteBusiness),e.each(l,function(t){var n=null!=l[t].FacilityHeader&&""!=l[t].FacilityHeader?l[t].FacilityHeader.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",o=null!=l[t].FacilityHeaderID&&""!=l[t].FacilityHeaderID?l[t].FacilityHeaderID:"",a=null!=l[t].FacilityValue&&""!=l[t].FacilityValue?l[t].FacilityValue.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",s=null!=l[t].FacilityValueID&&""!=l[t].FacilityValueID?l[t].FacilityValueID:"",r="",c=!1;(-1!=p.indexOf(","+l[t].FacilityValue.toLowerCase()+",")||"promotion"==l[t].FacilityValue.toLowerCase()&&m||"my favorite"==l[t].FacilityValue.toLowerCase()&&g||"kid friendly"==l[t].FacilityValue.toLowerCase()&&-1!=h.indexOf(",1,")||"kids only"==l[t].FacilityValue.toLowerCase()&&-1!=h.indexOf(",2,")||void 0!==isClickForOnlineGCStore&&1==isClickForOnlineGCStore&&(l[t].FacilityValue.toLowerCase().indexOf("onlinegcstore")>-1||l[t].FacilityValue.toLowerCase().indexOf(StoreKeyWordForGCListingWithSpace.toLowerCase())>-1)||e("#ancListingOnlineStore").length>0&&l[t].FacilityValue.toLowerCase().indexOf(storeKeyWordForListingWithSpace.toLowerCase())>-1||e("#ancListingOnlineStore").length>0&&l[t].FacilityValue.toLowerCase().indexOf(StoreKeyWordForGCListingWithSpace.toLowerCase())>-1||e("#ancListingCovid").length>0&&l[t].FacilityValue.toLowerCase().indexOf(covidKeyWordForListingWithSpace.toLowerCase())>-1)&&(c=!0),r=0==i.children().size()?e('<div class="filters-checkbox filters-first"/>').appendTo(i):e('<div class="filters-checkbox"/>').appendTo(i);var d=e('<div class="checkbox-custom-black vagaro-checkbox"/>');e(d).appendTo(r);e("<input />",{type:"checkbox",value:l[t].FacilityValue,id:l[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")}).attr("data-model",l[t].ControlType).attr("data-facilityheader",""!=n.trim()?n:a).attr("data-facilityvalue",a).attr("data-facilityheaderid",o).attr("data-facilityvalueid",s).prop("checked",c).attr("aria-checked",c).attr("onclick","_featured.AdvancefilterValues(this);").attr("role","checkbox").attr("tabindex",0).appendTo(d),e("<label/>",{id:"label"+l[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")}).text(l[t].FacilityValue).attr("for",l[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")).attr("tabindex",0).attr("role","checkbox").attr("aria-checked",c).appendTo(d)}),e.each(c,function(t){var i="",o=!1,a=null!=c[t].FacilityHeader&&""!=c[t].FacilityHeader?c[t].FacilityHeader.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",s=null!=c[t].FacilityHeaderID&&""!=c[t].FacilityHeaderID?c[t].FacilityHeaderID:"",r=null!=c[t].FacilityValue&&""!=c[t].FacilityValue?c[t].FacilityValue.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",l=null!=c[t].FacilityValueID&&""!=c[t].FacilityValueID?c[t].FacilityValueID:"";-1!=p.indexOf(","+c[t].FacilityValue.toLowerCase()+",")&&(o=!0),i=0==n.children().size()?e('<div class="filters-checkbox filters-first"/>').appendTo(n):e('<div class="filters-checkbox"/>').appendTo(n);var d=e('<div class="checkbox-custom-black vagaro-checkbox"/>');e(d).appendTo(i);var u=c[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,""),h=String.isNullOrUndefineOrBlank(u)||"other"!=u.toLowerCase()?u:"divlanguage"+u;e("<input />",{type:"checkbox",value:c[t].FacilityValue,id:h}).attr("data-model",c[t].ControlType).attr("data-facilityheader",a).attr("data-facilityvalue",r).attr("data-facilityheaderid",s).attr("data-facilityvalueid",l).attr("aria-checked",o).attr("onclick","_featured.AdvancefilterValues(this);").attr("role","checkbox").attr("tabindex",0).prop("checked",o).appendTo(d),e("<label/>",{id:"lbl"+h}).text(c[t].FacilityValue).attr("for",h).attr("tabindex",0).attr("role","checkbox").attr("aria-checked",o).appendTo(d)}),e.each(d,function(t){var i=null!=d[t].FacilityHeader&&""!=d[t].FacilityHeader?d[t].FacilityHeader.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",n=null!=d[t].FacilityHeaderID&&""!=d[t].FacilityHeaderID?d[t].FacilityHeaderID:"",a=null!=d[t].FacilityValue&&""!=d[t].FacilityValue?d[t].FacilityValue.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",s=null!=d[t].FacilityValueID&&""!=d[t].FacilityValueID?d[t].FacilityValueID:"",r="",l=!1;-1!=p.indexOf(","+d[t].FacilityValue.toLowerCase()+",")&&(l=!0),("vagaro pay later"==d[t].FacilityValue.toLowerCase()&&"Vagaro Pay Later"==businesstypes||void 0!==isClickForBNPL&&1==isClickForBNPL&&d[t].FacilityValue.toLowerCase().indexOf("buy now, pay later")>-1)&&(l=!0),r=0==o.children().size()?e('<div class="filters-checkbox filters-first"/>').appendTo(o):e('<div class="filters-checkbox"/>').appendTo(o);var c=e('<div class="checkbox-custom-black vagaro-checkbox"/>');e(c).appendTo(r);e("<input />",{type:"checkbox",value:d[t].FacilityValue,id:d[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")}).attr("data-model",d[t].ControlType).attr("data-facilityheader",i).attr("data-facilityvalue",a).attr("data-facilityheaderid",n).attr("data-facilityvalueid",s).attr("aria-checked",l).attr("onclick","_featured.AdvancefilterValues(this);").attr("role","checkbox").attr("tabindex",0).prop("checked",l).appendTo(c),e("<label/>",{id:"lbl"+d[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")}).text(d[t].FacilityValue).attr("for",d[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")).attr("tabindex",0).attr("role","checkbox").attr("aria-checked",l).appendTo(c)});var f=jQuery.grep(r,function(e){return e.MasterServiceCategoryOrder}).sort(function(e,t){return e.MasterServiceCategoryOrder-t.MasterServiceCategoryOrder}),C=[],S=0;if(0==f.length&&(C.businessType="Business Types"),0!=f.length&&"Business Types"!=C.businessType)for(var y=0;y<f.length;y++)e.inArray(f[y].MasterServiceCategoryName,C)<0&&(C[S]=f[y].MasterServiceCategoryName,S++);(C=jQuery.grep(C,function(e){return"Other"!=e})).push("Other");for(y=0;y<C.length;y++){var b=C[y];r=[],r=jQuery.grep(f,function(e){return e.MasterServiceCategoryName.toLowerCase()==b.toLowerCase()}).sort(function(e,t){return e.FacilityValue.localeCompare(t.FacilityValue)});var k,_,D=!1;e.each(r,function(t){var i=null!=r[t].FacilityHeader&&""!=r[t].FacilityHeader?r[t].FacilityHeader.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",n=null!=r[t].FacilityHeaderID&&""!=r[t].FacilityHeaderID?r[t].FacilityHeaderID:"",o=null!=r[t].FacilityValue&&""!=r[t].FacilityValue?r[t].FacilityValue.trim().toLowerCase().replace(/[^a-zA-Z0-9]+/g,""):"",s=null!=r[t].FacilityValueID&&""!=r[t].FacilityValueID?r[t].FacilityValueID:"",l="",c=!1;if(-1!=u.indexOf(","+r[t].FacilityValue.toLowerCase()+",")&&(c=!0),0==D){$divbType1=e('<div class="_4-col-flex-filter filtercheckboxdiv w-clearfix bottom"/>').appendTo(a),_=e('<div class="filter-title web-display-small"/>').appendTo($divbType1);e("<label/>",{id:"lbl"+b.charAt(0).toUpperCase()+b.slice(1)}).text(b.charAt(0).toUpperCase()+b.slice(1)).appendTo(_);k=e('<div class="filter-cateinput"/>').appendTo($divbType1),l=e('<div class="filters-checkbox filters-first"/>').appendTo(k),D=!0}else l=e('<div class="filters-checkbox"/>').appendTo(k);var d=e('<div class="checkbox-custom-black vagaro-checkbox"/>');e(d).appendTo(l);e("<input />",{type:"checkbox",value:r[t].FacilityValue,id:r[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")}).attr("data-model",r[t].ControlType).attr("data-facilityheader",i).attr("data-facilityvalue",o).attr("data-facilityheaderid",n).attr("data-facilityvalueid",s).attr("aria-checked",c).attr("onclick","_featured.AdvancefilterValues(this);").attr("role","checkbox").attr("tabindex",0).prop("checked",c).appendTo(d),e("<label/>",{id:"lbl"+r[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")}).text(r[t].FacilityValue).attr("for",r[t].FacilityValue.replace(/[^a-zA-Z0-9]+/g,"")).attr("tabindex",0).attr("role","checkbox").attr("aria-checked",c).appendTo(d)})}e("#adfilterLoader").css("display","none"),_featuredDtl.clearAdvanceRating(),_featuredDtl.cleardistanceRadius(),_featuredDtl.showHidUserFavourite(),null!=UserID&&""!=UserID?(e("#divEstablishment").removeClass("nthchild-issue"),e("#divEstablishment > div:nth-child(1)").css("display","").addClass("filters-first"),e("#divEstablishment > div:nth-child(2)").removeClass("filters-first")):(e("#divEstablishment").addClass("nthchild-issue"),e("#divEstablishment > div:nth-child(2)").addClass("filters-first")),void 0!==isClickForOnlineGCStore&&1==isClickForOnlineGCStore&&_featured.getAdvanceSearchData("homepagestore"),void 0!==isClickForBNPL&&1==isClickForBNPL&&(isClickForBNPL=!1,_featured.getAdvanceSearchData()),void 0!==countryid&&"1"!=countryid&&1!=countryid||"listings"!=tabSegment?HideShowControl("Online Store",!0):HideShowControl("Online Store",!1),"listings"==tabSegment||"book"==tabSegment||"class"==tabSegment?(e("#divAdOnlineStream").show(),e(".filter-tabs-menu").removeClass("filt-lastCurv")):(e("#divAdOnlineStream").hide(),e(".filter-tabs-menu").addClass("filt-lastCurv")),(e("#divFilterModeMobile #btnAtBusinessMobile").hasClass("active")||e("#divFilterModeMobile #btnMobileForMobile").hasClass("active")||e("#listStreamFilterId").length>0)&&e("#listStreamFilterId").hide()},_featuredDtl.clearAdvanceRating=function(){e("#rating-input").prev().html(""),e("#rating-input").val(-1),e("#rating-input").rating({min:0,max:5,step:1})},_featuredDtl.cleardistanceRadius=function(){distanceRadius=105},_featuredDtl.showHidUserFavourite=function(){e("#divAdvanceSearch ul li:first").hide()}}(jQuery,window,document),HomeServicesDateChange=function(){("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&$("html, body").width()<767||$("#mobile-check").is(":visible"))&&$("#spnHomeServicesDate").show()};var onServicedateChange=function(e,t){var i=getdatepickervalue(t),n=i.format("MMM dd,yyyy"),o=i.format("hh:nn a/p"),a=!1;$("#mobile-check").is(":visible")&&isServiceAnyTime&&serviceDate==n&&serviceTime==o&&(a=!0),isServiceAnyTime=$(t).val().toLowerCase()==AnyTime.toLowerCase(),$("#mobile-check").is(":visible")?setdatepickervalue({divid:"#mobileDateChange",textid:"#txtMobileServiceDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.LargeDateWithTime)},i):DatePickerFormat(VagaroCountryDateFormat.MiniDate),(a||serviceDate!=n||serviceTime!=o||$("#mobile-check").is(":visible")&&1==isServiceAnyTime)&&_featured.applyServiceFilters()};function filterHaveValue(e,t){return $("#professionalFilter ."+t+" > .inner-bubble-text").filter(function(){return $.trim(this.innerHTML.replace("&amp;","&"))==$.trim(e)}).length>0}function MobilefilterHaveValue(e,t){return $(".mobile-filter-result ."+t+" > .inner-bubble-text").filter(function(){return $.trim(this.innerHTML)==$.trim(e)}).length>0}function nofilterHideShow(){"photos"==tabSegment?($(".mobile-galleryfilter-result").show(),$(".mobile-filter-result").hide(),$("#mobileFilter .mobile-galleryfilter-result a").length>0||$(".imgpromcheck").is(":visible")||$(".atmobilecheck").is(":visible")?($("#mobileFilter .mobile-galleryfilter-result").css("display","block").addClass("vagaro-tag-dismiss"),$("#mobileFilter .location-text-mobile").css("display","none")):($("#mobileFilter .mobile-galleryfilter-result").css("display","none").removeClass("vagaro-tag-dismiss"),$("#mobileFilter .location-text-mobile").css("display","block"))):($(".mobile-galleryfilter-result").hide(),$(".mobile-filter-result").show(),$("#mobileFilter .mobile-filter-result a").length>0||$(".imgpromcheck").is(":visible")||$(".atmobilecheck").is(":visible")?($("#mobileFilter .mobile-filter-result").css("display","flex").addClass("vagaro-tag-dismiss"),$("#mobileFilter .location-text-mobile").css("display","none")):($("#mobileFilter .mobile-filter-result").css("display","none").removeClass("vagaro-tag-dismiss"),$("#mobileFilter .location-text-mobile").css("display","flex")))}function loadGoogleMaps(e,t){DeleteMarkers(),ShowLoader(!0);var i=new google.maps.LatLngBounds;if(e&&"undefined"!=typeof google){if(initializeGoogle(t),null==map){var n=new google.maps.LatLng(countryLat,countryLon);return void i.extend(n)}ShowLoader(!1)}google.maps.event.addListener(map,"tilesloaded",function(e){ShowLoader(!1)}),google.maps.event.addListenerOnce(map,"idle",function(){ShowLoader(!1)});try{if(isRedomap){if(IsDefaultLocation){var o=getCookie(ProximityCookieName);n=new google.maps.LatLng(o.lat,o.long);i.extend(n)}isRedomap=!1}else map.setCenter(i.getCenter(),map.fitBounds(i))}catch(e){}}function DeleteMarkers(){"undefined"!=typeof google&&removeMarkers.length>0&&(clearMarkers(),infobox&&infobox.close(),removeMarkers=[],BusinessArr=[])}function initializeGoogle(e){var t="cooperative";(iPadAndroid||isWindowsPhone)&&(t="greedy"),1==countryid?(countryLat=38.1345,countryLon=-97.3828,countryZoom=4):2==countryid?(countryLat=52.5629,countryLon=-1.8017,countryZoom=5):3==countryid?(countryLat=54.9776,countryLon=-102.3046,countryZoom=3):4==countryid?(countryLat=-26.11598,countryLon=133.7695,countryZoom=4):(null!=countryid&&null!=countryid||(countryLat=38.1345),countryLon=-97.3828,countryZoom=4);var i=[{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"landscape",stylers:[{visibility:"off"}]}],n={mapTypeId:"roadmap",center:new google.maps.LatLng(countryLat,countryLon),zoom:countryZoom,gestureHandling:t,mapTypeControl:!1,streetViewControl:!1,styles:i};if(null==map){var o=document.getElementById(e);if("undefined"!=typeof GoogleMapId&&GoogleMapId&&(n.mapId=GoogleMapId,delete n.styles),n.minZoom=5,map=new google.maps.Map(o,n),"undefined"!=typeof GoogleMapId&&GoogleMapId){var a=new google.maps.StyledMapType(i);map.mapTypes.set("vagaro_map",a),map.setMapTypeId("vagaro_map")}firsttimeMap=!1}0==isRedomap&&google.maps.event.addListener(map,"dragend",function(){$(".redo-search-btn").show()})}function getLocationDate(){var e=iPadAndroid||isWindowsPhone?15:5,t=new Date;if(t.getHours()>=19){t=t.setTime(t.getTime()+216e5),t=new Date(t),t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),9,0,0)}var i=t.format("nn"),n=parseInt(parseInt(i)%e);return n>0&&(i=i-n+e,t.setMinutes(i)),t}function onSearchClick(e,t,i,n,o){var a,s,r;if("locationSearch"==e?(a=$("#txtLocationSearch"),s=$(t.target).closest(".list-unstyled").find(".select2-input"),r=$("#hdngblCountryId")):"BusinesslocationSearch"==e&&(a=$(IdBusinessLocationSearch),s=$(t.target).closest(".list-unstyled").find(".select2-input"),r=$("#hdngblCountryId")),""!=s.val()&&""!=a.data().selectedid){var l="";if(ManageProximityState(l=void 0!==i?i:a.data().selectedid,s.val(),void 0!==n&&n),void 0===i||0!=(void 0!==o&&0==o)||1!=$("#mobile-check").is(":visible")||!HasIdExists(3)||"/"!==window.location.pathname&&""!==window.location.pathname||"listings"!=tabSegment?void 0!==i&&0==(void 0!==o&&0==o)&&-1==window.location.href.indexOf(_common.liveStreamClasses)&&_common.AddState(tabSegment):(_common.AddState("live-stream-classes"),$("body").hasClass("livestreampage")||($("body").addClass("livestreampage"),LoadLiveStreamPage())),null!=l&&"object"!=typeof l&&l.indexOf("|")>-1){var c=window.location.href.split("/"),d=c[0]+"//"+c[2],u=l.split("|")[0];if(null!=(businessURL=d+u)&&""!=businessURL)return $url=$("<a/>"),$url.attr("href",businessURL),void $url[0].click();var p=getCookie(ProximityCookieName);if(null==p)return;return p.countryid==r.attr("data-countryid")?($url=$("<a/>"),$url.attr("href",businessURL),void $url[0].click()):void(setCurrentLocationforBusiness=!0)}if("detail"==BasePage.toLowerCase()){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&("undefined"!=typeof IsBrandedApp||null!=IsBrandedApp||""!=IsBrandedApp||null!=IsBrandedApp)&&1==IsBrandedApp)return;var h="/listings";return"undefined"!=typeof promotionalURL&&null!=promotionalURL&&promotionalURL.length>0&&(h=h+"/"+promotionalURL),void(window.location.href=h)}void 0!==isSetIsCurrentLocationCookie&&setCookie(ProximityIsCurrentLocation,isSetIsCurrentLocationCookie),ProximityValueChanged(null,!1,"BusinesslocationSearch"==e),pageReload()}else{if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){var m=$("#txtLocationSearch");return a.data().selectedid="location",void setCurrentLocationFromDatabase({coords:{latitude:37.78222,longitude:-122.46178}},m,"locationSearch",{target:m},{text:"San Francisco, CA"},"applocationchange","/")}vagaro.alertsmall({message:"Please provide a location.",title:"Alert",callback:function(){ProxymityValueChaning()}})}}function ManageProximityState(e,t,i){var n=EmptyProximityValue();(n.businesstypes=businesstypes,""!=t&&void 0!==e&&null!=e&&"object"==typeof e&&(n.countryid=e.countryID,n.currencysymbol=e.currencySymbol,n.lat=e.latitude,n.long=e.longitude,n.zip=e.zipCode,n.city=e.city,n.state=e.stateCode,n.stateName=e.state,n.utcOffset=e.utcOffset,n.timeZoneOffSet=e.timeZoneOffSet,n.isSupportDayLight=e.IsSupportDayLight),setCookie(ProximityCookieName,n),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&$("#spnAppLocationSearch").html(_common.SetCityState(e.city,e.stateCode.toUpperCase())),i||"undefined"==typeof vgAppicationType||1!=vgAppicationType)||CallbackforMobileApp(0,0,"","","0","21|~|"+('{\\"cityName\\":\\"'+_common.SetCityState(n.city,n.state.toUpperCase())+'\\", \\"latitude\\":\\"'+n.lat+'\\", \\"longitude\\":\\"'+n.long+'\\", \\"countryId\\":'+n.countryid+"}"))}function ProxymityValueChaning(e){SetProximityVariables(e),null!=cltrlLocationSearch&&cltrlLocationSearch.init("top-dropdown",!1),null!=ctrlMobileCityState&&ctrlMobileCityState.init("mob-dropdown mobcommon-dropdown",!1)}function SetProximityVariables(e){if(0!=IsCookieEnabled()&&1!=IsCookieEnabled()){var t=getCookie(ProximityCookieName);return null!=t?(lattitude=t.lat,longitude=t.long,countryid=t.countryid,zip=t.zip,city=t.city,state=t.state,stateName=t.stateName,currencysymbol=t.currencysymbol,businesstypes=t.businesstypes,utcOffset=t.utcOffset,e&&""!=serviceDateTime||(serviceDateTime=getLocationDate())):countryid=1,!0}}function ProximityValueChanged(e,t,i){ProxymityValueChaning(i),isFilterScreen||("undefined"==typeof tabSegment||"listings"!=tabSegment&&"class"!=tabSegment||1!=$("#btnLiveStreamMobile").hasClass("active")?loadData(e,t):(setdefaultSortingOption("listSort","listingsLive"),1==$("#mobile-check").is(":visible")&&loadData(e,t)))}function setCurrentLocationFromDatabase(e,t,i,n,o,a,s){try{if(String.isNullOrUndefineOrBlank(e))return;var r=e.coords.latitude,l=e.coords.longitude,c=new vagaro.ajax;c.datamodel.Token="GetCurrentLocation",c.datamodel.data=[r,l,25,!1],c.datamodel.callback=function(e){if(null!=e){if(e.stateName=e.state,IsDefaultLocation=e.IsDefaultLocation,CountryID=e.countryID,e.state=e.stateCode.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()}),"applocationchange"==a&&void 0!==$(n.target).attr("id").toLowerCase()&&"txtlivestreamlocationsearch"==$(n.target).attr("id").toLowerCase()&&(a="applocationchangeLiveStream"),"onlocationchange"==a||"applocationchange"==a){e.id="location",e.text=_common.SetCityState(e.city,e.stateCode.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()})),t.select2("data",e),$(n.target).data("response",JSON.stringify(e)),$(n.target).attr("id").toLowerCase()!=DocIdBusinessLocationSearch&&$(IdBusinessLocationSearch).length>0&&$(IdBusinessLocationSearch).data("response",JSON.stringify(e)),_common.SetChoiceForSeleect2(t,e);try{"applocationchange"==a&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&$(n.target).attr("id").toLowerCase()!=DocIdBusinessLocationSearch&&IdBusinessLocationSearch.data("selectedid","")}catch(e){}if(1==$(n.target).data().instantsearch){var o=!0;"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&void 0!==s&&null!=s&&(o="home"==s.toLowerCase()||"/"==s||""==s,$("html,body").removeClass("mob-overflow-hidden")),onSearchClick(i,n,e,"applocationchange"==a,o)}}else if("loaddatabypage"==a){var r=EmptyProximityValue(),l=getCookie(ProximityCookieName);if($(IdBusinessLocationSearch).length>0&&$(IdBusinessLocationSearch).data("response",JSON.stringify(e)),void 0!==e&&null!=e){if(void 0===e.countryID?r=_common.SetDefaultCookie(l):(r.countryid=e.countryID,r.currencysymbol="2"==e.countryID?"£":"$",r.lat=e.latitude,r.long=e.longitude,r.zip=e.zipCode,r.city=e.city,r.state=e.state,r.timeZoneOffSet=e.timeZoneOffSet,r.isSupportDayLight=e.IsSupportDayLight),ipLocation=e.latitude+","+e.longitude,"undefined"!=typeof vgAppicationType&&1==vgAppicationType)CallbackforMobileApp(0,0,"","","0","21|~|"+('{\\"cityName\\":\\"'+_common.SetCityState(r.city,r.state.toUpperCase())+'\\", \\"latitude\\":\\"'+r.lat+'\\", \\"longitude\\":\\"'+r.long+'\\", \\"countryId\\":'+r.countryid+"}"))}else r=_common.SetDefaultCookie(l);setCookie(ProximityCookieName,r),null==n&&$("#dvtimezone").is(":visible")?_common.UpdateTimeZoneLocationCookie(!0):_common.UpdateTimeZoneLocationCookie(!1),SetProximityVariables(),setDropDown(!0),isRedomap&&0==("undefined"!=typeof vgAppicationType&&1==vgAppicationType)&&_common.AddState(s),loadData(s,!0)}"undefined"!=typeof _siteBuilderDetail?"applocationchangeLiveStream"==a?($("#txtLiveStreamLocationSearch").select2("destroy"),$("#txtLiveStreamLocationSearch").off("selected"),$("#txtLiveStreamLocationSearch").off("select2-close"),$("#divLiveStreamLocationSearchPopUp").modal("hide"),_siteBuilderDetail.gblsource="LiveStreamBusinessLocationSearch",_siteBuilderDetail.onSearchClick(_siteBuilderDetail.gblsource,n,e,!1,_siteBuilderDetail.flagAddState),void 0!==_siteBuilderDetail.isSetIsCurrentLocationCookie&&_siteBuilderDetail.setCookie(_siteBuilderDetail.ProximityIsCurrentLocation,_siteBuilderDetail.isSetIsCurrentLocationCookie),IsNewAddressHtml?(_siteBuilderDetail.IsShowNewadd=!0,_shopdetail.NewAddressHtml(),void 0!==_onlineCheckout.isClassCheckout&&_onlineCheckout.isClassCheckout&&_onlineCheckout.ChangeCustomerStartTime(e.timeZoneOffSet,e.countryID,e.IsSupportDayLight),_shopdetail.ChangeCustomerStartTime(e.timeZoneOffSet,e.countryID,e.IsSupportDayLight),$("html, body").removeClass("moboverflow-hide")):(_common.UpdateTimeZoneLocationCookie(!0),ShowLoader(!1))):"txtLiveStreamLocationSearch"==n.currentTarget.id&&($("#txtLiveStreamLocationSearch").select2("destroy"),$("#txtLiveStreamLocationSearch").off("selected"),$("#txtLiveStreamLocationSearch").off("select2-close"),$("#divLiveStreamLocationSearchPopUp").modal("hide"),_siteBuilderDetail.onSearchClick(_siteBuilderDetail.gblsource,n,e,!1,_siteBuilderDetail.flagAddState),void 0!==_siteBuilderDetail.isSetIsCurrentLocationCookie&&_siteBuilderDetail.setCookie(_siteBuilderDetail.ProximityIsCurrentLocation,_siteBuilderDetail.isSetIsCurrentLocationCookie),IsNewAddressHtml?(_siteBuilderDetail.IsShowNewadd=!0,_shopdetail.NewAddressHtml(),void 0!==_onlineCheckout.isClassCheckout&&_onlineCheckout.isClassCheckout&&_onlineCheckout.ChangeCustomerStartTime(e.timeZoneOffSet,e.countryID,e.IsSupportDayLight),_shopdetail.ChangeCustomerStartTime(e.timeZoneOffSet,e.countryID,e.IsSupportDayLight),$("html, body").removeClass("moboverflow-hide")):("txtLiveStreamLocationSearch"==$(_siteBuilderDetail.gblevent.target).attr("id")&&_common.UpdateTimeZoneLocationCookie(!0),ShowLoader(!1))):String.isNullOrUndefineOrBlank($(n.target).attr("id"))||"txtLiveStreamLocationSearch"!=$(n.target).attr("id")||_common.SetLocationBySearch(n,!0)}},c.datamodel.Error=function(e){alert("Oops, we cant's find your location")},c.Post()}catch(e){}}function pageReload(){if(1==isAdvanceSearch){if(localStorage.setItem("isAdvanceSearchMenu",1),isAdvanceSearch=!1,"home"==BasePagePervious.toLowerCase()){HideAdvanceSearchModel();try{if($("#txtLocationSearch").val($("#txtBusinessLocationSearch1").val()),$("#txtBusinessLocationSearch").val($("#txtBusinessLocationSearch1").val()),""!=$("#txtBusinessLocationSearch1").data("selectedid")){var e=$("#txtBusinessLocationSearch1").data("selectedid");$("#txtLocationSearch").select2("val",e),$("#txtBusinessLocationSearch").select2("val",e),$("#txtLocationSearch").data("selectedid",e).data("isselected",!0),$("#txtBusinessLocationSearch").data("selectedid",e).data("isselected",!0),isLocationByDefault=!0}}catch(e){}}else localStorage.setItem("isReloadPage",1),location.reload();return!1}try{if($("#txtLocationSearch").val($(IdBusinessLocationSearch).val()),""!=$(IdBusinessLocationSearch).data("selectedid")){e=$(IdBusinessLocationSearch).data("selectedid");$("#txtLocationSearch").select2("val",e),$("#txtLocationSearch").data("selectedid",e).data("isselected",!0)}!$("#divFilterModeMobile #btnAtBusinessMobile").hasClass("active")&&!$("#divFilterModeMobile #btnMobileForMobile").hasClass("active")&&!$("#divFilterModeMobile #btnLiveStreamMobile").hasClass("active")&&$("#listStreamFilterId").length>0&&($("#listStreamFilterId").hide(),$("#divFilterModeMobile #btnAtBusinessMobile").addClass("active"))}catch(e){}}var BasePagePervious=BasePage,isLocationByDefault=!1;function HideAdvanceSearchModel(){return $(".transform-active").is(":visible")&&($(".new-header-design").toggleClass("transform-active",500),$("#menuBar").toggleClass("header-border-none"),$(".search-backdrop").toggleClass("backdrop-visible"),$(".search-nav-bar").toggleClass("hidden-class")),setAdvSearchDefaultName(),!1}function setAdvSearchDefaultName(){1==isAdvanceSearch?(IdSearchServiceMain="#txtSearchServiceMain1",DocIdSearchServiceMain="txtSearchServiceMain1",IdBusinessLocationSearch="#txtBusinessLocationSearch1",DocIdBusinessLocationSearch="txtBusinessLocationSearch1",IdHomeServicesDate="#txtHomeServicesDate1"):(IdSearchServiceMain="#txtSearchServiceMain",DocIdSearchServiceMain="txtSearchServiceMain",IdBusinessLocationSearch="#txtBusinessLocationSearch",DocIdBusinessLocationSearch="txtBusinessLocationSearch",IdHomeServicesDate="#txtHomeServicesDate")}function dummyreleasesearch(){}$("#txtLocationSearch,.search-backdrop, #s2id_autogen1").click(function(){($(".new-header-design").toggleClass("transform-active",500),$("#menuBar").toggleClass("header-border-none"),$(".search-backdrop").toggleClass("backdrop-visible"),$(".search-nav-bar").toggleClass("hidden-class"),isAdvanceSearch=!1,$(".transform-active").is(":visible"))?(BasePage="Home",isAdvanceSearch=!0,setAdvSearchDefaultName(),PageBindAdvSearch(),$("#txtBusinessLocationSearch1").select2("focus"),$("#txtBusinessLocationSearch1").data("select2").val($("#txtLocationSearch").val()),isLocationByDefault=!0):BasePage=BasePagePervious}),LoadAdminServicesKeyphrase=function(){var e=service;if(void 0!==e&&""!=e){if(!AdminServiceList||!Array.isArray(AdminServiceList.results))return void(keyphrasedata="");var t,i=AdminServiceList.results;t=findObjectBytext(i,e),keyphrasedata=null!=t?t.Keyphrase:service}};urlService="",userAgent=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase(),iosDevices=/iPad|iPhone|iPod|iTouch/.test(navigator.userAgent)&&!window.MSStream,isRedomap=!1,IsDefaultLocation=!0,flagSetGeoLocationForApp=!1,IsSetBubbleCount=!1;var IsBrandedAppBusinessActive,InPageWidget_Ios,ScrollTargetListingDeals,CountryID=1,isGetLocation=!1,GoogleApiTimeInterval=1,_public={},ApiURLEnumPublic={getstyleimagescommaseparated:(ApiPath="websiteapi/homepage/")+"getstyleimagecommaseparated",getcitybylatlong:"getcitybylatlong",searchrelatedservice:"searchrelatedservice"};function ToggleLeftMenu(){_common.ToggelmobileMenu()}function loadHomePage(){"Home"==BasePage?(_common.loadHome(),_common.CloseToggelmobileMenu(),closeMobileSearch()):window.location.href=location.protocol+"//"+location.host}function loginLogout(){""!==UserID&&parseInt(UserID)>0?fnLogout():showLogin("yes")}function openKeypad(){$("body").addClass("win-keypad")}function closeKeypad(){$("body").removeClass("win-keypad")}(InPageWidget_Ios=self!==top&&iosDevices)?(ScrollTarget=$("body"),datePicker_contentWindow="body"):(ScrollTarget=$(window),datePicker_contentWindow=window),ScrollTargetListingDeals=iosDevices&&$("#mobile-check").is(":visible")?$(window):$("#divListing");bussinessTypesByCategoryname=[],bussinessTypeIdsByCategoryname=[];var defaultURL="<%=Vagaro.CommonPages.ShopDetailPage %>?BusinessID=",OldProximityCookieName="proximitystate",ProximityCookieName="proximitystate_v3",isSetIsCurrentLocationCookie=(ProximityIsCurrentLocation="proximityiscurrentLocation",!1),lattitude=(EmptyProximityValue=function(){return JSON.parse('{"lat":"","long":"","countryid":"1","zip":"","city":"","state":"","currencysymbol":"$","businesstypes":"","service":"","serviceDate":"","serviceTime":""}')},TrakingInfoValue=function(){return JSON.parse('{"Action":"","PageName":"","busionessName":"","businessID":"","Category":"","dealName":""}')},""),longitude="",zip=(countryid="",""),stateName=(city="",state="",""),businesstypeids="",vgserviceid="",pserviceid="",utcOffset=0,currencysymbol=(serviceDate="",serviceTime="",serviceDateTime="",isServiceAnyTime=!1,AnyTime="Anytime",serviceDateFormat="MMM D [at] h:mm A",""),myLikesCurrentValue=(currentSorting=0,0),isLoadDataCallFromDDL=0,myLikeNoDataMsg=(myLikedStyleUrlValue="/my-liked-styles",noDataMsg="No data available for selected location.","No data available for my liked styles."),CountryNames=["United States","United States","United Kingdom","Canada","Australia"],CurrentLocation="",isDealFilterApplied=!1;lBusinessPromoCodeID=$("#hdBusinessPromoCodeID").length>0?$("#hdBusinessPromoCodeID").val():null,strBusinessPromoURL=$("#hdBusinessPromoURL").val();RedirectToCalendar="no",kidsFacilitiesdata="",isNotSetByCookie=!0;var businessFacilities="",kidsFacilities="",isPromotionBusiness=!1,businessRating=(isFavouriteBusiness=!1,0),setCurrentLocationforBusiness=(distanceRadius=105,!1),displayMonths=6,DistanceText="mi";SearchingUserNameNow=!1,dealtitle="",slectedRedious=105,businessnamed="";var filledHeartIcon="",emptyHeartIcon="",arrStyle=(emptyHeartClass="unliked",[]),styleCounter=0,scrollPos=0;poldservice="";var isLiveStreamResize=!1,relatedSearchId="",homeSliderOptions=[{breakpoint:992,settings:{slidesToShow:2}},{breakpoint:768,settings:{slidesToShow:1,variableWidth:!0}}],searchFilterEnum={Business:1,Mobile:2,LiveStream:3},servicesEventType={Service:1,Class:2,CustomPkg:4,ServiceAddon:7,ClassAddon:8};businessSearchModeForSelection=[0,2];businessSearchMode=void 0===businessSearchMode?2:businessSearchMode;function removecheckBox(e,t){$("#professionalFilter ."+t+" > .inner-bubble-text ").filter(function(){return $.trim(this.innerHTML)==$.trim(e)}).parent().remove(),$(".mobile-filter-result ."+t+" > .inner-bubble-text ").filter(function(){return $.trim(this.innerHTML)==$.trim(e)}).parent().remove(),"chkkids"==t&&("Kid Friendly"!=e&&"Kids Only"!=e||_featured.GetKidsFacilities()),$('.filters-div  input[type="checkbox"]').length>0&&$('.filters-div  input[value="'+e+'"]').is(":checked")&&$('.filters-div  input[value="'+e+'"]').prop("checked",!1).next().attr("aria-checked","false"),businesstypesArray=businesstypes.split(",");var i=e;newdata=$.grep(businesstypesArray,function(e){return e!=i}),businesstypes=newdata.toString();var n=getCookie(ProximityCookieName);null!=n&&(n.businesstypes=businesstypes,setCookie(ProximityCookieName,n)),setCheckBox(businesstypes),nofilterHideShow(),_featured.getAdvanceSearchData()}function setCheckBox(e){var t=e.replace("Buy Now, Pay Later","Buy Now| Pay Later").split(",").map(e=>e.trim().replace("Buy Now| Pay Later","Buy Now, Pay Later"));$.each(t,function(e){""!=t[e]&&$('.filters-div  input[value="'+t[e]+'"]').prop("checked",!0)})}function findCurrentLocation(e,t,i,n,o,a){"undefined"!=typeof navigator&&null!=typeof navigator&&void 0!==navigator.geolocation&&null!=navigator.geolocation?void 0!==navigator.permissions&&null!=navigator.permissions?navigator.permissions.query({name:"geolocation"}).then(function(s){"prompt"==s.state||"granted"==s.state&&"onlocationchange"==o?navigator.geolocation.getCurrentPosition(function(s){isFirstTimeCall="false",isGetLocation=!0,clearInterval(GoogleApiTimeInterval),setCurrentLocationFromDatabase(s,e,t,i,n,o,a)},function(s){0==("undefined"!=typeof isFirstTimeCall&&null!=isFirstTimeCall&&"true"==isFirstTimeCall.toString().toLowerCase())&&latLongFailed(e,t,i,n,o,a),isGetLocation=!0,GetLatLong(),isFirstTimeCall="false"}):"denied"==s.state&&"onlocationchange"==o&&bootbox.confirm({title:"Location",message:"Allow access to Location Services to get your current location.",buttons:{cancel:{label:"Cancel",className:"location-popup-cancel-button-hiden"}},callback:function(e){}})}):navigator.geolocation.getCurrentPosition(function(s){isFirstTimeCall="false",setCurrentLocationFromDatabase(s,e,t,i,n,o,a)},function(){0==("undefined"!=typeof isFirstTimeCall&&null!=isFirstTimeCall&&"true"==isFirstTimeCall.toString().toLowerCase())&&latLongFailed(e,t,i,n,o,a),isFirstTimeCall="false"}):latLongFailed(e,t,i,n,o,a),ShowLoader(!1)}function latLongFailed(e,t,i,n,o,a){var s=getCookie(ProximityCookieName),r=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";$.ajax({url:r+"WebServices/MySampleService.asmx/GetLocation",type:"POST",contentType:"application/json; charset=utf-8"}).success(function(n){if("loaddatabypage"==o){var r=EmptyProximityValue();if(void 0!==n&&null!=n&&"success"==n.status.toLowerCase())void 0===(c=(l={us:"1",gb:"2",ca:"3",au:"4"})[n.countryCode.toLowerCase()])?r=_common.SetDefaultCookie(s):(r.countryid=c,r.currencysymbol="2"==c?"£":"$",r.lat=n.lat,r.long=n.lon,r.zip=n.zip,r.city=n.city,r.state=n.region),ipLocation=n.lat+","+n.lon;else r=_common.SetDefaultCookie(s);setCookie(ProximityCookieName,r),SetProximityVariables(),setDropDown(),loadData(a,!0)}else if("onlocationchange"==o&&void 0!==n&&null!=n&&"success"==n.status.toLowerCase()){var l={us:"1",gb:"2",ca:"3",au:"4"},c="1";isNullOrUndefineOrBlank(n.countryCode)||(c=l[n.countryCode.toLowerCase()]);var d={};if(void 0===c){var u=_common.SetDefaultCookie(s);d.latitude=u.lat,d.longitude=u.long,d.zipCode=u.zip,d.cityState=_common.SetCityState(u.city,u.state.toUpperCase()),d.city=u.city,d.stateName=u.stateName,d.state=u.state.toUpperCase(),d.stateCode=u.state,d.countryID=countryid}else d.countryID=c,d.latitude=n.lat,d.longitude=n.lon,d.zipCode=n.zip,d.cityState=_common.SetCityState(n.city,n.region.toUpperCase()),d.countryName=n.country,d.city=n.city,d.stateName=n.regionName,d.state=n.region.toUpperCase(),d.stateCode=n.region;if(d.currencySymbol="2"==d.countryID?"£":"$",d.type=1,d.id="location",d.text=_common.SetCityState(d.city,d.stateCode.toUpperCase()),_common.SetChoiceForSeleect2(e,d),e.select2("data",d),$(i.target).data("response",JSON.stringify(d)),"txtbusinesslocationsearch"!=$(i.target).attr("id").toLowerCase()&&$("#txtBusinessLocationSearch").length>0&&$("#txtBusinessLocationSearch").data("response",JSON.stringify(d)),1==$(i.target).data().instantsearch){var p=!0;"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(p="home"==a.toLowerCase()||"/"==a||""==a),onSearchClick(t,i,d,!1,p)}"txtLiveStreamLocationSearch"==i.currentTarget.id&&_common.SetLocationBySearch(i,!0)}})}function setCookieVariable(e){setCookie(ProximityCookieName,e),1==setCurrentLocationforBusiness&&""!=businessURL&&(window.location.href=businessURL,businessURL=""),SetProximityVariables(),ctlrMain.init("","true"),null!=ctlrListing&&ctlrListing.init("orange-dropdown","true"),0==setCurrentLocationforBusiness&&loadData(tabSegment,!0)}function onFeaturedBusinessRowLoad(e,t){var i=$(t),n=e.VagaroURL.replace("'","'").toLowerCase();null!=e.Telephone&&""!=e.Telephone&&$("#hdnPhone_"+e.BusinessID,i).val(e.Telephone),$("#businessName_"+e.BusinessID).text(truncateText(e.BusinessName,0,200,!0));var o=parseFloat(e.AverageRank),a=(o=isNaN(o)?0:o).toFixed(1),s=e.ReviewTotal||0,r=1===s?"Review":"Reviews";if(e.IsNewBusiness&&0===s)$("#divRating_"+e.BusinessID,i).closest(".vagaro-star-rating").attr("style","display: none !important"),$("#reviewTotal",i).addClass("badgeNewWrap").html("<span class='badge-button-blue'>New</span>"),$("#anrating_"+e.BusinessID,i).attr("aria-label","New Business");else{if(o>0){var l=(100*o/5).toFixed(1);$("#divRating_"+e.BusinessID,i).css("width",l+"%")}$("#reviewTotal",i).text(a+" ("+s+" "+r+")"),$("#anrating_"+e.BusinessID,i).attr("aria-label","Has "+a+" star ratings having total "+s+" "+r.toLowerCase()+"."),$("#divRating_"+e.BusinessID,i).closest(".vagaro-star-rating").attr("title",a)}e.Description&&null!=e.Description&&""!=e.Description?$("#pMoreContent_"+e.BusinessID).text().length<112&&($("#btnMoreContent_"+e.BusinessID,i).hide(),$("#divMoreContent_"+e.BusinessID,i).css("margin-top","0"),$("#pMoreContent_"+e.BusinessID).css("height","auto")):($("#divDescription_"+e.BusinessID,i).hide(),$("#divMoreContent_"+e.BusinessID,i).hide());if(e.isMobile||$("#imgOutCall_"+e.BusinessID,i).hide(),e.IsZoomIntegrated&&$("#imgIsZoomIntegrated_"+e.BusinessID,i).show(),e.isPromotion){var c={};c.BusinessID=e.BusinessID,c.VagaroURL=n,c.TotalPage=e.TotalPage}else $("#aPromotion_"+e.BusinessID,i).hide();if(null!=e.BusinessClosedNow&&e.BusinessClosedNow||$("#divBusinessStatus_"+e.BusinessID,i).addClass("visibilityHidden"),null!=e.FacilityValue&&e.FacilityValue.length>0){var d=e.FacilityValue.replace(", ",",");d=d.split(",").join(", "),$("#facilities_"+e.BusinessID,i).html(d),$("#facilities_"+e.BusinessID,i).attr("title",d)}var u=!0===e.isPromotion;return(!u||2!=e.lCountryID&&$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").length>6||$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").find(".ad-text:visible").length<$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").length||(0==_BusinessData.isFromMobile||0==_BusinessData.isCurrentLocation)&&void 0!==_BusinessData.cityName&&"undefined"!=e.City&&_BusinessData.cityName.toLowerCase()!=e.City.toLowerCase())&&$(".ad-text",i).hide(),u?$("#spAdText",i).text("Ad").show():$("#spAdText",i).hide(),$("#divBusinessCovid_"+e.BusinessID,i).hide(),i}function AppointmentClassSearchDate(e){var t=new Date(moment(e)._d);t.setHours(0,0,0,0);var i=new Date;i.setHours(0,0,0,0);var n=new Date;n.setDate(n.getDate()+1),n.setHours(0,0,0,0);return moment(new Date).format("MM-DD-YYYY")!=moment(t).format("MM-DD-YYYY")&&$("#txtServiceDate").val().toLowerCase()==AnyTime.toLowerCase()?countryDateFormat(moment(e),VagaroCountryDateFormat.MiniDate):moment(t).format("MM-DD-YYYY")==moment(i).format("MM-DD-YYYY")?"Today":moment(t).format("MM-DD-YYYY")==new moment(n).format("MM-DD-YYYY")?"Tomorrow":countryDateFormat(moment(e),VagaroCountryDateFormat.MiniDate)}function onServicesRowLoad(e,t){var i=$(t),n="",o=location.protocol+"//"+location.host+"/"+e.VagaroURL;$("#aServiceBusName",i).text(truncateText(e.BusinessName,0,22,!0));var a=Number(e.AverageRank||0).toFixed(1),s=parseInt(e.ReviewTotal)||0,r=1===s?"Review":"Reviews";if(e.IsNewBusiness&&0===s)$(".vagaro-star-rating",i).attr("style","display: none !important"),$("#divServiceBusReviewTotal",i).addClass("badgeNewWrap").html("<span class='badge-button-blue'>New</span>").attr("aria-label","New Business");else{if(e.AverageRank>0){var l=100*e.AverageRank/5;$("#divServiceBusRating",i).css("width",l.toFixed(1)+"%")}$("#divServiceBusReviewTotal",i).text(`${a} (${s} ${r})`).attr("aria-label",`Has ${a} star ratings having total ${s} ${r}.`),$(".star-container",i).attr("title",a)}if(1==e.IsShowPriceOnline){n=" "+currencysymbol+parseFloat(e.Price).toFixed(2);var c="";e.NewPrice!=e.Price?(c="<div class='old-newbothprice bookTodayBothPrice'><span aria-label='Old Price "+n+"' class='strikethrough'>"+n+"</span><span class='service-price-row-small-strong' aria-label='Promotion Price "+currencysymbol+parseFloat(e.NewPrice).toFixed(2)+"'>"+currencysymbol+parseFloat(e.NewPrice).toFixed(2)+"</span></div>",$("#divServiceBusPrice",i).html(c)):$("#divServiceBusPrice",i).html(n)}else $("#divServiceFromTime",i).addClass("search-no-price");e.Description&&null!=e.Description&&""!=e.Description?$("#pMoreContent_"+e.BusinessID).text().length<112&&($("#btnMoreContent_"+e.BusinessID,i).hide(),$("#divMoreContent_"+e.BusinessID,i).css("margin-top","0"),$("#pMoreContent_"+e.BusinessID).css("height","auto")):($("#divDescription_"+e.ServiceID).remove(),$("#divMoreContent_"+e.ServiceID).remove());e.isOutCallService||$("#imgOutCall",i).hide(),e.IsZoomIntegrated&&($("#imgIsZoomIntegrated",i).show(),$("#imgIsZoomIntegrated",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);")),null==e.PromotionCount||null==e.PromotionCount||0==e.PromotionCount?($("#aSerivceBusPromotion",i).hide(),$("#aSerivceBusPromotion",i).removeAttr("href")):$("#aSerivceBusPromotion",i).attr("href",o+"/deals/"+e.PromotionTitle+"-"+e.PromotionID+isdeal);try{if(void 0!==e.eventType&&1==e.eventType){if(void 0!==e.strFreeTime&&null!=e.strFreeTime){var d=moment(new Date(e.strFreeTime)).format("MMM DD,YYYY");$("#appDate",i).html(d);var u=AppointmentClassSearchDate(e.strFreeTime),p=moment(new Date(e.strFreeTime)).format("h:mm A");$("#divServiceTimeFormate",i).html("Book | "+u+' <span class="class-timedash">-</span> <span class="class-booktime">'+p+"</span>")}var h=e.ServiceTitle;void 0!==e.IsShowEventType&&e.IsShowEventType&&(h+=" - Service"),$("#divServiceTitleBook",i).html(h)}else{if(void 0!==e.strFreeTime&&null!=e.strFreeTime){u=AppointmentClassSearchDate(e.strFreeTime);var m=moment(new Date(e.strFreeTime)).format("h:mm A");$("#divServiceTimeFormate",i).html("Book | "+u+' <span class="class-timedash">-</span> <span class="class-booktime">'+m+"</span>"),$("#aServiceFromTime",i).addClass("classdateprice")}h=e.ServiceTitle;void 0!==e.IsShowEventType&&e.IsShowEventType&&(h+=" - Class"),$("#divServiceTitleBook",i).html(h)}}catch(e){}var g={};if(g.serviceid=e.ServiceID,g.vagarourl=e.VagaroURL,g.bookingDateTime=$("#appDate",i).html(),"Invalid date"==g.bookingDateTime&&(g.bookingDateTime=moment(new Date).format("MMM DD,YYYY")),0==e.IsAnyTimeSearch?($("#aServiceFromTime",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);"),$("#aServiceFromTime",i).show()):$("#aServiceFromTime",i).hide(),("undefined"!=typeof vgAppicationType&&1==vgAppicationType||$("#mobile-check").is(":visible"))&&0==e.IsAnyTimeSearch)$("#BusinessLogoSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);"),$("#BusinessDetailSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);");else try{var v=$("#aServiceFromTime",i).find(".class-booktime").text().trim();!!v&&0==e.IsAnyTimeSearch?($("#BusinessLogoSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);"),$("#BusinessDetailSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);")):($("#BusinessDetailSection",i).attr("onclick","javascript:_featured.RedirectBusinessDetailPage("+e.ServiceID+");"),$("#BusinessLogoSection",i).attr("onclick","javascript:_featured.RedirectBusinessDetailPage("+e.ServiceID+");"))}catch(t){$("#BusinessDetailSection",i).attr("onclick","javascript:_featured.RedirectBusinessDetailPage("+e.ServiceID+");"),$("#BusinessLogoSection",i).attr("onclick","javascript:_featured.RedirectBusinessDetailPage("+e.ServiceID+");")}if((void 0===e.strFreeTime||null==e.strFreeTime||""==e.strFreeTime)&&void 0!==e.ServiceID&&null!=e.ServiceID&&""!=e.ServiceID){var f={};f.serviceid=e.ServiceID,f.vagarourl=e.VagaroURL,$("#aServiceBusName",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(f)+",event);"),$("#anc_"+e.ServiceID).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(f)+",event);"),$("#ancbus_"+e.ServiceID).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(f)+",event);"),$("#aServiceRating",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(f)+",event);"),$("#BusinessDetailSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(f)+",event);"),$("#service_"+e.BusinessID).off("click").on("click",function(e){_featured.RedirectToBook24(f,e)}),$("#aServiceBusImage",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(f)+",event);"),$("#BusinessLogoSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(f)+",event);")}var C=!0===e.isPromotion;return(!C||$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").length>6||$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").find(".ad-text:visible").length<$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").length||(0==_ServiceData.isFromMobile||0==_ServiceData.isCurrentLocation)&&void 0!==_ServiceData.cityName&&"undefined"!=e.City&&_ServiceData.cityName.toLowerCase()!=e.City.toLowerCase())&&$(".ad-text",i).hide(),C?$("#spAdText",i).text("Ad").show():$("#spAdText",i).hide(),$("#divIsCovidReady",i).hide(),i}function onClassesRowLoad(e,t){var i=$(t),n="",o=location.protocol+"//"+location.host+"/"+e.VagaroURL;$("#aServiceBusName",i).text(truncateText(e.BusinessName,0,22,!0)),$("#aServiceBusName",i).attr("href",o),$("#aServiceBusName",i).attr("target","_blank");var a=Number(e.AverageRank||0).toFixed(1),s=parseInt(e.ReviewTotal)||0,r=1===s?"Review":"Reviews";if(e.IsNewBusiness&&0===s)$(".vagaro-star-rating",i).attr("style","display: none !important"),$("#divServiceBusReviewTotal",i).addClass("badgeNewWrap").html("<span class='badge-button-blue'>New</span>").attr("aria-label","New Business");else{if(e.AverageRank>0){var l=100*e.AverageRank/5;$("#divServiceBusRating",i).css("width",l.toFixed(1)+"%")}$("#divServiceBusReviewTotal",i).text(`${a} (${s} ${r})`).attr("aria-label",`Has ${a} star ratings having total ${s} ${r}.`),$(".star-container",i).attr("title",a)}if(1==e.IsShowPriceOnline){n=" "+currencysymbol+parseFloat(e.Price).toFixed(2);var c="";e.NewPrice!=e.Price?(c="<div class='old-newbothprice bookTodayBothPrice'><span class='strikethrough'>"+n+"</span><span class='service-price-row-small-strong' >"+currencysymbol+parseFloat(e.NewPrice).toFixed(2)+"</span></div>",$("#divServiceBusPrice",i).html(c)):$("#divServiceBusPrice",i).html(n)}else $("#divServiceFromTime",i).addClass("search-no-price");try{if(void 0!==e.eventType&&1==e.eventType){if(void 0!==e.strFreeTime&&null!=e.strFreeTime){var d=moment(new Date(e.strFreeTime)).format("MMM DD,YYYY");$("#appDate",i).html(d);var u=AppointmentClassSearchDate(e.strFreeTime),p=moment(new Date(e.strFreeTime)).format("h:mm A");$("#divclassFromDate",i).html("Book | "+u+' <span class="class-timedash">-</span> <span class="class-booktime">'+p+"</span>")}var h=e.ServiceTitle;void 0!==e.IsShowEventType&&e.IsShowEventType&&(h+=" - Service"),$("#divServiceTitleBook",i).html(h)}else{if(void 0!==e.strFreeTime&&null!=e.strFreeTime){u=AppointmentClassSearchDate(e.strFreeTime);var m=moment(new Date(e.strFreeTime)).format("h:mm A");$("#divclassFromDate",i).html("Book | "+u+' <span class="class-timedash">-</span> <span class="class-booktime">'+m+"</span>")}h=e.ServiceTitle;void 0!==e.IsShowEventType&&e.IsShowEventType&&(h+=" - Class"),$("#divServiceTitleBook",i).html(h)}}catch(e){}e.Description&&null!=e.Description&&""!=e.Description?$("#pMoreContent_"+e.BusinessID).text().length<112&&($("#btnMoreContent_"+e.BusinessID,i).hide(),$("#divMoreContent_"+e.BusinessID,i).css("margin-top","0"),$("#pMoreContent_"+e.BusinessID).css("height","auto")):($("#divDescription_"+e.ServiceID,i).hide(),$("#divMoreContent_"+e.ServiceID,i).hide());e.isOutCallService||$("#imgOutCall",i).hide(),e.IsZoomIntegrated&&($("#imgIsZoomIntegrated",i).show(),$("#imgIsZoomIntegrated",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);")),null==e.PromotionCount||null==e.PromotionCount||0==e.PromotionCount?($("#aSerivceBusPromotion",i).hide(),$("#aSerivceBusPromotion",i).removeAttr("href")):$("#aSerivceBusPromotion",i).attr("href",o+"/deals/"+e.PromotionTitle+"-"+e.PromotionID+isdeal);var g={};g.serviceid=e.ServiceID,g.vagarourl=e.VagaroURL,g.bookingDateTime=$("#appDate",i).html(),"Invalid date"==g.bookingDateTime&&(g.bookingDateTime=moment(new Date).format("MMM DD,YYYY")),0==e.IsAnyTimeSearch?($("#aServiceFromTime",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);"),$("#aServiceFromTime",i).show()):$("#aServiceFromTime",i).hide(),("undefined"!=typeof vgAppicationType&&1==vgAppicationType||$("#mobile-check").is(":visible"))&&0==e.IsAnyTimeSearch?($("#BusinessLogoSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);"),$("#BusinessDetailSection",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(g)+",event);")):($("#BusinessDetailSection",i).attr("onclick","javascript:_featured.RedirectBusinessDetailPage("+e.ServiceID+");"),$("#BusinessLogoSection",i).attr("onclick","javascript:_featured.RedirectBusinessDetailPage("+e.ServiceID+");"));var v=!0===e.isPromotion;return(!v||$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").length>6||$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").find(".ad-text:visible").length<$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").length||(0==_ClassData.isFromMobile||0==_ClassData.isCurrentLocation)&&void 0!==_ClassData.cityName&&"undefined"!=e.City&&_ClassData.cityName.toLowerCase()!=e.City.toLowerCase())&&$(".ad-text",i).hide(),v?$("#spAdText",i).text("Ad").show():$("#spAdText",i).hide(),$("#divIsCovidReady",i).hide(),i}function CallSetSessionData(e,t,i){var n=new vagaro.ajax;n.datamodel.Token="SetSessionData",n.datamodel.callback=successSession,n.datamodel.data=[e,t,i],n.datamodel.Error=onLoadFail,n.Post()}function successSession(e){null!=e.d&&(e=e.d),window.location=e}function onLoadFail(e){null!=e.d&&(e=e.d),ShowLoader(!1)}bookSearchItemType=[],$(".modal").on("shown.bs.modal",function(){navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)||$(this).find("input:text,textarea").first().focus()}),function(){"use strict";var e;if((e=document.createElement("DIV")).innerHTML="\x3c!--[if lte IE 8]><I></I><![endif]--\x3e",e.getElementsByTagName("I").length>0)resize_bg(),$("#fullbackground-wrapper").css("display","block"),$("#dvBrowserSettings").modal("show")}(),function(e){_featured={},_featured.advanceFilterData="",_featured.catchStyleInfo="",_featured.catchstyleMainCategory="",_featured.catchGeneralCategory="",_featured.defaultGeneralCategory="",_featured.catchStyleCategory="",_featured.selectedCastegoryID=0,_featured.BusinessPager=new Pagination(e("#ulFeatureBusiness"),{Token:"GetRandomActiveBusiness_New",Data:{},LocalData:{},IsAjaxQue:!0,templateName:"ulFeatureBusinessTemplate",PageSize:20,NoDataFoundDiv:e("#divNodataFeature"),Loader:e("#divFeatureBusinessLoader"),EnablePagescroll:!0,ScrollTarget:ScrollTargetListingDeals,initialpageData:initialpageData,pageName:"listings",lazyLoadClass:"lazypager",BestSalon:e("#divBestSaloonHead")}).init(),_featured.ServicesPager=new Pagination(e("#ulFeatureBusiness"),{Token:"FindFreeSlotsForBookAServiceOnlineNew",Data:{},LocalData:{},IsAjaxQue:!0,templateName:"serviceTemplate",PageSize:20,NoDataFoundDiv:e("#divNodataFeatureServices"),Loader:e("#divFeatureBusinessLoader"),EnablePagescroll:!0,ScrollTarget:ScrollTargetListingDeals,initialpageData:initialpageData,pageName:"book",lazyLoadClass:"lazypager",BestSalon:e("#divBestSaloonHead")}).init(),_featured.ClassPager=new Pagination(e("#ulFeatureBusiness"),{Token:"FindFreeSlotsForBookAClassOnlineNew",Data:{},LocalData:{},IsAjaxQue:!0,templateName:"classTemplate",PageSize:20,NoDataFoundDiv:e("#divNodataFeatureServices"),Loader:e("#divFeatureBusinessLoader"),EnablePagescroll:!0,ScrollTarget:ScrollTargetListingDeals,initialpageData:initialpageData,pageName:"class",lazyLoadClass:"lazypager",BestSalon:e("#divBestSaloonHead")}).init(),_featured.BisDetailpagefromListing=function(t,i){"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("#ancblist_"+t).removeAttr("target"),void 0!==i&&null!=i&&"true"==i.toString().toLowerCase()&&SetFeaturedMarketplaceCookie(t),event.stopPropagation(),event.preventDefault();var n=document.getElementById("ancblist_"+t);e("#mobile-check").is(":visible")&&"undefined"!=typeof vgAppicationType&&0==vgAppicationType?window.location.href=n.href:n.click()},_BusinessData={},_featured.BusinessPager.load=function(){var t=_featured.BusinessPager;if(e("#spnTotalRecords").hide(),e("#divBestSaloonHead").hide(),e("#divRelatedSearchHead").hide(),e("#divFAQSearchServiceHead").hide(),""!==lattitude&&void 0!==lattitude&&null!=lattitude&&void 0!==longitude&&""!==longitude&&null!=longitude&&(latlong=lattitude+"|"+longitude,_featured.GetCityByLatLong(latlong)),_featured.GetAdminRelatedService(),_featured.GetAdminFAQServiceClass(),_featured.clearselectiononservicecategorychange(),poldservice="",_featured.isStream=!1,t.options.ActivateLoading=!0,_BusinessData.sType="all",_featured.isOnlinestore=!1,_featured.isOnlineGCstore=!1,_featured.isDisplayCovidBadge=!1,"?VPLStatus=true"==window.location.search){_BusinessData.sFacilities="[[3,97]]",_BusinessData.sBusinessTypes="",_BusinessData.sBusinessTypeIds="[]",_BusinessData.sKidsCondition="",_BusinessData.iUserID=!0===isFavouriteBusiness?UserID:"",""==_BusinessData.iUserID&&(_BusinessData.iUserID=0),_BusinessData.sBusinessIds="",_BusinessData.SortType=5,_BusinessData.blnPromotion=!1,_BusinessData.sCurrentRating=0,_BusinessData.sSessionIDOfUser="",_BusinessData.SRandomGUID="",_BusinessData.sSearchRadious=50,_BusinessData.sPromotionCodeID="",_BusinessData.latlong="37.77501|-122.41826",_BusinessData.CountryID=countryid,_BusinessData.SearchFilter=2,_BusinessData.ArrSearchFilter="0,2",t.options.onRowLoad=onFeaturedBusinessRowLoad,t.options.afterLoad=onFeaturedBusinessAfterLoad;var i=getCookie(ProximityCookieName),n=getCookie(ProximityIsCurrentLocation);_BusinessData.cityName=i.city,_BusinessData.stateCode=i.state,_BusinessData.isFromMobile=!1,(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&(_BusinessData.isFromMobile=!0),_BusinessData.isCurrentLocation=void 0!==n&&null!=n&&"true"==n.toString().toLowerCase(),_BusinessData.ignoreBusinessIds="",_BusinessData.isOnlineStore=_featured.isOnlinestore,_BusinessData.isOnlineGCStore=_featured.isOnlineGCstore,_BusinessData.IsDisplayCovidBadge=_featured.isDisplayCovidBadge,HasIdExists(3)&&(_featured.isStream=!0),_BusinessData.isStream=_featured.isStream,e("#VagaroPay Later").prop("Checked",!0),_featured.BusinessPager.options.Data.objRandomBusinessData=_BusinessData,t.scroll()}else{_BusinessData.sFacilities=JSON.stringify(_featured.GetFacilityObject()),_BusinessData.sBusinessTypes=businesstypes,_BusinessData.sBusinessTypeIds=businesstypeids,_BusinessData.sKidsCondition=kidsFacilities,_BusinessData.iUserID=!0===isFavouriteBusiness?UserID:"",""==_BusinessData.iUserID&&(_BusinessData.iUserID=0),_BusinessData.sBusinessIds="",_BusinessData.SortType=getSortingValue(),_BusinessData.blnPromotion=isPromotionBusiness,_BusinessData.sCurrentRating=isNaN(businessRating>0?6-businessRating:businessRating)?0:businessRating>0?6-businessRating:businessRating,_BusinessData.sSessionIDOfUser="",_BusinessData.SRandomGUID="",_BusinessData.sSearchRadious=50,_BusinessData.sPromotionCodeID=lBusinessPromoCodeID,_BusinessData.latlong=latlong,_BusinessData.CountryID=countryid,_BusinessData.SearchFilter=businessSearchMode,_BusinessData.ArrSearchFilter=businessSearchModeForSelection.join(),t.options.onRowLoad=onFeaturedBusinessRowLoad,t.options.afterLoad=onFeaturedBusinessAfterLoad;i=getCookie(ProximityCookieName),n=getCookie(ProximityIsCurrentLocation);_BusinessData.cityName=i.city,_BusinessData.stateCode=i.state,_BusinessData.isFromMobile=!1,(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&(_BusinessData.isFromMobile=!0),_BusinessData.isCurrentLocation=void 0!==n&&null!=n&&"true"==n.toString().toLowerCase(),_BusinessData.ignoreBusinessIds="",_BusinessData.isOnlineStore=_featured.isOnlinestore,_BusinessData.isOnlineGCStore=_featured.isOnlineGCstore,_BusinessData.IsDisplayCovidBadge=_featured.isDisplayCovidBadge,HasIdExists(3)&&(_featured.isStream=!0),_BusinessData.isStream=_featured.isStream,_featured.BusinessPager.options.Data.objRandomBusinessData=_BusinessData,t.scroll()}},_ServiceData={},_featured.ServicesPager.load=function(){if(e("#divBestSaloonHead").hide(),e("#divRelatedSearchHead").hide(),String.isNullOrUndefineOrBlank(lattitude)||String.isNullOrUndefineOrBlank(longitude)||(latlong=lattitude+"|"+longitude,_featured.GetCityByLatLong(latlong)),_featured.GetAdminRelatedService(),_featured.GetAdminFAQServiceClass(),null==service||""==service||"select service"==service.toLowerCase())bootbox.alert("Please select a service.");else{var t=null,i=null;e("#spnTotalRecords").hide(),""!=lattitude&&""!=longitude&&(t=lattitude,i=longitude,e("#liNearest").css("display","")),_featured.isStream=!1,_featured.isDisplayCovidBadge=!1,_featured.clearselectiononservicecategorychange(),_featured.ServicesPager.options.ActivateLoading=!0,_ServiceData.CountryID=countryid,_ServiceData.lattitude=t,_ServiceData.longitude=i,_ServiceData.Radius=50,_ServiceData.strServiceTitle=service,_ServiceData.ReqServiceProviderID=0,_ServiceData.dtDate=0==isServiceAnyTime?serviceDate:new Date,_ServiceData.dtTime=0==isServiceAnyTime?serviceTime:null,_ServiceData.SortType=getSortingValue(),_ServiceData.BusinessTypes=businesstypeids,_ServiceData.Facilities=JSON.stringify(_featured.GetFacilityObject()),_ServiceData.KidsCriteria=""==kidsFacilities?null:kidsFacilities,_ServiceData.sPromotionCodeID=lBusinessPromoCodeID,_ServiceData.iUserID=UserID,_ServiceData.blnPromotion=isPromotionBusiness,_ServiceData.isPromotion=isPromotionBusiness,_ServiceData.sCurrentRating=isNaN(businessRating>0?6-businessRating:businessRating)?0:businessRating>0?6-businessRating:businessRating,_ServiceData.SearchFilter=businessSearchMode,_ServiceData.ArrSearchFilter=businessSearchModeForSelection.join(),_ServiceData.sPagingDetails=sPagingDetailsBookAService,_ServiceData.serviceTime=0==isServiceAnyTime?serviceTime:null,sPagingDetailsBookAService="",_featured.ServicesPager.options.onRowLoad=onServicesRowLoad,_featured.ServicesPager.options.afterLoad=onServicesAfterLoad,e(".EnablePagescroll").removeClass("EnablePagescroll"),e("#serviceTemplate").addClass("EnablePagescroll");var n=getCookie(ProximityCookieName),o=getCookie(ProximityIsCurrentLocation);_ServiceData.cityName=n.city,_ServiceData.stateCode=n.state,_ServiceData.isFromMobile=!1,(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&(_ServiceData.isFromMobile=!0),_ServiceData.isCurrentLocation=void 0!==o&&null!=o&&"true"==o.toString().toLowerCase(),_ServiceData.ignoreBusinessIds="",HasIdExists(3)&&(_featured.isStream=!0),_ServiceData.isStream=_featured.isStream,poldservice.toLowerCase()!=service.toLowerCase()&&(_ServiceData.VagaroServiceIDs="",_ServiceData.IsShowEventType=!1),_ServiceData.IsCovidReadyBadge=_featured.isDisplayCovidBadge,_featured.ServicesPager.options.Data.objServiceOptionsData=_ServiceData,_featured.ServicesPager.scroll()}},_featured.clearselectiononservicecategorychange=function(){try{var t=!1,i=_common.GetChoiceForSeleect2(e("#ddlServices")).id;if(""==i)""!=pserviceid&&(_featured.clearAdvanceSearch(),pserviceid="");else{var n="";(""==pserviceid||null==pserviceid)&&serviceId>0&&(pserviceid=serviceId),""!=pserviceid&&(n=pserviceid);var o=_common.GetChoiceForSeleect2(e("#txtSearchServiceMain")).id;null!=o&&parseInt(o)==o&&(pserviceid=o),(""!=n&&""!=pserviceid&&n!=pserviceid||""==n&&""!=pserviceid)&&(t=!0,_featured.clearAdvanceSearch())}t||""==i||poldservice.toLowerCase()!=i.toLowerCase()&&_featured.clearAdvanceSearch()}catch(e){}},_ClassData={},_featured.ClassPager.load=function(){if(e("#divBestSaloonHead").hide(),e("#divRelatedSearchHead").hide(),String.isNullOrUndefineOrBlank(lattitude)||String.isNullOrUndefineOrBlank(longitude)||(latlong=lattitude+"|"+longitude,_featured.GetCityByLatLong(latlong)),_featured.GetAdminFAQServiceClass(),_featured.GetAdminRelatedService(),null==service||""==service||"select service"==service.toLowerCase())bootbox.alert("Please select a class.");else{var t=null,i=null;e("#spnTotalRecords").hide(),""!=lattitude&&""!=longitude&&(t=lattitude,i=longitude,e("#liNearest").css("display","")),_featured.isStream=!1,_featured.isDisplayCovidBadge=!1,_featured.clearselectiononservicecategorychange(),_featured.ClassPager.options.ActivateLoading=!0,_ClassData.CountryID=countryid,_ClassData.lattitude=t,_ClassData.longitude=i,_ClassData.Radius=50,_ClassData.strServiceTitle=service,_ClassData.ReqServiceProviderID=0,_ClassData.dtDate=serviceDate,_ClassData.dtTime=0==isServiceAnyTime?serviceTime:null,_ClassData.SortType=getSortingValue(),_ClassData.BusinessTypes=businesstypeids,_ClassData.Facilities=JSON.stringify(_featured.GetFacilityObject()),_ClassData.KidsCriteria=""==kidsFacilities?null:kidsFacilities,_ClassData.sPromotionCodeID=lBusinessPromoCodeID,_ClassData.iUserID=UserID,_ClassData.isPromotion=isPromotionBusiness,_ClassData.sCurrentRating=1==isNaN(businessRating>0?6-businessRating:businessRating)?0:businessRating>0?6-businessRating:businessRating,_ClassData.SearchFilter=businessSearchMode,_ClassData.ArrSearchFilter=businessSearchModeForSelection.join(),_ClassData.sPagingDetails=sPagingDetailsBookAService,_ClassData.serviceTime=0==isServiceAnyTime?serviceTime:null,sPagingDetailsBookAService="",_featured.ClassPager.options.onRowLoad=onClassesRowLoad,_featured.ClassPager.options.afterLoad=onClassesAfterLoad,e(".EnablePagescroll").removeClass("EnablePagescroll"),e("#classTemplate").addClass("EnablePagescroll");var n=getCookie(ProximityCookieName),o=getCookie(ProximityIsCurrentLocation);_ClassData.cityName=n.city,_ClassData.stateCode=n.state,_ClassData.isFromMobile=!1,(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&(_ClassData.isFromMobile=!0),_ClassData.isCurrentLocation=void 0!==o&&null!=o&&"true"==o.toString().toLowerCase(),_ClassData.ignoreBusinessIds="",HasIdExists(3)&&(_featured.isStream=!0),_ClassData.isStream=_featured.isStream,poldservice.toLowerCase()!=service.toLowerCase()&&(_ClassData.VagaroServiceIDs="",_ClassData.IsShowEventType=!1),_ClassData.IsCovidReadyBadge=_featured.isDisplayCovidBadge,_featured.ClassPager.options.Data.objClassOptionsData=_ClassData,_featured.ClassPager.scroll()}},_featured.GetAvailDateForPromotion=function(t){var i=e("div[id=divPromoDateSP]",".promocustompopup"),n=e("div[id=divPromoTimeSP]",".promocustompopup");i.datetimepicker({pickTime:!1,format:"MMM DD,YYYY",enabledDates:t,defaultTime:"11:45 AM",direction:"up",customposition:"absolute"}),e("div[id=divPromoTimeSP]",".promocustompopup").datetimepicker({pickDate:!1,direction:"up",customposition:"absolute"}),null!=i&&i.length>0&&(i.each(function(e){i.eq(e).data("DateTimePicker").setDate(t[0])}),n.each(function(t){n.eq(t).data("DateTimePicker").setDate(e("#hdnSalontime").val())})),e(".promotion-popup .bootbox-close-button").bind("click",function(t){_common.destroyDateTimePicker(i),_common.destroyDateTimePicker(e("div[id=divPromoTimeSP]",".promocustompopup"))})},_featured.ProfessionalsPager=new Pagination(e("#ulFeatureBusiness"),{Token:"GetFeaturedServiceProviderNew",Data:{},LocalData:{},IsAjaxQue:!0,PageSize:20,templateName:"dvStylistTemplate",NoDataFoundDiv:e("#divNodataFeature"),Loader:e("#divFeatureBusinessLoader"),EnablePagescroll:!0,ScrollTarget:ScrollTarget,WallWidth:isWindowsPhone||isiPhone4?null:250,initialpageData:initialpageData,pageName:"professionals"}).init(),_featured.ProfessionalsPager.load=function(){e("#divBestSaloonHead").hide(),e("#divRelatedSearchHead").hide();var t=null,i=null;""!=lattitude&&""!=longitude&&(t=lattitude,i=longitude,e("#liNearest").css("display",""));var n,o=getCookie(ProximityCookieName);n=null!=countryid&&"undefined"!=countryid&&"2"==countryid?htmlEncode(o.city):_common.SetCityState(htmlEncode(o.city),htmlEncode(state)),e("#aCityState").html(n),e("#txtMobileCityState").val(n),e("#sectionheader h1").html("Professionals in  "+n),e("#sectionheader p").html("Find a "+(void 0===businesstypes?"":businesstypes)+" professional near you. Check out the specialties offered and book an appointment online easily in "+n+"! Browse portfolios and check out any products for sale.");var a="";e("#mobile-check").is(":visible")?"search professional names"==(a=e("#txtServiceProviderPublicpageMobile").val().toLowerCase())&&(a=""):"search professional names"==(a=e("#txtServiceProviderPublicpage").val().toLowerCase())&&(a="");_featured.ProfessionalsPager.options.ActivateLoading=!0,_featured.ProfessionalsPager.options.Data.sServiceIDs=null,_featured.ProfessionalsPager.options.Data.SortType=getSortingValue(),_featured.ProfessionalsPager.options.Data.ServiceProvidername=a,_featured.ProfessionalsPager.options.Data.sPromotionCodeID=lBusinessPromoCodeID,_featured.ProfessionalsPager.options.Data.CountryID=countryid,_featured.ProfessionalsPager.options.Data.lattitude=t,_featured.ProfessionalsPager.options.Data.longitude=i,_featured.ProfessionalsPager.options.Data.Radius=distanceRadius,_featured.ProfessionalsPager.options.Data.RankCondition=businessRating,_featured.ProfessionalsPager.options.Data.BusinessTypes=businesstypeids,_featured.ProfessionalsPager.options.Data.Facilities=JSON.stringify(_featured.GetFacilityObject()),_featured.ProfessionalsPager.options.Data.KidsCriteria=kidsFacilities,_featured.ProfessionalsPager.options.Data.userId=1==_featured.IsUserFavourite()?UserID:null,_featured.ProfessionalsPager.options.Data.isPromotion=_featuredDtl.IsPrmotion(),_featured.ProfessionalsPager.options.Data.SearchFilter=businessSearchMode,_featured.ProfessionalsPager.options.Data.sBusinessTypes=businesstypes,_featured.ProfessionalsPager.options.Data.ArrSearchFilter=businessSearchModeForSelection.join(),_featured.ProfessionalsPager.options.afterLoad=function(t){((isWindowsPhone||isiPhone4)&&e(".walllazy").lazyload({threshold:200,event:"lazyload",effect:"fadeIn"}).trigger("lazyload"),null==t||0==t.length)?setTimeout(function(){e("#divNodataFeature").attr("tabindex",-1).attr("role","banner").attr("aria-labelledby","myLikeNoDataMsg").focus(),e("myLikeNoDataMsg").attr("aria-hidden",!0)},600):"true"!=e("#hdnChkProfessional").val()?setTimeout(function(){e("#lnkServiceProvider_"+t[0].BusinessID+"_"+t[0].ServiceProviderID).attr("tabindex",-1).focus()},300):(e("#hdnChkProfessional").val("false"),setTimeout(function(){e("#txtServiceProviderPublicpage").focus()},100))},_featured.ProfessionalsPager.options.onRowLoad=onFeaturedServiceProviderRowLoad,_featured.ProfessionalsPager.scroll()},_featured.GalleryPager=new Pagination(e("#ulFeatureBusiness"),{Token:"websiteapi/homepage/getshopdetailstyle",PageSize:20,Data:{},IsAjaxQue:!0,LocalData:{},templateName:"ulFeatureStyleTemplate",NoDataFoundDiv:e("#divNodataFeature"),Loader:"Detail"==BasePage?e("#apgLoading"):e("#divFeatureBusinessLoader"),EnablePagescroll:!0,ScrollTarget:ScrollTarget,WallWidth:250,initialpageData:initialpageData,pageName:"photos",IsNewVagaroAPI:!0}).init(),_featured.GalleryPager.load=function(t){e("#divBestSaloonHead").hide(),e("#divRelatedSearchHead").hide(),t>0?(_featured.GalleryPager.options.checkTab=!0,_featured.GalleryPager.options.NoDataFoundDiv=e("#divNoGallery"),_featured.GalleryPager.options.Loader=e("#apgLoading"),_featured.GalleryPager.options.WallWidth=280,_featured.GalleryPager.options.LocalData.Page="Detail",currentSorting=7):(_featured.GalleryPager.options.checkTab=!1,_featured.GalleryPager.options.LocalData.Page="Home"),(isWindowsPhone||isiPhone4)&&(_featured.GalleryPager.options.WallWidth=null),_featured.GalleryPager.options.ActivateLoading=!0,_featured.GalleryPager.options.Data.businessId=t>0?t:null,_featured.GalleryPager.options.Data.calledFrom=t>0?2:1,_featured.GalleryPager.options.Data.userid=null==UserID||""==UserID?null:UserID,_featured.GalleryPager.options.Data.radious=105,_featured.GalleryPager.options.Data.latitude=t>0?null:lattitude,_featured.GalleryPager.options.Data.longitude=t>0?null:longitude,_featured.GalleryPager.options.Data.countryID=null==countryid?null:countryid,_featured.GalleryPager.options.Data.promotionCodeID=t>0?null:lBusinessPromoCodeID,_featured.GalleryPager.options.Data.sortingValue=currentSorting,"undefined"!=typeof styleCategoryIds?_featured.GalleryPager.options.Data.styleCategoryIds=styleCategoryCombineIds:_featured.GalleryPager.options.Data.styleCategoryIds="",window.location.href.includes(myLikedStyleUrlValue)&&0==isLoadDataCallFromDDL&&(myLikesCurrentValue=1),_featured.GalleryPager.options.Data.FromMyLikePhoto=myLikesCurrentValue,_featured.GalleryPager.options.Data.isCustomWebsite="undefined"!=typeof isCustomWebsite?isCustomWebsite:"",_featured.GalleryPager.options.onRowLoad=_featured.onRowLoadStyle,_featured.GalleryPager.options.afterLoad=function(t){ShowLoader(!1),(isWindowsPhone||isiPhone4)&&e(".walllazy").lazyload({threshold:200,event:"lazyload",effect:"fadeIn"}).trigger("lazyload"),null!=t&&0!=t.length||setTimeout(function(){e("#divNodataFeature").attr("tabindex",-1).attr("role","banner").attr("aria-labelledby","myLikeNoDataMsg").focus(),e("myLikeNoDataMsg").attr("aria-hidden",!0)},600)},_featured.GalleryPager.scroll(),_featured.GalleryPager.enableScroll(),1==myLikesCurrentValue&&e("#myLikeNoDataMsg").text(myLikeNoDataMsg)},e(function(){e("#divGalleryPopup").swipe({swipeLeft:function(e,t,i,n,o){e.preventDefault(),_home.NextStyle(e)},swipeRight:function(e,t,i,n,o){e.preventDefault(),_home.PrevStyle(e)}}),e("#divGalleryPopup").swipe({fingers:1})}),_featured.onRowLoadStyle=function(t,i){var n=e(i),o="",a="";if(parseInt(t.StyleID)>0?n.html(n.html().replace("{{BusinessOrStyleContainer}}","Style/Original/")):(n.html(n.html().replace("{{BusinessOrStyleContainer}}","Original/")),e(".gallery-hover-div",n).hide()),e(n).attr("id","style"+t.BusinessID),t.IsLikeByUser>0?(e("#imgLike",n).removeClass(emptyHeartClass),e(n).addClass("gallery-liked")):(e("#imgLike",n).addClass(emptyHeartClass),e(n).removeClass("gallery-liked")),"Detail"==_featured.GalleryPager.options.LocalData.Page&&(e("div.heart-bottom",n).css("top","0px"),e("h2.ServiceTitle",n).css({"word-wrap:":"break-word","word-break":"break-word",width:"84%"}),e("#divDistance",n).hide()),t.LikeCounter>0&&null!=t.LikeCounter){var s=e("#hdnLikeCount_"+t.StyleID,n).val();1==s?(e("#divGalleryLikeCount",n).html(s+" Like"),e("#divGalleryLikeCount_"+t.StyleID,n).attr("aria-label",s+" Like")):(e("#divGalleryLikeCount",n).html(s+" Likes"),e("#divGalleryLikeCount_"+t.StyleID,n).attr("aria-label",s+" Likes"))}else e("#divGalleryLikeCount",n).css("display","none"),e("#divGalleryLikeCount",n).html("");1==t.IsOnlineService?(1==t.IsShowPriceOnline?o=" "+("Detail"==BasePage?_shopdetail.currencySymbol:"2"==t.CountryID?"£":"$")+t.Price.format("#.##"):e(n).attr("data-price",""),e("#divPrice",n).html(o),e("#divPrice_"+t.StyleID,n).attr("aria-label",o),a=t.ServiceTitle.toString().escapeHtml(),e("#divServiceTitle",n).html(a),e("#divServiceTitle_"+t.StyleID,n).attr("aria-label",t.ServiceTitle.toString())):(e("#btnBook",n).css("display","none"),e("#divServiceTitle",n).css("display","none"),e(n).attr("data-servicetitle",""),e("#divServiceTitle",n).html(""),e("#divPrice",n).css("display","none"),e("#divPrice",n).html(""),e(n).attr("data-price",""),"Detail"==_featured.GalleryPager.options.LocalData.Page&&(e(".ServiceTitle",n).html(""),e(".ServiceTitle",n).css("display",""))),null!=t.CountryID&&"undefined"!=t.CountryID&&2!=t.CountryID?null==t.City&&""==t.City||null==t.StateCode||""==t.StateCode||e("#divAddress_"+t.StyleID,n).html(t.City+", "+t.StateCode):null==t.City&&""==t.City||e("#divAddress_"+t.StyleID,n).html(t.City);var r={};return r.styleid=t.StyleID,r.serviceid=t.ServiceID,r.spid=t.ServiceProviderID,r.styletitle=t.StyleTitle,r.businessemail=t.BusinessEmail,r.vagarourl=t.VagaroURL,r.styledesc=t.StyleDesc,r.servicetitle=t.ServiceTitle,r.countryid=t.CountryID,e("#btnBook",n).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(r)+",event);"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("#btnPortfolioSharing",n).length>0&&e("#btnPortfolioSharing",n).hide(),n},_featured.imageErrorStyle=function(e){_common.imageErrorStyle(e)},_featured.activeStyleId=0,_featured.fetchStyleImages=function(t,n,o){e("#divGalleryImageLoader").show();var a=e("#divStyleImages");a.html("");var s=new vagaro.ajax;s.datamodel.Token=ApiURLEnumPublic.getstyleimagescommaseparated,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=function(n){if(e("#divGalleryImageLoader").hide(),null!=n&&null!=n){var s=n.split("|##|");if(void 0!==o&&void 0!==o.data&&void 0!==o.data().price&&null!=o.data().price&&""!=o.data().price&&""!=o.data().price&&(o.data().price=parseFloat(o.data().price)),""==o.data().stylistname||null==o.data().stylistname||null==o.data().stylistname){o.data().stylistname=s[1],e("#divStylistName").html(""!=o.data().stylistname?"by "+o.data().stylistname:"");var r=_featured.GetBookDataFromObjectData(o.data());e("#btnBookPopUp").attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(r)+",event);")}var l=s[0].split("|~|");if(null!=l&&null!=l&&l.length>0)for(e("#divGalleryPopup").removeClass("singleimagepopup doulbleimagepopup"),1==l.length?e("#divGalleryPopup").addClass("singleimagepopup"):2==l.length&&e("#divGalleryPopup").addClass("doulbleimagepopup"),i=0;i<l.length;i++){var c=l[i].split("|~~|");if(c.length>0){var d=e("#divStyleImageTemplate").html();a.append(d),c[0]=c[0].escapeHtml(),e("#styleTitle",a).html(c[0]).attr("id","styleTitle_"+i),c.length>1&&e("#styleImage",a).attr("data-original",t+"/Style/Original/"+c[1]).attr("id","styleImage_"+i).attr("aria-hidden",!0).parent().attr("role","img").attr("aria-labelledby","styleImage_"+i+" styleTitle_"+i)}}lazyLoadWithContainer("lazystyle","divGalleryPopup")}},s.datamodel.data={StyleID:n},s.datamodel.Error=function(t){e("#divGalleryImageLoader").hide()},s.Post(),_featured.activeStyleId=n},_featured.fetchStylistName=function(t,i){var n=t,o=escape(location.protocol+"//"+location.host+"/"+n.data().vagarourl.toLowerCase()+"/styles");if(""==n.data().stylistname||null==n.data().stylistname||null==n.data().stylistname){var a=new vagaro.ajax;a.datamodel.Token=ApiURLEnumPublic.getstyleimagescommaseparated,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.callback=function(t){if(e("#divGalleryImageLoader").hide(),null!=t&&null!=t)if(n.data().stylistname=t.split("|##|")[1],n.hasClass("active"))n.find(".share-popup").hide(),n.removeClass("active");else{n.addClass("active"),e(".share-popup").hide(),n.find(".share-popup").show(),n.find(".facebook").unbind(),n.find(".twitter").unbind(),n.find(".pinterest").unbind(),n.find(".email-share-div").unbind();var a=o+"&text=Check out what I found @"+unescape(escape(n.data().businessname))+" - "+n.data().stylistname+"&related=vagaro";n.find(".twitter").click(function(){_siteBuilderSocialMedia.PostOnTwitter(a)}),n.find(".facebook").click(function(){_siteBuilderSocialMedia.PostonFacebook(i,"Photos")});var s=o+"&text="+unescape(n.data().businessname)+" - "+n.data().styletitle+"&media="+n.data().image+"&description="+n.data().servicetitle+n.data().styledesc;n.find(".pinterest").click(function(){_siteBuilderSocialMedia.PostOnPint(s)}),n.find(".email-share-div").click(function(){_siteBuilderSocialMedia.MailClick(n.data().styletitle,n,"Photos")})}},a.datamodel.data={StyleID:n.data().styleid},a.datamodel.Error=function(t){e("#divGalleryImageLoader").hide()},a.Post()}else{n.hasClass("active")?(n.find(".share-popup").hide(),n.removeClass("active")):(n.addClass("active"),e(".share-popup").hide(),n.find(".share-popup").show()),n.find(".facebook").unbind(),n.find(".twitter").unbind(),n.find(".pinterest").unbind(),n.find(".email-share-div").unbind();var s=o+"&text=Check out what I found @"+unescape(escape(n.data().businessname))+" - "+n.data().stylistname+"&related=vagaro";n.find(".twitter").click(function(){_siteBuilderSocialMedia.PostOnTwitter(s)}),n.find(".facebook").click(function(){_siteBuilderSocialMedia.PostonFacebook(i,"Photos")});var r=o+"&text="+unescape(n.data().businessname)+" - "+n.data().styletitle+"&media="+n.data().image+"&description="+n.data().servicetitle+n.data().styledesc;n.find(".pinterest").click(function(){_siteBuilderSocialMedia.PostOnPint(r)}),n.find(".email-share-div").click(function(){_siteBuilderSocialMedia.MailClick(n.data().styletitle,n,"Photos")})}},e("#galleryPopup").mouseup(function(t){var i=e(".gallery-popup-white-overall"),n=_common.getscrollTop(ScrollTarget);i.is(t.target)||0!==i.has(t.target).length||(_featured.closeGalleryPopup(n),e("html, body").removeClass("overflowHidden"))}),_featured.BusinessLogoClick=function(t){"pointer"==e(t).css("cursor")&&e(e("#divBusinessPhotos .cust-img-popup-slider")[0]).find("#imgServiceImage").click()},_featured.GetBookDataFromObjectData=function(e){var t={};return void 0!==e.serviceid&&"0"!=e.serviceid&&(t.serviceid=e.serviceid),void 0!==e.spid&&"0"!=e.spid&&(t.spid=e.spid),void 0!==e.styleid&&"0"!=e.styleid&&(t.styleid=e.styleid),void 0!==e.styletitle&&null!=e.styletitle&&""!=e.styletitle&&(t.styletitle=e.styletitle),void 0!==e.bookingDateTime&&null!=e.bookingDateTime&&""!=e.bookingDateTime&&(t.bookingDateTime=e.bookingDateTime),void 0!==e.vagarourl&&null!=e.vagarourl&&""!=e.vagarourl&&(t.vagarourl=e.vagarourl.toLowerCase()),t},_featured.openGalleryPopup=function(t,i){var n=_common.getscrollTop(ScrollTarget),o=e(t).parents(".cust-img-popup-slider"),a=o.data(),s=e("#divStyleImages"),r=s.clone(),l="50px";if(null!=i&&"P"==i&&(l="-50px"),r.css({transform:"translateX("+l+")",transition:"opacity 300ms,transform 300ms",opacity:"0","z-index":"1003"}),s.before(r),s.fadeOut(),s.attr("id","divStyleImages_Old"),s.remove(),setTimeout(function(){r.css({transform:"translateX(0px)",transition:"opacity 300ms,transform 300ms",opacity:"1","z-index":"1003"})},200),a.styleid>0){e("#imgLikePopUp").show(),e("#btnBookPopUp").show(),e("#divSharePopUp").show(),e(".share-div-overall").show(),e("#galleryPopup").removeClass("gallery-single-imagepopup"),_featured.fetchStyleImages(a.cdnurl,a.styleid,o);var c=e("#divSalonName_"+a.styleid,o).html(),d=e("#divAddress_"+a.styleid,o).html(),u="true"==a.isonlineservice.toString().toLowerCase()&&"true"==a.isshowpriceonline.toString().toLowerCase()?parseFloat(a.price).format("#.##").toString():"";"true"!=a.isonlineservice.toString().toLowerCase()&&e("#btnBookPopUp").hide(),null!=u&&null!=u&&u.length>0?(e("#divPricePopUp").html(("Detail"==BasePage?_shopdetail.currencySymbol:"2"==a.countryid?"£":"$")+u),e("#divPricePopUp").show()):(e("#divPricePopUp").html("&nbsp;"),e("#divPricePopUp").hide()),e(o).find(".btnlike").hasClass(emptyHeartClass)?e("#imgLikePopUp").addClass(emptyHeartClass).attr("aria-label","Click to like"):e("#imgLikePopUp").removeClass(emptyHeartClass).attr("aria-label","Click to unlike"),e("#divSocialIconsPopUp").hide(),e("#divSharePopUp").unbind(),e("#divSharePopUp").click(function(){var i=escape(location.protocol+"//"+location.host+"/"+a.vagarourl.toLowerCase()+"/styles");e("#divSocialIconsPopUp").find(".facebook").unbind(),e("#divSocialIconsPopUp").find(".twitter").unbind(),e("#divSocialIconsPopUp").find(".pinterest").unbind(),e("#divSocialIconsPopUp").find(".email-share-div").unbind(),e("#divSocialIconsPopUp").find(".facebook").click(function(){_siteBuilderSocialMedia.PostonFacebook(t,"Photos")});var n=i+"&text=Check out what I found @"+unescape(escape(a.businessname))+" - "+a.stylistname+"&related=vagaro";e("#divSocialIconsPopUp").find(".twitter").click(function(){_siteBuilderSocialMedia.PostOnTwitter(n)});var s=i+"&text="+unescape(a.businessname)+" - "+a.styletitle+"&media="+a.image+"&description="+a.servicetitle+a.styledesc;e("#divSocialIconsPopUp").find(".pinterest").click(function(){_siteBuilderSocialMedia.PostOnPint(s)}),e("#divSocialIconsPopUp").find(".email-share-div").click(function(){_siteBuilderSocialMedia.MailClick(a.styletitle,o,"Photos")}),e("#divSocialIconsPopUp").toggle()}),e("#imgLikePopUp").unbind(),e("#imgLikePopUp").click(function(){e("#divSocialIconsPopUp").hide(),UserID>0?_featured.clickToLikeStyle(t):(_common.reloadstyle=!1,_common.isFromLikeStyle=!0,_common.likestyle=t,showLogin())}),e("#divServiceTitlePopup").text(a.styletitle),e("#divSalonNamePopUp").html(c),e("#divAddressPopUp").html(d),e("#divStyleDescPopUp").text(a.styledesc),e("#divStylistName").html(""!=a.stylistname?"by "+a.stylistname:"");var p=_featured.GetBookDataFromObjectData(o.data());e("#btnBookPopUp").attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(p)+",event);"),e("#styleImage").attr("alt",c),e("#styleImage").attr("title",c),e("#galleryPopup").show(),e("html, body").addClass("overflowHidden"),_featured.centerGalleryPopup(),e("#divListing").mouseup(function(t){var i=e(".gallery-popup-white-overall");i.is(t.target)||0!==i.has(t.target).length||_featured.closeGalleryPopup(n)}),e("#galleryPopup").mouseup(function(t){var i=e(".gallery-popup-white-overall");i.is(t.target)||0!==i.has(t.target).length||(_featured.closeGalleryPopup(n),e("html, body").removeClass("overflowHidden"))}),e("#divGalleryPopup").scroll(function(){if(e("#divStyleImages").find(".gallery-popup-img").length>1){var t=0;e(".gallery-popup-img",e("#divStyleImages")).each(function(){if(e("#styleImage_"+t).attr("src").indexOf("no-shop-image-big-new.gif")>-1){var i=e("#styleImage_"+t).attr("data-original");e("body").append('<img src="'+i+'" id="imgDummy" />'),e("#imgDummy").width()>0&&e("#styleImage_"+t).lazyload({effect:"fadeIn"}),e("#imgDummy").remove()}t++})}})}else{e("#galleryPopup").show(),e("html, body").addClass("overflowHidden"),e("#imgLikePopUp").hide(),e("#btnBookPopUp").hide(),e("#divSharePopUp").hide(),e(".share-div-overall").hide(),e("#galleryPopup").addClass("gallery-single-imagepopup"),e("#divGalleryPopup").removeClass("singleimagepopup doulbleimagepopup");var h=e("#divStyleImages");h.html("");var m=e("#divStyleImageTemplate").html();h.append(m),e("#styleImage",h).attr("src",e(t).attr("src")),e("#divServiceTitlePopup").html(""),e("#divStylistName").html(""),e("#divSalonNamePopUp").html(""),e("#divAddressPopUp").html(""),e("#divStyleDescPopUp").html(""),e("#galleryPopup").mouseup(function(t){var i=e(".gallery-popup-white-overall");i.is(t.target)||0!==i.has(t.target).length||(_featured.closeGalleryPopup(n),e("html, body").removeClass("overflowHidden"))}),void 0!==setPopupPosi&&"undefined"!=typeof WebsiteBuilderType&&"Builder"==WebsiteBuilderType&&(e("#galleryPopup").addClass("wbGalleryPopup"),e("#galleryPopup").after('<div class="wbGalleryPopup-backdrop"></div>'),setPopupPosi("#galleryPopup"))}"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("#galleryPopup #divSharePopUp").hide(),setTimeout(function(){e("#ucgallarybook").focus()},1500),e("#imgLikePopUp").focus()},_featured.centerGalleryPopup=function(){var t=e("#galleryPopup:visible").height();e(".gallery-popup-white-overall").css("max-height",t)},_featured.closeGalleryPopup=function(t){void 0!==setPopupPosi&&"undefined"!=typeof WebsiteBuilderType&&"Builder"==WebsiteBuilderType&&(e("#galleryPopup").removeClass("wbGalleryPopup"),e(".wbGalleryPopup-backdrop").remove()),e("#galleryPopup").hide(),e("html, body").removeClass("overflowHidden"),e("#divListing").unbind(),e("html, body").scrollTop(t),(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&e("#divBookNowMasterPage").addClass("mobile-book-div"),window.location.href.includes(myLikedStyleUrlValue)&&setMylikesGalleryFilterValue(1,"aMyLikesOption_filter_1",0,1)},_featured.RedirectToBook24=function(e,t){_common.RedirectToBook24(e,t)},_featured.RedirectBusinessDetailPage=function(e){_common.RedirectBusinessDetailPage(e)},_featured.checkHeart=function(e){return _common.checkHeart(e)},_featured.clickToLikeStyle=function(e){_common.clickToLikeStyle(e)},_featured.GetUserLike=function(){_common.GetUserLike()},_featured.SetGalleryData=function(){_common.SetGalleryData(!0)},_featured.PromotionsPager=new Pagination(e("#dealListing"),{Token:"GetFeaturedPromotionListByProximityNew",Data:{},LocalData:{},PageSize:20,IsAjaxQue:!0,templateName:"divFeaturedPromotionTemplate",NoDataFoundDiv:e("#divNodataFeature"),Loader:e("#divFeatureBusinessLoader"),EnablePagescroll:!0,ScrollTarget:ScrollTargetListingDeals,initialpageData:initialpageData,pageName:"deals",lazyLoadClass:"lazypager"}).init(),_featured.PromotionsPager.load=function(){var t;e("#divBestSaloonHead").hide(),e("#divRelatedSearchHead").hide(),e("#spnTotalRecords").hide();var i=getCookie(ProximityCookieName);t=null!=countryid&&"undefined"!=countryid&&"2"==countryid?htmlEncode(i.city):_common.SetCityState(htmlEncode(i.city),htmlEncode(state)),e("#aCityState").html(t),e("#txtMobileCityState").val(t),e("#sectionheader").addClass("listing-header").removeClass("div-block-97"),e("#sectionheader h1").addClass("listing-h1 web-display-small").removeClass("business-heading with-paragraph web-display-large"),e("#sectionheader p").addClass("paragraph-2").removeClass("title-paragraph"),e("#sectionheader h1").html("Great Deals in "+t),e("#sectionheader p").html("Great beauty and fitness coupons, discounts, and offers from the best in the industry. Book an appointment below, quickly and easily in "+t),_home.loadPromotions(_featured.PromotionsPager,!1,0),setTimeout(function(){e("#ancFilter").focus()},700)},_featured.GetMapCenter=function(){var e=map.getCenter(),t=new google.maps.LatLng(e.lat(),e.lng());_featured.BusinessPager.load(t.lat(),t.lng())},_featured.changeBusSearchType=function(t,i,n){if("book"!=tabSegment||"book"==tabSegment&&1==IsExistsClassInServiceSearch()&&-1==window.location.href.indexOf(_common.liveStreamClasses)&&i==searchFilterEnum.LiveStream)if(i==searchFilterEnum.LiveStream){if(-1==window.location.href.indexOf(_common.liveStreamClasses)){if(-1==businessSearchModeForSelection.indexOf(searchFilterEnum.LiveStream))return;_common.AddState(_common.liveStreamClasses)}setCategoryWidthheight()}else-1==window.location.href.indexOf("listings")&&-1==window.location.href.indexOf("class/")&&_common.AddState(tabSegment);else"book"==tabSegment&&-1==window.location.href.indexOf("book/")&&(_common.AddState(tabSegment),e("body").removeClass("livestreampage"));togglebusinesssearch(i),e("#atBusiness").removeClass("active").attr("aria-checked",!1),e("#atMobile").removeClass("active").attr("aria-checked",!1),e("#atStream").removeClass("active").attr("aria-checked",!1),e(".atmobilecheck").hide(),e(".atstreamcheck").hide(),e(".athomecheck").hide(),e(".mobile-filter-result").removeClass("atmobileicon"),HasIdExists(1)&&(e("#atMobile").addClass("active").attr("aria-checked",!0).focus(),e(".atmobilecheck").show(),e(".mobile-filter-result").addClass("atmobileicon")),HasIdExists(3)&&(e("#atStream").addClass("active").attr("aria-checked",!0).focus(),e(".atstreamcheck").show()),HasIdExists(2)&&(e("#atBusiness").addClass("active").attr("aria-checked",!0).focus(),e(".athomecheck").show()),e("#divSelectedMode").html(e(t).text()),_featured.applyServiceFilters(),e("#ddlBusMode").trigger("w-close.w-dropdown")},_featured.applyCustomServiceFilters=function(t,i){"ddlServices"==t&&(service=_common.GetChoiceForSeleect2(e("#ddlServices")).text),"txtMobileService"==t&&(service=e("#txtMobileService")[0].value),serviceDateTime=e("#mobile-check").is(":visible")?getdatepickervalue("#txtMobileServiceDate"):getdatepickervalue("#txtServiceDate"),relatedSearchId=service,null!=serviceDateTime&&""!=serviceDateTime&&"Date"!=serviceDateTime&&(serviceDate=serviceDateTime.format("MMM DD,YYYY"),serviceTime=serviceDateTime.format("hh:nn a/p")),loadData(null,!1),_common.AddState(i)},_featured.applyServiceFilters=function(){service=_common.GetChoiceForSeleect2(e("#ddlServices")).text,null!=(serviceDateTime=e("#mobile-check").is(":visible")?getdatepickervalue("#txtMobileServiceDate"):getdatepickervalue("#txtServiceDate"))&&""!=serviceDateTime&&"Date"!=serviceDateTime&&(serviceDate=serviceDateTime.format("MMM DD,YYYY"),serviceTime=serviceDateTime.format("hh:nn a/p")),loadData(null,!1)},_featured.GetGalleryFilterData=function(t){if(styleCategoryIds=_featured.GetSelectedCategories(),styleCategoryCombineIds=_featured.GetSelectedCategoriesWithCombine(),null!=styleCategoryIds&&null!=styleCategoryIds){if(""!=styleCategoryIds){var n=styleCategoryIds.split(","),o='<div id="divFirstSlideGallery" aria-hidden="true" class="w-inline-block">&nbsp;</div>';for(styleCategoryName="",i=0;i<n.length;i++)o+='<a id="btnRemoveFilter_'+n[i]+'" class="filter-result-text w-inline-block chkbusiness vagaro-dismiss-tag" href="javascript:void(0);" aria-label="'+e("#lblInnerStyleCategory_"+n[i]).html()+'">',o+='<div class="inner-bubble-text vagaro-dismiss-inner-txt" aria-hidden="true">'+e("#lblInnerStyleCategory_"+n[i]).html()+"</div>",o+='<div class="vagaro-dismiss-img" role="button" onclick="javascript:_featured.removeFilter('+n[i]+');" aria-label="Close '+e("#lblInnerStyleCategory_"+n[i]).html()+'"><img src="'+cdnImagePath+'PublicImages/Images/vagaro-tag-close-2.svg" class="inner-bubble-x" title="Remove this filter" alt="Remove" width="10" height="10" aria-hidden="true" /></div>',o+="</a>",styleCategoryName+=e("#lblInnerStyleCategory_"+n[i]).html()+",";styleCategoryName=styleCategoryName.substring(0,styleCategoryName.length-1).toLowerCase(),_common.AddState(tabSegment),o+='<div id="divLastSlideGallery" class="w-inline-block">&nbsp;</div>',e("#divGalleryFilters").html(o)}else e("#divGalleryFilters").html("");"bookservice"==t?onSearchClickService("listings"):loadData(null,!1),e(".mobile-galleryfilter-result").html(o),nofilterHideShow()}setTimeout(function(){e("#hHeaderText").focus()},700),setTimeout(function(){e("#Homegalaryfilter").focus()},700)},_featured.GetSelectedCategories=function(){var t="";return e("#divSubcategory input:checkbox").length>0&&(t=e.map(e("#divSubcategory input:checkbox:checked"),function(e,t){return e.value}).join(",")),t};_featured.GetSelectedCategoriesWithCombine=function(){var t="";if(e("#divSubcategory input:checkbox").length>0){var i,n=[];i=e.map(e("#divSubcategory input:checkbox"),function(t,i){var o=e("#"+t.id).data("catid");if(-1==n.indexOf(o))return n.push(o),o});for(var o=0;o<=i.length-1;o++){var a="";a=e.map(e("#divSubcategory input:checkbox:checked"),function(t,n){if(e("#"+t.id).data("catid")==i[o])return t.value}).join(","),"76"!=i[o]&&"74"!=i[o]&&""==a&&(a=e.map(e("#divSubcategory input:checkbox"),function(t,n){if(e("#"+t.id).data("catid")==i[o])return t.value}).join(",")),""!=a&&(t=o==i.length-1?t+"["+a+"]":t+"["+a+"],")}}return t},_featured.AdvancefilterValues=function(t){1==e(t).prop("checked")?e(t).next().attr("aria-checked","true"):e(t).next().attr("aria-checked","false")},_featured.loadGalleryFilters=function(){e("#divGalleryFilterContent").show(),e("html, body").addClass("overflowHidden"),""==styleCategoryIds?e("#btnClear").text("Cancel"):e("#btnClear").text("Clear Selection"),_featured.getMainStyleCategory()},_featured.getMainStyleCategory=function(){if(0==_featured.catchStyleInfo.length){e("#divFilterContent").html(""),e("#divGalleryFilterLoader").show();var t={BusinessID:0},i=new vagaro.ajax;i.datamodel.Token="GetStyleInfo",i.datamodel.callback=_featured.GetStyleInfoSucess,i.datamodel.data=t,i.datamodel.Error=function(e){bootbox.alert("Error Occurred in Loading Filters :: "+e)},i.Post()}else _featured.GetStyleInfoSucess(_featured.catchStyleInfo)},_featured.GetStyleInfoSucess=function(t){var i=0;if(null==t.categorylist&&void 0===t.categorylist||0!=_featured.catchstyleMainCategory.length)e(".w--current").focus();else{_featured.catchStyleInfo=t;var n=e.grep(t.categorylist,function(e){return 2==e.CategoryType&&null==e.ParentCategoryID}).sort(function(e,t){return e.CategoryTitle.localeCompare(t.CategoryTitle)});if(_featured.catchstyleMainCategory=n,null!=_featured.catchstyleMainCategory&&_featured.catchstyleMainCategory.length>0){var o='<div class="_4-col-flex-filter"><div class="photo-tabs-menu-2 w-tab-menu">';e.each(_featured.catchstyleMainCategory,function(e){0==e&&(i=_featured.catchstyleMainCategory[e].CategoryID),o+='<a id="aCategory_'+_featured.catchstyleMainCategory[e].CategoryID+'" class="deals-category-tab w-inline-block w-tab-link deals-button-tab'+(0==e?" w--current deals-button-tab":" ")+'" onclick="javascript:_featured.selectIndexChangMainStyleCategory('+_featured.catchstyleMainCategory[e].CategoryID+');" href="javascript:void(0);"  tabindex="0"><div>'+_featured.catchstyleMainCategory[e].CategoryTitle+"</div></a>"}),o+="</div></div>",o+='<div class="tabs-content-3 w-tab-content"><div class="tab-pane-3 w--tab-active w-tab-pane"><div class="w-form" id="divSubcategory"></div></div></div>',e("#divFilterContent").html(o)}_featured.selectIndexChangMainStyleCategory(null!=parentCategoryId&&null!=parentCategoryId&&parentCategoryId>0?parentCategoryId:i),e("#divGalleryFilterLoader").hide()}},_featured.selectIndexChangMainStyleCategory=function(t){if(e("#divGalleryFilterContent").find(".w--current").removeClass("w--current"),e("#aCategory_"+t).addClass("w--current"),setTimeout(function(){e("#firstCategoryID").focus()},1e3),t>0){if(_featured.selectedCastegoryID!=t){_featured.selectedCastegoryID=t;var i=_featured.catchStyleInfo;if(null!=i&&null!=i.categorylist&&void 0!==i.categorylist&&0==_featured.defaultGeneralCategory.length){var n=e.grep(i.categorylist,function(e){return 1==e.CategoryType&&null!=e.ParentCategoryID});_featured.defaultGeneralCategory=n}if(null!=i&&null!=i.categorylist||void 0!==i.categorylist||0==_featured.catchGeneralCategory.length){var o;0==_featured.selectedCastegoryID?o=e.grep(i.categorylist,function(e){return 1==e.CategoryType&&null!=e.ParentCategoryID}):_featured.selectedCastegoryID>0&&(o=e.grep(i.categorylist,function(e){return 1==e.CategoryType&&null!=e.ParentCategoryID||e.ParentCategoryID==_featured.selectedCastegoryID}));var a=o.sort(function(e,t){return e.CategoryTitle.localeCompare(t.CategoryTitle)}).sort(function(e,t){return e.CategoryType-t.CategoryType});_featured.catchGeneralCategory=a}var s=_featured.catchGeneralCategory.length;if(s>0){html="";for(var r=0;r<s;r++){var l=_featured.catchGeneralCategory[r];null!=l.CategoryID&&l.CategoryID>0&&(0==r&&1==l.CategoryType?html+='<div class="_4-col-flex-filter filtercheckboxdiv w-clearfix bottom"><div class="filter-title" id="firstCategoryID" tabindex="0" aria-selected="true" aria-expanded="true" role="group" aria-labelledby="firstCategoryID">'+l.CategoryTitle+"</div>":html+='<div class="_4-col-flex-filter filtercheckboxdiv w-clearfix bottom"><div class="filter-title" tabindex="0" aria-selected="true" aria-expanded="true" role="group">'+l.CategoryTitle+"</div>",html+=_featured.chkInnerStyleCategory(l.CategoryID),html+="</div>")}e("#divSubcategory").html(html)}}setTimeout(function(){e("#firstCategoryID").focus()},1e3)}},_featured.chkInnerStyleCategory=function(t){var i="",n=_featured.catchStyleInfo;null==n.styleCategorylist&&void 0===n.styleCategorylist||0!=_featured.catchStyleCategory.length||(_featured.catchStyleCategory=n.styleCategorylist);var o=e.grep(_featured.catchStyleCategory,function(e){return e.SubCategoryID==t}).sort(function(e,t){return e.StyleCategoryTitle.localeCompare(t.StyleCategoryTitle)});if(o.length>0){i+='<div class="filter-cateinput">';e.grep(_featured.defaultGeneralCategory,function(e){return e.CategoryID==t});for(var a=0;a<o.length;a++){var s=o[a],r=null!=styleCategoryIds&&null!=styleCategoryIds&&(styleCategoryIds+",").indexOf(s.StyleCategoryID+",")>-1?"checked":"";if(""!=r){0==e("#divFirstSlideGallery").length&&e("#divGalleryFilters").append('<div id="divFirstSlideGallery" class="w-inline-block">&nbsp;</div>');var l='<a id="btnRemoveFilter_'+s.StyleCategoryID+'" class="filter-result-text w-inline-block chkbusiness vagaro-dismiss-tag" href="javascript:void(0);" aria-label="'+s.StyleCategoryTitle+'">';l+='<div class="inner-bubble-text vagaro-dismiss-inner-txt" aria-hidden="true">'+s.StyleCategoryTitle+"</div>",l+='<div class="vagaro-dismiss-img" role="button" onclick="javascript:_featured.removeFilter('+s.StyleCategoryID+');" aria-label="Close '+s.StyleCategoryTitle+'"><img src="'+cdnImagePath+'PublicImages/Images/vagaro-tag-close-2.svg" class="inner-bubble-x" title="Remove this filter" alt="Remove" width="10" height="10" aria-hidden="true" /></div>',l+="</a>",e("#divLastSlideGallery").length>0&&e("#divLastSlideGallery").remove(),l+='<div id="divLastSlideGallery" class="w-inline-block">&nbsp;</div>',e("#divGalleryFilters").append(l),e(".mobile-galleryfilter-result").append(l),nofilterHideShow()}if(null!=s.StyleCategoryID&&s.StyleCategoryID>0){var c="chkInnerStyleCategory_"+s.StyleCategoryID,d=!1;""!=r&&(d=!0),i+='<div class="filters-checkbox'+(0==a?" filters-first":"")+'"><div class="checkbox-custom-black vagaro-checkbox"><input onclick="_featured.AdvancefilterValues(this);" type="checkbox"  value="'+s.StyleCategoryID+'" id="'+c+'" data-catid="'+t+'" /><label id="lblInnerStyleCategory_'+s.StyleCategoryID+'" for="'+c+'" aria-label="'+s.StyleCategoryTitle+'" role="checkbox" aria-checked="'+d+'">'+s.StyleCategoryTitle+"</label></div></div>"}}i+="</div>"}return i},_featured.removeFilter=function(t){if(t){if(styleCategoryIds=(styleCategoryIds+",").replace(t+",","").replace(/^,|,$/g,""),e("#divGalleryFilters #btnRemoveFilter_"+t).remove(),e(".mobile-galleryfilter-result #btnRemoveFilter_"+t).remove(),e("#chkInnerStyleCategory_"+t).prop("checked",!1).next().attr("aria-checked","false"),styleCategoryCombineIds=_featured.GetSelectedCategoriesWithCombine(),""!=styleCategoryIds&&null!=styleCategoryIds&&"undefined"!=typeof styleCategoryIds){var n=styleCategoryIds.split(",");for(styleCategoryName="",i=0;i<n.length;i++)styleCategoryName+=e("#lblInnerStyleCategory_"+n[i]).html()+",";styleCategoryName=styleCategoryName.substring(0,styleCategoryName.length-1).toLowerCase()}else styleCategoryName="",styleCategoryCombineIds="";_common.AddState(tabSegment),loadData(null,!1)}else{var o=""!=styleCategoryIds;styleCategoryIds="",styleCategoryCombineIds="",e("#divFilterContent").find('input[type="checkbox"]').prop("checked",!1).next().attr("aria-checked","false"),e("#divFilterContent").find(".w--current").removeClass("w--current"),e("#divGalleryFilters").html(""),e(".mobile-galleryfilter-result").html(""),e("#divFilterContent").find(".deals-category-tab").first().trigger("click"),o?loadData(null,!1):_featuredDtl.HideGalleryFilter(),styleCategoryName="",_common.AddState(tabSegment)}setTimeout(function(){e("#Homegalaryfilter").focus()},700)},_featured.clearRating=function(t){""!=e("#rating-input",e(t)).val()&&"-1"!=e("#rating-input",e(t)).val()||(e(".rating-symbol",e(t)).addClass("glyphicon-star-empty"),e("#rating-input",e(t)).val(-1))},_featured.onClickonClearSelection=function(){e(".business-toggle").click(),ResetBusinessSearchMode(),togglebusinesssearch(2),_featured.setSilderdata(),1==e('.filters-div  input[type="checkbox"]').is(":checked")||105!=slectedRedious?(e('.filters-div  input[type="checkbox"]').filter(function(){return!0}).prop("checked",!1).next().attr("aria-checked","false"),_featured.clearAdvanceSearch(),_featured.getAdvanceSearchData()):(e('.filters-div  input[type="checkbox"]').filter(function(){return!0}).prop("checked",!1).next().attr("aria-checked","false"),e(".atstreamcheck").hide(),e(".athomecheck").hide(),e(".atmobilecheck").hide(),e(".mobile-filter-result").removeClass("atmobileicon"),HasIdExists(1)&&(e(".atmobilecheck").show(),e(".mobile-filter-result").addClass("atmobileicon")),HasIdExists(3)&&(e(".atstreamcheck").show(),e(".athomecheck").hide()),HasIdExists(2)&&(e(".atstreamcheck").hide(),e(".athomecheck").show()),_featured.getAdvanceSearchData()),_featuredDtl.HideAdvanceSearch(),e(".filter-pill-pkg").removeClass("applied"),e("#txtBusinessLocationSearch,#professionalFilter,#txtServiceProviderPublicpage,#aSearchStylist,#ancFilter,.athomecheck,#divAdBusiness,#divAdOtheLocation,#divAdOnlineStream,#ulFeatureBusiness").removeAttr("tabindex"),setTimeout(function(){e("#ancFilter").focus()},700)},_featured.GetCityByLatLong=function(t){var i="",n="class"==tabSegment?"book":tabSegment;if(void 0!==t&&null!=typeof t&&""!=t&&(i=t.split("|")),"undefined"!=typeof promotionCodeId&&!String.isNullOrUndefineOrBlank(promotionCodeId)&&promotionCodeId>0)return!1;if(void 0!==i&&null!=i&&""!=i){var o=new vagaro.ajax,a={};a.Latitude=parseFloat(i[0]),a.Longitude=parseFloat(i[1]),a.Radius=105,a.CountryID=parseFloat(countryid),a.CityName=city;var s={};s.getApirequestlatolong=a,o.datamodel.Token=ApiURLEnumPublic.getcitybylatlong,o.datamodel.data=s,o.datamodel.callback=function(t){if(t.length>0){var i=t,o=cookieManager.getCookie("proximitystate_v3");if("book"!=n&&"class"!=n||(o.businesstypes="",o.category=""),void 0!==o&&null!=o&&""!=o)if(promotionCodeId>0){if(void 0!==o.businesstypes&&null!=o.businesstypes&&""!=o.businesstypes)e(i).each(function(e){i[e].categoryname=o.businesstypes});else if(("book"==n||"class"==n)&&!String.isNullOrUndefineOrBlank(service)){var a=/\s\s+/g,s=/[^0-9a-zA-Z\" \"]+/gi,r=service.toLowerCase().trim().replace(a," ").replace(s,"").replace(/ /g,"-");e(i).each(function(e){i[e].service=r,i[e].sectionName=n})}}else if(void 0!==o.category&&null!=o.category&&""!=o.category||void 0!==o.businesstypes&&null!=o.businesstypes&&""!=o.businesstypes){var l=(String.isNullOrUndefineOrBlank(o.category)?o.businesstypes:o.category).toLowerCase().replace(/\s+/g,"-");window.location.href.indexOf(l.toLowerCase())>-1&&e(i).each(function(e){i[e].categoryname=l})}else if(("book"==n||"class"==n)&&!String.isNullOrUndefineOrBlank(service)){a=/\s\s+/g,s=/[^0-9a-zA-Z\" \"]+/gi,r=service.toLowerCase().trim().replace(a," ").replace(s,"").replace(/ /g,"-");e(i).each(function(e){i[e].service=r,i[e].sectionName=n})}e(i).each(function(e){i[e].City=i[e].City.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()}),i[e].Cityurl=i[e].City.replace(/\s+/g,"-").toLowerCase(),i[e].ServiceURL=void 0!==urlService&&null!=urlService&&""!=urlService?urlService:service}),e("#divBestSaloon").html(""),e("#ulCityLatlongTemplate").tmpl(i).appendTo("#divBestSaloon"),0==e("#myLikeNoDataMsg").is(":visible")&&e("#divBestSaloonHead").show()}},o.datamodel.Error=function(e){},o.Post()}},_featured.GetAdminRelatedService=function(){var t=tabSegment,i="",n={};n.serviceId=""!==businesstypes&&null!==businesstypes?businesstypes:""!==service&&null!==service?service:"topRecord";var o=new vagaro.ajax,a={};a.getApirequestService=n,o.datamodel.Token=ApiURLEnumPublic.searchrelatedservice,o.datamodel.data=a,o.datamodel.callback=function(n){if(n.length>0){var o=n,a=cookieManager.getCookie("proximitystate_v3");if("book"!=t&&"class"!=t||(a.businesstypes="",a.category=""),void 0!==a&&null!=a&&""!=a)if(promotionCodeId>0){if(void 0!==a.businesstypes&&null!=a.businesstypes&&""!=a.businesstypes)e(o).each(function(e){o[e].categoryname=a.businesstypes});else if(("book"==t||"class"==t)&&!String.isNullOrUndefineOrBlank(service)){var s=service.replace(/\s|'+/g,"-").replace(/[^a-zA-Z ]/g,"-").replace(/-+/g,"-").toLowerCase().trim();e(o).each(function(e){o[e].service=s})}}else if(void 0!==a.category&&null!=a.category&&""!=a.category||void 0!==a.businesstypes&&null!=a.businesstypes&&""!=a.businesstypes){var r=(String.isNullOrUndefineOrBlank(a.category)?a.businesstypes:a.category).replace(/\s|'+/g,"-").replace(/[^a-zA-Z ]/g,"-").replace(/-+/g,"-").toLowerCase().trim();window.location.href.indexOf(r.toLowerCase())>-1&&e(o).each(function(e){o[e].categoryname=r})}else if(("book"==t||"class"==t)&&!String.isNullOrUndefineOrBlank(service)){s=service.replace(/\s|'+/g,"-").replace(/[^a-zA-Z ]/g,"-").replace(/-+/g,"-").toLowerCase().trim();e(o).each(function(e){o[e].service=s})}e(o).each(function(e){o[e].ServiceTitle=o[e].ServiceTitle.toLowerCase().replace(/\b[a-z]/g,function(e){return e.toUpperCase()}).replace(/'(S)/g,function(e){return e.toLowerCase()}),o[e].ServiceTitle_param=o[e].ServiceTitle.toLowerCase().replace(/'/g,"\\'").replace(/\b[a-z]/g,function(e){return e.toUpperCase()}).replace(/'(S)/g,function(e){return e.toLowerCase()}),isNullOrUndefineOrBlank(o[e].ServiceURL)?o[e].ServiceUrl=o[e].ServiceTitle.replace(/'/g,"").replace(/\s|'+/g,"-").replace(/[^a-zA-Z ]/g,"-").replace(/-+/g,"-").toLowerCase().trim():o[e].ServiceUrl=o[e].ServiceURL.replace(/'/g,"").replace(/\s|'+/g,"-").replace(/[^a-zA-Z ]/g,"-").replace(/-+/g,"-").toLowerCase().trim(),1==o[e].EventType||2==o[e].EventType?i="book":0==o[e].EventType&&(i="listing"),o[e].sectionName=i}),e("#divRelatedSearch").html(""),e("#ulRelatedSearchTemplate").tmpl(o).appendTo("#divRelatedSearch"),0==e("#myLikeNoDataMsg").is(":visible")&&e("#divRelatedSearchHead").show()}},o.datamodel.Error=function(e){},o.Post()},findObjectByURL=function(e,t){for(var i=0;i<e.length;i++){if(e[i].url===t)return e[i];if(e[i].children&&e[i].children.length>0){var n=this.findObjectByURL(e[i].children,t);if(n)return n}}return null},_featured.GetAdminFAQServiceClass=function(){var t="",i=_common.GetChoiceForSeleect2(e("#ddlServices")).id;if(i=function(e){if(String.isNullOrUndefineOrBlank(e))return null;var t=e.toLowerCase();if(!AdminServiceList||!Array.isArray(AdminServiceList.results))return null;for(var i=0;i<AdminServiceList.results.length;i++){var n=AdminServiceList.results[i];if(n.children)for(var o=0;o<n.children.length;o++){var a=n.children[o];try{if(void 0!==a.text&&null!=a.text&&a.text.toLowerCase()===t)return Number(a.id)}catch(e){}}}}(i),void 0===i||""==i||null==i){var n=window.location.href.split("/");i=function(e){if(String.isNullOrUndefineOrBlank(e))return null;var t=e.toLowerCase();if(!AdminServiceList||!Array.isArray(AdminServiceList.results))return null;for(var i=0;i<AdminServiceList.results.length;i++){var n=AdminServiceList.results[i];if(n.children)for(var o=0;o<n.children.length;o++){var a=n.children[o];try{if(void 0!==a.url&&null!=a.url&&a.url.toLowerCase()===t)return Number(a.id)}catch(e){}}}}(i=(i=n[n.length-2]).replace(/-/g," "))}if(""!=i&&null!=i&&e.isNumeric(i)&&(t=i),""!=relatedSearchId&&e.isNumeric(relatedSearchId)&&(t=relatedSearchId),e("#divFAQSearchServiceHead").hide(),""!=t&&null!=t){relatedSearchId="";var o={};e("#divFAQSearchService").empty(),o.serviceId=t;var a=new vagaro.ajax;a.datamodel.Token="GetServiceClassFAQ",a.datamodel.data=o,a.datamodel.callback=function(t){e("#divFAQSearchService").empty();var i="",n=getCookie(ProximityCookieName);null!=n&&null!=n&&(i=null!=countryid&&"undefined"!=countryid&&"2"==countryid?htmlEncode(n.city):_common.SetCityState(htmlEncode(n.city),htmlEncode(state)));var o=t;null!=o&&o.length>0&&(jQuery.each(o,function(e,t){t.Question=t.Question.replace("{service}",service),t.Answer=t.Answer.replace("{service}",service)}),null!=i&&""!=i&&jQuery.each(o,function(e,t){t.Question=t.Question.replace("{location}",i),t.Answer=t.Answer.replace("{location}",i)}),e("#ulFAQServiceSearchTemplate").tmpl(o).appendTo("#divFAQSearchService"),e("#divFAQSearchServiceHead").show())},a.datamodel.Error=function(e){},a.Post()}},_featured.setRelatedService=function(t,i,n,o,a,s){urlService=a,relatedSearchId=t,_featured.GetCityByLatLong();var r=window.location.href.substring(window.location.href.lastIndexOf("/")+1),l=n,c=r.slice(0,r.lastIndexOf("--")).replace(/-/g," "),d=r.slice(r.lastIndexOf("--")+2);service=i;var u,p;u=c.toLowerCase().trim().replace(y," ").replace(b,"").replace(/ /g,"-")+"--",p=d.toLowerCase().trim();var h=o,m=o,g="",v={basepage:"Home",sectionName:h},f="",C=i,S=a;C=C.replace(/\//g,"-");var y=/\s\s+/g,b=/[^0-9a-zA-Z\" \"]+/gi,k={},_=cookieManager.getCookie("proximitystate_v3");if("listings"==h?(_.category=service,_.businesstypes=service):(_.category="",_.businesstypes=""),void 0!==_&&null!=_&&""!=_)if(tabSegment=m,promotionCodeId>0)null!=promotionalURL&&null!=promotionalURL&&promotionalURL.length>0&&(g="/"+promotionalURL),void 0!==_.businesstypes&&null!=_.businesstypes&&""!=_.businesstypes?(history.pushState(v,h,(window.location.href.match("/$")?"../":"/")+m+"/"+promotionalURL+"/"+_.businesstypes.toLowerCase()+f.concat("/",u,p,"")),k.businesstypes=_.businesstypes):"book"==h||"class"==h?""!=service&&void 0!==service&&null!=service&&(history.pushState(v,h,(window.location.href.match("/$")?"../":"/")+m+g+f.concat("/",l.replace(/\s|'+/g,"-").replace(/[^a-zA-Z ]/g,"-").replace(/-+/g,"-").toLowerCase().trim(),"/",u,p,"")),k.category="",k.businesstypes=""):(history.pushState(v,h,(window.location.href.match("/$")?"../":"/")+m+"/"+promotionalURL+f.concat("/",u,p,"")),k.businesstypes="");else if(void 0!==_.category&&null!=_.category&&""!=_.category||void 0!==_.businesstypes&&null!=_.businesstypes&&""!=_.businesstypes){String.isNullOrUndefineOrBlank(_.category)?_.businesstypes:_.category;var D=l;-1===window.location.href.indexOf(D.toLowerCase())&&(history.pushState(v,h,(window.location.href.match("/$")?"../":"/")+m+"/"+D.toLowerCase()+f.concat("/",u,p,"")),k.category=String.isNullOrUndefineOrBlank(_.category)?"":_.category,k.businesstypes=String.isNullOrUndefineOrBlank(_.businesstypes)?"":_.businesstypes)}else"book"==h||"class"==h?(null!=S&&""!=S&&(C=S),history.pushState(v,h,(window.location.href.match("/$")?"../":"/")+m+g+f.concat("/",C.replace(/'/g,"").replace(/\s+/g,"-").replace(/\s+/g,"-").toLowerCase().trim(),"/",u,p,"")),k.category="",k.businesstypes=""):(history.pushState(v,h,(window.location.href.match("/$")?"../":"/")+m+f.concat("/",u,p,"")),k.category="",k.businesstypes="");setCookie(ProximityCookieName,_),setCookie(ProximityIsCurrentLocation,!1),loadData(null,!1),e("#txtSearchServiceMain1").parent().find(".select2-input").val(C),e("#txtSearchServiceMain").parent().find(".select2-input").val(C),e("#ddlServices").parent().find(".select2-input").val(service),s.preventDefault()},_featured.setLocationbybestsalon=function(t,i,n,o,a,s,r){_featured.GetCityByLatLong();var l,c,d={1:"us",2:"--gb",3:"--ca",4:"--au"},u=tabSegment,p="",h={basepage:"Home",sectionName:u},m="";l=t.toLowerCase().replace(/\s+/g,"-").trim()+"--",c=i.toLowerCase().trim();var g=s.toLowerCase().replace(/\s+/g,"-").trim(),v={},f=cookieManager.getCookie("proximitystate_v3");if(void 0!==f&&null!=f&&""!=f)if(promotionCodeId>0)if(null!=promotionalURL&&null!=promotionalURL&&promotionalURL.length>0&&(p="/"+promotionalURL),void 0!==f.businesstypes&&null!=f.businesstypes&&""!=f.businesstypes)history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+"/"+promotionalURL+"/"+f.businesstypes.toLowerCase()+m.concat("/",l,c,1==n?"":d[n])),v.businesstypes=f.businesstypes;else if("book"==u||"class"==u){if(""!=service&&void 0!==service&&null!=service){var C=/\s\s+/g,S=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+p+m.concat("/",service.toLowerCase().trim().replace(C," ").replace(S,"").replace(/ /g,"-"),"/",l,c,1==n?"":d[n])),v.businesstypes=""}}else history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+"/"+promotionalURL+m.concat("/",l,c,1==n?"":d[n])),v.businesstypes="";else if(void 0!==f.category&&null!=f.category&&""!=f.category||void 0!==f.businesstypes&&null!=f.businesstypes&&""!=f.businesstypes){var y=(String.isNullOrUndefineOrBlank(f.category)?f.businesstypes:f.category).toLowerCase().replace(/\s+/g,"-");window.location.href.indexOf(y.toLowerCase())>-1&&(history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+"/"+y.toLowerCase()+m.concat("/",l,c,1==n?"":d[n])),v.category=String.isNullOrUndefineOrBlank(f.category)?"":f.category,v.businesstypes=String.isNullOrUndefineOrBlank(f.businesstypes)?"":f.businesstypes)}else if("book"==u||"class"==u)if(u="book",2==n)if(""!=service&&void 0!==service&&null!=service&&""!=urlService){C=/\s\s+/g,S=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+p+m.concat("/",urlService.toLowerCase().trim().replace(C," ").replace(S,"").replace(/ /g,"-"),"/",l,g,1==n?"":d[n])),v.category="",v.businesstypes=""}else{C=/\s\s+/g,S=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+p+m.concat("/",service.toLowerCase().trim().replace(C," ").replace(S,"").replace(/ /g,"-"),"/",l,g,1==n?"":d[n])),v.category="",v.businesstypes=""}else if(""!=service&&void 0!==service&&null!=service&&""!=urlService){C=/\s\s+/g,S=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+p+m.concat("/",urlService.toLowerCase().trim().replace(C," ").replace(S,"").replace(/ /g,"-"),"/",l,c,1==n?"":d[n])),v.category="",v.businesstypes=""}else{C=/\s\s+/g,S=/[^0-9a-zA-Z\" \"]+/gi;history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+p+m.concat("/",service.toLowerCase().trim().replace(C," ").replace(S,"").replace(/ /g,"-"),"/",l,c,1==n?"":d[n])),v.category="",v.businesstypes=""}else 2==n?(history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+m.concat("/",l,g,1==n?"":d[n])),v.category="",v.businesstypes=""):(history.pushState(h,u,(window.location.href.match("/$")?"../":"/")+u+m.concat("/",l,c,1==n?"":d[n])),v.category="",v.businesstypes="");v.city=t,v.countryid=n,v.state=i,v.lat=o,v.long=a,v.currencysymbol=2==n?"£":"$",lattitude=o,longitude=a,setCookie(ProximityCookieName,v),setCookie(ProximityIsCurrentLocation,!1),e(IdBusinessLocationSearch).data("select2").setVal(""),e(IdBusinessLocationSearch).data("selectedid",""),loadData(null,!1),document.title="Salons in "+t+", "+i+" | Vagaro",e("#txtBusinessLocationSearch").closest("#dvBusinessLocationSearch").find(".select2-input").val(t+", "+i.toUpperCase()),e("#txtBusinessLocationSearch1").closest("#dvBusinessLocationSearch1").find(".select2-input").val(t+", "+i.toUpperCase()),e("#txtLocationSearch").val(t+", "+i.toUpperCase()),r.preventDefault()},_featured.setSilderdata=function(){DistanceText=3==e("#hdngblCountryId").data("countryid")||4==e("#hdngblCountryId").data("countryid")?"km":"mi",distanceRadius=105,e("#slidevalue").html(" 105 "+DistanceText)},_featured.clearAdvanceSearch=function(t){resetAllCheckBox(),kidsFacilitiesdata="",_featuredDtl.clearAdvanceRating(),"proxysearch"==t&&_featured.setSilderdata(),businessFacilities="",kidsFacilities="",isPromotionBusiness=!1,isFavouriteBusiness=!1,businessRating=parseInt(parseInt(e("#rating-input").val())+1);var i=getCookie(ProximityCookieName);null!=i&&(i.businesstypes="",setCookie(ProximityCookieName,i))},_featured.GetFacilities=function(){var t="",i=e("#divEstablishment input[data-model=1]:checkbox:checked ").length;e("#divEstablishment > div ").length>0&&i>0&&(t=e.map(e("#divEstablishment input[data-model=1]:checkbox:checked "),function(e,t){return e.value}).join(",")),e("#divLanguage > div ").length>0&&e("#divLanguage input[data-model=1]:checkbox:checked ").length>0&&(t+=(i>0?",":"")+e.map(e("#divLanguage input[data-model=1]:checkbox:checked "),function(e,t){return e.value}).join(",")),e("#divPayment > div ").length>0&&e("#divPayment input[data-model=1]:checkbox:checked ").length>0&&(t+=","+e.map(e("#divPayment input[data-model=1]:checkbox:checked "),function(e,t){return e.value}).join(","));var n=e("#divEstablishment input[data-model=2]:checkbox:checked ").length;return e("#divEstablishment > div ").length>0&&n>0&&(t+=","+e.map(e("#divEstablishment input[data-model=2]:checkbox:checked "),function(e,t){return e.value}).join(",")),e("#professionalFilter > .chkFacilities").remove(),t},_featured.GetFacilityObject=function(){var t=new Array,i=e("#divEstablishment input[data-model=1]:checkbox:checked ").length;e("#divEstablishment > div ").length>0&&i>0?e.map(e("#divEstablishment input[data-model=1]:checkbox:checked"),function(i,n){e(i).data("facilityvalue").toLowerCase().indexOf("onlinestore")>-1||e(i).data("facilityvalue").toLowerCase().indexOf("online store")>-1?_featured.isOnlinestore=!0:e(i).data("facilityvalue").toLowerCase().indexOf("onlinegcstore")>-1||e(i).data("facilityvalue").toLowerCase().indexOf("online gc store")>-1?_featured.isOnlineGCstore=!0:e(i).data("facilityvalue").toLowerCase().indexOf("covid19ready")>-1||e(i).data("facilityvalue").toLowerCase().indexOf("covid-19 ready")>-1?_featured.isDisplayCovidBadge=!1:t.push(new Array(e(i).data("facilityheaderid"),e(i).data("facilityvalueid")))}):"listings"==tabSegment&&e("#ancListingCovid").length>0&&(_featured.isDisplayCovidBadge=!0);var n=e("#divEstablishment input[data-model=2]:checkbox:checked ").length;return e("#divEstablishment > div ").length>0&&n>0&&e.map(e("#divEstablishment input[data-model=2]:checkbox:checked"),function(i,n){t.push(new Array(e(i).data("facilityheaderid"),e(i).data("facilityvalueid")))}),e("#divLanguage > div ").length>0&&e("#divLanguage input[data-model=1]:checkbox:checked ").length>0&&e.map(e("#divLanguage input[data-model=1]:checkbox:checked"),function(i,n){t.push(new Array(e(i).data("facilityheaderid"),e(i).data("facilityvalueid")))}),e("#divPayment > div ").length>0&&e("#divPayment input[data-model=1]:checkbox:checked ").length>0&&e.map(e("#divPayment input[data-model=1]:checkbox:checked"),function(i,n){t.push(new Array(e(i).data("facilityheaderid"),e(i).data("facilityvalueid")))}),t},_featured.GetKidsFacilities=function(){kidsFacilitiesdata="";var t="";e("#divEstablishment > div ").length>0&&(t=e.map(e("#divEstablishment input[data-model=0]:checkbox:checked"),function(e,t){return e.value}).join(","));var i="";return-1!=t.toLowerCase().indexOf("friendly")&&(i=1,kidsFacilitiesdata="Kid Friendly"),-1!=t.toLowerCase().indexOf("only")&&(""==i?(kidsFacilitiesdata="Kids Only",i=2):(i+=",2",kidsFacilitiesdata+=",Kids Only")),e("#professionalFilter > .chkkids").remove(),i},_featured.IsUserFavourite=function(){var t=!1;return e("#divEstablishment > div ").length>0&&e("#divEstablishment input[data-model=-1]:checkbox").length>0&&(t=e("#divEstablishment input[data-model=-1]:checkbox").prop("checked")),t},_featured.getBusiness=function(){if(e("#AdvanceFilterContent").find(":CheckBox").length>0){var t="";return e("#divBusinessType > div ").length>0&&e("#divBusinessType input[data-model=1]:checkbox").length>0&&(t=e.map(e("#divBusinessType input[data-model=1]:checkbox:checked"),function(e,t){return e.value}).join(",")),e("#professionalFilter .filter-result-text ,.mobile-filter-result .filter-result-text").filter(function(){return!0}).remove(),t}return businesstypes},_featured.getBusinessTypeIds=function(){if(e("#AdvanceFilterContent").find(":CheckBox").length>0){var t=new Array;return e("#divBusinessType > div ").length>0&&e("#divBusinessType input[data-model=1]:checkbox").length>0&&e.map(e("#divBusinessType input[data-model=1]:checkbox:checked"),function(i,n){t.push(new Array(e(i).data("facilityheaderid"),e(i).data("facilityvalueid")))}),e("#professionalFilter .filter-result-text ,.mobile-filter-result .filter-result-text").filter(function(){return!0}).remove(),JSON.stringify(t)}return businesstypeids},_featured.getAdvanceLiveStreamSearchData=function(){-1==businessSearchModeForSelection.indexOf(searchFilterEnum.LiveStream)||"undefined"==typeof tabSegment||"class"!=tabSegment&&"listings"!=tabSegment?e("body").removeClass("livestreampage"):e("body").hasClass("livestreampage")||(selectClassCategory(null,!1),e("body").addClass("livestreampage"),_common.AddState(_common.liveStreamClasses),LoadLiveStreamPage()),e("#txtBusinessLocationSearch,#professionalFilter,#txtServiceProviderPublicpage,#aSearchStylist,#ancFilter,.athomecheck,#divAdBusiness,#divAdOtheLocation,#divAdOnlineStream,#ulFeatureBusiness,#s2id_autogen1").removeAttr("tabindex"),setTimeout(function(){e("#hHeaderText").focus()},500)},_featured.getAdvanceSearchData=function(t){isDealFilterApplied=!0,businesstypeids=_featured.getBusinessTypeIds(),businesstypes=_featured.getBusiness();var i=getCookie(ProximityCookieName);if(null!=i&&(i.businesstypes=businesstypes,setCookie(ProximityCookieName,i)),generateCheckboxList(businesstypes,"chkbusiness"),generateCheckboxList(businessFacilities=_featured.GetFacilities(),"chkFacilities"),kidsFacilities=_featured.GetKidsFacilities(),generateCheckboxList(kidsFacilitiesdata,"chkkids"),(isPromotionBusiness=_featuredDtl.IsPrmotion())?(e(".mobile-filter-result").addClass("promoicon").removeClass("atmobileicon"),e(".imgpromcheck").show()):(e(".mobile-filter-result").removeClass("promoicon"),e(".imgpromcheck").hide()),(isFavouriteBusiness=_featured.IsUserFavourite())&&!filterHaveValue("My Favorite","chkfav")?generateCheckboxList("My Favorite","chkfav"):0==isFavouriteBusiness&&filterHaveValue("My Favorite","chkfav")&&removecheckBox("My Favorite","chkfav"),(businessRating=parseInt(parseInt(e("#rating-input").val())+1))>0&&0==getSortingValue()&&(currentSorting=4),slectedRedious=distanceRadius,e(".atmobilecheck").hide(),e(".atstreamcheck").hide(),e(".athomecheck").hide(),e(".mobile-filter-result").removeClass("atmobileicon"),e("#atBusiness").removeClass("active"),e("#atMobile").removeClass("active"),e("#atStream").removeClass("active"),HasIdExists(1)&&(e(".atmobilecheck").show(),e(".mobile-filter-result").addClass("atmobileicon"),e("#atMobile").addClass("active")),HasIdExists(3)&&(e(".atstreamcheck").show(),e("#atStream").addClass("active")),HasIdExists(2)&&(e(".athomecheck").show(),e("#atBusiness").addClass("active")),"book"!=tabSegment&&"class"!=tabSegment||(e("#aBusinessTab").removeClass("active"),e("#aMobileTab").removeClass("active"),e("#aStreamTab").removeClass("active"),HasIdExists(1)&&e("#aMobileTab").addClass("active"),HasIdExists(3)&&e("#aStreamTab").addClass("active"),HasIdExists(2)&&e("#aBusinessTab").addClass("active")),"bookservice"==t?onSearchClickService("listings"):(void 0!==t&&"homepagestore"==t&&(isClickForOnlineStore=!1,isClickForOnlineGCStore=!1),loadData(null,!1)),!String.isNullOrUndefineOrBlank(businesstypes)){var n=businesstypes.trim().split(",");""!=businesstypes&&1==n.length&&e("#divBusinessType > div ").length>0&&e("#divBusinessType input[data-model=1]:checkbox:checked").length>0&&(category=n[0].toString(),i.category=category,setCookie(ProximityCookieName,i),_featured.GetCityByLatLong())}-1==businessSearchModeForSelection.indexOf(searchFilterEnum.LiveStream)&&_common.AddState(tabSegment),e("#txtBusinessLocationSearch,#professionalFilter,#txtServiceProviderPublicpage,#aSearchStylist,#ancFilter,.athomecheck,#divAdBusiness,#divAdOtheLocation,#divAdOnlineStream,#ulFeatureBusiness,#s2id_autogen1").removeAttr("tabindex"),e("#ancFilter").focus(),e("#txtServiceProviderPublicpage").focus()},_common.setTouchEvents(),e("#userImage").attr("onerror","imageError(this)")}(jQuery,window,document),$(window).bind("resize",function(e){if(_common.setviewport(),homeLivestreamSlider_mobile(),$(window).width()>767){var t=window.location.href;"undefined"==typeof VParentDomain&&(VParentDomain=""),t==VParentDomain&&($(".tips-mobile-section-fade").hide(),$(".tips-mobile-section").hide())}}),$(window).bind("orientationchange",function(e){_common.setviewport(),homeLivestreamSlider_mobile(),$("html").hasClass("loginpopopenHtml")&&setTimeout(function(){$("body, html").scrollTop(0)},500),$("html").hasClass("loginmodalpopup")&&setTimeout(function(){$("body, html").scrollTop(0)},500)}),$(window).on("load",function(){"detail"==BasePage.toLowerCase()&&_shopdetail.isWidget}),$(document).on("click","#LiveStreamBookmarkMobile",function(){$(this).toggleClass("activeBookMark")}),$(document).ready(function(){$(".upcoming-checkin-btn").click(function(){$(this).toggleClass("checked-show")}),$(".duration-text").click(function(){$("#durationdropdown").slideToggle("600")}),$(".stream-more").click(function(){$("#streamclassdropdown").slideToggle("600"),$(window).width()<767&&$(this).closest(".livestreampage").find(".mobile-classmore-links").toggle()}),$(".family-friends-invite-msg").addClass("msgshow"),$("#servicePromotion").slick({dots:!1,infinite:!0,speed:3e3,autoplay:!0,arrows:!1}),$("#map_canvas").on("mouseup touchend",function(e){var t=$(".infoBox");t.is(e.target)||0!==t.has(e.target).length||$(".infoBox").hide()}),RedirectToShopOwnerPage=function(){var e=location.protocol+"//"+location.host+"/merchants/settings/book/notification?enc=kFc1Op9nOSCvWL4oU2imcJjAj2n6DZlr9nJsykS8u5Io8IYWVUj7iwryOUf9E17g";if("undefined"!=typeof vgAppicationType&&1==vgAppicationType)CallbackforMobileApp(0,0,"","","0",'10|~|{"url":"'+(e+="&isFromEmail=1")+'"}');else if(iPadAndroid){e+="&isFromEmail=1",(t=window.open(e))&&!t.closed&&void 0!==t&&void 0!==t.closed||(window.location.href=e)}else if("undefined"!=typeof UserID&&null!=UserID&&""!=UserID&&parseInt(UserID)>0&&"undefined"!=typeof UserType&&null!=UserType&&""!=UserType&&(3==parseInt(UserType)||5==parseInt(UserType)||6==parseInt(UserType))){var t;return(t=window.open(e))&&!t.closed&&void 0!==t&&void 0!==t.closed||(window.location.href=e),!1}},_common.FeaturedBusinessTooltip(),$(document).on("touchstart click",function(e){$(e.target).closest(".ad-text").length||$(e.target).closest(".gen-tooltip-div").length||$(".ad-text").removeClass("hover")}),$(".onlyfilter-pill").click(function(){$(".mob-class-stream-filter").addClass("openfilter")}),$(".filterclosebtn").click(function(){$(".mob-class-stream-filter").removeClass("openfilter")}),$(window).scroll(function(){$(window).scrollTop()>=211?$(".livestreampage .mobile-listing-business").addClass("mobfix-timeslide"):$(".livestreampage .mobile-listing-business").removeClass("mobfix-timeslide")}),$("#anclivebackArrow").click(function(){$("#live-stream-classes-popup").modal("hide")}),$(document).on("input","#dvSearchServiceMain .select2-container input[type=text]",function(){""==$.trim($(this).val())&&$("#select2-drop ul.select2-results").parent().addClass("selectbox-hide-border")});var e=window.location.pathname;$("#btnLiveStream").on("click",function(t){$("#btnLiveStream").attr("href",e),$("#btnLiveStreamMobile").attr("href",e),t.preventDefault()}),$("#btnLiveStreamMobile").on("click",function(t){$("#btnLiveStreamMobile").attr("href",e),$("#btnLiveStream").attr("href",e),t.preventDefault()})}),$(document).keyup(function(e){$(".gallery-popup-background:visible").length>0&&(37==e.keyCode?_home.PrevStyle(e):39==e.keyCode?_home.NextStyle(e):27==e.keyCode&&_featured.closeGalleryPopup())});var ctlrMain,ctlrListing,Services,ctrlBusinessSearch,cltrlLocationSearch,ctrlMobileCityState,cltrlBusinessLocationSearch,objCtlrSearchAdvBusinessType,noUserImg="https://vagaro.azureedge.net/static-content/Images/user-male-img_155_new.png";function setSortingValue(e,t){currentSorting!=e&&(currentSorting=0,$(".nDropDownMenus").find("a").removeClass("sort-active").attr("aria-selected",!1),""==e&&null==e||(currentSorting=e,$("#"+t).addClass("sort-active").attr("aria-selected",!0)),loadData(null,!1)),$(".w-dropdown").trigger("w-close.w-dropdown"),setTimeout(function(){$("#dDropDownMenus").attr("tabindex",-1).focus()},1e3)}function setSortingFilterValue(e,t){currentSorting!=e&&(currentSorting=0,$(".nDropDownMenusFilter").find("a").removeClass("sort-active").attr("aria-selected",!1),""==e&&null==e||(currentSorting=e,$("#"+t).addClass("sort-active").attr("aria-selected",!0)),loadData(null,!1)),$(".w-dropdown").trigger("w-close.w-dropdown"),setTimeout(function(){$("#dDropDownMenusFilter").attr("tabindex",-1).focus()},1e3)}function setSortingGalleryFilterValue(e,t){currentSorting!=e&&(currentSorting=0,$(".nDropDownMenusGalleryFilter").find("a").removeClass("sort-active").attr("aria-selected",!1),""==e&&null==e||(currentSorting=e,$("#"+t).addClass("sort-active").attr("aria-selected",!0)),loadData(null,!1)),$(".w-dropdown").trigger("w-close.w-dropdown"),setTimeout(function(){$("#dDropDownMenusGalleryFilter").attr("tabindex",-1).focus()},700)}function setMylikesGalleryFilterValue(e,t,i,n){UserID>0||1==i?myLikesCurrentValue==e&&1!=n||(myLikesCurrentValue=0,$(".nDropDownMenusFilterMyLikes").find("a").removeClass("myLikeAll-active").attr("aria-selected",!1),""==e&&null==e||(myLikesCurrentValue=e,$("#"+t).addClass("myLikeAll-active").attr("aria-selected",!0)),isLoadDataCallFromDDL=1,loadData(null,!1),_common.AddState("photos"),setMylikesGalleryDDLText(myLikesCurrentValue)):1==e&&showLogin(),$(".w-dropdown").trigger("w-close.w-dropdown"),setTimeout(function(){$("#dDropDownMenusFilterMyLikes").attr("tabindex",-1).focus()},700)}function setMylikesGalleryDDLSelection(e){"photos"!=e&&(myLikesCurrentValue=0),$(".nDropDownMenusFilterMyLikes").find("a").removeClass("myLikeAll-active").attr("aria-selected",!1),$(".nDropDownMenusFilterMyLikes #aMyLikesOption_filter_"+myLikesCurrentValue).addClass("myLikeAll-active").attr("aria-selected",!0),$(".nDropDownMenusFilterMyLikes #aMyLikesOption_filter_mobile_"+myLikesCurrentValue).addClass("myLikeAll-active").attr("aria-selected",!0),setMylikesGalleryDDLText(myLikesCurrentValue)}function setMylikesGalleryDDLText(e){0==e?($(myLikeDdlTextID).text("Gallery"),$(myLikeDdlTextIDMobile).text("Gallery")):($(myLikeDdlTextID).text("My Liked Styles"),$(myLikeDdlTextIDMobile).text("My Liked Styles"))}function onFeaturedServiceProviderRowLoad(e,t){var i=$(t),n="0",o="0",a="";null==e.Photo&&(e.Gender,$("#imgServiceProvider_"+e.BusinessID+"_"+e.ServiceProviderID,i).attr("src",noUserImg)),a=null!=e.CountryID&&"undefined"!=e.CountryID&&2!=e.CountryID?null!=e.City&&String(e.City).length>15?String(e.City).substr(0,15)+"...":e.City+", "+(null!=e.StateCode&&String(e.StateCode).length>15?String(e.StateCode).substr(0,15)+"...":e.StateCode):null!=e.City&&String(e.City).length>15?String(e.City).substr(0,15)+"...":e.City,$("#spnAddress",i).html(a),$("#spnBusinessName_"+e.BusinessID+"_"+e.ServiceProviderID,i).html(unescape(escape(e.BusinessName))),null!=e.AvgSPRating&&(n=parseInt(e.TotalSPRank),o=parseFloat(e.AvgSPRating).toFixed(1)),$("#ratingStartfilled",i).css("width",100*o/5+"%"),$("#ratingStartfilled",i).attr("title",o),$("#dvProfessionalRatingName",i).attr("title",o),$("#imgServiceProvider_"+e.BusinessID+"_"+e.ServiceProviderID,i).attr("aria-label",e.ServiceProviderName+" from "+e.BusinessName+", "+e.City+", "+e.StateCode+". Has "+e.AvgSPRating+" Star Ratings Having Total "+e.TotalSPRank+" reviews. Navigate to book appointment with this professional.");var s=1==n?"Review":"Reviews";$("#spServiceProviderRank",i).html(o+" ("+n+" "+s+")"),$("#arating",i).attr("href","/"+e.VagaroURL),$("#divRating",i).attr("title",o),e.IsAcceptAppOnline?$("#btnsave",i).css("display","block"):$("#btnsave",i).css("display","none"),$("#divDistance",i).css("display",""),$("#spnDostancetext",i).html(e.distanceUnit);var r={};return r.spid=e.ServiceProviderID,r.vagarourl=e.VagaroURL,$("#btnsave",i).attr("onclick","_featured.RedirectToBook24("+JSON.stringify(r)+",event);"),i}function RedirectToBusinessDetailPage(e,t){var i=new vagaro.ajax;i.datamodel.Token="SetSessionDataForServiceProvider",i.datamodel.callback=SetSessionDataForServiceProviderCallback,i.datamodel.data=[e,t],i.datamodel.Error=function(e){},i.Post()}function SetSessionDataForServiceProviderCallback(e){location.href="/"+e}function imageError(e){e.src="https://vagaro.azureedge.net/static-content/Images/user-male-img_155_new.png "}_featured.imageStaffError=function(e,t){t.src=1==e||"true"==e?"https://vagaro.azureedge.net/static-content/Images/user-male-img_155_new.png":"https://vagaro.azureedge.net/static-content/Images/user-female-img_155_new.jpg"},_featured.ImageGenderWise=function(e){return 1==e||"true"==e?"https://vagaro.azureedge.net/static-content/Images/user-male-img_155_new.png":"https://vagaro.azureedge.net/static-content/Images/user-female-img_155.jpg"};var marker,map,businessURL="";function onSearchClickService(e,t){$("#dvHome").hide(),"detail"==BasePage.toLowerCase()?window.location.href=$("#listings").attr("href").replace("listings","book"):"home"==BasePage.toLowerCase()?window.location.hash="book":window.location.href=$("#listings").attr("href").replace(/([#])\w+/g,"book"),ProximityValueChanged("book",!0);new ctlrSearchService($("#txtSearchServiceMain"),"")}function BussinessTypeSelectionChanged(e){objCtlrSearchAdvBusinessType.init(),window.location.href.indexOf("photos")}function AnyTimeDate(){$(".hmanytime-text").addClass("xdsoft_current"),$(".xdsoft_time_variant .xdsoft_current").removeClass("xdsoft_current"),$(".xdsoft_calendar .xdsoft_current").removeClass("xdsoft_current");var e=$("#txtServiceDate").val().toLowerCase();$("#txtHomeServicesDate").val(AnyTime),$("#txtServiceDate").val(AnyTime),e!=AnyTime.toLowerCase()&&(serviceTime=""),$(".xdsoft_cancel").focus()}function setDropDown(e){$("#txtLocationSearch").length>0&&(cltrlLocationSearch=new ProximitySearch($("#txtLocationSearch"),$("#hdngblCountryId"),$("#navCountryList")).init("top-dropdown",!0)),setTimeout(function(){destroytxtLocationSearch()},1e3),setMobileLocation(e),$("#txtBusinessLocationSearch").length>0&&(cltrlBusinessLocationSearch=new ProximitySearch($("#txtBusinessLocationSearch"),$("#hdngblCountryId"),null).init("service-where-dropdown home-serch-service-height mobcommon-dropdown",!0));var t="";t=(new Date).getMonth()>6?(new Date).getFullYear()+1:(new Date).getFullYear(),applydatepicker({divid:"#divHomeServicesDate",textid:"#txtHomeServicesDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.MiniDate)+" [at] h:mm A",defaultDateTime:serviceDateTime,pickTime:!0,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,yearStart:(new Date).getFullYear(),yearEnd:t,callBackOnChange:HomeServicesDateChange}),("undefined"!=typeof vgAppicationType&&1==vgAppicationType||$("#mobile-check").is(":visible"))&&($("#txtHomeServicesDate").val(AnyTime),$("#spnHomeServicesDate").hide()),setTimeout(function(){$("#ctl00_ancHome").focus()},1e3)}function destroytxtLocationSearch(){$(".on-search-LocationSearch").select2("destroy")}function onFeaturedBusinessAfterLoad(e){if($("#spnTotalRecords").show(),_common.FeaturedBusinessTooltip(),null==e){var t=[];$(".listings-business-parent-div").each(function(){var e=$(this).data();if(null!=typeof e.businessid){var i={};i.BusinessID=e.businessid,i.BusinessName=e.businessname,i.LATITUDE=e.latitude,i.LONGITUDE=e.longitude,t.push(i)}$("#pMoreContent_"+e.businessid).text().length<=112&&($("#divMoreContent_"+e.businessid).hide(),$("#pMoreContent_"+e.businessid).css("height","auto"))}),google.maps.event.trigger(map,"resize"),loadMarkers(t,"listing"),0==$(".listings-business-parent-div").length&&($("#spnTotalRecords").html("No").attr("aria-label","No"),$("#divBestSaloonHead").hide(),$("#divRelatedSearchHead").hide(),$("#divFAQSearchServiceHead").hide()),$(".listing-business-info-div").each(function(e){$(this).find(".business-type-facility").get(0).scrollWidth-$(this).width()<=0&&$(this).find(".substring-div").hide()}),setTimeout(function(){$("#divNodataFeature").attr("tabindex",-1).attr("role","banner").attr("aria-labelledby","myLikeNoDataMsg").focus(),$("myLikeNoDataMsg").attr("aria-hidden",!0)},600)}else if(e.length>0){e.length>=1||e[0].TotalPage>=1?$("#mobile-check").length&&$("#mobile-check").is(":visible")&&"undefined"!=typeof BasePage&&"Home"===BasePage&&"undefined"!=typeof tabSegment&&(""===tabSegment||"/"===tabSegment)?$(".divSorting").hide():$(".divSorting").show():$(".divSorting").hide();for(var i=0;i<e.length;i++)e[i];$("#spnTotalRecords").html(e[0].TotalPage).attr("aria-label",e[0].TotalPage),$("#spnTotalRecords").attr("tabindex",0),$("#map_canvas:visible").length>0&&(google.maps.event.trigger(map,"resize"),loadMarkers(e,"listing"))}else $("#spnTotalRecords").html("No").attr("aria-label","No"),$(".divSorting").hide();""==_BusinessData.ignoreBusinessIds&&setTimeout(function(){var e="";1==$("#ulFeatureBusiness").is(":visible")&&$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").slice(0,6).each(function(){var t=$(this);void 0!==t.data("ispromotion")&&"true"==t.data("ispromotion").toString().toLowerCase()&&void 0!==$(this).data("businessid")&&(e+=$(this).data("businessid")+",")}),e=e.replace(/(^[,\s]+)|([,\s]+$)/g,""),_BusinessData.ignoreBusinessIds=e,_featured.BusinessPager.options.Data.objRandomBusinessData=_BusinessData},500)}var infobox,countryLat,countryLon,countryZoom,mapServices,servicesMarker,total=25,mapFlag=!1,markers=new Array;removeMarkers=[];function loadMarkers(e,t){if(null!=e&&null!=e&&e.length>0){var i,n=new google.maps.LatLngBounds;map.setTilt(45);new google.maps.Size(26,33);for(i=0;i<e.length;i++){var o=new google.maps.LatLng(e[i].LATITUDE,e[i].LONGITUDE);n.extend(o);var a=document.createElement("img");a.src=cdnImagePath+"PublicImages/Images/map-img.png",a.style.width="26px",a.style.height="33px",a.className="gmp-marker-drop";var s=new google.maps.marker.AdvancedMarkerElement({position:o,map:map,content:a,title:e[i].BusinessName,gmpClickable:!0});removeMarkers.push(s),"listing"==t&&s.addListener("click",function(t,i){return function(){var n=e[i].BusinessID;$(".listings-60").animate({scrollTop:$(".listings-60").find($("#feature_"+e[i].BusinessID)).position().top},600),$(".listings-business-parent-div").removeClass("active"),$("#feature_"+n).addClass("active"),showInfoWindow(e[i].BusinessID,t,"listing")}}(s,i)),"deals"==t&&s.addListener("click",function(t,i){return function(){var n=e[i].BusinessID,o=e[i].PromotionID;$(".listings-60").animate({scrollTop:$(".listings-60").find($("#deals_"+n+"_"+o)).position().top},600),$("#deals_"+n+"_"+o).addClass("active"),setTimeout(function(){$("#deals_"+n+"_"+o).removeClass("active")},900),showInfoWindow(e[i].BusinessID,t,"deals",e[i].PromotionID)}}(s,i)),"book"!=t&&"class"!=t||s.addListener("click",function(i,n){return function(){var o=e[n].BusinessID;$(".listings-60").animate({scrollTop:$(".listings-60").find($("#service_"+e[n].BusinessID)).position().top},600),$(".listings-business-parent-div").removeClass("active"),$("#service_"+o).addClass("active"),showInfoWindow(e[n].BusinessID,i,t)}}(s,i))}try{isRedomap?isRedomap=!1:(map.setCenter(n.getCenter(),map.fitBounds(n)),"deals"==t?removeMarkers.length<3?setTimeout(function(){map.setZoom(12)},500):setTimeout(function(){map.setZoom(9)},500):e.length<3&&setTimeout(function(){map.setZoom(11)},500)),setTimeout(function(){$(".gm-control-active.gm-fullscreen-control").addClass("secondary-button"),$("#map_canvas img").each(function(){"https://vagaro.azureedge.net/static-content/PublicImages/Images/map-img.png"==this.src&&$(this).parent().addClass("g-pin font-awesome-solid-pro")}),setTimeout(function(){$(".gm-control-active.gm-fullscreen-control").addClass("secondary-button"),$("#map_canvas img").each(function(){"https://vagaro.azureedge.net/static-content/PublicImages/Images/map-img.png"==this.src&&$(this).parent().addClass("g-pin font-awesome-solid-pro")})},2e3),setTimeout(function(){$(".gm-control-active.gm-fullscreen-control").addClass("secondary-button"),$("#map_canvas img").each(function(){"https://vagaro.azureedge.net/static-content/PublicImages/Images/map-img.png"==this.src&&$(this).parent().addClass("g-pin font-awesome-solid-pro")})},4e3)},1e3)}catch(e){}}}function GetWorkingHours(e){var t=new vagaro.ajax;t.datamodel.Token="GetWorkingHoursByBusinessID",t.datamodel.callback=GetWorkingHoursByBusinessIDCallback,t.datamodel.data=[e],t.datamodel.Error=function(e){},t.Post()}function GetWorkingHoursByBusinessIDCallback(e){var t=$("#ulBusinessWorkingHours");t.empty(),e.length>0&&t.append(e)}function showInfoWindow(e,t,i,n){var o=$("#MapInfoTemplate");$("#infobox").html(o);var a={};$("#divServiceDetailsTemplate",o).hide();var s=!0;if("deals"==i)$("#deals_"+e+"_"+n).find("#location_"+e+"_"+n).show().css("display","inline"),a="<a class='map-tooltip' id='dealurl_"+e+"' href="+(location.protocol+"//"+location.host+"/"+$("#deals_"+e+"_"+n).attr("href"))+">"+$("#deals_"+e+"_"+n).html()+"</a>",$("#deals_"+e+"_"+n).find("#location_"+e+"_"+n).hide();else if("book"==i||"class"==i){a=$("#service_"+e).data(),$("#divServiceNameTemplate",o).html(service);var r=$("#divServiceFromTime",$("#service_"+e)).html(),l=$("#divServiceFromTime",$("#service_"+e)).attr("class");$("#divPriceTemplate",o).html(r),$("#divPriceTemplate",o).attr("class",l);var c={};if(c.serviceid=a.serviceid,c.vagarourl=a.vagarourl,c.bookingDateTime=$("#service_"+e+" #appDate").html(),$("#aPriceTemplate",o).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(c)+",event);"),"class"==i?$("#aPriceTemplate",o).addClass("classdateprice-map"):$("#aPriceTemplate",o).removeClass("classdateprice-map"),"anytime"==$("#txtServiceDate").val().toString().toLowerCase())if($("#aPriceTemplate",o).hide(),"book"==i)(m={}).serviceid=a.serviceid,m.vagarourl=a.vagarourl,$("#aTemplateUrl",o).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(m)+",event);"),$("#aTemplateBusinessImage",o).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(m)+",event);");else $("#aTemplateBusinessImage",o).attr("href",u);else $("#aPriceTemplate",o).show(),$("#aTemplateBusinessImage",o).attr("href",u);$("#divServiceDetailsTemplate",o).show(),s=!1}else a=$("#feature_"+e).data();if("deals"!=i){var d=a.businessname,u=location.protocol+"//"+location.host+("listing"!=i?"/":"")+a.vagarourl.replace("'","'").toLowerCase();"book"==i||"class"==i?$("#mapCont",o).attr("onclick",$("#service_"+e).attr("onclick")):$("#mapCont",o).attr("click","location.href:"+u);var p=a.businessimage;$("#aTemplateBusinessImage",o).addClass("lazy").attr("data-original",""+p).removeAttr("src"),$("#aTemplateBusinessImage",o).css("background-image","url('"+p+"')"),$("#aTemplateBusinessImage",o).attr("title",d);var h=(100*(a.averagerank||0)/5).toFixed(1);$(".divTemplateRating").css("width",h+"%");o=$("#MapInfoTemplate");$(".caption-map",o).text(truncateText(d,0,27,!0)),$(".caption-map",o).attr("title",d);var m,g=null!=a.review?Number(a.review):0,v=1===g?"Review":"Reviews",f=null!=a.averagerank?parseFloat(a.averagerank).toFixed(1):"0.0";if($(".card-miles",o).text(f+" ("+g+" "+v+")"),"anytime"==$("#txtServiceDate").val().toString().toLowerCase())if("book"==i)(m={}).serviceid=a.serviceid,m.vagarourl=a.vagarourl,$("#aTemplateUrl",o).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(m)+",event);"),$("#aTemplateBusinessImage",o).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(m)+",event);");else $("#aTemplateUrl",o).attr("href",u),$("#aTemplateBusinessImage",o).attr("href",u);else $("#aTemplateUrl",o).attr("href",u),$("#aTemplateBusinessImage",o).attr("href",u);infobox.setContent(o.html())}else infobox.setContent(a),setTimeout(function(){$(".map-tooltip .daily-deal-image-div").lazyload()},500);infobox.open(map,t),map.panTo(infobox.getPosition());var C=map.getZoom(),S=0;console.log(s+"---"+C),setTimeout(function(){0==s?5==C?S=5.395:6==C?S=2.695:7==C?S=1.395:8==C?S=.695:9==C?S=.345:10==C?S=.17:11==C?S=.085:12==C?S=.0425:13==C?S=.0215:14==C?S=.0115:15==C?S=.0055:16==C?S=.0028:17==C?S=.0014:18==C?S=7e-4:19==C?S=35e-5:20==C?S=17e-5:21==C?S=9e-5:22==C&&(S=5e-5):5==C?S=1.9925:6==C?S=.9925:7==C?S=.5125:8==C?S=.2525:9==C?S=.1325:10==C?S=.0625:11==C?S=.0325:12==C?S=.0155:13==C?S=.0085:14==C?S=.004:15==C?S=.002:16==C?S=.001:17==C?S=5e-4:18==C?S=25e-5:19==C?S=15e-5:20==C?S=1e-4:21==C?S=5e-5:22==C&&(S=2e-5),map.setCenter({lat:infobox.getPosition().lat()+S,lng:infobox.getPosition().lng()})},250),setTimeout(function(){$("#aTemplateBusinessImage").lazyload({event:"lazyload",effect:"fadeIn"}).trigger("lazyload")},100);try{$(infobox.div_).show()}catch(e){}}function showInfoWindowdailydeal(e,t){var i=$("#MapInfoTemplate");$("#infobox").html(i);var n=$("#deals_"+e).data(),o="",a="",s="",r="",l="",c="",d="",u="";null!=n&&"undefined"!=n?(o=n.businessimage,a=n.businessname,s=n.vagarourl,r=n.address,l=n.facility,c=n.distance,d=n.phone,u=n.detail):(o=$("#ddhdnBusinessImage_"+e).val(),a=$("#ddbusinessName_"+e).text(),s=$("#ddbusinessName_"+e).attr("href"),r=$("#ddaddress_"+e).text(),l=$("#ddfacilities_"+e).text(),c=$("#ddspnDistance_"+e).text(),d=$("#ddhdnPhone_"+e).val(),u=$("#ddbusinessImage_"+e).attr("href"));$("#btnbook24").attr("onclick");var p=$("#aPromotion_"+e).attr("style"),h=$("#aPromotion_"+e).attr("href"),m={};m.vagarourl=s.replace("/",""),0==$("#ulBusinessWorkingHours").children("#maploader").length&&$("#ulBusinessWorkingHours").appendTo("<div id='maploader' class='Loader Loader-center' style='height: 170px; position: relative;'><div class='loadImg'><span class='loaderimage'></span></div></div>");i=$("#MapInfoTemplate"),$("#aTemplateBusinessImage",i).css("background-image","url('"+o+"')");$("#templateMapIcon",i).hide(),null!=c&&""!=c&&$("#templateMapIcon",i).show(),$(".caption-map",i).text(truncateText(a,0,50,!0)),$("#templateAddress",i).text(truncateText(r+"-"+l,0,50,!0)),$("#templateDistance",i).text(c),$("#templateTelephone",i).text(d),$("#templateBook",i).attr("onclick","javascript:_featured.RedirectToBook24("+JSON.stringify(m)+",event);"),$("#templateDetails",i).attr("href",u),$("#aTemplateBusinessImage",i).attr("href",u),$("#aTemplatePromotion",i).attr("style",p),$("#aTemplatePromotion",i).attr("onclick",h),infobox.setContent(i.html()),infobox.open(map,t)}function showMarkers(){setAllMap(map)}function clearMarkers(){setAllMap(null)}function setAllMap(e){for(var t=0;t<removeMarkers.length;t++)removeMarkers[t].map=e}function callBackLoginToHome(e){if(RedirectToCalendar="no",0==e)_common.reloadstyle=!0;else{if(void 0!==_shopdetail.setLoginControl&&(_shopdetail.setLoginControl(),_shopdetail.setBookTextOnLoginlogout(!0)),($("#photos").hasClass("active")||$("#styles").is(":visible")||void 0!==_common.isFromLikeStyle&&!0===_common.isFromLikeStyle)&&(_common.reloadstyle?(_featured.GetUserLike(),setMylikesGalleryFilterValue(1,"aMyLikesOption_filter_1",0,1)):0==_common.reloadstyle&&(_featured.SetGalleryData(),setMylikesGalleryFilterValue(0,"aMyLikesOption_filter_0",0,1))),"detail"===BasePage.toLowerCase()){null!=_shopdetail.bookmarkonlogin&&1==_shopdetail.bookmarkonlogin?(_shopdetail.addToFavorite(),_shopdetail.bookmarkonlogin=!1):"undefined"!=typeof _shopdetail&&null!=typeof _shopdetail&&null!=typeof _shopdetail&&_shopdetail.showFavorites(),"BookAppointment"!=sFromPage&&_shopdetail.CheckCustomerExists();try{_onlineCheckout.GetCartItemCount()}catch(e){}}document.body.scrollTop=document.documentElement.scrollTop=0}}function CalendarLinkClick(e,t){ShowLoader(!0),t.ctrlKey&&"a"==t.target.tagName.toLowerCase()?(ShowLoader(!1),e.target="_blank",e.href="/ShopOwner/ChooseBusiness.aspx",e.target=""):location.href="../../../ShopOwner/ChooseBusiness.aspx"}function readCookie(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return null}function showMoreContent(e,t){var i=$("#btnMoreContent_"+e),n=$("#pMoreContent_"+e);if(i.hasClass("active"))n.animate({height:"41px"},200),i.removeClass("active"),i.html("More");else{n.css("height","auto");var o=n.height();n.height("41px").animate({height:o+"px"},200,function(){n.css("height","auto")}),i.addClass("active").html("Less")}t.stopPropagation(),t.preventDefault()}function showMoreclmsg(e,t){var i=$(e),n=i.parent().find(".class-msg-ul"),o=$($(n).selector)[0].scrollHeight;i.hasClass("active")?($($(n).selector).animate({height:"80px"},200),i.removeClass("active"),i.html("More")):($($(n).selector).animate({height:o+20+"px"},200),i.addClass("active"),i.html("Less")),t.stopPropagation(),t.preventDefault()}function onServicesAfterLoad(e){if($("#spnTotalRecords").show(),_common.FeaturedBusinessTooltip(),null==e){var t=[];$(".listings-business-parent-div").each(function(){var e=$(this).find("#aServiceFromTime").attr("onclick");$(this).attr("onclick",e);var i=$(this).data(),n={};n.BusinessID=i.businessid,n.BusinessName=i.businessname,n.LATITUDE=i.latitude,n.LONGITUDE=i.longitude,t.push(n)}),google.maps.event.trigger(map,"resize"),loadMarkers(t,"book")}else e.length>0?($(".divSorting").show(),$("#spnTotalRecords").html(e[0].TotalPage).attr("aria-label",e[0].TotalPage),$("#spnTotalRecords").attr("tabindex",0),$("#map_canvas:visible").length>0&&(google.maps.event.trigger(map,"resize"),loadMarkers(e,"book")),_ServiceData.VagaroServiceIDs=e[0].ElasticService,_ServiceData.IsShowEventType=e[0].IsShowEventType,_ServiceData.sPagingDetails=e[0].sPagingDetails,_featured.ServicesPager.options.Data.objServiceOptionsData=_ServiceData):($("#spnTotalRecords").html("No").attr("aria-label","No"),$(".divSorting").hide()),IsOnlyClassFoundInServiceSearch();""==_ServiceData.ignoreBusinessIds&&setTimeout(function(){var e="";1==$("#ulFeatureBusiness").is(":visible")&&$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").slice(0,6).each(function(){var t=$(this);void 0!==t.data("ispromotion")&&"true"==t.data("ispromotion").toString().toLowerCase()&&void 0!==$(this).data("businessid")&&(e+=$(this).data("businessid")+",")}),e=e.replace(/(^[,\s]+)|([,\s]+$)/g,""),_ServiceData.ignoreBusinessIds=e,_featured.ServicesPager.options.Data.objServiceOptionsData=_ServiceData},500),poldservice=service}function onClassesAfterLoad(e){if($("#spnTotalRecords").show(),_common.FeaturedBusinessTooltip(),null==e){var t=[];$(".listings-business-parent-div").each(function(){var e=$(this).find("#aServiceFromTime").attr("onclick");$(this).attr("onclick",e);var i=$(this).data(),n={};n.BusinessID=i.businessid,n.BusinessName=i.businessname,n.LATITUDE=i.latitude,n.LONGITUDE=i.longitude,t.push(n)}),google.maps.event.trigger(map,"resize"),loadMarkers(t,"class")}else e.length>0?($(".divSorting").show(),$("#spnTotalRecords").html(e[0].TotalPage).attr("aria-label",e[0].TotalPage).attr("tabindex",0),$("#map_canvas:visible").length>0&&(google.maps.event.trigger(map,"resize"),loadMarkers(e,"class")),_ClassData.sPagingDetails=e[0].sPagingDetails,_ClassData.VagaroServiceIDs=e[0].ElasticService,_ClassData.IsShowEventType=e[0].IsShowEventType,_featured.ClassPager.options.Data.objClassOptionsData=_ClassData):($("#spnTotalRecords").html("No").attr("aria-label","No"),$(".divSorting").hide());""==_ClassData.ignoreBusinessIds&&setTimeout(function(){var e="";1==$("#ulFeatureBusiness").is(":visible")&&$("#ulFeatureBusiness:visible").find("section.listings-business-parent-div").slice(0,6).each(function(){var t=$(this);void 0!==t.data("ispromotion")&&"true"==t.data("ispromotion").toString().toLowerCase()&&void 0!==$(this).data("businessid")&&(e+=$(this).data("businessid")+",")}),e=e.replace(/(^[,\s]+)|([,\s]+$)/g,""),_ClassData.ignoreBusinessIds=e,_featured.ClassPager.options.Data.objClassOptionsData=_ClassData},500),poldservice=service}$(document).ready(function(){$("button.gm-control-active.gm-fullscreen-control.secondary-button").click(function(){$(this).toggleClass("ZoomInMap")}),-1!==window.location.pathname.indexOf("//")&&($url=$("<a/>"),$url.attr("href",window.location.href.replace(/([^:]\/)\/+/g,"$1")),$url[0].click())});var countryLats,countryLons,countryZooms,servicesBusinessArr=new Array,totals=100,servicesMarkersArr=new Array;function initializeGoogleforServices(){1==countryid?(countryLats=38.1345,countryLons=-97.3828,countryZooms=4):2==countryid?(countryLats=52.5629,countryLons=-1.8017,countryZooms=5):3==countryid?(countryLats=54.9776,countryLons=-102.3046,countryZooms=3):4==countryid?(countryLats=-26.11598,countryLons=133.7695,countryZooms=4):(null!=countryid&&null!=countryid||(countryLats=38.1345),countryLons=-97.3828,countryZooms=4);var e={mapTypeId:"roadmap",center:new google.maps.LatLng(countryLats,countryLons),zoom:countryZooms},t=document.getElementById("serviceMap_canvas");"undefined"!=typeof GoogleMapId&&GoogleMapId&&(e.mapId=GoogleMapId),mapServices=new google.maps.Map(t,e)}function loadGoogleMapsforServices(){DeleteMarkersforServices();var e=new google.maps.LatLngBounds;mapServices.setTilt(45),servicesBusinessArr=new Array,servicesMarkersArr=new Array;var t;for($("#ServiceContainer").find(".service-listing").each(function(e){if(e<totals){var t=$(this);servicesBusinessArr=$("#hdnServicesDetails",t).val().split("|"),servicesMarkersArr.push([servicesBusinessArr[0],servicesBusinessArr[1],servicesBusinessArr[2]])}}),t=0;t<servicesMarkersArr.length;t++){var i=new google.maps.LatLng(servicesMarkersArr[t][1],servicesMarkersArr[t][2]);e.extend(i);var n=document.createElement("img");n.src="https://vagaro.azureedge.net/static-content/Images/map-pin.png",n.className="gmp-marker-drop",(servicesMarker=new google.maps.marker.AdvancedMarkerElement({position:i,map:mapServices,content:n,gmpClickable:!0})).addListener("click",function(e,t){return function(){$(".service-listing").removeClass("selected-service-map");var e=$("#divBusiness_"+servicesMarkersArr[t][0]);$("#dvServices");e.addClass("selected-service-map"),$("html, body").animate({scrollTop:$("#divBusiness_"+servicesMarkersArr[t][0]).offset().top-60})}}(0,t))}try{mapServices.setCenter(e.getCenter(),mapServices.fitBounds(e))}catch(e){}}function DeleteMarkersforServices(){"undefined"!=typeof google&&servicesMarkersArr.length>0&&(clearMarkers(),servicesMarkersArr=[],servicesBusinessArr=[])}function HidePromotionDetailPopup(){$("#divModalPromotionDetail").modal("hide")}function HidePromotionDetailSlidePopup(){$("#divPromotionsModal").modal("hide")}function PrintPromotion(e){window.open("/Users/PrintPromotion.aspx?BID="+e+"&OnlyApproved=true","","top=0,width=700,height=700,toolbar=0,scrollbars=0,status=0,resizable=1")}function SETAppVar(){isWindowsApp=!0,$("html").addClass("windowsAppHTML"),$("body").addClass("windowsApp")}function dragOnSlider(e,t,i,n){e.offsetX<0?_common.nextPrevious(t,1,i,n):e.offsetX>0&&_common.nextPrevious(t,0,i,n)}$(document).on("click",".promo-top-border .dropdowndiv",function(){"Home"!=BasePage&&"MyAccount"!=BasePage&&"Detail"!=BasePage||null==navigator.userAgent||!navigator.userAgent.match(/iPad/i)||$("html,body").scrollTop(0)});var isSetBanner=!1;function setWebBanner(){var e=window.sessionStorage.getItem("flagClosed");isSetBanner||"1"==e||($().smartWebBanner({title:"Vagaro",titleSwap:!1,url:"",author:"Vagaro LLC",speedIn:300,speedOut:800,useIcon:!0,iconOverwrite:"https://vagaro.azureedge.net/static-content/Images/vg-app-new@2x.png",iconGloss:!0,showFree:!1,daysHidden:0,daysReminder:30,popupDuration:4e3,popupSpeedIn:400,popupSpeedOut:1200,theme:"light",autoApp:!0,debug:!0,button:"View"}),window.sessionStorage.setItem("flagClosed","0")),isSetBanner=!0}function SetOverlayTop(){IsSmartBannerVisible}function setkeepAlive(){!function(e){var t=document.createElement("iframe");t.style.display="none",t.onload=function(){t.parentNode.removeChild(t)};try{t.src=e+"/keepalive.aspx?id="+(Math.random()+1).toString(36).substring(2)}catch(i){t.src=e+"/keepalive.aspx?id=w5a2g"}document.body.appendChild(t)}(location.protocol+"//"+location.hostname+(location.port?":"+location.port:""))}function redoSearch(){$(".redo-search-btn").hide();var e={coords:{latitude:map.getCenter().lat(),longitude:map.getCenter().lng()}};isRedomap=!0,setCurrentLocationFromDatabase(e,$("#txtLocationSearch"),null,null,null,"loaddatabypage",tabSegment)}function showHideRateDialog(e){switch(e){case 1:$("#divRateDialog1").hide(),$("#divRateDialog3").show();break;case 2:$("#divRateDialog1").hide(),$("#divRateDialog2").show();break;case 3:CallbackforMobileApp(0,0,"","",0,"22|~|4"),$("#divRateDialog2").hide(),$("#divRateDialog1").show(),$("#divRateDialog").hide();break;case 4:CallbackforMobileApp(0,0,"","",0,"22|~|2"),$("#divRateDialog2").hide(),$("#divRateDialog1").show(),$("#divRateDialog").hide();break;case 5:CallbackforMobileApp(0,0,"","",0,"22|~|4"),$("#divRateDialog3").hide(),$("#divRateDialog1").show(),$("#divRateDialog").hide();break;case 6:CallbackforMobileApp(0,0,"","",0,"22|~|3"),$("#divRateDialog3").hide(),$("#divRateDialog1").show(),$("#divRateDialog").hide()}}function showMobileSearchControl(){if("undefined"!=typeof tabSegment&&""!=tabSegment&&"home"!=tabSegment.toLowerCase()&&"/"!=tabSegment&&($("#pageSection").removeAttr("class"),$("#dvHome").show(),0==$("#mobile-check").is(":visible"))){$("#dvAdvanceFilter").attr("style","display:none"),$("#pageSection").attr("style","display:none");history.replaceState({basepage:"Home",sectionName:"/"},"home","/"),$("#mobileBack").hide(),$("#custmobileBack").hide()}$("#search-bar-wrapper-all").show(),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&$("#sortingDropDown").hide(),setTimeout(function(){$("#dvBusinessLocationSearch").find(".select2-input").click()},100),$("html,body").addClass("mob-overflow-hidden"),$("#btnBackHomeSearch").data("iscustomerappsearch","1"),$("html, body").removeClass("searchaddservclass"),$("#dvSearchServiceMain").removeClass("book-service-open-common"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,24)}if($(document).ready(function(){$("#txtServiceProviderPublicpage ,#txtServiceProviderPublicpageMobile").keypress(function(e){if(13==e.keyCode)return _featured.ProfessionalsPager.init(),_featured.ProfessionalsPager.load(),document.activeElement.blur(),!1})}),iosDevices&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType){var $body=jQuery("body"),selectFocus_cnt=1;$(document).on("focus",".inputfixscrollselect  .select2-input",function(){2==selectFocus_cnt||$("#select2-drop").is(":visible")?selectFocus_cnt=1:($body.addClass("changefixposition"),setTimeout(function(){$(".inputfixscrollselect").siblings("#btnCancelGC").find("a").focus(),setTimeout(function(){selectFocus_cnt=2,$(".inputfixscrollselect .select2-input").focus()},300)},300))}).on("blur",".inputfixscrollselect .select2-input",function(){$body.removeClass("changefixposition")}),$(document).on("focus",".inputfixscroll",function(){$body.addClass("changefixposition")}).on("blur",".inputfixscroll",function(){$body.removeClass("changefixposition")})}function bappIsUndefine(e){return void 0===e||null==e||""===e||null==e}function AddUserControlAsync(e,t,i,n,o){var a=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";"undefined"!=typeof regionId&&""!=regionId&&(a=a+regionId+"/"),e=a+"WebServices/"+e,$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:e,async:!1,data:t,dataType:"json",success:function(e){i.append(e.d),null!=n&&"function"==typeof n&&n(e)},error:function(e){alert("error occured."),null!=o&&"function"==typeof o&&o(e)}})}function get_browser(){var e,t=navigator.userAgent,i=t.match(/(opera|chrome|safari|firefox|msie|trident|edge(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(i[1]))return{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""};if("Chrome"===i[1]){if(null!=(e=t.match(/\bOPR\/(\d+)/)))return{name:"Opera",version:e[1]};if(null!=(e=t.match(/\bEdge\/(\d+)/)))return{name:"Edge",version:e[1]}}return i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&i.splice(1,1,e[1]),{name:i[0],version:i[1]}}$("#fitness-option").click(function(){if(""!=AdminServiceList){$.each(AdminServiceList.results,function(e){delete AdminServiceList.results[e].serviceDisplayClass});var e=$.grep(AdminServiceList.results,function(e,t){return 0==e.EventType}),t=$.grep(AdminServiceList.results,function(e,t){return 2==e.EventType}),i=$.grep(AdminServiceList.results,function(e,t){return 1==e.EventType}),n={serviceDisplayClass:"hide-home-servicesclass"};$.each(i,function(e){$.extend(i[e],n)});var o=$.grep(AdminServiceList.results,function(e,t){return 1==e.IsCustom}),a={serviceDisplayClass:"hide-home-servicesclass hide-customserviceclass"};$.each(o,function(e){$.extend(o[e],a)}),$.merge(e,t),$.merge(e,i),AdminServiceList.results=e;var s=$("#txtSearchServiceMain").data("select2").containerId;$("#"+s).data("isclass",1),$("#popular-beauty-cat-row").hide(),$("#popular-fitness-cat-row").show(),$("#txtSearchServiceMain").select2("data",{}),$("#txtSearchServiceMain").data("choice","")}else $("#beauty-option").parent(".vg-default-tab-link .text-secondary:hover").addClass("active"),$("#fitness-option").parent(".vg-default-tab-link .text-secondary:hover").removeClass("active");$("#beauty-option").attr("aria-selected",!1),$("#fitness-option").attr("aria-selected",!0)}),$("#beauty-option").click(function(){if(""!=AdminServiceList){$.each(AdminServiceList.results,function(e){delete AdminServiceList.results[e].serviceDisplayClass});var e=$.grep(AdminServiceList.results,function(e,t){return 0==e.EventType}),t=$.grep(AdminServiceList.results,function(e,t){return 2==e.EventType}),i={serviceDisplayClass:"hide-home-servicesclass"};$.each(t,function(e){$.extend(t[e],i)});var n=$.grep(AdminServiceList.results,function(e,t){return 1==e.EventType}),o=$.grep(AdminServiceList.results,function(e,t){return 1==e.IsCustom}),a={serviceDisplayClass:"hide-home-servicesclass hide-customserviceclass"};$.each(o,function(e){$.extend(o[e],a)}),$.merge(e,n),$.merge(e,t),AdminServiceList.results=e,$("#popular-beauty-cat-row").show(),$("#popular-fitness-cat-row").hide();var s=$("#txtSearchServiceMain").data("select2").containerId;$("#"+s).data("isclass",0),$("#txtSearchServiceMain").select2("data",{}),$("#txtSearchServiceMain").data("choice","")}else $("#beauty-option").parent(".vg-default-tab-link  .text-secondary:hover").addClass("active"),$("#fitness-option").parent(".vg-default-tab-link  .text-secondary:hover").removeClass("active");$("#beauty-option").attr("aria-selected",!0),$("#fitness-option").attr("aria-selected",!1)});var _FirstSearchDate,_LastSearchDate,_MaxSearchDate,_MaxSearchActiveDate,timerIDHome,timerIDListing,UpComingLiveStreamFromType={Home:1,Listing:2},DayShortNames=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"),DayNames=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"),MonthNames=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),MonthNamesFull=["January","February","March","April","May","June","July","August","September","October","November","December"],isLoadDateResult=!0,_gblLiveStreamSearchServiceId=0,_gblLiveStreamSearchServiceName="",_gblCurrentTimeDiff="";function LoadLiveStreamPage(){var e={dropdownCssClass:"bookaservice-select service-what-dropdown",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Search Classes"};new ctlrSearchService($("#ddlLiveStreamClass"),e);clearInterval(timerIDHome),clearInterval(timerIDListing),bkLiveStreamEvent.init(),bkLiveStreamEvent.timeSlotsCache={},$(".stream-more").removeClass("selected"),$("#listview").html(""),$("#SearchHeaderBar").html(""),LoadUpcomingLiveStreamClasses(UpComingLiveStreamFromType.Listing)}function ElasticSearchLiveStream(){$("#listview").html(""),$("#SearchHeaderBar").html(""),bkLiveStreamEvent.timeSlotsCache={},selectClassCategory(null,!1),$(".stream-more").removeClass("selected"),String.isNullOrUndefineOrBlank(window.history)||String.isNullOrUndefineOrBlank(window.history.state)||String.isNullOrUndefineOrBlank(window.history.state.subTab)||_common.AddState(_common.liveStreamClasses),LoadUpcomingLiveStreamClasses(UpComingLiveStreamFromType.Listing)}function RefreshLiveStreamData(e){if(e==UpComingLiveStreamFromType.Home){if("undefined"==typeof tabSegment||"/"!=tabSegment&&"home"!=tabSegment.toLowerCase())clearInterval(timerIDHome),"undefined"!=typeof HomePageLiveStreamData&&null!=HomePageLiveStreamData&&(HomePageLiveStreamData=null);else if("undefined"!=typeof HomePageLiveStreamData&&null!=HomePageLiveStreamData&&HomePageLiveStreamData.length>0){var t=0;$.grep(HomePageLiveStreamData,function(e){if(e.EventDurationRemainMin=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!0),e.EventDurationRemain=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!1),1==e.IsDisplayDuration){var i="#tr"+e.AppointmentID;if($(i).length>0)if(e.EventDurationRemainMin<-5)t++,$(i).hide();else{var n=$(i+" .divAutoRefreshHome"),o='<div class="livebgbottombox">';if(n.removeClass("signup-btn"),1==e.IsEnrolled)e.EventDurationRemainMin>5?o+='<div class="signed-up-text web-subheading-font"><Span class="font-awesome-5pro-light" aria-hidden="true">&#xf058;</Span>You\'re Signed Up</div>':o+="<div class=\"joinnowbtn flamingo-button\" onclick=\"javascript:AddLogEventDataInFirebase({Category:'Live_Stream_Classes_Join_Now', Action : 'Join Now', PageName:'Home', BusinessID:'"+e.BusinessID+"', BusinessName:'"+escape(e.BusinessName)+"', ClassBy:'"+escape(e.ServiceProviderName)+"', ClassDuration : '"+e.Duration+"', ClassName: '"+escape(e.ServiceTitle)+"', ClassPrice:'"+e.EventPrice+"', ClassStartDateTime:'"+e.AppointmentStartTime+"' });  ClassSignupPublicButton(event,"+e.AppointmentID+","+e.BusinessID+');" role="button"><span>Join Now</span></div>';else{var a="Join Now",s="Join Now",r="Live_Stream_Classes_Join_Now",l="flamingo-button";e.EventDurationRemainMin>5&&(n.addClass("signup-btn"),a="Sign Up",s="Sign Up",r="Live Stream",l="secondary-button"),a+=' <div class="mobile-home-price">- '+e.EventPrice+"</div>",o+='<div class="joinnowbtn '+l+'" onclick="javascript:AddLogEventDataInFirebase({Category:\''+r+"', Action : '"+s+"', PageName:'Home', BusinessID:'"+e.BusinessID+"', BusinessName:'"+escape(e.BusinessName)+"', ClassBy:'"+escape(e.ServiceProviderName)+"', ClassDuration : '"+e.Duration+"', ClassName: '"+escape(e.ServiceTitle)+"', ClassPrice:'"+e.EventPrice+"', ClassStartDateTime:'"+e.AppointmentStartTime+"' }); ClassSignupPublicButton(event,"+e.AppointmentID+","+e.BusinessID+');" role="button" aria-label="'+s+" price is "+e.EventPrice+'"><span aria-hidden="true">'+a+'</span></div><div class="livestreambottomtext web-subheading-font " aria-hidden="true">'+e.EventPrice+"</div>"}o+="</div>",$(i+" #Service").length>0&&e.EventDurationRemainMin>0&&$(i+" #Service").attr("aria-label",e.DayName+" "+e.AvailableStartTime+" "+e.EventDuration.replace("hr","hour")+" "+e.ServiceTitle+" "+e.ServiceProviderName+" Starts in "+e.EventDurationRemain.replace("hr","hour")),e.EventDurationRemainMin>5?o+='<div class="class-start-time web-caption-text" role="link" aria-hidden="true" aria-label="Starts in '+e.EventDurationRemain.replace("hr","hour")+'">Starts in '+e.EventDurationRemain+"</div>":e.EventDurationRemainMin>0?o+='<div class="class-start-time web-caption-text-flamingo" role="link" aria-hidden="true" aria-label="Starts in '+e.EventDurationRemain.replace("hr","hour")+'">Starts in  '+e.EventDurationRemain+"</div>":o+='<div class="livebtnbg" aria-hidden="true"><div class="livebtn badge-button-alert"><span class="dot"></span><span>LIVE</span></div></div>',n.html(o)}}}),t==HomePageLiveStreamData.length&&($("#scLiveStreamClasses").hide(),clearInterval(timerIDHome))}}else if(window.location.href.indexOf(_common.liveStreamClasses)>-1){bkLiveStreamEvent.model.EventDate=_FirstSearchDate;var i=bkLiveStreamEvent.getResponseFromCache();null!=i&&$.grep(i,function(e){if(e.EventDurationRemainMin=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!0),e.EventDurationRemain=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!1),1==e.IsDisplayDuration){var t="#tr"+e.AppointmentID;if($(t).length>0)if(e.EventDurationRemainMin<-5)$(t).hide();else{var i="<span class='liveDuration-provide'>"+e.ServiceProviderName+'</span><span class="separate"></span>',n="Starts in  "+e.EventDurationRemain.replace("hr","hour").replace("min","minute");e.EventDurationRemainMin>5?i+="<span role='link' class=\"smallsizetext web-caption-text\" aria-label='"+n+"'>Starts in "+e.EventDurationRemain+"</span>":e.EventDurationRemainMin>0?i+="<span role='link' class=\"smallsizetext redtext web-caption-text-flamingo\" aria-label='"+n+"'>Starts in "+e.EventDurationRemain+"</span>":i+='<div class="livebtnbg"><div class="livebtn text-error"><span class="dot"/><span>LIVE</span></div></div>',0==e.IsEnrolled&&(i+='<span class="mobile-free-text">'+e.EventPrice+"</span>"),$(t+" .divDurationListview").html(i);var o="stremspotbg";e.EventDurationRemainMin>5&&(o+=" removemargin");var a="<div class='"+o+"'>";0==e.IsEnrolled&&(a+='<div><div class="livestreambottomtext web-subheading-font">'+e.EventPrice+"</div></div>"),a+='</div><div class="class-signup-col stream-btn">';var s="book-class-btn class-signup border-none";if(e.EventDurationRemainMin>5&&(s+=" signup-white-btn"),a+='<div class="'+s+'" data-delay="0">',a+="<div class=\"cls-signuptext secondary-button\" onclick=\"javascript:AddLogEventDataInFirebase({Category:'Live Stream',Action : 'Sign Up', PageName:'Home', BusinessID:"+e.BusinessID+", BusinessName:'"+escape(e.BusinessName)+"', ClassBy:'"+escape(e.ServiceProviderName)+"', ClassDuration : '"+e.Duration+"', ClassName: '"+escape(e.ServiceTitle)+"', ClassPrice:'"+e.EventPrice+"', ClassStartDateTime:'"+e.AppointmentStartTime+"' });ClassSignupPublicButton(event, "+e.AppointmentID+", "+e.BusinessID+');"  role="button">',1==e.IsEnrolled)e.EventDurationRemainMin>5?a+='<div class="signed-up-text "><span class="font-awesome-5pro-light">&#xf058;</span>You\'re Signed Up</div>':a+="<div>Join Now</div>";else{var r="Join Now";e.EventDurationRemainMin>5&&(r="Sign Up"),a+="<div>"+r+"</div>"}a+="</div></div></div>",1==e.IsEnrolled&&e.EventDurationRemainMin>5?($(t+" .divBtnListView").addClass("signupText"),a+='<div class="signed-up-text" onclick="javascript:ClassSignupPublicButton(event,'+e.AppointmentID+","+e.BusinessID+');"><span class="font-awesome-5pro-light">&#xf058;</span>You\'re Signed Up</div>'):$(t+" .divBtnListView").removeClass("signupText"),$(t+" .divBtnListView").html(a)}}})}else clearInterval(timerIDListing)}function LoadUpcomingLiveStreamClasses(e,t,i,n){if(isLoadDateResult=!1,void 0===t&&(t=1),void 0===n&&(n=!1),void 0===i&&(i=null),null!=i){var o=new Date(_MaxSearchDate);if(new Date(i)>o)return!1}var a=getBookmark(),s=GetTimeZoneIDFromCookies(),r={};if(e==UpComingLiveStreamFromType.Home)ShowLoaderLiveStream(!0),r.StartDate=null,r.IsCalledFrom=UpComingLiveStreamFromType.Home,r.pageSize=20;else{null==i&&($("#listview").html(""),$("#SearchHeaderBar").html(""),bkLiveStreamEvent.timeSlotsCache={},ShowLoaderLiveStreamListing(!0)),r.StartDate=i,r.IsCalledFrom=UpComingLiveStreamFromType.Listing,r.ServiceId=_gblLiveStreamSearchServiceId,$("#dvDurationText").removeClass("active"),$("input[name='liveStreamDuration']").siblings("label").attr("aria-checked",!1);var l=[];IsFromMobile()?$.each($("input[name='liveStreamDuration1']:checked"),function(){l.push($(this).val())}):($.each($("input[name='liveStreamDuration']:checked"),function(){l.push($(this).val())}),l.length>0?($("#dvDurationText").addClass("active"),1!=$("input[name='liveStreamDuration']:checked").val()&&2!=$("input[name='liveStreamDuration']:checked").val()&&3!=$("input[name='liveStreamDuration']:checked").val()&&4!=$("input[name='liveStreamDuration']:checked").val()||$("input[name='liveStreamDuration']:checked").siblings("label").attr("aria-checked",!0)):$("input[name='liveStreamDuration']").siblings("label").attr("aria-checked",!1)),r.Duration=l.join(", "),r.IsBookMarkSearch=a;var c=$("#ddlLiveStreamClass").val();String.isNullOrUndefineOrBlank(c)||(r.ClassName=c)}r.pageIndex=t,r.loginUserID=UserID,r.strLoginUserId=String.isNullOrUndefineOrBlank(UserID)?UserID:ReactUId,r.TimeOffSet=s,"Undefined"!=lBusinessPromoCodeID&&null!=lBusinessPromoCodeID&&""!=lBusinessPromoCodeID&&(r.sPromotionCodeID=lBusinessPromoCodeID);var d=new vagaro.ajax;d.datamodel.Token=ApiURLEnumOnlineCommon.getupcominglivestreamclasses,d.datamodel.IsNewVagaroAPI=!0,d.datamodel.data=r,d.datamodel.callback=function(t){var o=(new Date).toString();if(null!=t&&null!=t.SliderStartDate&&(o=new Date(t.StrSliderStartDate),_gblCurrentTimeDiff=new Date(t.StrSliderStartDate)-new Date),e==UpComingLiveStreamFromType.Home){var a=!0;if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&void 0!==iosDevices&&iosDevices&&(a=!1),a&&null!=t&&null!=t.ObjLiveStreamResponse&&t.ObjLiveStreamResponse.length>0){var r=t.ObjLiveStreamResponse,l=t.ObjBookMarkedBusinessList;$("#scLiveStreamClasses").show(),r=$.grep(r,function(e){e.DayName=DayShortNames[e.DayNo],e.AvailableStartTime=e.AvailableStartTime.replace(/^0+/,"");var t=e.StreamingEventCapacity-e.StreamingNoOfAttendees;return e.RemainCapacity=t.toString()+(t>1?" Spots Left":" Spot Left"),e.ServiceProviderName=e.FirstName+" "+e.LastName,e.EventPrice=BindEventPrice(e.CountryID,e.SellPrice),e.EventDurationRemainMin=getDateDiff(o,e.AppointmentStartTime,!0),e.EventDurationRemain=getDateDiff(o,e.AppointmentStartTime,!1),e.IsEnrolled=getEnrolled(e.AttendeeList),e.SpName=FindInitials(e.FirstName+" "+e.LastName,""),e.IsBookMark=getBookmarkBusiness(e.BusinessID,l),e.IsDisplayDuration=CheckCurrentDateWithSliderDate(o,e.AppointmentStartTime),!(t<=0&&0==e.IsEnrolled||e.EventDurationRemainMin<-5)}),$("#dvLiveStream").html(""),$("#dvLiveStream").append($("#LiveStreamHomeTemplate").tmpl(r)),homeLivestreamSlider_mobile(),$(".lazy-spimg-home").lazyload({effect:"fadeIn",failure_limit:5e4,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".initialspphoto"}).trigger("lazyload"),HomePageLiveStreamData=r,timerIDHome=setInterval(function(){RefreshLiveStreamData(UpComingLiveStreamFromType.Home)},3e4)}else $("#scLiveStreamClasses").hide()}else{if(null==i&&null!=t&&null!=t.SliderStartDate){$("#listview").html("");for(var c=[],d=new Date(t.StrSliderStartDate),u=GetCityStateValueFromLiveStream(),p=0;p<28;p++){var h={};h.dateID="date"+p,h.sDate=MonthNames[d.getMonth()]+""+d.getDate()+d.getFullYear(),h.sDateSearch=d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate(),h.selected="",h.SearchDate=d.getDate(),h.sDay=DayShortNames[d.getDay()].toUpperCase(),h.EventDateHeader=countryDateFormat(h.sDateSearch,VagaroCountryDateFormat.LongMiniDate),h.sDateID="dv"+h.sDate,h.TimeZoneOfCityState=u,h.eventDetailView=[],c.push(h),d.setDate(d.getDate()+1),_MaxSearchDate=h.sDateSearch,0==p&&(_FirstSearchDate=h.sDateSearch,$("#SearchHeaderBar").html(h.EventDateHeader))}$("#aTimeZoneBasedOn").html(u).attr("aria-label","Time Based On "+u),$("#EventTemplateListviewHeader").tmpl(c).appendTo("#listview"),$animation_elements=$(".scrollLiveStream"),$("#dvLiveStreamSearchDate").html(""),$("#LiveStreamSearchDateTemplate").tmpl(c).appendTo("#dvLiveStreamSearchDate"),$(".listing-slider").unslick(),$(".listing-slider").slick({infinite:!1,speed:600,slidesToShow:7,slidesToScroll:7,onAfterChange:function(e,t){"Next"!=e.CurrentSlideDirection&&"Prev"!=e.CurrentSlideDirection||ChangeDateForLiveStream(e,t)},responsive:[{breakpoint:768,settings:{arrows:!1}}]})}if(null!=t&&null!=t.ObjLiveStreamResponse&&t.ObjLiveStreamResponse.length>0){var m=t.ObjLiveStreamResponse;l=t.ObjBookMarkedBusinessList;if(null!=(m=$.grep(m,function(e){var t=new Date(e.AppointmentStartTime);e.DayName=DayShortNames[e.DayNo],e.AvailableStartTime=e.AvailableStartTime.replace(/^0+/,"");var i=e.StreamingEventCapacity-e.StreamingNoOfAttendees;return e.RemainCapacity=i.toString()+(i>1?" Spots Left":" Spot Left"),e.ServiceProviderName=e.FirstName+" "+e.LastName,e.EventPrice=BindEventPrice(e.CountryID,e.SellPrice),e.EventDate=MonthNames[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear(),e.EventDateHeader=countryDateFormat(e.AppointmentStartTime,VagaroCountryDateFormat.LongMiniDate),e.IsBookMark=getBookmarkBusiness(e.BusinessID,l),e.EventDurationRemainMin=getDateDiff(o,e.AppointmentStartTime,!0),e.EventDurationRemain=getDateDiff(o,e.AppointmentStartTime,!1),e.EventDateBkp=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate(),e.IsEnrolled=getEnrolled(e.AttendeeList),e.SpName=FindInitials(e.FirstName+" "+e.LastName,""),e.TimeZone=s,e.IsDisplayDuration=CheckCurrentDateWithSliderDate(o,e.AppointmentStartTime),!(i<=0&&0==e.IsEnrolled||e.EventDurationRemainMin<-5)}))&&m.length>0){if(_LastSearchDate=m[0].EventDateBkp,bkLiveStreamEvent.model.EventDate=m[0].EventDateBkp,bkLiveStreamEvent.addResponseToCache(m),BindLiveStreamData(m,n),null!=t.SliderStartDate){ShowLoaderLiveStreamListing(!1),isLoadDateResult=!1;var g=new Date(_LastSearchDate);g.setDate(g.getDate()+1),BindLiveStreamDateSearch(g.getFullYear()+"/"+(g.getMonth()+1)+"/"+g.getDate(),null,!0,!0)}var v=new Date(_LastSearchDate);new Date(_LastSearchDate);void 0!==_MaxSearchActiveDate&&null!=_MaxSearchActiveDate?v>new Date(_MaxSearchActiveDate)&&(_MaxSearchActiveDate=_LastSearchDate):_MaxSearchActiveDate=_LastSearchDate,null==i&&(clearInterval(timerIDListing),timerIDListing=setInterval(function(){RefreshLiveStreamData(UpComingLiveStreamFromType.Listing)},3e4))}else null==i?(ShowLoaderLiveStreamListing(!1),BindNoRecordAndCallNextDate(_FirstSearchDate)):BindNoRecordAndCallNextDate(i)}else isLoadDateResult=!0,null==i?(ShowLoaderLiveStreamListing(!1),BindNoRecordAndCallNextDate(_FirstSearchDate)):BindNoRecordAndCallNextDate(i);0==isLiveStreamResize&&setTimeout(function(){setCategoryWidthheight(),isLiveStreamResize=!0},1500)}ShowLoader(!1)},d.datamodel.Error=function(t){ShowLoaderLiveStream(!1),UpComingLiveStreamFromType.Listing==e&&(ShowLoaderLiveStreamListing(!1),isLoadDateResult=!0)},d.Post()}function getiOSCustomerAppVersion(){var e=null!=navigator.userAgent.toLowerCase()?navigator.userAgent.toLowerCase():"",t="";return String.isNullOrUndefineOrBlank(e)||(t=e.split("(vagaroapp")[1].trim().split(")")[0]),t}function BindEventPrice(e,t){var i=parseFloat(t).toFixed(2);return 0==i?"Free":("2"==e?"£":"$")+i}var _NoRecordCount=0;function BindNoRecordAndCallNextDate(e){var t="#"+$("#listview").find("[data-searchdate='"+e+"']")[0].id;$(t).html(""),$(t).addClass("data-bind").addClass("data-bind-no-record"),$("#divNoRecordLiveStreamListing").clone().appendTo(t),0==_NoRecordCount&&getSelectedSlider(t.replace("#dv",""));var i=new Date(e),n=countryDateFormat(i,VagaroCountryDateFormat.LongMiniDate);$(t+" .class-date-time").html(n),i.setDate(i.getDate()+1),BindLiveStreamDateSearch(i.getFullYear()+"/"+(i.getMonth()+1)+"/"+i.getDate(),null,!0,!0),_NoRecordCount++}function BindStreamClassCategoryDropdown(){if(""!=AdminServiceList){var e=$.grep(AdminServiceList.results,function(e,t){return 2==e.EventType})[0].children;ClassListMore=[],$.grep(e,function(e){if("Yoga"==e.text&&$(".LiveStreamCrossfit").length>0)$(".LiveStreamYoga")[0].id=e.id;else if("Pilates"==e.text&&$(".LiveStreamCrossfit").length>0)$(".LiveStreamPilates")[0].id=e.id;else if("cycle/spinning"==e.text.toLowerCase().replace(/ /g,"")&&$(".LiveStreamCycle").length>0)$(".LiveStreamCycle")[0].id=e.id;else if("Crossfit"==e.text&&$(".LiveStreamCrossfit").length>0)$(".LiveStreamCrossfit")[0].id=e.id;else if("strengthtraining"==e.text.toLowerCase().replace(/ /g,"")&&$(".LiveStreamStrength").length>0)$(".LiveStreamStrength")[0].id=e.id;else if("Boxing"==e.text&&$(".LiveStreamBoxing").length>0)$(".LiveStreamBoxing")[0].id=e.id;else{var t={};t.ServiceId=e.id,t.CategoryName=e.text,ClassListMore.push(t)}}),$("#LiveStreamClassList").html(""),$("#LiveStreamClassListMobile").html(""),$("#StreamClassCategoryDropdownTemplate").tmpl(ClassListMore).appendTo("#LiveStreamClassList"),$("#StreamClassCategoryDropdownTemplate").tmpl(ClassListMore).appendTo("#LiveStreamClassListMobile")}}function SearviceFilter(e,t){var i=$("#ddlLiveStreamClass");i.select2("data",{id:"",text:""}),void 0!==i.data("choice")&&_common.SetDefaultForSeleect2(i),$(e).hasClass("fliter-class-name")?$(e).hasClass("selected")?($(e).removeClass("selected"),_gblLiveStreamSearchServiceId=RemoveCommaSeparatedValue(_gblLiveStreamSearchServiceId,$(e).data("livestreamid"),","),_gblLiveStreamSearchServiceName=RemoveCommaSeparatedValue(_gblLiveStreamSearchServiceName,$(e).data("livestream"),",")):selectClassCategory(e,!1):$(e).parent().hasClass("active")?($(e).parent().removeClass("active"),$("#"+e.id.replace("li","")).removeClass("selected"),_gblLiveStreamSearchServiceId=RemoveCommaSeparatedValue(_gblLiveStreamSearchServiceId,$(e).data("livestreamid"),","),_gblLiveStreamSearchServiceName=RemoveCommaSeparatedValue(_gblLiveStreamSearchServiceName,$(e).data("livestream"),",")):selectClassCategory(e,!0),$(".stream-more").removeClass("selected"),1==$("#LiveStreamClassList").find("li").hasClass("active")&&$(".stream-more").addClass("selected"),_common.AddState(_common.liveStreamClasses),CallSearchWithFilter();var n=window.location.pathname;n.indexOf("live-stream-classes")>0?($("#btnLiveStream").attr("href",n),$("#btnLiveStreamMobile").attr("href",n)):($("#btnLiveStream").attr("href","/live-stream-classes"),$("#btnLiveStreamMobile").attr("href","/live-stream-classes"))}function RemoveCommaSeparatedValue(e,t,i){i=i||",";var n,o=(e=e.toString()).split(i);for(t=""+t;(n=o.indexOf(t))>=0;)o.splice(n,1);return o.join(i)}function getBookmarkBusiness(e,t){var i=!1;return null!=t&&t.indexOf(e)>-1&&(i=!0),i}function BindLiveStreamData(e,t){if(null!=e&&e.length>0){var i=e.uniqueObjects(["EventDate"]),n=[],o=0;$.grep(i,function(i){o+=1;var a={};a.RowNo=o,a.DayName=DayShortNames[i.DayNo],a.EventDate=i.EventDate,a.EventDateHeader=i.EventDateHeader,a.EventDateBkp=i.EventDateBkp,a.TimeZone=i.TimeZone,a.TimeZoneOfCityState=GetCityStateValueFromLiveStream();var s=e.filter(function(e){return a.EventDate==e.EventDate?e:null});a.eventDetailView=[],null!=s&&s.length>0&&$.grep(s,function(e){var t={};t.IsBookMark=e.IsBookMark,t.ServiceTitle=e.ServiceTitle,t.AvailableStartTime=e.AvailableStartTime,t.EventDuration=e.EventDuration,t.Photo=e.Photo,t.ServiceProviderName=e.ServiceProviderName,t.EventPrice=e.EventPrice,t.DayName=e.DayName,t.RemainCapacity=e.RemainCapacity,t.SpName=e.SpName,t.EventDurationRemainMin=e.EventDurationRemainMin,t.EventDurationRemain=e.EventDurationRemain,t.AppointmentID=e.AppointmentID,t.BusinessID=e.BusinessID,t.AppointmentStartTime=e.AppointmentStartTime,t.CountryID=e.CountryID,t.IsEnrolled=e.IsEnrolled,t.IsDisplayDuration=e.IsDisplayDuration,a.eventDetailView.push(t)}),a.eventDetailView.length>0&&n.push(a);var r=a.EventDate.replace(",","").replace(/ /g,""),l="#dv"+r;if($(l).html(""),$("#EventTemplateListviewHeader").tmpl(a).appendTo(l),$(l).show(),1!=t){if(getSelectedSlider(r),_FirstSearchDate!=_LastSearchDate){var c=0;if(IsFromMobile()&&(c=$("#divFixedSearchDate").outerHeight()+$("#divLiveStreamClassSearch").outerHeight()+$("#SearchHeaderBar").height()+49),/iPad/.test(navigator.userAgent)){var d=parseInt($(l).offset().top)-parseInt($(".streamclasslistingWrapper").offset().top)+c;window.scrollTo({top:d,behavior:"smooth"})}else $("html, body").animate({scrollTop:parseInt($(l).offset().top)-parseInt($(".streamclasslistingWrapper").offset().top)+c},800)}else if(/iPad/.test(navigator.userAgent)){d=parseInt($(l).offset().top)-parseInt($(".streamclasslistingWrapper").offset().top)+c;window.scrollTo({top:d,behavior:"smooth"})}else $("html, body").animate({scrollTop:0},800);var u=new Date(a.EventDate),p=(DayNames[u.getDay()],MonthNamesFull[u.getMonth()],u.getDate(),countryDateFormat(a.EventDate,VagaroCountryDateFormat.LongMiniDate));$("#SearchHeaderBar").html(p)}$(l).addClass("data-bind"),$(l).removeClass("data-bind-no-record"),_NoRecordCount=0,setTimeout(function(){isLoadDateResult=!0,CheckEmptyDivInView()},1e3),$(".lazy-spimg-listing-loader").removeClass("lazy-spimg-listing-loader"),$(l+" .lazy-spimg-listing").addClass("lazy-spimg-listing-loader"),$(".lazy-spimg-listing-loader").lazyload({effect:"fadeIn",failure_limit:5e4,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".initialspphotolist"}).trigger("lazyload")})}}function IsFromMobile(){return 1==$("#mobile-check").is(":visible")}function BindLiveStreamDateSearch(e,t,i,n){if(null!=t){isLoadDateResult=!1;try{$(".listing-slider div").removeClass("selected"),$(t.parentNode).addClass("selected"),$(t.parentNode).focus()}catch(e){console.log(e)}}if(null!=e){_LastSearchDate=e,bkLiveStreamEvent.model.EventDate=e;var o=bkLiveStreamEvent.getResponseFromCache();if(null!=o&&null!=(o=$.grep(o,function(e){try{e.EventDurationRemainMin=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!0),e.EventDurationRemain=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!1)}catch(t){e.EventDurationRemainMin=e.EventDurationRemainMin}return e.IsEnrolled=getEnrolled(e.AttendeeList),!(e.EventDurationRemainMin<-5)}))&&o.length>0)return void BindLiveStreamData(o,i);var a="#"+$("#listview").find("[data-searchdate='"+e+"']")[0].id;if(1==n&&!DivInView(a))return;var s=new Date(e),r=DayShortNames[s.getDay()]+", "+MonthNamesFull[s.getMonth()]+" "+s.getDate();if(0==$(a).hasClass("data-bind-no-record")&&($(a).html(""),$("#divLoaderLiveStreamListingInner").clone().appendTo(a),$(a+" .class-date-time").html(r)),1!=i){if(_FirstSearchDate!=_LastSearchDate){var l=0;IsFromMobile()&&(l=$("#divFixedSearchDate").outerHeight()+$("#divLiveStreamClassSearch").outerHeight()+$("#SearchHeaderBar").height()+49),$("html, body").animate({scrollTop:parseInt($(a).offset().top)-parseInt($(".streamclasslistingWrapper").offset().top)+l},800)}else $("html, body").animate({scrollTop:0},800);var c=countryDateFormat(e,VagaroCountryDateFormat.LongMiniDate);$("#SearchHeaderBar").html(c)}if(1==$(a).hasClass("data-bind")&&1==$(a).hasClass("data-bind-no-record"))return void setTimeout(function(){isLoadDateResult=!0,CheckEmptyDivInView()},1e3)}LoadUpcomingLiveStreamClasses(UpComingLiveStreamFromType.Listing,1,e,i)}function getEnrolled(e){return UserID>0&&""!=e&&(arrAttendeeList=e.split(","),arrAttendeeList.indexOf(UserID)>-1)}function getDateDiff(e,t,i){var n=new Date(t)-new Date(e),o=Math.floor(n/6e4),a=Math.floor(o/60),s=Math.floor(a/24);if(i)return o;var r="";return s>0&&(r=s+(s>1?" days ":" day ")),(a%=24)>0&&(r+=a+" hr "),(o%=60)>0&&(r+=o+" min"),r}function CheckCurrentDateWithSliderDate(e,t){try{return moment(new Date(e)).format("MM-DD-YYYY")==moment(new Date(t)).format("MM-DD-YYYY")}catch(e){return!1}}function ShowLoaderLiveStream(e){e?($("#dvLiveStream").html(""),$("#divLoaderLiveStream").clone().appendTo("#dvLiveStream")):$("#dvLiveStream").html("")}function ShowLoaderLiveStreamListing(e){e?($("#DateSliderStencil").show(),$("#dvLiveStreamSearchDate").html(""),$("#DateSliderStencil").clone().appendTo("#dvLiveStreamSearchDate"),$("#divLoaderLiveStreamListing").html(""),$("#divLoaderLiveStreamListingInner").clone().appendTo("#divLoaderLiveStreamListing"),$("#divLoaderLiveStreamListing").show()):($("#divLoaderLiveStreamListing").hide(),$("#DateSliderStencil").hide())}function ClearLiveStreamFilter(){$("input[name='liveStreamDuration1']:checkbox").removeAttr("checked"),$("input[name='liveStreamDuration']:checkbox").removeAttr("checked"),$(".LiveStreamBookmarkClass").removeClass("active")}function getBookmark(){var e=!1;try{(IsFromMobile()&&($("#LiveStreamBookmarkMobile").hasClass("active")||$("#LiveStreamBookmarkMobile").hasClass("activeBookMark"))||$("#LiveStreamBookmark").hasClass("active"))&&(e=!0)}catch(t){e=!1}return e}function CallSearchWithFilter(e){_LastSearchDate=null,_MaxSearchActiveDate=null,$("#listview").html(""),$("#SearchHeaderBar").html(""),e&&$(".mob-class-stream-filter").removeClass("openfilter"),$("#streamclassdropdown").hide(),$("#durationdropdown").hide(),$(".livestreampage .mobile-classmore-links").hide(),$(".stream-more").focus(),isLoadDateResult=!1,bkLiveStreamEvent.timeSlotsCache={},BindLiveStreamDateSearch(null,null,!1,!1),setTimeout(function(){$("#LiveStreamBookmark").attr("tabindex",-1).focus()},1e3)}function ManagaBusinessBookmark(e){if((e=$(e)).hasClass("active"))e.removeClass("active"),IsFromMobile()||CallSearchWithFilter();else{if(!(UserID>0))return objLiveStreamEventBookmark={},objLiveStreamEventBookmark.obj=e,showCommonLoginPopup("LiveStreamEventBookmark"),!1;e.addClass("active"),IsFromMobile()||CallSearchWithFilter()}}function ChangeDateForLiveStream(e,t){var i,n=$(".listing-slider .slick-active"),o=$(n[0]);if("Prev"==e.CurrentSlideDirection){if(0==t&&n.not(".selected").length<7)return;o=$(n[6])}else{if(1==n.hasClass("selected"))if(i=$(n[6]).eq(0).data().tmplItem.data.sDateSearch,_MaxSearchDate==i)return}$(".listing-slider div").removeClass("selected"),$(o).addClass("selected"),isLoadDateResult=!1,i=o.eq(0).data().tmplItem.data.sDateSearch;var a=new Date(i),s=a.getFullYear()+"/"+(a.getMonth()+1)+"/"+a.getDate();$($("#dvLiveStreamSearchDate").find("[data-searchdate='"+s+"']")[0]).parent().addClass("selected"),BindLiveStreamDateSearch(s,null,!1,!1)}function getSelectedSlider(e){if($(".listing-slider div").removeClass("selected"),$("."+e).parent().addClass("selected"),!$("."+e).parent().hasClass("slick-active")){var t=$("."+e).parent().attr("index");null!=t&&void 0!==t&&(Number(t)%7&&(t-=Number(t)%7),$(".listing-slider").slickGoTo(t))}}bkLiveStreamEvent={timeSlotsCache:{},model:{},init:function(){this.model.cacheLen=31,this.model.cacheDuration=30},getCacheKey:function(){return this.model.EventDate.toString()},addResponseToCache:function(e){if(void 0===this.timeSlotsCache[this.getCacheKey()]||null===this.timeSlotsCache[this.getCacheKey()]){this.timeSlotsCache[this.getCacheKey()]={timestamp:new Date,resp:e},Object.keys||(Object.keys=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t});var t=Object.keys(this.timeSlotsCache);t.length>this.model.cacheLen&&delete this.timeSlotsCache[t[0]]}},getResponseFromCache:function(){if(void 0!==this.timeSlotsCache[this.getCacheKey()]&&null!==this.timeSlotsCache[this.getCacheKey()]){var e=this.timeSlotsCache[this.getCacheKey()].timestamp,t=new Date;if(t.setMinutes(t.getMinutes()-this.model.cacheDuration),e>t)return this.timeSlotsCache[this.getCacheKey()].resp;this.removeCacheByCurKey()}return null},removeCacheByCurKey:function(){delete this.timeSlotsCache[this.getCacheKey()]}};var $animation_elements=$(".scrollLiveStream"),$window=$(window),lastScrollTop=0;function GetActiveDivBind(){if(!IsFromMobile()&&window.location.href.indexOf(_common.liveStreamClasses)>-1){var e=$(".listing-slider .slick-active.selected");if(void 0!==e&&e.length>0){isLoadDateResult=!1,searchDate=e.eq(0).data().tmplItem.data.sDateSearch;var t=new Date(searchDate),i=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate();$($("#dvLiveStreamSearchDate").find("[data-searchdate='"+i+"']")[0]).parent().addClass("selected"),BindLiveStreamDateSearch(i,null,!1,!1)}}}function GetActiveDivInView(){if(window.location.href.indexOf(_common.liveStreamClasses)>-1){var e=$(this).scrollTop(),t="downside";t=e>lastScrollTop?"downside":"upside",lastScrollTop=e;var i=$("#SearchHeaderBar").height(),n=0,o=16;IsFromMobile()&&(n=0-$("#divFixedSearchDate").outerHeight(),o=58,i=0);$window.height(),parseInt($(".streamclasslistingWrapper").offset().top);var a=$window.scrollTop()+parseInt($(".streamclasslistingWrapper").offset().top-o)+n-i;if($.each($animation_elements,function(){DivInView(this)?($(this).addClass("in-view"),$(this).removeClass("out-view")):($(this).removeClass("in-view"),$(this).addClass("out-view"))}),isLoadDateResult){var s;_NoRecordCount=0,isLoadDateResult=!1,a=$window.scrollTop()+parseInt($(".streamclasslistingWrapper").offset().top-o)+n+i,$(".in-view").each(function(){if(!IsFromMobile()||0!=$("#pageSection").hasClass("mobfix-timeslide")){var e=$(this),t=e.offset();if(IsFromMobile()&&(a=$window.scrollTop()+($("#divFixedSearchDate").height()+$(".stremclassdate").height()+$(".class-monthly-available",this).height())),a>t.top&&a<t.top+e.height()+36){$("#SearchHeaderBar").html($(".class-monthly-available .class-date-time",this).html());var i=$(".class-monthly-available",this).parent().context.id;if(!String.isNullOrUndefineOrBlank(i))getSelectedSlider(i.toString().replace("dv",""))}}});var r=$(".in-view").not(".data-bind");if(r.length>0&&(s="upside"==t?r[r.length-1]:r[0]),void 0!==s&&null!=s){var l=$("#"+s.id)[0].attributes["data-searchdate"].value;if(l==_MaxSearchDate&&"upside"==t)return void(isLoadDateResult=!0);var c=new Date(l);if("upside"==t&&void 0!==_MaxSearchActiveDate&&null!=_MaxSearchActiveDate)if(c>new Date(_MaxSearchActiveDate))return void(isLoadDateResult=!0);var d=!0;"upside"==t&&(d=!1),$.grep(r,function(e,t){t>5||(BindLiveStreamDateSearch(l=$("#"+r[t].id)[0].attributes["data-searchdate"].value,null,d,!1),d=!0)})}else isLoadDateResult=!0}}}function CheckEmptyDivInView(){var e,t=$(".in-view").not(".data-bind");(t.length>0&&(e=t[0]),void 0!==e&&null!=e)&&BindLiveStreamDateSearch($("#"+e.id)[0].attributes["data-searchdate"].value,null,!0,!0)}function DivInView(e){var t=$(e);if(t.length>0){var i=0;IsFromMobile()&&(i=0-$("#divFixedSearchDate").outerHeight());var n=$("#SearchHeaderBar").height(),o=$window.height()-parseInt($(".streamclasslistingWrapper").offset().top)-i+n,a=$window.scrollTop()+parseInt($(".streamclasslistingWrapper").offset().top)+i-n;IsFromMobile()&&(o=$window.height()-parseInt($(".streamclasslistingWrapper").offset().top),a=$window.scrollTop()+($("#divFixedSearchDate").outerHeight()+$(".stremclassdate").height()));var s=a+o,r=t.outerHeight()-28,l=t.offset().top;if(l+r>=a&&l<=s)return!0}return!1}function AfterBeforeLoginLiveStream(){if(window.location.href.indexOf(_common.liveStreamClasses)>-1)try{$.each(bkLiveStreamEvent.timeSlotsCache,function(e,t){var i=t.resp;null!=i&&($.grep(i,function(e){e.EventDurationRemainMin=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!0),e.EventDurationRemain=getDateDiff(moment(new Date).add(_gblCurrentTimeDiff,"milliseconds")._d,e.AppointmentStartTime,!1),e.IsEnrolled=getEnrolled(e.AttendeeList)}),BindLiveStreamData(i,!0))})}catch(e){console.log(e)}else LoadUpcomingLiveStreamClasses(UpComingLiveStreamFromType.Home)}$window.on("scroll",GetActiveDivInView),$window.on("resize",GetActiveDivBind);var countryEnum={US:1,UK:2,CA:3,AU:4},timeZoneOffSetArray=[{Id:-12,AbbrivationName:"AoE",DayLightAbbrivationName:"AoE",TimeZoneId:"Dateline Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-11,AbbrivationName:"SST",DayLightAbbrivationName:"SST",TimeZoneId:"UTC-11",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-10,AbbrivationName:"HST",DayLightAbbrivationName:"HDT",TimeZoneId:"Hawaiian Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-9,AbbrivationName:"ADT",DayLightAbbrivationName:"AKDT",TimeZoneId:"Alaskan Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-8,AbbrivationName:"PST",DayLightAbbrivationName:"PDT",TimeZoneId:"Pacific Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-7,AbbrivationName:"MST",DayLightAbbrivationName:"MDT",TimeZoneId:"US Mountain Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-7,AbbrivationName:"MST",DayLightAbbrivationName:"MDT",TimeZoneId:"Mountain Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!0},{Id:-6,AbbrivationName:"CST",DayLightAbbrivationName:"CDT",TimeZoneId:"Central Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-5,AbbrivationName:"EST",DayLightAbbrivationName:"EDT",TimeZoneId:"Eastern Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-4,AbbrivationName:"AST",DayLightAbbrivationName:"ADT",TimeZoneId:"Atlantic Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-3.5,AbbrivationName:"NST",DayLightAbbrivationName:"NDT",TimeZoneId:"Newfoundland Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:10,AbbrivationName:"ChST",DayLightAbbrivationName:"ChST",TimeZoneId:"West Pacific Standard Time",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:12,AbbrivationName:"WAKT",DayLightAbbrivationName:"WAKT",TimeZoneId:"UTC+12",CountryId:countryEnum.CA,IsSupportDayLight:!1},{Id:-12,AbbrivationName:"AoE",DayLightAbbrivationName:"AoE",TimeZoneId:"Dateline Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-11,AbbrivationName:"SST",DayLightAbbrivationName:"SST",TimeZoneId:"UTC-11",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-10,AbbrivationName:"HST",DayLightAbbrivationName:"HDT",TimeZoneId:"Hawaiian Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-9,AbbrivationName:"ADT",DayLightAbbrivationName:"AKDT",TimeZoneId:"Alaskan Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-8,AbbrivationName:"PST",DayLightAbbrivationName:"PDT",TimeZoneId:"Pacific Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-7,AbbrivationName:"MST",DayLightAbbrivationName:"MDT",TimeZoneId:"US Mountain Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-7,AbbrivationName:"MST",DayLightAbbrivationName:"MDT",TimeZoneId:"Mountain Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!0},{Id:-6,AbbrivationName:"CST",DayLightAbbrivationName:"CDT",TimeZoneId:"Central Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-5,AbbrivationName:"EST",DayLightAbbrivationName:"EDT",TimeZoneId:"Eastern Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-4,AbbrivationName:"AST",DayLightAbbrivationName:"ADT",TimeZoneId:"Atlantic Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:10,AbbrivationName:"ChST",DayLightAbbrivationName:"ChST",TimeZoneId:"West Pacific Standard Time",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:12,AbbrivationName:"WAKT",DayLightAbbrivationName:"WAKT",TimeZoneId:"UTC+12",CountryId:countryEnum.US,IsSupportDayLight:!1},{Id:-8,AbbrivationName:"PST",DayLightAbbrivationName:"PST",TimeZoneId:"UTC-08",CountryId:countryEnum.UK,IsSupportDayLight:!1},{Id:-3,AbbrivationName:"FKST",DayLightAbbrivationName:"FKST",TimeZoneId:"E. South America Standard Time",CountryId:countryEnum.UK,IsSupportDayLight:!1},{Id:-2,AbbrivationName:"GST",DayLightAbbrivationName:"GST",TimeZoneId:"UTC-02",CountryId:countryEnum.UK,IsSupportDayLight:!1},{Id:0,AbbrivationName:"GMT",DayLightAbbrivationName:"BST",TimeZoneId:"GMT Standard Time",CountryId:countryEnum.UK,IsSupportDayLight:!1},{Id:2,AbbrivationName:"CEST",DayLightAbbrivationName:"CEDT",TimeZoneId:"South Africa Standard Time",CountryId:countryEnum.UK,IsSupportDayLight:!1},{Id:6,AbbrivationName:"IOT",DayLightAbbrivationName:"IOT",TimeZoneId:"Central Asia Standard Time",CountryId:countryEnum.UK,IsSupportDayLight:!1},{Id:6.5,AbbrivationName:"CCT",DayLightAbbrivationName:"CCT",TimeZoneId:"Myanmar Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1},{Id:7,AbbrivationName:"CXT",DayLightAbbrivationName:"CXT",TimeZoneId:"SE Asia Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1},{Id:8,AbbrivationName:"AWST",DayLightAbbrivationName:"AWST",TimeZoneId:"W. Australia Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1},{Id:8.75,AbbrivationName:"ACWST",DayLightAbbrivationName:"ACWST",TimeZoneId:"Aus Central W. Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1},{Id:9.5,AbbrivationName:"ACST",DayLightAbbrivationName:"ACDT",TimeZoneId:"Cen. Australia Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1},{Id:10,AbbrivationName:"AEST",DayLightAbbrivationName:"AEDT",TimeZoneId:"E. Australia Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1},{Id:10.5,AbbrivationName:"LHST",DayLightAbbrivationName:"LHDT",TimeZoneId:"Lord Howe Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1},{Id:11,AbbrivationName:"NFT",DayLightAbbrivationName:"NFT",TimeZoneId:"Norfolk Standard Time",CountryId:countryEnum.AU,IsSupportDayLight:!1}];function TimeZoneDropdownShowHide(){"undefined"!=typeof vgAppicationType&&1==vgAppicationType?showMobileSearchControl():1==$("#mobile-check").is(":visible")?_common.focusonMobileLocationControl():_common.focusonLocationControl(!0)}function GetTimeZoneIDFromCookies(e,t){var i=getCookie(ProximityCookieName);if(null!=i&&(null!=(n=$.grep(timeZoneOffSetArray,function(e){return"-7"!=i.timeZoneOffSet||i.countryid!=countryEnum.US&&i.countryid!=countryEnum.CA?e.Id==i.timeZoneOffSet&&e.CountryId==i.countryid:e.Id==i.timeZoneOffSet&&e.CountryId==i.countryid&&e.IsSupportDayLight==i.isSupportDayLight}))&&n.length>0))return 1==e?t?n[0].DayLightAbbrivationName:n[0].AbbrivationName:n[0].TimeZoneId;var n=$.grep(timeZoneOffSetArray,function(e){return-8==e.Id&&e.CountryId==countryEnum.US});return 1==e?n[0].AbbrivationName:n[0].TimeZoneId}function GetCityStateValueFromLiveStream(){var e=cookieManager.getCookie("proximitystate_v3");if(null!=e)return String.isNullOrUndefineOrBlank(e.city)?htmlEncode(e.stateName):htmlEncode(e.city)+", "+htmlEncode(e.state)}var stickyHeaders=function(){$(".scrollLiveStream").each(function(){if(!IsFromMobile()||0!=$("#pageSection").hasClass("mobfix-timeslide")||0!=isLoadDateResult){var e=0;IsFromMobile()&&(e=0-$("#divFixedSearchDate").height());var t=$(this),i=t.offset(),n=$(window).scrollTop()+parseInt($(".streamclasslistingWrapper").offset().top+e);$(".class-monthly-available",this);if(n>i.top&&n<i.top+t.height()){$("#SearchHeaderBar").html($(".class-monthly-available .class-date-time",this).html());var o=$(".class-monthly-available",this).parent().context.id;if(!String.isNullOrUndefineOrBlank(o))getSelectedSlider(o.toString().replace("dv",""))}}})};function setCategoryWidthheight(){if(1==$("#mobile-check").is(":visible"))$(".fliter-class-name").show();else{var e=$("#divStreamListingFilters");e.children("a").show();var t=$(".dropdown-stream"),n=0,o=$(".streamfilterclass").outerWidth(!0)-31,a=!1,s=e.children("a").size();for(1779==$(window).width()&&(o-=105),i=0;i<s;i++){if((n+=e.children("a").eq(i).outerWidth(!0))>o){e.children("a").eq(i).hide(),e.children("a").eq(i).nextAll().hide(),i>s-3&&(e.children("a").eq(i-1).hide(),e.children("a").eq(i-1).nextAll().hide()),a=!0;break}0==e.children("a").eq(i).is(":visible")&&e.children("a").eq(i).show()}1==a&&0==t.is(":visible")?t.show():0==a&&1==t.is(":visible")&&t.hide(),$(".stream-more").removeClass("selected"),$.grep(e.children("a"),function(e,t){if($(e).length>0){var i=$(e)[0].id;$(e).is(":visible")?$("#li"+i).parent("li").hide():($("#li"+i).parent("li").show(),$(e).hasClass("selected")&&($(".stream-more").addClass("selected"),$("#li"+i).parent("li").addClass("active")))}})}}function IsExistsClassInServiceSearch(){return 0==bookSearchItemType.length||-1==bookSearchItemType.indexOf(1)&&bookSearchItemType.indexOf(2)>-1}function IsOnlyClassFoundInServiceSearch(){$(".listings-business-parent-div").length>0&&($("#ulFeatureBusiness").find("section[data-eventtype=1]").length>0&&bookSearchItemType.push(1),$("#ulFeatureBusiness").find("section[data-eventtype=2]").length>0&&bookSearchItemType.push(2))}function homeLivestreamSlider(){$(".homebox-slider").slick({infinite:!1,speed:600,slidesToShow:4,leftMode:!0,variableWidth:!0,responsive:[{breakpoint:1679,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:1200,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:767,settings:{slidesToShow:2,slidesToScroll:1}},{breakpoint:660,settings:{slidesToShow:1,slidesToScroll:1,arrows:!1}}]})}function homeLivestreamSlider_mobile(){var e=$(window).width();setTimeout(function(){e<=767?$(".homebox-slider").unslick():e>=767&&($(".homebox-slider").unslick(),homeLivestreamSlider())},60)}function LiveStream(e,t,i,n,o,a,s){try{var r={};r.Action=e,r.PageName="Home",r.BusinessName=i,r.BusinessID=n,r.Action=e,r.Category=t,""!=o&&(r.DealName=o),_vgLogEvent.LogData(r),void 0!==s&&"true"==s.toLowerCase()&&SetFeaturedMarketplaceCookie(n),window.location.href=a}catch(e){}}function SetFeaturedMarketplaceCookie(e){cookieManager.setCookie(e,e,30,cookieManager.defaultPath,cookieManager.defaultDomain,!0,!1)}function DailyDeal(e,t,i,n,o){try{var a={},s="";console.log(i+" "+n+" "+o),"Deal List"==e&&(s="Deal Details"),a.Action=s,a.Category=t,a.Label=t,a.BusinessName=i,a.BusinessID=n,a.isDealDetails=!0,a.IsListPage=!0,a.IsMapPage=!0,a.isFiltered=!1,a.DealName=o,_vgLogEvent.LogData(a)}catch(e){}}function getBusinessTypelist(e){var t=[],i={};i.businessId=e;var n=new vagaro.ajax;n.datamodel.Token="getBusinessTypeListByBusinessId",n.datamodel.data=i,n.datamodel.callback=function(e){t=e,vuiForms.frame.forms.responseBusinessTypes(t)},n.datamodel.Error=function(e){t=null},n.Post()}!function(e){"use strict";e.fn.VagaroForms=function(t,i){e.isFunction(t)&&(t=null);var n,o=e.extend({},e.fn.VagaroForms.defaults,t),a=this;function s(t){if("https://portal.forms.com"==t.origin||-1!=t.origin.indexOf("localhost")||-1!=t.origin.indexOf("10.10")||-1!=t.origin.indexOf("vagaro")||-1!==t.origin.indexOf("bookitall.com")||-1!==t.origin.indexOf("localdev.com")){var i=t.data||t.originalEvent.data;if(i.indexOf("callToVagaroForHEICCallBack")>-1)return void _callBackToCheckInApp(i);var n=JSON.parse(t.data||t.originalEvent.data);switch(n.eventType){case"ECHO":o.loaded=!0;break;case"callSubmitButton":case"callSubmitButton":vuiForms.frame.forms.submitForm();break;case"getSize":l(o.receivers.onGetSize,n);break;case"loadTutorial":l(o.receivers.onloadTutorial,n);break;case"setParentDivHeight":onsetParentDivHeightCallback();break;case"setToScrollPosition":onsetToScrollPositionCallback(n);break;case"closeFrame":l(o.receivers.onClose,n),l(o.receivers.onHideLoading,n),vuiForms.frame.destroy();break;case"reloadIframeParentPage":l(o.receivers.onReloadIframeParentPage,n);break;case"hideLoading":l(o.receivers.onHideLoading,n);break;case"SavebuttonName":l(o.receivers.SavebuttonName,n);break;case"displayLoading":l(o.receivers.onDisplayLoading,n);break;case"resetReponseFrame":l(o.receivers.onResetReponseFrame,n);break;case"error":l(o.receivers.onFormsDown,n);break;case"sendMessage":case"iframe_Loaded":case"parent_screen":l(o.receivers.onMessage,n);break;case"setHeight":e(vuiForms.frame).find("iframe").css("height",n.height+"px"),e(".settingmainwhitebg").css("min-height",parseInt(n.height+10)+"px");break;case"setContentHeight":e(vuiForms.frame).find("iframe").css("height",n.height+"px"),e(vuiForms.frame).find("iframe").parent().css("height",n.height+"px");var a=null!=userAgent.match(/Android/i)&&null!=userAgent.match(/Mobile/i)&&null==userAgent.match(/Windows/i);if(/(iPhone)/i.test(navigator.userAgent)&&!window.MSStream||a)if(null!=typeof getQueryStringData)"Builder"===getQueryStringData("Type")&&(n.height<1500?(n.height=1500,e(vuiForms.frame).find("iframe").css("height",n.height+560+"px"),e(vuiForms.frame).find("iframe").parent().css("height",n.height+560+"px")):(e(vuiForms.frame).find("iframe").css("height",n.height+"px"),e(vuiForms.frame).find("iframe").parent().css("height",n.height+"px")));break;case"setCheckinContentHeight":e(vuiForms.frame).find("iframe").css("height",n.height+160+"px"),e(vuiForms.frame).find("iframe").parent().css("height",n.height+160+"px");break;case"showHideSaveCancel":l(o.receivers.onShowHideSaveCancel,n);break;case"scrollToTop":l(o.receivers.onscrollToTop,n);break;case"submitFormResponse":l(o.receivers.onsubmitFormResponse,n);break;case"GetFormRespIframeData":l(o.receivers.onGetFormRespIframeData,n);break;case"getServicesandClass":l(o.receivers.ongetServicesandClass,n);break;case"getMemberships":l(o.receivers.ongetMemberships,n);break;case"getLoginUserDetails":l(o.receivers.ongetLoginUserDetails,n);break;case"getBusinessTypelist":l(o.receivers.ongetBusinessTypelistList,n);break;case"getAccessRights":l(o.receivers.ongetAccessRights,n);break;case"showMessage":l(o.receivers.onShowMessage,n);break;case"GetStateDetailByName":l(o.receivers.onGetStateDetailByName,n);break;case"GetCityByZipCode":l(o.receivers.onGetCityByZipCode,n);break;case"DateRangePickerSetUp":l(o.receivers.onDateRangePickerSetUp,n);break;case"editFormOrSaopResponse":l(o.receivers.onEditFormResponse,n.message);break;case"newEditFormOrSaopResponse":l(o.receivers.onNewEditFormResponse,n.message);break;case"ResetCheckInAppTimer":l(o.receivers.onResetCheckInAppTimer,n.message);break;case"SendFormSaveSuccess":l(o.receivers.onSendFormSaveSuccess,n);break;case"loadVagaroDrive":l(o.receivers.onloadVagaroDrive,n);break;case"loadReactiveVagaroDrivePopup":l(o.receivers.onloadReactiveVagaroDrivePopup,n);break;case"setToFormScrollPosition":l(o.receivers.setToFormScrollPosition,n);break;case"loadVagaroDriveRequired":l(o.receivers.onloadVagaroDriveRequired,n);break;case"callToVagaroForHEICCallBack":l(o.receivers.callToVagaroForHEICCallBack,n);break;case"callOpenManageMerchantAccountDialog":l(o.receivers.onOpenManageMerchantAccountDialog,n);break;case"getCCDetailsFromVagaro":l(o.receivers.ongetCCDetailsFromVagaro,n);break;case"loadMarkerPhotoEditor":l(o.receivers.onloadMarkerPhotoEditor,n.postData);break;case"callEmployeeSignPopup":l(o.receivers.callEmployeeSignPopup,n.postData);break;case"HideLastModifydate":n.postData?null!=document.getElementById("lastmodifiedForm")&&(document.getElementById("lastmodifiedForm").style.display="none"):document.getElementById("lastmodifiedForm").style.display="block",Call_Last_Modified_date(0);break;case"setDatePickerDiv":l(o.receivers.onsetDatePickerDiv,n);break;case"setDatePickerScrollFromVagaro":l(o.receivers.onSetDatePickerScrollFromVagaro,n.postData);break;case"sendFormTitleToVagaro":l(o.receivers.onsetFormTitle,n.message)}}}return a.post=o.post,a.destroy=function(){window.removeEventListener("message",s,!1),null!=a&&(a.each(function(){e.data(this,""),e(this).attr("style","").removeData().hide().html("")}),a=null)},a.forms={getSize:function(){r('{"eventType": "getSize"}')},addStyle:function(e){r('{"eventType": "addStyle", "style" : "'+e+'"}')},submitForm:function(){var e={formRespId:"undefined"!=typeof _custForm&&null!=_custForm?_custForm.CurrentFormResponseId:"",isEdit:"undefined"!=typeof isFormSoapEdit&&isFormSoapEdit};"undefined"!=typeof isFormSoapEdit&&(isFormSoapEdit=!1),r('{"eventType": "submitForm", "message": '+JSON.stringify(e)+"}")},NextSign:function(){r('{"eventType": "NextSign"}')},submitFormRespIframeData:function(e){"object"==typeof e&&(e=JSON.stringify(e)),r('{"eventType": "GetFormRespIframeDataSuccess", "message": '+e+"}")},submitAllForm:function(e){r('{"eventType": "submitAllForm","formsRes":'+JSON.stringify(e)+"}")},responseServiceAndClass:function(e){r('{"eventType": "responseServiceAndClass", "data": '+JSON.stringify(e)+"}")},responseMembership:function(e){r('{"eventType": "responseMembership", "data": '+JSON.stringify(e)+"}")},responseBusinessTypes:function(e){r('{"eventType": "responseBusinessTypes", "data": '+JSON.stringify(e)+"}")},hideHeaderandFooter:function(){r('{"eventType": "hideHeaderandFooter"}')},addClassInFormsBody:function(e){r('{"eventType": "addClassInFormsBody" , "data": '+JSON.stringify(e)+"}")},addClassInFormsHtml:function(e){r('{"eventType": "addClassInFormsHtml" , "data": '+JSON.stringify(e)+"}")},showHeaderandFooter:function(e){r('{"eventType": "showHeaderandFooter", "message": '+e+"}")},sendLoginUseDetails:function(e){r('{"eventType": "sendLoginUseDetails", "data": '+JSON.stringify(e)+"}")},checkWebView:function(e){r('{"eventType": "checkWebView","iswebview" : "'+e+'"}')},ignorePro:function(e){r('{"eventType": "ignorePro","ignorePro" : "'+e+'"}')},getHeight:function(){r('{"eventType": "getHeight"}')},getContentHeight:function(){null!=typeof getQueryStringData?r("Builder"===getQueryStringData("Type")?'{"eventType": "getWBContentHeight"}':'{"eventType": "getContentHeight"}'):r('{"eventType": "getContentHeight"}')},HideSignatureData:function(){r('{"eventType": "HideSignatureData"}')},getCheckinContentHeight:function(){r('{"eventType": "getCheckinContentHeight"}')},setScreen:function(e,t,i,n,o){r(JSON.stringify({eventType:"setScreen",objScreen:""+e,topoffset:""+t,headeroffset:""+i,divgotit:""+n,divouterheight:""+o}))},hideSubmitButton:function(){r('{"eventType": "hideSubmitButton"}')},showSubmitButton:function(){r('{"eventType": "showSubmitButton"}')},hidePopup:function(){r('{"eventType": "hidePopup"}')},sendAccessRights:function(e){r('{"eventType": "sendAccessRights","accessrights" : "'+e+'"}')},sendStateDetail:function(e){r('{"eventType": "sendStateDetail","message" : "'+e+'"}')},sendCityByZipCode:function(e){r('{"eventType": "sendCityByZipCode","message" : "'+e+'"}')},getFormResponseDetailById:function(e){r('{"eventType": "getFormOrSoapResponseDetailById","message" : "'+e+'"}')},getFormValidationContentHeight:function(){r('{"eventType": "getFormValidationContentHeight"}')},getFormValidationScrollTop:function(){r('{"eventType": "getFormValidationScrollTop"}')},IsOnline:function(e){r('{"eventType": "IsOnline", "IsOnline" : "'+e+'"}')},heicSucessResponseFromVagaro:function(e){r(JSON.stringify(e))},sendCCDetailsToForms:function(e){e.eventType="sendCCDetailsToForms",r(JSON.stringify(e))},setPreviewFlag:function(e){r('{"eventType": "setPreviewFlag"}')},GetRentContractHeight:function(){r('{"eventType": "GetRentContractHeight"}')},callMarkerSaveFunction:function(e){r('{"eventType": "callMarkerEditorSave", "responseData": '+JSON.stringify(e)+"}")},callEmployeeSignValidate:function(e){r('{"eventType": "callEmployeeSignValidate", "responseData": '+JSON.stringify(e)+"}")},FillAllCustomerData:function(e){r('{"eventType": "FillAllCustomerData","responseData": '+JSON.stringify(e)+"}")},setDarkModePreference:function(e){r('{"eventType": "setDarkModePreference" , "data": '+JSON.stringify(e)+"}")},FormTitle:function(){r('{"eventType": "formTitle"}')}},window.addEventListener("message",s,!1),a.each(function(){e.data(this,"plugin")||function(t){var i=e('<iframe class="b-iframe" '+o.iframeAttr+' id="iFrame_'+a.attr("id")+'" style="display:none;"></iframe>');if(1==t){var n=e("<div id='frame_apgProgress_"+a[0].id+"' style='display:none;'></div><div style='position: relative; ' id='divinnertop_up'><div id='ccfram_backgroundElement' style='position: fixed; left: 0px; top: 0px; width: 100%; height: 100%;' class='ModalPopupBG'></div><div style='color: white; font-family: \"Lucida Grande\",\"Arial\"; font-size: 11px; position: absolute; text-align: center;width: 100%; z-index: 2001; top: 6px; position:relative;'></div><div style='width: auto; height: auto; margin: 0 -7px;z-index:9999; position:relative' class='contentContainer'></div></div>");n.find(".contentContainer").append(i),n.appendTo(a)}else i.appendTo(a);a.data("iframe_id",i.attr("id")),i.height(o.height).width(o.width),i.attr("src",o.loadUrl),console.log(i.attr("id")),l(o.receivers.onOpening),i.load(function(i){if(1==o.isOnline){var n=vuiForms._getOnlineStyle();if(vuiForms.frame.forms.addStyle(n),null!=typeof getQueryStringData){var s=getQueryStringData("Type");"OnBoarding"!=s&&"ImportOnBoarding"!=s&&vuiForms.frame.forms.IsOnline("1")}else vuiForms.frame.forms.IsOnline("1")}1==o.isfullwidth&&e(this).addClass("framefullwidth"),vuiForms.frame.forms.checkWebView(o.iswebview?"true":"false"),vuiForms.frame.forms.ignorePro(o.ignorePro?"true":"false"),window.setTimeout(function(t){var i,n,s,r,c,d,u,p;o.loaded=!0,l(o.receivers.onOpened),a.find("iframe").css("display","block"),1==t?(i=o.height,n=o.width,s=a.attr("id"),p=document.getElementById(s),r=function(e,t){var i,n,o,a;return i=function(){var e,t;return void 0!==window.innerWidth?(e=window.innerWidth,t=window.innerHeight):void 0!==document.documentElement&&void 0!==document.documentElement.clientWidth&&0!=document.documentElement.clientWidth?(e=document.documentElement.clientWidth,t=document.documentElement.clientHeight):(e=document.getElementsByTagName("body")[0].clientWidth,t=document.getElementsByTagName("body")[0].clientHeight),t+"|"+e}().split("|"),n=i[0],o=i[1],(a=(n-e)/2)<0&&(a=1),a+"|"+(o-t)/2+"|"+n}(i,n).split("|"),c=r[0],d=r[1],r[2],p.style.left=d-20+"px",(u=document.documentElement.scrollTop!=document.body.scrollTop?document.documentElement.scrollTop+document.body.scrollTop:document.body.scrollTop)>0&&(c=parseInt(c)+u),c-=20,p.style.top=c+"px",p.style.position="absolute",p.width="auto",p.height="auto",p.style.zIndex=100001,p.style.display=""):e("#"+vuiForms.contentContainer).show(),null!=vuiForms.loader&&vuiForms.loader(!1)}(t),1e3)})}(o.modal),console.log("frame.each")});function r(t){try{null==document.getElementById(a.data("iframe_id"))&&null==document.getElementById(a.data("iframe_id"))||document.getElementById(a.data("iframe_id")).contentWindow.postMessage(t,function(){if(null==n||1==function(){try{if(void 0!==n&&null!=n&&n.indexOf("forms.vagaro.com")>0){var t=/^(https*:\/\/[^\/]*).*$/g.exec(e("#"+a.data("iframe_id")).attr("src"));if(t)if(t[1]!=n)return!0}return!1}catch(e){return!1}}()){var t=/^(https*:\/\/[^\/]*).*$/g.exec(e("#"+a.data("iframe_id")).attr("src"));t&&(n=t[1])}return n}())}catch(e){console.log(e)}}function l(t,i){e.isFunction(t)&&t.call(this,i)}},e.fn.VagaroForms.defaults={height:375,width:480,loaded:!1,appendTo:"body",iframeAttr:'scrolling="yes" frameborder="0"',loadUrl:"",modal:!0,modalClose:!0,opacity:1,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,speed:250,transition:"fadeIn",transitionClose:!1,zIndex:1000001,showLog:!0,afterCallBackHandle:0,iswebview:!1,ignorePro:!1,isfullwidth:!1,receivers:{onOpening:function(e){"function"==typeof onFormOpeningCallback&&onFormOpeningCallback(e)},onClose:function(e){"function"==typeof onFormCloseCallback&&onFormCloseCallback(e)},onOpened:function(e){"function"==typeof onFormOpenedCallback&&onFormOpenedCallback(e)},onError:function(e){"function"==typeof onErrorCallback&&onErrorCallback(e)},onReloadIframeParentPage:function(e){"function"==typeof onReloadIframeParentPageCallback&&onReloadIframeParentPageCallback(e)},onHideLoading:function(e){"function"==typeof onHideLoadingCallbackForms&&onHideLoadingCallbackForms(e)},SavebuttonName:function(e){"function"==typeof SavebuttonNameCallbackForms&&SavebuttonNameCallbackForms(e)},onDisplayLoading:function(e){"function"==typeof onDisplayLoadingCallbackForms&&onDisplayLoadingCallbackForms(e)},onResetReponseFrame:function(e){"function"==typeof onResetReponseFrameCallback&&onResetReponseFrameCallback(e)},onGetSize:function(e){"function"==typeof onGetSizeCallback&&onGetSizeCallback(e)},onloadTutorial:function(e){"function"==typeof onloadTutorialCallback&&onloadTutorialCallback(e)},onMessage:function(e){"function"==typeof onMessageCallback&&onMessageCallback(e)},onFormsDown:function(e){"function"==typeof onFormsDownCallback&&onFormsDownCallback(e)},onShowHideSaveCancel:function(e){"function"==typeof onShowHideSaveCancelCallback&&onShowHideSaveCancelCallback(e)},onscrollToTop:function(e){"function"==typeof onscrollToTopCallback&&onscrollToTopCallback(e)},onGetFormRespIframeData:function(e){"function"==typeof onGetFormRespIframeDataCallback&&onGetFormRespIframeDataCallback(e)},onsubmitFormResponse:function(e){"function"==typeof onsubmitFormResponseCallback&&onsubmitFormResponseCallback(e)},ongetServicesandClass:function(e){"function"==typeof ongetServicesandClassCallback&&ongetServicesandClassCallback(e)},ongetMemberships:function(e){"function"==typeof ongetMembershipsCallback&&ongetMembershipsCallback(e)},ongetLoginUserDetails:function(e){"function"==typeof ongetLoginUserDetailsCallback&&ongetLoginUserDetailsCallback(e)},ongetBusinessTypelistList:function(e){"function"==typeof ongetBusinessTypelistCallback&&ongetBusinessTypelistCallback(e)},onShowMessage:function(e){"function"==typeof onShowMessageCallback&&onShowMessageCallback(e)},onGetStateDetailByName:function(e){"function"==typeof onGetStateDetailByNameCallback&&onGetStateDetailByNameCallback(e)},onGetCityByZipCode:function(e){"function"==typeof onGetCityByZipCodeCallback&&onGetCityByZipCodeCallback(e)},onDateRangePickerSetUp:function(e){"function"==typeof onDateRangePickerSetUpCallback&&onDateRangePickerSetUpCallback(e)},ongetAccessRights:function(e){"function"==typeof ongetAccessRightsCallback&&ongetAccessRightsCallback(e)},onEditFormResponse:function(e){"function"==typeof onEditFormResponseCallback&&onEditFormResponseCallback(e)},onNewEditFormResponse:function(e){"function"==typeof onNewEditFormResponseCallback&&onNewEditFormResponseCallback(e)},onResetCheckInAppTimer:function(e){"function"==typeof onFocusInCallback&&onFocusInCallback(e)},onSendFormSaveSuccess:function(e){"function"==typeof onSendFormSaveSuccessCallback&&onSendFormSaveSuccessCallback(e)},onloadVagaroDrive:function(e){"function"==typeof onloadVagaroDriveCallback&&onloadVagaroDriveCallback(e)},onloadReactiveVagaroDrivePopup:function(e){"function"==typeof onloadReactiveVagaroDrivePopupCallback&&onloadReactiveVagaroDrivePopupCallback(e)},onloadVagaroDriveRequired:function(e){"function"==typeof onloadVagaroDriveRequiredCallback&&onloadVagaroDriveRequiredCallback(e)},setToFormScrollPosition:function(e){"function"==typeof onsetToFormScrollPositionCallBack&&onsetToFormScrollPositionCallBack(e)},callToVagaroForHEICCallBack:function(e){"function"==typeof _callBackToCheckInApp&&_callBackToCheckInApp(e)},onOpenManageMerchantAccountDialog:function(e){"function"==typeof onOpenManageMerchantAccountDialogCallBack&&onOpenManageMerchantAccountDialogCallBack(e)},ongetCCDetailsFromVagaro:function(e){"function"==typeof ongetCCDetailsFromVagaroCallBack&&ongetCCDetailsFromVagaroCallBack(e)},onloadMarkerPhotoEditor:function(e){"function"==typeof onloadMarkerPhotoEditorCallback&&onloadMarkerPhotoEditorCallback(e)},callEmployeeSignPopup:function(e){"function"==typeof callEmployeeSignPopupCallback&&callEmployeeSignPopupCallback(e)},onsetDatePickerDiv:function(e){"function"==typeof onsetDatePickerDivCallback&&onsetDatePickerDivCallback(e)},onSetDatePickerScrollFromVagaro:function(e){"function"==typeof onSetDatePickerScrollFromVagaroCallBack&&onSetDatePickerScrollFromVagaroCallBack(e)},onsetFormTitle:function(e){"function"==typeof onsetFormTitleCallback&&onsetFormTitleCallback(e)}}}}(jQuery),window.vuiForms={frameUrl:null,frame:null,contentContainer:null,modal:!1,height:375,width:480,loader:function(e){e?$("#apgProgress").length>0?$("#apgProgress").show():$("#apgLoading").length>0&&$("#apgLoading").show():$("#apgProgress").length>0?$("#apgProgress").hide():$("#apgLoading").length>0&&$("#apgLoading").hide()},buttonBackColor:null!=typeof hdnButtonBackColor?$("#hdnButtonBackColor").val():"",buttonFontColor:null!=typeof ButtonFontColor?$("#hdnButtonFontColor").val():"",buttonHoverColor:null!=typeof ButtonHoverColor?$("#hdnButtonHoveColor").val():"",displayLoading:function(e){this.loader(!0)},hideLoading:function(e){this.loader(!1)},ChangeSaveButtonName:function(e){$("#btnSaveForm").val(e.Name),$("#btnSaveForm").attr("data-IspenddingSign",e.PendingSign)},setHeight:function(e,t){var i="iFrame_"+this.contentContainer;$("#"+i).height(e),$("#"+i).width(t)},getSize:function(e,t){forms.getSize()},getFormsPage:function(e,t,i,n,o,a){this.modal=!1,this.height=i,this.width=n,this.iswebview=o,this.isOnline=a,this.contentContainer=e;var s={data:{url:t},custom_code:1e3};this._callFormsPageSuccess(s)},_callFormsPageSuccess:function(e){null!=e&&1e3==e.custom_code?(vuiForms.modal,null==e.data.url||null==e.data.url||"undefined"==e.data.url||(vuiForms.frame=$("#"+vuiForms.contentContainer).VagaroForms({loadUrl:e.data.url,modal:vuiForms.modal,height:vuiForms.height,width:vuiForms.width,afterCallBackHandle:vuiForms.afterCallBackHandle,iswebview:vuiForms.iswebview,isfullwidth:vuiForms.isfullwidth,isOnline:vuiForms.isOnline}))):(null!=vuiForms.loader&&vuiForms.loader(!1),onFormsDownCallback(e))},getFilledFormsPage:function(e,t,i,n,o){this.modal=!1,this.height=i,this.width=n,this.iswebview=o,this.contentContainer=e,this.iframeAttr='scrolling="yes" frameborder="0"';var a={data:{url:t},custom_code:1e3};this._callFilledFormsSuccess(a)},_callFilledFormsSuccess:function(e){null!=e&&1e3==e.custom_code?(vuiForms.modal,null==e.data.url||null==e.data.url||"undefined"==e.data.url||(vuiForms.frame=$("#"+vuiForms.contentContainer).VagaroForms({iframeAttr:vuiForms.iframeAttr,loadUrl:e.data.url,modal:vuiForms.modal,height:vuiForms.height,width:vuiForms.width,afterCallBackHandle:vuiForms.afterCallBackHandle,iswebview:vuiForms.iswebview,isfullwidth:vuiForms.isfullwidth}))):null!=vuiForms.loader&&vuiForms.loader(!1)},_callDirectUrl:function(e,t,i,n,o){vuiForms.frame=$("#"+vuiForms.contentContainer).VagaroForms({loadUrl:e,modal:t,height:i,width:n,afterCallBackHandle:o})},setIframeUrl:function(e,t,i,n,o){null!=vuiForms.frame?vuiForms.frame.find("iframe").attr("src",e):vuiForms.frame=$("#"+vuiForms.contentContainer).VagaroForms({loadUrl:e,modal:t,height:i,width:n,afterCallBackHandle:o})},_getStyle:function(){var e,t,i="";if("undefined"!=typeof backGroundColor&&""!=backGroundColor&&(i+=".popupwidth542 .modal-body { background-color:"+backGroundColor+"}"),""!=$("#hdnButtonBackColor").val()&&null!=$("#hdnButtonBackColor").val()&&""!=$("#hdnButtonFontColor").val()&&null!=$("#hdnButtonFontColor").val()){var n=(e=$("#hdnButtonBackColor").val(),t=30,e=e.replace("#",""),r=parseInt(e.substring(0,2),16),g=parseInt(e.substring(2,4),16),b=parseInt(e.substring(4,6),16),result="rgba("+r+","+g+","+b+","+t/100+")",result);i+=".btn-theme-text  { background-color: "+$("#hdnButtonBackColor").val()+"!important;border-color:"+$("#hdnButtonBackColor").val()+"!important; color : "+$("#hdnButtonFontColor").val()+"!important;}",i+=".btn-theme-text:hover { background-color: "+$("#hdnButtonHoveColor").val()+"!important;border-color:"+$("#hdnButtonHoveColor").val()+"!important;}",i+=".btn-default  { background-color!important:  #666666 }",i+=".vg-default-tab-link.active a,.vg-default-tab-link a:hover {color: "+$("#hdnButtonBackColor").val()+"!important;}.vg-default-tab-link.active a: before,.vg-default-tab-link.active a: hover: before { border-color: "+$("#hdnButtonBackColor").val()+"!important; }.vg-default-tab-link.active a:before,.vg-default-tab-link.active a:hover:before {border-color: "+$("#hdnButtonBackColor").val()+"!important;}",i+=".pagination-new-default ul li:hover a,.pagination-new-default ul li.active a { color: #fff !important; background-color: "+$("#hdnButtonBackColor").val()+"!important;}",i+=".fmTextWrap.active { border-left-color: "+$("#hdnButtonBackColor").val()+"!important}",i+=".customer-table-arrow a { color: "+$("#hdnButtonBackColor").val()+"!important}",i+=".loader-imgNew { border-right-color: "+n+"!important}",i+=".loader-imgNew { border-top-color: "+n+"!important}",i+=".loader-imgNew { border-bottom-color: "+n+"!important}",i+=".loader-imgNew { border-left-color: "+$("#hdnButtonBackColor").val()+"!important}"}return i+=".framefullwidth { width:100%!important;}"},_getOnlineStyle:function(){if(""==$("#hdnFontColor").val()&&""==$("#hdnTabBackgroundColor").val()&&""==$("#hdnContentHeaderFontColor").val())return"";var e="",t=void 0!==$("#hdnFontColor").val()?$("#hdnFontColor").val():"#333",i=void 0!==$("#hdnTabBackgroundColor").val()?$("#hdnTabBackgroundColor").val():"#fff",n=void 0!==$("#hdnContentHeaderFontColor").val()?$("#hdnContentHeaderFontColor").val():"#cdcdcd";return e+=".frm-form-title, .frm-input-title, .customredio-box-singal-type2 label, .signature-content, .frm-form-text.heading, .frm-form-text,.customcheck-box-singal-black label, .customcheck-box-singal label,.frm-img-caption { color: "+t+"; font-family: "+(void 0!==$("#hdnContentFontName").val()?$("#hdnContentFontName").val():'"proxima-nova",sans-serif!important"')+";}",e+=".title-line { border-color: "+t+";}",e+=".whiitebg body, .whiitebg  {background-color: "+i+"!important;}",e+=".ratting-common a { background-color: #fff; border-color: "+n+";}",e+=".ratting-common a.active, .ratting-common a:after, .ratting-common a:hover {border-color: "+n+";}",e+=".ratting-common a:hover:after, .ratting-common a.active:after {background:"+n+";}"}},onFormsDownCallback=function(e){var t="";if(void 0!==e&&void 0!==e.data&&null!=e.data&&void 0!==e.data.Message&&""!==e.data.Message){t=e.data.Message+""}else t=void 0!==e&&void 0!==e.Message&&null!=e.Message&&""!==e.Message?e.Message:"Some error occured, Please try again!.";swal({title:"",text:t,html:!0,showCancelButton:!1,customClass:"sweet-alert-model",animation:"slide-from-bottom"},function(e){return window.location.href=window.location.href,!1})},onsetParentDivHeightCallback=function(e){($("body,html").hasClass("Popup_Widget")||$("body,html").hasClass("Newtab_Widget"))&&$("#mobile-check").is(":visible")?($(vuiForms.frame).find("iframe").css("height",$("body").height()+"px"),$(vuiForms.frame).find("iframe").parent().css("height",$("body").height()+"px"),$("html,body").addClass("overflow-hidden-remove")):$("body,html").hasClass("Embedded_Widget")&&$("#mobile-check").is(":visible")&&($(vuiForms.frame).find("iframe").css("height",screen.height+"px"),$(vuiForms.frame).find("iframe").parent().css("height",screen.height+"px"),$("html,body").addClass("overflow-hidden-remove"))},onsetToScrollPositionCallback=function(e){($("body,html").hasClass("Popup_Widget")||$("body,html").hasClass("Newtab_Widget"))&&$("#mobile-check").is(":visible")?($("html,body").removeClass("overflow-hidden-remove"),setTimeout(function(){$("html,body").animate({scrollTop:e.position},400)},250)):$("body,html").hasClass("Embedded_Widget")&&$("#mobile-check").is(":visible")&&setTimeout(function(){parent.$("html,body").animate({scrollTop:e.position},400)},250)},onsetToFormScrollPositionCallBack=function(e){setTimeout(function(){"undefined"!=typeof _employeeOwner&&1==$(_employeeOwner.control.aformstatus).is(":visible")&&1==_employeeOwner.model.IsRentContract?$(".settingMainWarp").animate({scrollTop:e.position+626},500):parent.$("html,body").animate({scrollTop:e.position},400)},0)},onloadTutorialCallback=function(){return ShowDynamicPopupForShopOwner("/DynamicPopupPages/Videos.aspx",402,765,"divVideos","Play Video","ShowVideoBoxAlways",""),!1},onloadVagaroDriveCallback=function(){return ShowDynamicPopupForShopOwner("/ShopOwner/VagaroDrivePopup.aspx?RequestFrom=uploadForms",700,1050,"divVagaroDrive","Vagaro Drive","showVagaroDrive","","Vagarodrivepopup"),!1},onOpenManageMerchantAccountDialogCallBack=function(){window.open("/merchants/settings/premiumfeature/creditcardprocessing","_blank")},ongetCCDetailsFromVagaroCallBack=function(e){if(null!=ZenSwipeCardDetails&&"undefined"!=typeof ZenSwipeCardDetails&&""!=ZenSwipeCardDetails)ZenSwipeCardDetails.UserID=e.UserID,vuiForms.frame.forms.sendCCDetailsToForms(ZenSwipeCardDetails);else{var t=JSON.parse('{"UserID" : "'+e.UserID+'","eventType": ""}');vuiForms.frame.forms.sendCCDetailsToForms(t)}},onloadReactiveVagaroDrivePopupCallback=function(){return ShowDynamicPopupForShopOwner("/ShopOwner/VagaroDriveReactivePopup.aspx?RequestFrom=uploadForms",175,600,"divReactiveVagaroDrivePopup","Vagaro Drive ReActivated","showReactiveVagaroDrive","","Vagarodrivepopup"),!1},onloadVagaroDriveRequiredCallback=function(){swal({title:"",text:"Uploading Files to Forms requires Vagaro Drive. Would you like to activate Vagaro Drive?",customClass:"sweet-alert-model",animation:"slide-from-bottom",confirmButtonText:"Activate Vagaro Drive"},function(e){1==e?top.location=window.location.origin+"/merchants/settings/premiumfeature/drive":$("#SelectForm").val("0").trigger("change"),swal.close()}),$(".gencustom-head .gencutom-title").text("Vagaro Drive Required")},_callBackToCheckInApp=function(e){null!=window.JSInterface&&window.JSInterface.CallWSMethod(e)},onGetSizeCallback=function(e){},onGetFormRespIframeDataCallback=function(e){var t="";void 0!==e.message&&null!=e.message&&(t=e.message);var i={formId:t},n=new vagaro.ajax;n.datamodel.Token="GetFormRespIframeData",n.datamodel.data=i,n.datamodel.callback=function(e){vuiForms.frame.forms.submitFormRespIframeData(e)},n.datamodel.Error=function(e){this.loader(!1)},n.Post()},onReloadIframeParentPageCallback=function(e){window.location.reload(!0)},onDisplayLoadingCallbackForms=function(e){vuiForms.displayLoading()},onHideLoadingCallbackForms=function(e){vuiForms.hideLoading()},SavebuttonNameCallbackForms=function(e){vuiForms.ChangeSaveButtonName(e)},onResetReponseFrameCallback=function(){$("#SelectForm").val("0"),$("#divFilledFormsIframe").hide(),_custForm.getResponseList()},ongetServicesandClassCallback=function(e){BindServices(e.businessID)},BindServices=function(e){var t=[],i={};i.BusinessID=e,i.IncludePackage=0,i.loadClass=null;var n=new vagaro.ajax;n.datamodel.Token="GetALLActiveServicesAndClassForForms",n.datamodel.data=i,n.datamodel.callback=function(e){t=e,vuiForms.frame.forms.responseServiceAndClass(t)},n.datamodel.Error=function(e){t=null},n.Post()},ongetMembershipsCallback=function(e){BindMemberships(e.businessID)},BindMemberships=function(e){var t=[],i={};i.BusinessID=e,i.Type=1;var n=new vagaro.ajax;n.datamodel.Token="GetAllActiveMembershipForForms",n.datamodel.data=i,n.datamodel.callback=function(e){t=e,vuiForms.frame.forms.responseMembership(t)},n.datamodel.Error=function(e){t=null},n.Post()},ongetBusinessTypelistCallback=function(e){getBusinessTypelist(e.businessId)},ongetAccessRightsCallback=function(){"undefined"!=typeof _custForm&&_custForm.ongetAccessRightsCallback()},onEditFormResponseCallback=function(e){_custForm.editFormResponse(e.respId,e.respPageUrl,e.formId,e.isEdit)},onNewEditFormResponseCallback=function(e){_custForm.newEditFormResponse(e)},onGetStateDetailByNameCallback=function(e){if(null!=e.message){var t={objParam:{BusinessID:""==$("#hdnBusinessID").val()?0:$("#hdnBusinessID").val(),LoginUserId:$("#hdnLoginUserID").val(),CountryID:e.message.CountryID,StateName:e.message.StateName}};formsAjax("GetStateDetailByName",t,getStateDetailByNameSuccess,getStateDetailByNameFailed,!1,!0)}},getStateDetailByNameSuccess=function(e){vuiForms.frame.forms.sendStateDetail(e)},getStateDetailByNameFailed=function(e){console.log(e)},onGetCityByZipCodeCallback=function(e){if(null!=e.message){var t={objParam:{BusinessID:""==$("#hdnBusinessID").val()?0:$("#hdnBusinessID").val(),LoginUserId:$("#hdnLoginUserID").val(),CountryID:e.message.CountryID,strZipCode:e.message.strZipCode}};formsAjax("GetCityByZipCode",t,getCityByZipCodeCallSuccess,getCityByZipCodeCallFailed,!1,!0)}},onDateRangePickerSetUpCallback=function(e){var t=e.message;if($(window).scrollTop(t.position),$("body,html").hasClass("Embedded_Widget")&&$("#mobile-check").length>0&&$("#mobile-check").is(":visible")){var i=t.position;try{parent.$("html,body").animate({scrollTop:i},400)}catch(e){"undefined"!=typeof $Interframe&&void 0!==$Interframe.setWidgetScroll?$Interframe.setWidgetScroll(i):$("html,body").animate({scrollTop:i},400)}}},getCityByZipCodeCallSuccess=function(e){vuiForms.frame.forms.sendCityByZipCode(e)},getCityByZipCodeCallFailed=function(e){console.log(e)};var formsAjax=function(e,t,i,n,o,a){var s=new vagaro.ajax;s.datamodel.Token=e,s.datamodel.data=t,s.datamodel.callback=i,s.datamodel.Error=n,0==a&&(s.datamodel.async=!1),1==o?s.PostQue():s.Post()};function setFormPageHeight(){"undefined"!=typeof iframe_type&&(1==iframe_type?1==$(".navigation-bg").is(":visible")?vuiForms.setHeight($(window).height()-$(".navigation-bg").height(),"100%"):vuiForms.setHeight($(window).height(),"100%"):2!=iframe_type&&4!=iframe_type||vuiForms.setHeight($(window).height()-$(".headerFix").height(),"100%"))}function successHEICtoJPG(e){navigator.userAgent.toLowerCase().indexOf("safari")<0&&(navigator.userAgent.toLowerCase().indexOf("iphone")>-1||navigator.userAgent.toLowerCase().indexOf("ipad")>-1)&&(e=unescape(e));var t=JSON.parse(e);t.eventType="heicSucessResponseFromVagaro",vuiForms.frame.forms.heicSucessResponseFromVagaro(t)}function onsetDatePickerDivCallback(){var e=document.querySelector(".formsbutton-row");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function onSetDatePickerScrollFromVagaroCallBack(e){var t=0;($("body,html").hasClass("Popup_Widget")||$("body,html").hasClass("Newtab_Widget")||$("body,html").hasClass("Embedded_Widget"))&&$("#mobile-check").length>0&&$("#mobile-check").is(":visible")?setTimeout(function(){t=e;try{parent.$("html,body").animate({scrollTop:t},400)}catch(e){"undefined"!=typeof $Interframe&&void 0!==$Interframe.setWidgetScroll?$Interframe.setWidgetScroll(t):$("html,body").animate({scrollTop:t},400)}},350):(t=e,window.parent.scrollTo(0,t>0?t:0))}function onsetFormTitleCallback(e){_onlineCheckout.FormTitle=e}ongetLoginUserDetailsCallback=function(){"undefined"!=typeof _custForm&&_custForm.sendUseDetailsToForm()},onShowMessageCallback=function(e){alertToastMsg(e.message,e.type)},$(window).on("resize",function(){setTimeout(function(){setFormPageHeight()},500)}),$(window).bind("orientationchange",function(e){setTimeout(function(){setFormPageHeight()},1e3)}),$(".settingMainWarp").on("touchend",function(e){null!=vuiForms.frame&&vuiForms.frame.forms.getHeight(),setTimeout(function(){setFormPageHeight()},1e3)}),$(".settingMainWarp").on("touchstart",function(e){null!=vuiForms.frame&&vuiForms.frame.forms.getHeight(),setTimeout(function(){setFormPageHeight()},1e3)});ApiPath="websiteapi/homepage/";activetabtype=1;var FMBPercentage,dailyDealFeeValue,dailyDealFeeValue_ExistingUser,dailyDealFeeType,IsForVeraNewCustomer,cartDailyDealFee,dailydeal_CCOFF_Depositper,totalDepositWhenDepositLessDDFee,frmcontainer,onlineVPLCheckout=0,isGCAppliedForClass=!1,tipType="percentage",ischkFirstTimeCustomerCart=null,dailydealFee=0,totalDailyDealFee=0,totalOriginalPrice=0,IsDailyDealFeeCCOFF=!1,totalDailyDealFeeOfAllCart_PMGCA=0,isPromotionApplied=!1,ApiURLEnumOnlineCheckout={removecartitem:ApiPath+"removecartitem",classaddtocart:ApiPath+"classaddtocart",getgcpackageandpointforonlinecheckout:ApiPath+"getgcpackageandpointforonlinecheckout",getclasscancellationpolicy:ApiPath+"getclasscancellationpolicy",getreturnpolicy:ApiPath+"getreturnpolicy",getcitybyzipcode:ApiPath+"getcitybyzipcode",validatepromocodeandgetdetails:ApiPath+"validatepromocodeandgetdetails",updatemutiplecartitem:ApiPath+"updatemutiplecartitem",getonlinecheckouttipsetting:ApiPath+"getonlinecheckouttipsetting",updateeventsessionattendees:ApiPath+"updateeventsessionattendees",getonlineinvoicebusinessuserdetailsbyinvoiceid:ApiPath+"getonlineinvoicebusinessuserdetailsbyinvoiceid",removecheckoutitem:ApiPath+"removecheckoutitem",getcartcount:ApiPath+"getcartcount",getstatesbymultiplecountryid:ApiPath+"getstatesbymultiplecountryid",getappointmentcancellationpolicy:ApiPath+"getappointmentcancellationpolicy",getbusinesshourslist:ApiPath+"getbusinesshourslist",getuserccdetailsbyonlyuserid:ApiPath+"getuserccdetailsbyonlyuserid",giftcertificateaddtocart:ApiPath+"giftcertificateaddtocart",serviceaddtocart:ApiPath+"serviceaddtocart",checkuserexistsbyuserid:ApiPath+"checkuserexistsbyuserid",getformbyserviceids:ApiPath+"getformbyserviceids",insertusersatformload:ApiPath+"insertusersatformload",getformsbyids:ApiPath+"getformsbyids",validateshoppingcartdata:ApiPath+"validateshoppingcartdata",saveuserccdetails:ApiPath+"saveuserccdetails",geteventtimezonedate:ApiPath+"geteventtimezonedate",getState:"myaccount/getstatesbymultiplecountryid",getStateCode:"myaccount/getcitybyzipcodewithstatecode",getuservplaccountdetail:"myaccount/getuservplaccounts",gcpromocodelimt:"myaccount/gcpromocodelimt",getgcpromocodelimt:"myaccount/getgcpromocodelimt"},CartItemTypeEnumOnlineCheckout={Membership:"7",Package:"5",Product:"2",GC:"3",Class:"8",Service:"1",ClassAddon:"20",VCFFee:"21"},_PackageMembership={Product:3,PartialProduct:21};function getLocationDatepickupinstrore(){if(null!=_onlineCheckout.minDate)return _onlineCheckout.minDate;var e=e=new Date,t=e.format("mm"),i=parseInt(parseInt(t)%30);return i>0&&(t=t-i+30,e.setMinutes(t)),e}function Converttimeformat(e){var t=e;t=(t=t.replace("AM"," AM")).replace("PM"," PM");var i=Number(t.match(/^(\d+)/)[1]),n=Number(t.match(/:(\d+)/)[1]),o=t.match(/\s(.*)$/)[1];"PM"==o&&i<12&&(i+=12),"AM"==o&&12==i&&(i-=12);var a=i.toString(),s=n.toString();return i<10&&(a="0"+a),n<10&&(s="0"+s),a}function ConverttimeformattoMiniut(e){var t=e;t=(t=t.replace("AM"," AM")).replace("PM"," PM");var i=Number(t.match(/^(\d+)/)[1]),n=Number(t.match(/:(\d+)/)[1]),o=t.match(/\s(.*)$/)[1];"PM"==o&&i<12&&(i+=12),"AM"==o&&12==i&&(i-=12);var a=i.toString(),s=n.toString();return i<10&&(a="0"+a),n<10&&(s="0"+s),s}function verifyaddresshideloadingCallback(){ShowLoader(!1)}function FormatPhoneByCountry(e,t){try{if(null!=e&&void 0!==e&&0!=e.length&&e.length>8){var i=e.replace(/\D/g,""),n={0:"(",3:") ",6:"-"};void 0!==t&&null!=t&&1*t>0&&(2==t&&10==i.length||4==t&&9==i.length)&&(i="0"+i),void 0!==t&&null!=t&&1*t>0&&(2==t?n={3:" ",7:" "}:3==t?n={3:"-",6:"-"}:4==t&&(n={0:"(",2:") ",6:" "})),e="";for(var o=0;o<i.length;o++)e+=(n[o]||"")+i[o]}return e}catch(t){return e}}function DisableFinalSubmitButton(e){return 1==e?($("#ancBuyNow").css("pointer-events","auto").removeClass("checkoutdisable"),!0):"none"!==$("#ancBuyNow").css("pointer-events")&&($("#ancBuyNow").css("pointer-events","none").addClass("checkoutdisable"),!0)}
/*!
 * Select2 4.0.0
 * https://select2.github.io
 *
 * Released under the MIT license
 * https://github.com/select2/select2/blob/master/LICENSE.md
 *Waitlist 2.0: Add for wailtlist. By Chandni Shah, 30/07/2018
 */function InfoBox(e){e=e||{},google.maps.OverlayView.apply(this,arguments),this.content_=e.content||"",this.disableAutoPan_=e.disableAutoPan||!1,this.maxWidth_=e.maxWidth||0,this.pixelOffset_=e.pixelOffset||new google.maps.Size(0,0),this.position_=e.position||new google.maps.LatLng(0,0),this.zIndex_=e.zIndex||null,this.boxClass_=e.boxClass||"infoBox",this.boxStyle_=e.boxStyle||{},this.closeBoxMargin_=e.closeBoxMargin||"2px",this.closeBoxURL_=e.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===e.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=e.infoBoxClearance||new google.maps.Size(1,1),void 0===e.visible&&(e.visible=void 0===e.isHidden||!e.isHidden),this.isHidden_=!e.visible,this.alignBottom_=e.alignBottom||!1,this.pane_=e.pane||"floatPane",this.enableEventPropagation_=e.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}function isMobileDevice(){return/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent)}function isJsonString(e){try{JSON.parse(e)}catch(e){return!1}return!0}function MyAccountlistener(e){if(null!=e&&"undefined"!=e&&null!=e.data&&"undefined"!=e.data&&isJsonString(e.data||e.originalEvent.data)){var t=JSON.parse(e.data||e.originalEvent.data);if("setMyAccountIframeHeight"===t.eventType)if(void 0!==t.height&&null!=t.height){var i=window.screen.availHeight;window.matchMedia("(max-width: 991px)").matches||(i<820&&(i=820),t.height<i&&(t.height=820)),$(".vagaro-iframe iframe").length>0&&($(".vagaro-iframe iframe")[0].style.cssText="height:"+t.height+"px!important;min-height:"+i+"px !important")}}}_onlineCheckout={},_HighRiskEmailCheck={},function(e,t,n){var o;_onlineCheckout.IsRecurringPkg="",_onlineCheckout.IsRecurringMembership=!1,_onlineCheckout.IsRecurringMembershipCount=0,_onlineCheckout.IsRecurringPkgCount=0,_onlineCheckout.PrintType={Receipt:1,GC:2},_onlineCheckout.Empty="",_onlineCheckout.StatesList=[],_onlineCheckout.selectedCountryId=1,_onlineCheckout.popupStateList={},_onlineCheckout.selectedAddressData={},_onlineCheckout.ccCardOnFile=null,_onlineCheckout.BusSavedCard=null,_onlineCheckout.isCCConfirmationfrompage="",_onlineCheckout.zenSwipeCardDetails=null,_onlineCheckout.isCheckoutCCChanged=!1,_onlineCheckout.isUpdateItemQty=!1,_onlineCheckout.isUpdateAddonsItemQty=!1,_onlineCheckout.isShowClassPolicePopup=!0,_onlineCheckout.isShowProductPolicePopup=!0,_onlineCheckout.formsResponse=[],_onlineCheckout.currentresponse=[],_onlineCheckout.isConsiderForms=!1,_onlineCheckout.isFormsDirectClass=!1,_onlineCheckout.isFormsbookwithcc=!1,_onlineCheckout.isFormsbookwithoutcc=!1,_onlineCheckout.formId="",_onlineCheckout.loadNewCCandShip=!1,_onlineCheckout.IsThisNewCustomer=!1,_onlineCheckout.isFromInvoice=!1,_onlineCheckout.InvoiceID=0,_onlineCheckout.businessWorkinghour=[],_onlineCheckout.GCVoidMsg="This gift card has been voided and can no longer be used.",_onlineCheckout.GCExpMsg="This gift card has expired and can no longer be used.",_onlineCheckout.GCBalMsg="There is no balance available in the gift card you have selected.",_onlineCheckout.GCQuantityMsg="There is no quantity available in the gift card you have selected.",_onlineCheckout.GCOtherMsg="The gift card you have selected belongs to other service and can not be used here.",_onlineCheckout.IsValidatedOnePerUser=!1,_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount=null,_onlineCheckout.lstUserListForCheckout_ShowDiscount=null,_onlineCheckout.lstMembershipForCheckout_ShowDiscount=null,_onlineCheckout.IsPromotionEnable_ShowDiscount=!1,_onlineCheckout.GcAndPackagesForCheckout_ShowDiscount=null,_onlineCheckout.UserListForCheckout_ShowDiscount=null,_onlineCheckout.MembershipForCheckout_ShowDiscount=null,_onlineCheckout.RelationshipsArr=null,_onlineCheckout.ChildAge="",_onlineCheckout.FamilyAndFriendsDetails=null,_onlineCheckout.SelectedFamilyFriendsCount=null,_onlineCheckout.MaxNoFamilyFriends=null,_onlineCheckout.SelectedFamilyFriendsArr=null,_onlineCheckout.PackageSharingDetail=null,_onlineCheckout.currentTime=null,_onlineCheckout.minDate=null,_onlineCheckout.objMin=null,_onlineCheckout.objMax=null,_onlineCheckout.objChecktime=0,_onlineCheckout.FormsResponseID=null,_onlineCheckout.isFillCCDetailsForms="0",_onlineCheckout.CardNotPresentMessage="This account is restricted to online gift cards only",_onlineCheckout.TotalPaidCount=0,_onlineCheckout.TipApplyCounter=0,_onlineCheckout.TipAppliedSum=0,_onlineCheckout.ShoppingCartStep=0,_onlineCheckout.DateFormatdddMMMDDYYYY="ddd, MMM DD, YYYY",_onlineCheckout.DateFormatdddMMM_ddYYYY="ddd, MMM dd, YYYY",_onlineCheckout.IsVplChanged=!1,_onlineCheckout.isCheckoutVPLChanged=!1,_onlineCheckout.isCheckoutVPLPromocode=!1,_onlineCheckout.totalfinalAmount=0,_onlineCheckout.totalFinalDiscount=0,_onlineCheckout.VPLCheckoutData={},_onlineCheckout.customerEnroll={},_onlineCheckout.VplSelectedBank={},_onlineCheckout.isClassCheckout=!1,_onlineCheckout.isCalShippingCharge=!1,_onlineCheckout.CountryID=1,_onlineCheckout.IsVPLAddress=0,_onlineCheckout.CustomerDetails={},_onlineCheckout.IsBuyGC=!1,_onlineCheckout.IsPartialPointAllowed=!1,_onlineCheckout.isFormResponseSubmittedCalled=!1,_onlineCheckout.FormCallSource=!1,_onlineCheckout.invoiceStatus={Draft:1,Sent:2,Paid:3,Overdue:4,Void:5},_onlineCheckout.CheckoutBarcodeCodePrepayOnline={srvc:"srvc",GC:"GC",Pkg:"Pkg",IOU:"IOU",MS:"MS",CLS:"CLS",srvcGC:"SrvcGC",Fee:"FEE",Point:"point",dailyDealFee:"dailyDealFee"},_onlineCheckout.ItemType={Other:1,Class:8},_onlineCheckout.CodeType={GCCode:"CheckGCNumber",PromoCode:"CheckPromoNumber"},_onlineCheckout.PromoCodeType={GCCode:1,PromoCode:2},_onlineCheckout.PaymentOptionText={TextPkg:"Use Package Visit - ",TextMS:"Use Membership Visit - ",TextGC:"Use Gift Card - ",TextPoint:"Points Balance - "},_onlineCheckout.Controls={TmplBookingPaymentOption:"#BookingPaymentOption",DivPaymentOption:"#divPaymentOption",DvcheckoutBookingTabs:"#dvcheckoutBookingTabs",PaymentOptionMsPkgPoint:".payment-option-mspkgpoint",tabGooglePay:"#tabGooglePay",tabApplePay:"#tabApplePay",keyGooglePay:"tabGooglePay",keyApplePay:"tabApplePay"},_onlineCheckout.Model={IsPaymentOption:!1},_onlineCheckout.CssClass={ActiveTab:"w--current"},_onlineCheckout.AuthoriseListData=[],_onlineCheckout.AuthorisePaymnetCount=0,_onlineCheckout.IsUpSellMemPkgAdd=0,_onlineCheckout.IsPkgAdded=!1,_onlineCheckout.arrpaidType={UnPaid:0,Paid:1,Deposits:2,PartiallyPaid:3,PaidClass:4,DepositsClass:5,PartiallyPaidClass:6,OfflineDeposit:7,OfflineDepositPrepay:8},_onlineCheckout.arrPaymentTitleType={Default:"Payment Information",Select:"Select Payment Method",Deposits:"This Business Requires a Deposit:",HoldOnCard:"Credit Card Required to Secure Your Reservation"},_onlineCheckout.VPLTwoFactor={None:0,Email:1,Cell:2,EmailAndCell:3},_onlineCheckout.ApplyVCFLocation={OnLoad:1,ApplyTip:2,ApplyPromoCode:3,RemovePromoCode:4,RemoveDiscount:5,ShippingMethod:6,ApplyGC:7,CCSelection:8,MembershipUpSell:9,PackageUpSell:10,RemoveUpSell:11},_onlineCheckout.FormTitle="",_onlineCheckout.VPLTwoFactorStatus=0,_onlineCheckout.applePaySession=null,_onlineCheckout.resetGlobalVeriable=function(){_onlineCheckout.ccCardOnFile=null,_onlineCheckout.isCCConfirmationfrompage="",_onlineCheckout.zenSwipeCardDetails=null,_onlineCheckout.isCheckoutCCChanged=!1,_onlineCheckout.isUpdateItemQty=!1,_onlineCheckout.businessWorkinghour=[],_onlineCheckout.isShowClassPolicePopup=!0,_onlineCheckout.isShowProductPolicePopup=!0,_onlineCheckout.IsThisNewCustomer=!1,"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("#mobileCart").hide(),"1"!=getCookie("EventType")&&"8"!=getCookie("EventType")&&"5"!=getCookie("EventType")&&void 0!==clearCookie&&null!=clearCookie&&clearCookie("UniqueCreateLink")},_onlineCheckout.loadPage=function(){if(_onlineCheckout.IsPartialPointAllowed="undefined"!=typeof _IsPartialPointAllowed&&_IsPartialPointAllowed,_onlineCheckout.isFromInvoice="undefined"!=typeof sIsFromInvoice&&sIsFromInvoice,_onlineCheckout.isValidForCheckoutInvoice()?(null!=onlineShoppingCart.invoiceDetails&&1!=onlineShoppingCart.invoiceDetails.CountryID&&(currencysymbol=onlineShoppingCart.invoiceDetails.CurrencySymbol),CommonFromPage="Invoice",e("#shoppingcartfirst").hide()):e("#shoppingcartfirst").show(),e("#divHeaderBusinessName").attr("tabindex",-1).focus(),_onlineCheckout.resetGlobalVeriable(),_onlineCheckout.checkIfProductExists(),_onlineCheckout.initWebFlowtab(),_onlineCheckout.calculateSubTotalForFirstStep(),_onlineCheckout.errorMessage(),_onlineCheckout.ImgLazyLoad(),_onlineCheckout.isValidForCheckoutInvoice()?(_onlineCheckout.InvoiceID=sInvoiceID,e("#divshippinginfo").hide(),"True"==e("#hdnIsFormsEnable").val()?_onlineCheckout.UpdateMutipleCartItem(null,!1,!0):_onlineCheckout.UpdateMutipleCartItem(null,!1,!1)):_onlineCheckout.InvoiceID=0,_onlineCheckout.CheckCustomerExists(),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.each(onlineShoppingCart.Memberships,function(t,i){var n=e(".product-div-shopping-col[data-type='membership']").eq(t);"true"!=_onlineCheckout.isFromInvoice.toString().toLowerCase()&&i.MaxNoFamilyFriends>0?(0==e("#divMemberChipsForMS").children().length&&(_onlineCheckout.ResetPkgMembershipVariable(),_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(2)),n.find(".scffsharing").show()):n.find(".scffsharing").hide()}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){var t=!1;e.each(onlineShoppingCart.Packages,function(i,n){"true"!=_onlineCheckout.isFromInvoice.toString().toLowerCase()&&n.MaxNoFamilyFriends>0?0==e("#"+n.ServiceId+"_"+n.autoId).children().length&&(t||(_onlineCheckout.PackageSharingDetail=null,t=!0),_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(1)):e("#"+n.ServiceId+"_"+n.autoId).closest(".scffsharing").empty()})}},_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS=function(t){if(null==_onlineCheckout.FamilyAndFriendsDetails){var i=new vagaro.ajax;i.datamodel.Token="GetFamilyAndFriendsDetailsByUserID",i.datamodel.data={objRequest:{businessID:businessID,loginUserID:UserID,UserID:UserID,IsLoadFromOffline:!0,strLoginUserId:strUserID,parentPage:"OnlineShoppingCart"}},i.datamodel.callback=function(i){null!=i&&(_onlineCheckout.FamilyAndFriendsDetails=i,1==t?e.each(onlineShoppingCart.Packages,function(t,i){e("#"+i.ServiceId+"_"+i.autoId).empty(),_onlineCheckout.BindFamilyChipsForPkgMS(i,1)}):4==t?void 0!==_shopdetail.BookingDetail.MembershipUpSellData&&null!=_shopdetail.BookingDetail.MembershipUpSellData&&_shopdetail.BookingDetail.MembershipUpSellData.length>0&&(_onlineCheckout.RelationshipsArr=_shopdetail.BookingDetail.MembershipUpSellData[0].Relationships.split(","),_onlineCheckout.ChildAge=_shopdetail.BookingDetail.MembershipUpSellData[0].ChildAge,_onlineCheckout.MaxNoFamilyFriends=_shopdetail.BookingDetail.MembershipUpSellData[0].MaxNoFamilyFriends,_onlineCheckout.BindFamilyChipsForPkgMS(null,4)):5==t?void 0!==_shopdetail.BookingDetail.PackageUpSellData&&null!=_shopdetail.BookingDetail.PackageUpSellData&&_shopdetail.BookingDetail.PackageUpSellData.length>0&&e.each(_shopdetail.BookingDetail.PackageUpSellData,function(t,i){e("#"+i.ServiceId+"_"+i.autoId).empty(),_onlineCheckout.BindFamilyChipsForPkgMS(i,5)}):e.each(onlineShoppingCart.Memberships,function(e,t){_onlineCheckout.BindFamilyChipsForPkgMS(t,2)}))},i.datamodel.Error=function(e){},i.Post()}else 1==t?e.each(onlineShoppingCart.Packages,function(t,i){e("#"+i.ServiceId+"_"+i.autoId).empty(),_onlineCheckout.BindFamilyChipsForPkgMS(i,1)}):4==t?void 0!==_shopdetail.BookingDetail.MembershipUpSellData&&null!=_shopdetail.BookingDetail.MembershipUpSellData&&_shopdetail.BookingDetail.MembershipUpSellData.length>0&&(_onlineCheckout.RelationshipsArr=_shopdetail.BookingDetail.MembershipUpSellData[0].Relationships.split(","),_onlineCheckout.ChildAge=_shopdetail.BookingDetail.MembershipUpSellData[0].ChildAge,_onlineCheckout.MaxNoFamilyFriends=_shopdetail.BookingDetail.MembershipUpSellData[0].MaxNoFamilyFriends,_onlineCheckout.BindFamilyChipsForPkgMS(null,4)):5==t?void 0!==_shopdetail.BookingDetail.PackageUpSellData&&null!=_shopdetail.BookingDetail.PackageUpSellData&&_shopdetail.BookingDetail.PackageUpSellData.length>0&&e.each(_shopdetail.BookingDetail.PackageUpSellData,function(e,t){_onlineCheckout.BindFamilyChipsForPkgMS(t,5)}):e.each(onlineShoppingCart.Memberships,function(e,t){_onlineCheckout.BindFamilyChipsForPkgMS(t,2)})},_onlineCheckout.BindFamilyChipsForPkgMS=function(t,i){if(1==i||5==i){var n,o=0,a=null,s={};void 0!==t.Relationships&&null!=t.Relationships&&(n=t.Relationships.split(","));var r=t.ChildAge,l=t.MaxNoFamilyFriends;if(s.MaxNoFamilyFriends=l,s.ServiceId=t.ServiceId,s.autoId=t.autoId,null!=n&&null!=_onlineCheckout.FamilyAndFriendsDetails){e.grep(n,function(n){e.grep(_onlineCheckout.FamilyAndFriendsDetails,function(s){if(s.Relation==n){var c=!1;if("Child"==s.Relation){var d=r.split("-");(-1==s.Age&&d[1]>18||s.Age>=d[0]&&s.Age<=d[1])&&(c=!0)}else c=!0;if(c){var u=!1;l>o&&(o+=1,null==a&&(a=[]),a.push(s.UserID),u=!0);var p="#"+t.ServiceId+"_"+t.autoId;5==i&&(e("#scffsharingPkg").show(),p="#divMemberChipsForPKG"),u?e(p).append('<a id="'+s.UserID+'" href="javascript:void(0)" role="link" aria-label="'+s.FullName+' selected" onclick="_onlineCheckout.AddRemoveFamilyFriendPkg('+s.UserID+","+t.autoId+","+t.ServiceId+",'"+s.FullName+"',"+i+');" class="tag shared-ff-chkout selected blue-button">'+s.FullName+"</a>"):e(p).append('<a id="'+s.UserID+'" href="javascript:void(0)" role="link" aria-label="'+s.FullName+' unselected" onclick="_onlineCheckout.AddRemoveFamilyFriendPkg('+s.UserID+","+t.autoId+","+t.ServiceId+",'"+s.FullName+"',"+i+');" class="tag shared-ff-chkout gray-button">'+s.FullName+"</a>")}}}),5==i&&e("#scffsharingPkg").show()}),s.SelectedFamilyFriendsCountpkg=o,null!=a&&a.length>0&&(s.SelectedFamilyFriends=a.join(",")),null==_onlineCheckout.PackageSharingDetail&&(_onlineCheckout.PackageSharingDetail=[]);var c=!0;e.each(_onlineCheckout.PackageSharingDetail,function(e,t){t.ServiceId==s.ServiceId&&t.autoId==s.autoId&&(c=!1)}),c&&_onlineCheckout.PackageSharingDetail.push(s),(u=e.extend(!0,[],n))[u.indexOf("Child")]="Child (Age: "+r+")";var d=u.join(", ");e("#lblRelationshipsAndAgePkg"+t.ServiceId+t.autoId).text(d),5==i&&e("#lblRelationshipsAndAgePKG").text(d)}}else if(4==i){if(null!=_onlineCheckout.RelationshipsArr&&null!=_onlineCheckout.FamilyAndFriendsDetails){e.grep(_onlineCheckout.RelationshipsArr,function(t){e.grep(_onlineCheckout.FamilyAndFriendsDetails,function(i){if(i.Relation==t){var n=!1;if("Child"==i.Relation&&void 0!==_onlineCheckout.ChildAge&&null!=_onlineCheckout.ChildAge){var o=_onlineCheckout.ChildAge.split("-");(-1==i.Age&&o[1]>18||i.Age>=o[0]&&i.Age<=o[1])&&(n=!0)}else n=!0;if(n){var a=!1;_onlineCheckout.MaxNoFamilyFriends>_onlineCheckout.SelectedFamilyFriendsCount&&(_onlineCheckout.SelectedFamilyFriendsCount+=1,null==_onlineCheckout.SelectedFamilyFriendsArr&&(_onlineCheckout.SelectedFamilyFriendsArr=[]),_onlineCheckout.SelectedFamilyFriendsArr.push(i.UserID),a=!0),e("#scffsharingMS").show(),a?e("#divMemberChipsForMS").append('<a id="m'+i.UserID+'" href="javascript:void(0)" role="link" aria-label="'+i.FullName+' selected" onclick="_onlineCheckout.AddRemoveFamilyFriend('+i.UserID+",'m','"+i.FullName+'\');" class="tag shared-ff-chkout selected blue-button">'+i.FullName+"</a>"):e("#divMemberChipsForMS").append('<a id="m'+i.UserID+'" href="javascript:void(0)" role="link" aria-label="'+i.FullName+' unselected" onclick="_onlineCheckout.AddRemoveFamilyFriend('+i.UserID+",'m','"+i.FullName+'\'); " class="tag shared-ff-chkout blue-button">'+i.FullName+"</a>")}}})}),(u=e.extend(!0,[],_onlineCheckout.RelationshipsArr))[u.indexOf("Child")]="Child (Age: "+_onlineCheckout.ChildAge+")";d=u.join(", ");e("#lblRelationshipsAndAgeMS").text(d)}}else if(null!=_onlineCheckout.RelationshipsArr&&null!=_onlineCheckout.FamilyAndFriendsDetails){var u;e.grep(_onlineCheckout.RelationshipsArr,function(t){e.grep(_onlineCheckout.FamilyAndFriendsDetails,function(i){if(i.Relation==t){var n=!1;if("Child"==i.Relation&&void 0!==_onlineCheckout.ChildAge&&null!=_onlineCheckout.ChildAge){var o=_onlineCheckout.ChildAge.split("-");(-1==i.Age&&o[1]>18||i.Age>=o[0]&&i.Age<=o[1])&&(n=!0)}else n=!0;if(n){var a=!1;_onlineCheckout.MaxNoFamilyFriends>_onlineCheckout.SelectedFamilyFriendsCount&&(_onlineCheckout.SelectedFamilyFriendsCount+=1,null==_onlineCheckout.SelectedFamilyFriendsArr&&(_onlineCheckout.SelectedFamilyFriendsArr=[]),_onlineCheckout.SelectedFamilyFriendsArr.push(i.UserID),a=!0),a?e("#divMemberChipsForMS").append('<a id="m'+i.UserID+'" href="javascript:void(0)" role="link" aria-label="'+i.FullName+' selected" onclick="_onlineCheckout.AddRemoveFamilyFriend('+i.UserID+",'m','"+i.FullName+'\');" class="tag shared-ff-chkout selected blue-button">'+i.FullName+"</a>"):e("#divMemberChipsForMS").append('<a id="m'+i.UserID+'" href="javascript:void(0)" role="link" aria-label="'+i.FullName+' unselected" onclick="_onlineCheckout.AddRemoveFamilyFriend('+i.UserID+",'m','"+i.FullName+'\'); " class="tag shared-ff-chkout blue-button">'+i.FullName+"</a>")}}})}),(u=e.extend(!0,[],_onlineCheckout.RelationshipsArr))[u.indexOf("Child")]="Child (Age: "+_onlineCheckout.ChildAge+")";d=u.join(", ");e("#lblRelationshipsAndAgeMS").text(d)}},_onlineCheckout.ResetPkgMembershipVariable=function(){_onlineCheckout.RelationshipsArr=null,_onlineCheckout.ChildAge="",_onlineCheckout.FamilyAndFriendsDetails=null,_onlineCheckout.SelectedFamilyFriendsCount=null,_onlineCheckout.MaxNoFamilyFriends=null,_onlineCheckout.SelectedFamilyFriendsArr=null},_onlineCheckout.AddRemoveFamilyFriend=function(t,i,n){null==_onlineCheckout.SelectedFamilyFriendsArr&&(_onlineCheckout.SelectedFamilyFriendsArr=[]),_onlineCheckout.SelectedFamilyFriendsArr.includes(t)?(e("#"+i+t).attr("aria-label",n+" unselected"),_onlineCheckout.SelectedFamilyFriendsArr=e.grep(_onlineCheckout.SelectedFamilyFriendsArr,function(e){return e!=t}),_onlineCheckout.SelectedFamilyFriendsCount-=1,e("#"+i+t).toggleClass("selected"),e("#"+i+t).hasClass("selected")?(e("#"+i+t).removeClass("gray-button"),e("#"+i+t).addClass("blue-button")):(e("#"+i+t).addClass("gray-button"),e("#"+i+t).removeClass("blue-button"))):(e("#"+i+t).attr("aria-label",n+" selected"),_onlineCheckout.MaxNoFamilyFriends>_onlineCheckout.SelectedFamilyFriendsCount?(null==_onlineCheckout.SelectedFamilyFriendsArr&&(_onlineCheckout.SelectedFamilyFriendsArr=[]),_onlineCheckout.SelectedFamilyFriendsArr.push(t),_onlineCheckout.SelectedFamilyFriendsCount+=1,e("#"+i+t).toggleClass("selected"),e("#"+i+t).hasClass("selected")?(e("#"+i+t).removeClass("gray-button"),e("#"+i+t).addClass("blue-button")):(e("#"+i+t).addClass("gray-button"),e("#"+i+t).removeClass("blue-button"))):_common.PassiveAlertFailed("You have reached maximum number of family & friends."))},_onlineCheckout.AddRemoveFamilyFriendPkg=function(t,i,n,o,a){var s,r=e.grep(_onlineCheckout.PackageSharingDetail,function(e){return e.ServiceId==n&&e.autoId==i}),l=0,c=null,d="#"+n+"_"+i;5==a&&(d="#divMemberChipsForPKG"),null!=r[0].SelectedFamilyFriends&&(c=r[0].SelectedFamilyFriends.split(",")),l=r[0].SelectedFamilyFriendsCountpkg,s=r[0].MaxNoFamilyFriends,null==c&&(c=[]),c.includes(t.toString())?(e("#"+t).attr("aria-label",o+" unselected"),c=e.grep(c,function(e){return e!=t}),l-=1,e(d).find("#"+t).toggleClass("selected"),e(d).find("#"+t).hasClass("selected")?(e(d).find("#"+t).removeClass("gray-button"),e(d).find("#"+t).addClass("blue-button")):(e(d).find("#"+t).addClass("gray-button"),e(d).find("#"+t).removeClass("blue-button")),e.each(_onlineCheckout.PackageSharingDetail,function(e,t){t.ServiceId==n&&t.autoId==i&&(t.SelectedFamilyFriends=c.join(","),t.SelectedFamilyFriendsCountpkg=l)})):(e("#"+t).attr("aria-label",o+" selected"),s>l?(null==c&&(c=[]),c.push(t),l+=1,e(d).find("#"+t).toggleClass("selected"),e(d).find("#"+t).hasClass("selected")?(e(d).find("#"+t).removeClass("gray-button"),e(d).find("#"+t).addClass("blue-button")):(e(d).find("#"+t).addClass("gray-button"),e(d).find("#"+t).removeClass("blue-button")),e.each(_onlineCheckout.PackageSharingDetail,function(e,t){t.ServiceId==n&&t.autoId==i&&(t.SelectedFamilyFriends=c.join(","),t.SelectedFamilyFriendsCountpkg=l)})):_common.PassiveAlertFailed("You have reached maximum number of family & friends."))},_onlineCheckout.EnableDisableSharing=function(t,i,n){if(1==n||5==n){var o="#"+t+"_"+i;if(5==n&&(o="#divMemberChipsForPKG"),e(o).closest("#divsharedPkgwithFF").toggle(),!e(o+":checked").length>0)e(o).attr("checked",!1),e(o).next().attr("aria-checked",!1),e.each(_onlineCheckout.PackageSharingDetail,function(e,o){(o.ServiceId==t&&o.autoId==i||5==n)&&(o.SelectedFamilyFriends=null,o.SelectedFamilyFriendsCountpkg=0)});else{var a=[];e(o+" .selected").map(function(e){a.push(this.id)}),e(o).attr("checked",!0),e(o).next().attr("aria-checked",!0),e.each(_onlineCheckout.PackageSharingDetail,function(e,n){n.ServiceId==t&&n.autoId==i&&(n.SelectedFamilyFriends=a.join(),n.SelectedFamilyFriendsCountpkg=a.length)})}}else if(t>0&&2==n){var s="#FFFriends_"+t,r="#divsharedMSwithFF_"+t,l="#divMemberChipsForMS_"+t;if(!e(s).length)return;if(e(r).toggle(e(s).is(":checked")),e(s).is(":checked")){e(s).prop("checked",!0).next().attr("aria-checked",!0);a=[];e(l+" .selected").each(function(){var e=this.id.substring(1);a.push(Number(e))}),_onlineCheckout.SelectedFamilyFriendsArr=a}else e(s).prop("checked",!1).next().attr("aria-checked",!1),_onlineCheckout.SelectedFamilyFriendsArr=null}else if(e("#divsharedMSwithFF").toggle(),!e("#FFFriends:checked").length>0)e("#FFFriends").attr("checked",!1),e("#FFFriends").next().attr("aria-checked",!1),_onlineCheckout.SelectedFamilyFriendsArr=null;else{a=[];e("#FFFriends").attr("checked",!0),e("#FFFriends").next().attr("aria-checked",!0),e("#divMemberChipsForMS .selected").map(function(e){var t=this.id.substring(1);a.push(Number(t))}),_onlineCheckout.SelectedFamilyFriendsArr=a}e("#chk"+t+i).focus()},_onlineCheckout.CheckCustomerExists=function(){var e=new vagaro.ajax;e.datamodel.async=!1,e.datamodel.Token=ApiURLEnumOnlineCheckout.checkuserexistsbyuserid,e.datamodel.data={loginUserID:UserID,businessID:businessID},e.datamodel.IsNewVagaroAPI=!0,e.datamodel.callback=function(e){_onlineCheckout.IsThisNewCustomer=1!=e,_onlineCheckout.errorMessage()},e.datamodel.Error=function(e){},e.Post()},_onlineCheckout.ImgLazyLoad=function(){setTimeout(function(){e(".lazy").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"https://vagaro.azureedge.net/static-content/Images/no-shop-image-big-new.gif"}).trigger("lazyload")},500)},_onlineCheckout.initWebFlowtab=function(){Webflow.destroy(),Webflow.ready()},_onlineCheckout.cartItemQtyDown=function(t){var i=e(t),n=i.closest(".item-quantitychange").find(".itemqtyinput"),o=n.val(),a=parseInt(n.attr("data-min"));e(t).closest(".product-div-shopping-col").attr("data-rid");if(o>=a+1){var s=parseInt(o)-1;i.closest(".item-quantitychange").find(".itemqtyinput").val(s)}o!=a&&_onlineCheckout.updateCartItem(t)},_onlineCheckout.cartItemQtyUp=function(t){var i=e(t),n=i.closest(".item-quantitychange").find(".itemqtyinput"),o=n.val(),a=parseInt(n.attr("data-max"));e(t).closest(".product-div-shopping-col").attr("data-rid");if(o<a){var s=parseInt(o)+1;i.closest(".item-quantitychange").find(".itemqtyinput").val(s)}o!=a&&_onlineCheckout.updateCartItem(t)},_onlineCheckout.VisibleControlLength=function(t){return e(t).filter(function(){return"none"!==e(this).css("display")}).length},_onlineCheckout.continueShoping=function(){try{var t=document.activeElement.id;if("undefined"!=t&&"ancCheckoutSuccess"==t&&"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&void 0!==_siteBuilderDetail.UserLocationInfo.RedirectAfterBooking&&null!=_siteBuilderDetail.UserLocationInfo.RedirectAfterBooking&&""!=_siteBuilderDetail.UserLocationInfo.RedirectAfterBooking){var i=_siteBuilderDetail.UserLocationInfo.RedirectAfterBooking;i.startsWith("http://")||i.startsWith("https://")||(i="https://"+i),window.top.location.href=i}else{if(1==IsWebsiteBuilderCommunication)return e(".shopping-bag-items .cartremoverdtl").length>0?void wbc._postMessage('{"eventType": "KeepShopping"}'):void wbc._postMessage('{"eventType": "WBBusinessDetailPage"}');if(0==isCheckInApp){if("true"==IsClassReschedule.toLowerCase())return void swal({html:!0,title:"Your class reschedule detail will be lost Are you sure?",text:"",type:"",showCancelButton:!0,confirmButtonText:"Yes",cancelButtonText:"No",closeOnCancel:!0},function(e){1==e&&(IsClassReschedule="false",_onlineCheckout.continueShoping())});e("#mobile-check").is(":visible")&&e("#mobileCart").show(),e("#dvDailyDealsDetail").html(""),e("#dvDailyDealsDetail").hide(),e("#pageSection").show().addClass("pagesectionFlex"),DisplayFullView(!1),_onlineCheckout.UpdateMutipleCartItem(null,!0,!1),vgAppicationType==objApplicationType.CheckinApp?"classes"==e("#ancShoppingCartIcon").attr("data-redirectto")?_siteBuilderDetail.LoadComponentDetails("classes"):_siteBuilderDetail.LoadComponentDetails("book-now"):(e("#navbarNavDropdown li.active a").click(),null!=e("#dvCheckoutSuccessMSG").html()&&"undefined"!=e("#dvCheckoutSuccessMSG").html()&&"Successful Checkout"==e("#dvCheckoutSuccessMSG").html()&&location.pathname.includes("/shopping-bag")&&"undefined"!=typeof PromotionAppointmentID&&null!=PromotionAppointmentID&&""!=PromotionAppointmentID&&"undefined"!=typeof isFromTextMarketing&&isFromTextMarketing&&window.location.pathname.indexOf("/promotiontm/")>0&&window.location.pathname.indexOf(PromotionAppointmentID)>0?window.history.pushState("forward",null,window.location.href.replace("/promotiontm/"+PromotionAppointmentID,"")):null!=e("#dvCheckoutSuccessMSG").html()&&"undefined"!=e("#dvCheckoutSuccessMSG").html()&&"Successful Checkout"==e("#dvCheckoutSuccessMSG").html()&&location.pathname.includes("/shopping-bag")&&"undefined"!=typeof PromotionAppointmentID&&null!=PromotionAppointmentID&&""!=PromotionAppointmentID&&"undefined"!=typeof isFromTextMarketing&&!isFromTextMarketing&&window.location.pathname.indexOf("/promotion/")>0&&window.location.pathname.indexOf(PromotionAppointmentID)>0&&window.history.pushState("forward",null,window.location.href.replace("/promotion/"+PromotionAppointmentID,"")));try{e(".lazy,.lazy-bgimg").lazyload({effect:"fadeIn"})}catch(e){}}else null==glbMembershipData.membershipID||null!=onlineShoppingCart.Events&&0!=onlineShoppingCart.Events.length?"function"==typeof CheckInSuccessRedirection&&CheckInSuccessRedirection():("function"==typeof InsertCheckInLog&&(glbDataCheckIn.requiredMembershipStatus=2,InsertCheckInLog()),isDisplayForms=!0);_vgClassSessionSelection.PreviousClassRow=""}}catch(e){}},_onlineCheckout.ValidateMinMaxValue=function(t){var i=e(t),n=i.val();try{/\D/g.test(n)&&(n=1,i.val("1")),(n=parseInt(n))>0==0&&i.val("1")}catch(e){i.val("1")}var o=parseInt(i.attr("data-min")),a=parseInt(i.attr("data-max")),s=void 0===i.attr("data-istrack")?"True":i.attr("data-istrack"),r=parseInt(i.val());return r<o?i.val(o):"True"==s&&r>a&&i.val(a),_onlineCheckout.updateCartItem(t),!1},_onlineCheckout.OpenClassAlertPpopup=function(t){var i=null;if(null==_vgClassSessionSelection.commonProperty.MembershipPackageDetailsForClass||null==_vgClassSessionSelection.commonProperty.MembershipPackageDetailsForClass?(_shopdetail.LoadMembershipPackageData(),i=_shopdetail.MembershipPackageDetails):i=_vgClassSessionSelection.commonProperty.MembershipPackageDetailsForClass,1e3==i.CustomCode&&null!=i.Data.UserMemberShipAndPackageInformation&&null!=i.Data.MembershipOrPackageRequiredToBookResponse&&i.Data.MembershipOrPackageRequiredToBookResponse.length>0){var n=i.Data.UserMemberShipAndPackageInformation;if(n.IsMemPkgReqToBook&&!n.IsUserHasRequiredMembership&&!n.IsUserHasRequiredPackage){var o=i.Data.MembershipOrPackageRequiredToBookResponse,a=e.grep(o,function(e){return 1==e.Type}),s=e.grep(o,function(e){return 2==e.Type}),r=e.grep(a,function(e){return e.IsOnline}),l=e.grep(s,function(e){return e.IsOnline});r.length>0&&l.length>0?(e("#classAlertPpopupHeader").html('<div class="web-display-small membership-modal-heading">Membership or Package Required to Book</div><div class="web-body-font"> <p>You cannot book <b>'+t+"</b> without being a member or package holder. Purchase a qualifying membership or package to continue booking.</p></div>"),errorMessage="Select a membership or package to continue booking."):r.length>0?(e("#classAlertPpopupHeader").html('<div class="web-display-small membership-modal-heading">Membership Required to Book</div> <div class="web-body-font"><p>You cannot book <b>'+t+"</b>  without being a member. Purchase a qualifying membership to continue booking.</p></div>"),errorMessage="Select a membership to continue booking."):l.length>0?(e("#classAlertPpopupHeader").html('<div class="web-display-small membership-modal-heading">Package Required to Book</div><div class="web-body-font"><p>You cannot book <b>'+t+"</b> without being a package holder. Purchase a qualifying package to continue booking.</p></div>"),errorMessage="Select a package to continue booking."):a.length>0&&s.length>0?e("#classAlertPpopupHeader").html('<div class="web-display-small membership-modal-heading">Membership or Package Required to Book</div> <div class="web-body-font"> <p>You cannot book <b>'+t+"</b> without being a member or package holder. Purchase a qualifying membership or package to continue booking.</div></p>"):a.length>0?e("#classAlertPpopupHeader").html('<div class="web-display-small membership-modal-heading">Membership Required to Book</div> <div class="web-body-font"><p>You cannot book <b>'+t+"</b> without being a member. Purchase a qualifying membership to continue booking.</div></p>"):s.length>0&&e("#classAlertPpopupHeader").html('<div class="web-display-small membership-modal-heading">Package Required to Book</div> <div class="web-body-font"> <p>You cannot book <b>'+t+"</b> without being a package holder. Purchase a qualifying package to continue booking.</div></p>"),e("#classAlertPpopup").modal("show")}}},_onlineCheckout.DeleteCartItems=function(t){var i=e(t).closest(".cartremoverdtl"),n=i.attr("data-bid"),o=i.attr("data-rid"),a=i.attr("data-type"),s=i.attr("data-email"),r=i.attr("data-autoid"),l=i.attr("data-rand"),c=!1;if(void 0!==i.attr("data-isWorkShop")&&"true"==i.attr("data-isWorkShop").toLowerCase()&&(c=!0,i=e(t).closest(".service-div-checkout")),void 0!==IsWebsiteBuilderCommunication&&"inventory"==a&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication||1==("undefined"!=typeof isWidget&&"inventory"==a&&null!=isWidget&&"true"==isWidget.toLowerCase())){var d={eventName:"ProductRemovedFromCart",timestamp:(new Date).getTime(),data:{productName:document.querySelectorAll(".product-name.thm-textColor.web-subheading-font.web-builder-font-color")[1].textContent.trim()}};"undefined"!=typeof wbc&&void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication?wbc._postMessage('{"eventType": "MysiteSendEventMessage","message": '+JSON.stringify(d)+"}"):"undefined"!=typeof $Interframe&&$Interframe.sendEventMessage(d)}1==isCheckInApp&&(UserID=glbDataCheckIn.scanUserID),ShowLoader(!0);var u={businessID:n,referenceId:o,cardItemType:a,userEmail:s,autoId:r,isCheckInApp:isCheckInApp,isWorkShop:c,randomForWorkShop:l,loginUserID:UserID},p=[],h=!1,m=!1;if(_shopdetail.IsMemPkgReqToBook){var g=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);g.forEach(function(e){e.IsMemPkgRequired&&(m=!0)}),e.each(onlineShoppingCartmain.Packages,function(e,t){null!=t&&1==t.IsFromClass&&p.push(t)}),e.each(onlineShoppingCartmain.Memberships,function(e,t){null!=t&&1==t.IsFromClass&&p.push(t)}),e.each(onlineShoppingCartmain.Memberships,function(e,t){null!=t&&t.MembershipId.toString()==o&&1==t.IsFromClass&&g.length>0&&m&&(p.length>1?p.splice(service,1):(_onlineCheckout.OpenClassAlertPpopup(""),h=!0,ShowLoader(!1)))}),e.each(onlineShoppingCartmain.Packages,function(e,t){null!=t&&t.ServiceId.toString()==o&&1==t.IsFromClass&&g.length>0&&(p.length>1?p.splice(t,1):(_onlineCheckout.OpenClassAlertPpopup(""),h=!0,ShowLoader(!1)))})}h||vagaro.ajaxCall(ApiURLEnumOnlineCheckout.removecartitem,u,function(n){if(ShowLoader(!1),"classes"==a){var d=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);if(d.length>0){e.each(d,function(t,i){null!=i&&i.eventID==o&&e.each(i.eventEnrollment,function(t,n){null!=n&&n.autoID==r&&i.eventEnrollment.splice(e.inArray(n,i.eventEnrollment),1)}),null!=i&&0==i.eventEnrollment.length&&d.splice(e.inArray(i,d),1)});try{d.length>0?localStorage[_vgClassSessionSelection.model.EventStorage]=JSON.stringify(d):localStorage.removeItem(_vgClassSessionSelection.model.EventStorage)}catch(e){}}c?null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0&&e.each(onlineShoppingCartmain.Events,function(t,i){if(null!=i&&i.eventID==o){var n=i.eventEnrollment;for(t=0;t<n.length;t++)n[t].randomForWorkShop==l&&n[t].cUserEmail==s&&(n.splice(t,1),t--)}null!=i&&0==i.eventEnrollment.length&&onlineShoppingCartmain.Events.splice(e.inArray(i,onlineShoppingCartmain.Events),1)}):null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0&&e.each(onlineShoppingCartmain.Events,function(t,i){null!=i&&i.eventID==o&&e.each(i.eventEnrollment,function(t,n){null!=n&&n.autoID==r&&i.eventEnrollment.splice(e.inArray(n,i.eventEnrollment),1)}),null!=i&&0==i.eventEnrollment.length&&onlineShoppingCartmain.Events.splice(e.inArray(i,onlineShoppingCartmain.Events),1)});var u=e(t).closest(".service-div-checkout");u.find(".cartremoverdtl").length<=1&&u.remove()}else if("inventory"==a)for(var p=onlineShoppingCartmain.Inventories.length-1;p>=0;p--){var m=onlineShoppingCartmain.Inventories[p];null!=m&&(m.InventoryId.toString()==o&&0==m.MasterInventoryId||m.MasterInventoryId.toString()==o)&&onlineShoppingCartmain.Inventories.splice(p,1)}else"servicepackage"==a?(e.each(_onlineCheckout.PackageSharingDetail,function(t,i){null!=i&&i.ServiceId.toString()==o&&i.autoId.toString()==r&&_onlineCheckout.PackageSharingDetail.splice(e.inArray(i,_onlineCheckout.PackageSharingDetail),1)}),e.each(onlineShoppingCartmain.Packages,function(t,i){null!=i&&i.ServiceId.toString()==o&&i.autoId.toString()==r&&onlineShoppingCartmain.Packages.splice(e.inArray(i,onlineShoppingCartmain.Packages),1)})):"gc"==a?e.each(onlineShoppingCartmain.GiftCertificates,function(t,i){null!=i&&i.GiftCertificatePhotoID.toString()==o&&i.autoId==r&&onlineShoppingCartmain.GiftCertificates.splice(e.inArray(i,onlineShoppingCartmain.GiftCertificates),1)}):"membership"==a&&(_onlineCheckout.ResetPkgMembershipVariable(1),e.each(onlineShoppingCartmain.Memberships,function(t,i){null!=i&&i.MembershipId.toString()==o&&onlineShoppingCartmain.Memberships.splice(e.inArray(i,onlineShoppingCartmain.Memberships),1)}));h||i.remove(),_onlineCheckout.IsRecurringMembership=!1,_onlineCheckout.IsRecurringPkg=!1,_onlineCheckout.IsRecurringMembershipCount=0,_onlineCheckout.IsRecurringPkgCount=0,parseInt(n)<=0&&(e(".divcartdetail").hide(),e(".divHeaderText").text("There are no items in the cart."),e(".divnoitem").attr("style",""),1==IsWebsiteBuilderCommunication&&(e(".btnContShopping").attr("href","javascript:void(0);"),e(".btnContShopping").attr("onclick","_onlineCheckout.continueShoping();"))),_onlineCheckout.checkIfProductExists(),_onlineCheckout.GetCartItemCount(n),_onlineCheckout.calculateSubTotalForFirstStep(),_onlineCheckout.IsClassBookingOnly(!1),_onlineCheckout.errorMessage()},function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},!1,!0),e("#divHeaderBusinessName").focus()},_onlineCheckout.DeleteWorkShopCartItems=function(e){swal({title:"",text:"Are you sure you want to delete whole workshop?",showCancelButton:!0,customClass:"text-left",html:!0},function(t){t&&_onlineCheckout.DeleteCartItems(e)})},_onlineCheckout.onlyUnique=function(e,t,i){return i.indexOf(e)===t},_onlineCheckout.updateCartItem=function(t){var i=e(t).closest(".product-div-shopping-col"),n=(i.attr("data-bid"),i.attr("data-rid")),o=i.attr("data-type"),a=i.find("#txtItemsQuantity").val();try{/\D/g.test(a)&&(i.find("#txtItemsQuantity").val("1"),a=1),(a=parseInt(a))>0==0&&(i.find("#txtItemsQuantity").val("1"),a=1)}catch(e){i.find("#txtItemsQuantity").val("1"),a=1}_onlineCheckout.isUpdateItemQty=!0,"inventory"==o?(e.each(onlineShoppingCartmain.Inventories,function(){if(this.MasterInventoryId.toString()==n.toString()){var t=e.grep(onlineShoppingCartmain.Inventories,function(e){return e.InventoryId==n});String.isNullOrUndefineOrBlank(t)||(this.Quantity=this.Quantity/t[0].Quantity*a,this.Price=this.Price/t[0].Quantity*a,this.bundleQuantity=t[0].Quantity,this.calculatedTax=parseFloat(this.Price*this.Tax/100),this.BusinessTax=_onlineCheckout.ApplyMultipleTax(this.Price,this),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+n+'"]').find(".div-block-59 .product-name").html(currencysymbol+_onlineCheckout.decimalFormate(this.Price)))}}),e.each(onlineShoppingCartmain.Inventories,function(){this.InventoryId.toString()==n.toString()&&0==this.MasterInventoryId&&(this.Quantity=a,this.Price=a*this.SellingPrice,this.calculatedTax=parseFloat(this.Price*this.Tax/100),this.BusinessTax=_onlineCheckout.ApplyMultipleTax(this.Price,this),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+n+'"]').find(".div-block-59 .product-name").html(currencysymbol+_onlineCheckout.decimalFormate(this.Price)))})):"servicepackage"==o&&e.each(onlineShoppingCartmain.Packages,function(){if(this.ServiceId.toString()==n.toString()){if(this.NoOfVisit=a,1==this.eventType){var t=this.Price;this.PromotionID>0&&(t=_onlineCheckout.calculatePromotionAmt(this.PromotionID,this.IsAmount,this.AmountValue,this.Price,1)),this.TotalPrice=t*this.NoOfVisit,this.calculatedTax=parseFloat(this.TotalPrice*this.Tax/100),this.BusinessTax=_onlineCheckout.ApplyMultipleTax(this.TotalPrice,this)}else 2==this.eventType?(this.TotalPrice=_onlineCheckout.GetClassSessionWisePrice(this.sessionDetail,this.NoOfVisit,1),this.calculatedTax=parseFloat(this.TotalPrice*this.Tax/100),this.BusinessTax=_onlineCheckout.ApplyMultipleTax(this.TotalPrice,this)):4==this.eventType&&(this.TotalPrice=_onlineCheckout.decimalFormate(e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+n+'"]').find(".div-block-59 .product-name")[0].innerHTML.substr(1)),this.calculatedTax=parseFloat(this.TotalPrice*this.Tax/100),this.BusinessTax=_onlineCheckout.ApplyMultipleTax(this.TotalPrice,this));var i=0,o=0;if(null!=this.lstAddonService&&this.lstAddonService.length>0)for(var s=0;s<this.lstAddonService.length;s++)i=this.lstAddonService[s].Originalprice*this.NoOfVisit,o=_onlineCheckout.parseTodecimal(o,2)+_onlineCheckout.parseTodecimal(i,2),e("#addprice_"+this.ServiceId+"_"+s).html(currencysymbol+_onlineCheckout.decimalFormate(i)),this.lstAddonService[s].Price=_onlineCheckout.decimalFormate(i);this.TotalAddonServicePrice=o,e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+n+'"]').find(".div-block-59 .product-name").html(currencysymbol+_onlineCheckout.decimalFormate(this.TotalPrice))}}),setTimeout(function(){_onlineCheckout.calculateSubTotalForFirstStep()},5)},_onlineCheckout.MapFormsWithUserId=function(t,i){i.keySort({UserId:"asc"}),e.each(t,function(t,n){var o={};e.each(i,function(t,i){if(e.inArray(i.ServiceId,n.ServiceIds)>-1&&(n.FormId!=o.FormId||i.UserId!=o.UserId)){var a={};a.UserId=i.UserId,a.FullName=i.FirstName+" "+i.LastName,a.EmailId=i.EmailId,a.FormUrl=n.FormUrl,a.ServiceId=i.ServiceId,a.FormId=n.FormId,_onlineCheckout.formsResponse.push(a),o=a}})}),e.each(_onlineCheckout.formsResponse,function(e,t){var i=!1;_onlineCheckout.formsResponse.length>e+1&&t.FormId==_onlineCheckout.formsResponse[e+1].FormId&&(i=!0),t.flagDup=i})},_onlineCheckout.GetFormsByIds=function(){_onlineCheckout.formsResponse=[],_onlineCheckout.currentresponse=[];var t="",i=onlineShoppingCartmain.UsersPoints,n=onlineShoppingCartmain.Events,o="",a="",s=onlineShoppingCartmain.Memberships,r="";e.each(i,function(e,i){0!=i.userId&&(t+=i.userId+",")}),""==(t=t.slice(0,-1))&&_onlineCheckout.isValidForCheckoutInvoice()&&"True"==e("#hdnIsFormsEnable").val()&&null!=onlineShoppingCartmain.invoiceDetails&&null!=onlineShoppingCartmain.invoiceDetails.InvoiceGridObject&&(t=onlineShoppingCartmain.invoiceDetails.InvoiceGridObject.PayeeId),void 0!==n&&null!=n&&n.length>0&&(e.each(n,function(t,i){o+=i.eventID+",",!String.isNullOrUndefineOrBlank(i.eventEnrollment)&&i.eventEnrollment.length>0&&e.grep(i.eventEnrollment,function(t){!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){o+=e.ServiceId+","})})}),o=o.slice(0,-1)),null!=onlineShoppingCartmain.Memberships&&onlineShoppingCartmain.Memberships.length>0&&(e.each(s,function(e,t){r+=t.MembershipId+","}),r=r.slice(0,-1)),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&(e.each(onlineShoppingCart.ServiceInvoice,function(e,t){o+=t.serviceid+",",a+=t.AppConfirmUniqueID+","}),o=o.slice(0,-1),a=a.slice(0,-1));var l={serviceIds:o,membershipIds:r,UserIds:"undefined"!=typeof isCheckInApp&&1==isCheckInApp&&""==t?UserID:t,businessID:businessID,loginUserID:UserID,strAppConfirmUniqueIds:a,callFrom:"undefined"!=typeof isCheckInApp&&1==isCheckInApp?3:1};ShowLoader(!0),0==t&&0==UserID&&window.location.reload();var c=new vagaro.ajax;c.datamodel.Token=ApiURLEnumOnlineCheckout.getformsbyids,c.datamodel.IsNewVagaroAPI=!0,c.datamodel.callback=function(t){if(ShowLoader(!1),null!=t){_onlineCheckout.currentresponse=t,_onlineCheckout.updateAppIdforms=[],_onlineCheckout.formResponseIds=[];var a=[];if(e.each(n,function(n,s){o+=s.eventID+",",e.each(s.eventEnrollment,function(n,o){e.each(i,function(t,i){if(i.emailId==o.cUserEmail||i.userId==o.customerID){var n={};n.FirstName=o.cFirstName,n.LastName=o.cLastName,n.ServiceId=s.eventID,n.UserId=i.userId,n.EmailId=i.emailId,n.Cell=o.cUserCellNo,n.CellCountryID=o.cCellcountryID,n.DialingCode=o.cDialingCode,a.push(n),!String.isNullOrUndefineOrBlank(o.lstAddonService)&&o.lstAddonService.length>0&&e.grep(o.lstAddonService,function(e){var t={};t.FirstName=o.cFirstName,t.LastName=o.cLastName,t.ServiceId=e.ServiceId,t.UserId=i.userId,t.EmailId=i.emailId,t.Cell=o.cUserCellNo,t.CellCountryID=o.cCellcountryID,t.DialingCode=o.cDialingCode,a.push(t)})}}),e.grep(t,function(t){null!=t&&(String.isNullOrUndefineOrBlank(t.ServiceIds)||e.grep(t.ServiceIds,function(e){if(0==String.isNullOrUndefineOrBlank(e)&&o.eventID==e){var i={AppConfirmUniqueID:null,ServiceID:e,FormID:t.FormId,AppointmentId:o.appointmentID,IsReqAlways:t.IsReqAlways};_onlineCheckout.updateAppIdforms.push(i)}}))})})}),""!=o){var r=e.grep(a,function(e){return 0==e.UserId});if(r.length>0){var l=new vagaro.ajax;l.datamodel.Token=ApiURLEnumOnlineCheckout.insertusersatformload,l.datamodel.IsNewVagaroAPI=!0,l.datamodel.callback=function(i){var n=e.grep(a,function(e){return 0!=e.UserId});e.each(n,function(e,t){i.push(t)}),_onlineCheckout.MapFormsWithUserIds(t,i,s)},l.datamodel.data={objUsers:r,LoggedInUserId:UserID},l.datamodel.Error=function(e){ShowLoader(!1)},l.Post()}else _onlineCheckout.MapFormsWithUserIds(t,a,s)}else e.each(i,function(e,t){var i={};i.UserId=t.userId,i.EmailId=t.emailId,a.push(i)}),_onlineCheckout.MapFormsWithUserIds(t,a,s)}else 1==_onlineCheckout.isFormsDirectClass&&_onlineCheckout.DirectClassCheckout(),_onlineCheckout.IsShowForms(!1)},c.datamodel.data=l,c.datamodel.Error=function(e){ShowLoader(!1)},c.Post()},_onlineCheckout.GetFormsByIdsForMS=function(t,i){_onlineCheckout.currentresponse=[];var n=i;if(t&&n){var o={serviceIds:"",membershipIds:t,UserIds:"undefined"!=typeof isCheckInApp&&1==isCheckInApp&&""==n?UserID:n,businessID:businessID,loginUserID:UserID,strAppConfirmUniqueIds:"",callFrom:"undefined"!=typeof isCheckInApp&&1==isCheckInApp?3:1};ShowLoader(!0);var a=new vagaro.ajax;a.datamodel.Token=ApiURLEnumOnlineCheckout.getformsbyids,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.callback=function(o){if(ShowLoader(!1),o&&o.length>0){if(1==_onlineCheckout.FormCallSource){var a=Number(t);o=o.filter(function(e){return!(!e.MembershipIds||0===e.MembershipIds.length)&&e.MembershipIds.includes(a)}),_onlineCheckout.FormCallSource=!1}_onlineCheckout.currentresponse=o;var s=[];e.each(n.toString().split(","),function(e,t){s.push({UserId:parseInt(t,10)})});var r=[];e.each(t.toString().split(","),function(e,t){r.push({MembershipId:Number(t),userID:Number(i)})}),_onlineCheckout.MapFormsWithUserIds(o,s,r)}else _onlineCheckout.IsShowForms(!1)},a.datamodel.Error=function(){ShowLoader(!1)},a.datamodel.data=o,a.Post()}else _onlineCheckout.IsShowForms(!1)},_onlineCheckout.MapFormsWithUserIds=function(t,i,n){i.keySort({UserId:"asc"}),e.each(t,function(t,n){var o={};e.each(i,function(t,i){if(e.inArray(i.ServiceId,n.ServiceIds)>-1&&(n.FormId!=o.FormId||i.UserId!=o.UserId)){var a={};a.UserId=i.UserId,a.FullName=i.FirstName+" "+i.LastName,a.EmailId=i.EmailId,a.FormUrl=n.FormUrl,a.ServiceId=i.ServiceId,a.FormId=n.FormId,_onlineCheckout.formsResponse.push(a),o=a}})}),e.each(t,function(t,o){var a={};e.each(n,function(t,n){e.inArray(n.MembershipId,o.MembershipIds)>-1&&(o.FormId==a.FormId&&n.userID==a.UserId||e.each(i,function(e,t){if(t.UserId==n.userID){var i={};i.UserId=t.UserId,i.FullName=FullUserName,i.EmailId=t.emailId,i.FormUrl=o.FormUrl,i.MembershipId=n.MembershipId,i.FormId=o.FormId,_onlineCheckout.formsResponse.push(i),a=i}}))})}),e.each(t,function(t,n){var o={};e.each(i,function(e,t){if(n.IsReqForAllClients&&(n.FormId!=o.FormId||t.UserId!=o.UserId)){var i={};i.UserId=t.UserId,i.FullName=null!=FullUserName?FullUserName:t.FirstName+" "+t.LastName,i.EmailId=t.EmailId,i.FormUrl=n.FormUrl,i.FormId=n.FormId,_onlineCheckout.formsResponse.push(i),o=i}})}),e.each(t,function(e,t){var i=_onlineCheckout.formsResponse.filter(function(e){return e.FormId===t.FormId});if(!i.length>0){var n={};n.UserId=parseInt(UserID),n.FullName=FullUserName,n.EmailId=UserEmail,n.FormUrl=t.FormUrl,n.FormId=t.FormId,_onlineCheckout.formsResponse.push(n)}}),e.each(_onlineCheckout.formsResponse,function(e,t){var i=!1;_onlineCheckout.formsResponse.length>e+1&&t.FormId==_onlineCheckout.formsResponse[e+1].FormId&&(i=!0),t.flagDup=i}),_onlineCheckout.IsShowForms(!0),_onlineCheckout.DisplayFormsInIframe(),"function"==typeof ShowLoader&&ShowLoader(!1)},_onlineCheckout.DisplayFormsInIframe=function(t,i){var n="",o="undefined"!=typeof AllowCustomField&&null!==AllowCustomField&&""!==AllowCustomField.trim()&&"true"===AllowCustomField.toLowerCase();if(0==isCheckInApp&&(n=_shopdetail.activeTabName),0==isCheckInApp&&"book-now"==n&&void 0!==i&&null!=i&&""!=i)"true"==i.IsNewCard&&(isCCChanged=!0,ZenSwipeCardDetails=i);else if(0==isCheckInApp&&"book-now"!=n&&void 0!==i&&null!=i&&""!=i&&"true"==i.IsNewCard){var a={BusinessID:businessID,CCFirstName:i.first_name,CCLastName:i.last_name,CCMiddleName:i.middle_name,CardTokenId:i.card_token,CreditCardNumber:i.cc_no,CreditCardType:i.cc_type,ExpMonth:"",ExpYear:"",FullName:i.first_name+" "+i.last_name,SecurityCode:i.cvv,index:0,isselfcard:!0};_onlineCheckout.ccCardOnFile=a,_onlineCheckout.zenSwipeCardDetails=a,_onlineCheckout.isFillCCDetailsForms="1",_onlineCheckout.BindCCDetailForBooking(a,null,null)}_onlineCheckout.formsResponse.length>0?(1==_onlineCheckout.formsResponse.length?"book-now"==n?e("#btnFormsSubmit").text("Next"):1==_onlineCheckout.isFormsDirectClass?e("#btnFormsSubmitDirectClass").text("Next"):1==_onlineCheckout.IsFromCheckInLoginPage?e("#btnFormsSubmitCheckInApp").text("Submit"):e("#btnFormsSubmitCheckOut").text("Next"):"book-now"==n?e("#btnFormsSubmit").text("Next"):1==_onlineCheckout.isFormsDirectClass?e("#btnFormsSubmitDirectClass").text("Next"):1==_onlineCheckout.IsFromCheckInLoginPage?e("#btnFormsSubmitCheckInApp").text("Next"):e("#btnFormsSubmitCheckOut").text("Next"),null!=vuiForms.frame&&vuiForms.frame.destroy(),"book-now"==n&&void 0!==_onlineCheckout.formsResponse&&_onlineCheckout.formsResponse.length>0?("OnBoarding"==getQueryStringData("Type")&&e("#Onboard-BookNow-back").hide(),o?DisplayFormsIFrameForAppNew(_onlineCheckout.formsResponse[0]):DisplayFormsIFrameForApp(_onlineCheckout.formsResponse[0])):1==_onlineCheckout.isFormsDirectClass&&void 0!==_onlineCheckout.formsResponse&&_onlineCheckout.formsResponse.length>0?o?DisplayFormsIFrameDirectClassNew(_onlineCheckout.formsResponse[0]):DisplayFormsIFrameDirectClass(_onlineCheckout.formsResponse[0]):1==_onlineCheckout.IsFromCheckInLoginPage&&void 0!==_onlineCheckout.formsResponse&&_onlineCheckout.formsResponse.length>0?DisplayFormsIFrameCheckInApp(_onlineCheckout.formsResponse[0]):void 0!==_onlineCheckout.formsResponse&&_onlineCheckout.formsResponse.length>0&&(o?DisplayFormsIFrameNew(_onlineCheckout.formsResponse[0]):DisplayFormsIFrame(_onlineCheckout.formsResponse[0]))):(_onlineCheckout.currentresponse=[],1==_onlineCheckout.isFormsDirectClass?_onlineCheckout.DirectClassCheckout():1==_onlineCheckout.isFormsbookwithcc?_shopdetail.ValidateBookingDataWithCC():1==_onlineCheckout.isFormsbookwithoutcc?_shopdetail.ValidateBookingDataWithoutCC():"book-now"!=n&&(1==_onlineCheckout.IsClickFromCheckInButton?(e("#divCheckInAppDetails").show(),e("#divFormsCheckInApp").hide(),checkInAppointmentProcess()):1==_onlineCheckout.IsFromCheckInLoginPage?(e("#divCheckInAppDetails").show(),e("#divFormsCheckInApp").hide()):_onlineCheckout.checkoutGotoNextStep(!1)),_onlineCheckout.IsShowForms(!1))},_onlineCheckout.IsShowForms=function(t){var i="";0==isCheckInApp&&(i=_shopdetail.activeTabName),t?"book-now"==i?(e("#divForms").show(),e("#divCheckoutScreen").hide()):1==_onlineCheckout.isFormsDirectClass?(e("#divFormsDirectClass").show(),e("#shoppingcartfirst").hide()):(_onlineCheckout.isValidForCheckoutInvoice()&&"True"==e("#hdnIsFormsEnable").val()&&e("#btnBuyNowBackCheckOut").hide(),e("#divFormsCheckOut").show(),e("#divFormsCheckoutScreen").hide()):"book-now"==i?(1==_onlineCheckout.isFormsbookwithcc||1==_onlineCheckout.isFormsbookwithoutcc?(setTimeout(function(){ShowLoader(!0)},100),e("#dvOnlineBooking").hide()):(e("#divCheckoutScreen").show(),e(window).scrollTop(0)),e("#divForms").hide()):1==_onlineCheckout.isFormsDirectClass?e("#divFormsDirectClass").hide():(e("#divFormsCheckOut").hide(),e("#divFormsCheckoutScreen").show())},_onlineCheckout.FormsClick=function(){if(void 0!==_onlineCheckout.formsResponse&&_onlineCheckout.formsResponse.length>0){var t=_onlineCheckout.formsResponse[0],i=0;void 0!==t.UserId&&null!=t.UserId&&(i=parseInt(t.UserId));var n="";void 0!==t.FullName&&null!=t.FullName&&(n=t.FullName),1==_onlineCheckout.IsFromCheckInLoginPage&&(i=UserID,n=FullUserName);void 0!==t.ServiceId&&null!=t.ServiceId&&t.ServiceId;var o=e.grep(_onlineCheckout.currentresponse,function(e){return e.FormId==t.FormId}),a="";o.length>0&&void 0!==o[0].ServiceIds&&null!=o[0].ServiceIds&&(a=o[0].ServiceIds.toString()),_onlineCheckout.isValidForCheckoutInvoice()&&"True"==e("#hdnIsFormsEnable").val()&&i<=0&&null!=onlineShoppingCartmain.invoiceDetails&&null!=onlineShoppingCartmain.invoiceDetails.InvoiceGridObject&&(n=onlineShoppingCartmain.invoiceDetails.FirstName+" "+onlineShoppingCartmain.invoiceDetails.LastName,i=onlineShoppingCartmain.invoiceDetails.InvoiceGridObject.PayeeId);var s=!1;o.length>0&&void 0!==o[0].IsReqAlways&&null!=o[0].IsReqAlways&&(s=o[0].IsReqAlways);var r="";if(s&&(a=""),"undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart&&(!String.isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&e.each(onlineShoppingCart.ServiceInvoice,function(e,t){""!=r&&(r+=","),r+=t.AppConfirmUniqueID+"#"+t.serviceid}),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(e){""!=r&&(r+=","),r+=String.isNullOrUndefineOrBlank(e.AppConfirmUniqueID)?"#"+e.eventID:e.AppConfirmUniqueID+"#"+e.eventID})})),"undefined"!=typeof glbMyAppDataAllData&&null!=glbMyAppDataAllData&&1==_onlineCheckout.IsFromCheckInLoginPage){var l="undefined"!=typeof localAppID&&""!=localAppID?localAppID:localClassAppID;e.each(glbMyAppDataAllData,function(e,t){t.AppointmentID==l&&(""!=r&&(r+=","),r+=t.AppConfirmUniqueID+"#"+t.ServiceID)})}try{if("Submit"==e("#btnFormsSubmitCheckOut").text())(c={}).Action=_vgLogEvent.model.buttonText+" - Fill Form",c.Category="Live Stream",c.PageName="Live Stream",null!=e("#businessname")&&null!=e("#businessname").text()&&(c.BusinessName=e("#businessname").text()),c.TypeofService="Live Stream",null!=e("#livestream")&&null!=e("#livestream").text()&&e("#livestream").text().includes("Live")&&(c.isLiveStream=!0,c.isInHouse=!1),c.IsFormfilled=!0,_vgLogEvent.LogData(c)}catch(e){}var c={LoginUserID:UserID,UserName:FullUserName,BusinessID:businessID,ResBy:i,ResByName:n,ServiceId:a,CallFrom:"1",ApptServiceIds:r,IsOnlineForm:"True"};vuiForms.frame.forms.sendLoginUseDetails(c),vuiForms.frame.forms.submitForm()}},_onlineCheckout.AddEventLogInFirebaseForForms=function(){try{if("Submit"==e("#btnFormsSubmitCheckOut").text()){var t={Category:"Live Stream"};t.Action=_vgLogEvent.model.buttonText+" - Fill Form",t.PageName="Live Stream",t.BusinessID=businessID,null!=e("#businessname")&&null!=e("#businessname").text()&&(t.BusinessName=e("#businessname").text()),t.IsFormfilled=!0,t.TypeofService="Live Stream",null!=e("#livestream")&&null!=e("#livestream").text()&&e("#livestream").text().includes("Live")&&(t.isLiveStream=!0,t.isInHouse=!1),_vgLogEvent.LogEventData(t)}}catch(e){}},_onlineCheckout.SendDetailsToForms=function(){if(void 0!==_onlineCheckout.formsResponse&&_onlineCheckout.formsResponse.length>0){var t=_onlineCheckout.formsResponse[0],i=0;void 0!==t.UserId&&null!=t.UserId&&(i=parseInt(t.UserId));var n="";void 0!==t.FullName&&null!=t.FullName&&(n=t.FullName),1==_onlineCheckout.IsFromCheckInLoginPage&&(i=UserID,n=FullUserName);void 0!==t.ServiceId&&null!=t.ServiceId&&t.ServiceId;var o=e.grep(_onlineCheckout.currentresponse,function(e){return e.FormId==t.FormId}),a="";o.length>0&&void 0!==o[0].ServiceIds&&null!=o[0].ServiceIds&&(a=o[0].ServiceIds.toString()),_onlineCheckout.isValidForCheckoutInvoice()&&"True"==e("#hdnIsFormsEnable").val()&&i<=0&&null!=onlineShoppingCartmain.invoiceDetails&&null!=onlineShoppingCartmain.invoiceDetails.InvoiceGridObject&&(n=onlineShoppingCartmain.invoiceDetails.FirstName+" "+onlineShoppingCartmain.invoiceDetails.LastName,i=onlineShoppingCartmain.invoiceDetails.InvoiceGridObject.PayeeId);var s={LoginUserID:UserID,UserName:FullUserName,BusinessID:businessID,ResBy:i,ResByName:n,ServiceId:a,CallFrom:"1",isLoadCCIframe:"true",IsOnlineForm:"True"};vuiForms.frame.forms.sendLoginUseDetails(s)}},_onlineCheckout.FormsClickForAll=function(){var t=e.grep(_onlineCheckout.formsResponse,function(e){return e.FormId==_onlineCheckout.formId});vuiForms.frame.forms.submitAllForm(t)},_onlineCheckout.FormsClickFromBookNow=function(){var t=ISAndroidOrIOSDevicesAndBrowser();(t||"undefined"!=typeof vgAppicationType&&1==vgAppicationType)&&e("#btnFormsSubmit").attr("disabled",!0);var i,n=e(".familycktfrnd ul li.selected").data("value"),o=e(".familycktfrnd ul li.selected .avtar-name").html().replace(" (Me)","");if(void 0!==_onlineCheckout.formsResponse&&_onlineCheckout.formsResponse.length>0){var a=_onlineCheckout.formsResponse[0],s="",r=hdnCommandArgArray.serviceid;String.isNullOrUndefineOrBlank(hdnCommandArgArray.addonServiceIds)||(r+=","+hdnCommandArgArray.addonServiceIds),a.IsReqAlways&&(e.grep(r.split(","),function(t){String.isNullOrUndefineOrBlank(a.ServiceIds)||e.grep(a.ServiceIds,function(e){0==String.isNullOrUndefineOrBlank(e)&&t==e&&(s+=e+",")})}),s=s.replace(/,\s*$/,""))}i=void 0!==n&&UserID!=n?{LoginUserID:n,UserName:o,BusinessID:businessID,CallFrom:"1",ServiceId:s,IsOnlineForm:"True"}:{LoginUserID:UserID,UserName:FullUserName,BusinessID:businessID,CallFrom:"1",ServiceId:s,IsOnlineForm:"True"},vuiForms.frame.forms.sendLoginUseDetails(i),vuiForms.frame.forms.submitForm(),_onlineCheckout.FormResponseSubmitted(),(t||"undefined"!=typeof vgAppicationType&&1==vgAppicationType)&&setTimeout(function(){e("#btnFormsSubmit").attr("disabled",!1)},1e3)},_onlineCheckout.FormResponseSubmitted=function(){try{if(void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication||"undefined"!=typeof isWidget&&null!=isWidget&&"true"==isWidget.toLowerCase()){var e=(new Date).getTime(),t=_onlineCheckout.formsResponse[0].FormId||"";vuiForms.frame.forms.FormTitle();var i={eventName:"FormResponseSubmitted",timestamp:e,data:{formId:t,formName:_onlineCheckout.FormTitle||""}};UserID&&parseInt(UserID)>0&&(i.data.customerId="undefined"!=typeof staticEncryptUserID&&null!==staticEncryptUserID?staticEncryptUserID:""),"undefined"!=typeof wbc&&void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication?wbc._postMessage('{"eventType": "MysiteSendEventMessage","message": '+JSON.stringify(i)+"}"):"undefined"!=typeof $Interframe&&$Interframe.sendEventMessage(i),_onlineCheckout.isFormResponseSubmittedCalled=!0,setTimeout(function(){_shopdetail.startCreditCardCaptureInterval()},1e3)}}catch(e){}},_onlineCheckout.formsCallBackSuccess=function(e,t,i){1==e?_onlineCheckout.formsResponse.shift():_onlineCheckout.RemoveProcessedForms(),_onlineCheckout.DisplayFormsInIframe(t,i)},_onlineCheckout.fromsCallBackFailed=function(){vagaro.alert("Some error occured. Please try again.")},onsubmitFormResponseCallback=function(e){void 0!==e.message&&null!=e.message&&""!=e.message?(null!=_onlineCheckout.FormsResponseID?_onlineCheckout.FormsResponseID+=","+e.message:_onlineCheckout.FormsResponseID=e.message,"undefined"!=typeof _onlineCheckout&&void 0!==_onlineCheckout.formResponseIds&&_onlineCheckout.formResponseIds.push(e.message),_onlineCheckout.formsCallBackSuccess(e.isSingleSave,e.isCCCaptureInForms,e.zenSwipeCardDetailsFormForms)):_onlineCheckout.fromsCallBackFailed(),ShowLoader(!1)},_onlineCheckout.RemoveProcessedForms=function(){_onlineCheckout.formsResponse=e.grep(_onlineCheckout.formsResponse,function(e){return e.FormId!=_onlineCheckout.formId})},_onlineCheckout.UpdateMutipleCartItem=function(t,i,n){if(void 0===IsWebsiteBuilderCommunication||1!=IsWebsiteBuilderCommunication||1!=i){_onlineCheckout.IsValidatedOnePerUser=!1;var o=!(!String.isNullOrUndefineOrBlank(getCookie("loginTypeValue"))&&8==getCookie("loginTypeValue"))&&n;if(_onlineCheckout.isConsiderForms=o,_onlineCheckout.IsFromCheckInLoginPage=!1,1!=i&&(_onlineCheckout.ValidateErrorMessage(onlineShoppingCartmain),0==onlineShoppingCartmain.IsValidCartData))return!1;if(e("#hdnIsFromPage").length>0&&e("#hdnIsFromPage").val(""),1==_onlineCheckout.isUpdateItemQty||1==_onlineCheckout.isUpdateAddonsItemQty){ShowLoader(!0);var a=new vagaro.ajax,s={};s.businessID=businessID,s.inventories=onlineShoppingCartmain.Inventories,s.packages=onlineShoppingCartmain.Packages,a.datamodel.Token=ApiURLEnumOnlineCheckout.updatemutiplecartitem,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.callback=function(e){if(ShowLoader(!1),e.IsSuccess?_onlineCheckout.GetCartItemCount(e.ItemCount):e.IsSuccess||-1!=e.ItemCount||window.location.reload(),_onlineCheckout.isUpdateItemQty=!1,1==_onlineCheckout.isUpdateAddonsItemQty)return _onlineCheckout.isUpdateAddonsItemQty=!1,void _onlineCheckout.LoadShoppingCartExternal();1!=i&&_onlineCheckout.getUserGCDetail()},a.datamodel.data=s,a.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},a.Post()}else 1!=i&&_onlineCheckout.getUserGCDetail()}else _onlineCheckout.continueShoping()},_onlineCheckout.MembershipAddToCart=function(t,i){var n=0,o="",a="",s=!1,r=0,l=!1,c=0,d=0;if(0==isCheckInApp){if(UserID<=0)return objMembershipAddToCart=t,showCommonLoginPopup("MembershipAddToCart"),!1;var u=(h=e(t).closest("div.div-block-18")).attr("data-id"),p=h.attr("data-IsOverride");"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(d=h.data("price")),o=h.attr("data-promotionDetail"),a=h.attr("data-promotiontitle"),void 0===o||""==a?(s=h.attr("data-isinitialdiscount"),r=h.attr("data-initialdiscount"),l=h.attr("data-isamount"),c=h.attr("data-billingcycle")):c=h.attr("data-billingcycle")}else{n=glbDataCheckIn.scanUserID,businessID=glbDataCheckIn.businessID;var h=t.closestObj;u=t.membershipID,p=t.IsOverride;o=t.promotiondetail,a=t.promotiontitle,c=t.billingCycle,void 0!==o&&""==a&&(s=t.isInitialDiscount,r=t.initialDiscount,l=t.isAmount)}String.isNullOrUndefineOrBlank(p)&&(p=!1);var m="NoRedirect";if("undefined"!=typeof businessID&&1!=i||"undefined"!=e("#hdnBusinessId").val()&&(businessID=e("#hdnBusinessId").val(),m="Redirect",cookieManager.setCookie("Referral","DailyDealToCart",.0833,cookieManager.defaultPath,cookieManager.defaultDomain,!0,!1)),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&!String.isNullOrUndefineOrBlank(d)){var g=d.split("/");d=g[0]}ShowLoader(!0),Data={},Data.businessID=businessID,t.ItemId>0?(Data.membershipID=t.ItemId,Data.IsOverride=!1,Data.checkInUserID=n,Data.ischeckinApp=isCheckInApp,Data.promotiondetail=t.PromotionDetail,Data.promotiontitle=t.PromotionTitle,Data.IsInitialDiscount=t.IsInitialDiscount,Data.InitialDiscount=t.InitialDiscount,Data.BillingCycle=t.BillingCycle,Data.IsAmount=t.IsAmount,Data.IsFromClass=!0):(Data.membershipID=u,Data.IsOverride=p,Data.checkInUserID=n,Data.ischeckinApp=isCheckInApp,Data.promotiondetail=o,Data.promotiontitle=a,Data.IsInitialDiscount=s,Data.InitialDiscount=r,Data.IsAmount=l,Data.BillingCycle=c,Data.IsFromClass=!1);var v=new vagaro.ajax;v.datamodel.Token="websiteapi/homepage/membershipaddtocart",v.datamodel.IsNewVagaroAPI=!0,v.datamodel.async=!1,v.datamodel.callback=function(i){h.attr("data-isoverride","false"),ShowLoader(!1);var n="Membership has been added successfully to cart.";if(0==i.IsSuccess)return n=i.Message,0==i.MessageId?(swal({html:!0,title:n,text:"",type:"",showCancelButton:!0,showConfirmButton:!1,customClass:"Membership-alert-modal",confirmButtonText:"",cancelButtonText:"Close",closeOnCancel:!0},function(n){0==isCheckInApp?n&&(h.attr("data-isoverride","true"),e(t).click(),i.IsSuccess&&_onlineCheckout.GetCartItemCount(i.ItemCount,h,d)):n?(glbMembershipData.closestObj.attr("data-isoverride","true"),glbMembershipData.IsOverride=!0,RedirectAddToCartMembership(glbMembershipData.membershipID,!0),e("#licartIcon a").attr("data-isbypass","true"),e("#licartIcon a").click()):2==glbDataCheckIn.membershipStatus&&(ShowLoader(!0),-1!==i.Message.indexOf("modify")?InsertCheckInLog():(e("#licartIcon a").attr("data-isbypass","true"),e("#licartIcon a").click()))}),void setTimeout(function(){e(".gencutom-title").html("Membership is Already Active")},100)):(swal({title:n,type:"",showConfirmButton:!1,showCancelButton:!0,cancelButtonText:"OK",html:!0},function(e){e&&swal.close()}),void setTimeout(function(){e(".gencutom-title").html("You Already Have a Membership")},100));i.IsSuccess&&(0==isCheckInApp?"Redirect"==m?(ManageAddtoCart(t),_onlineCheckout.GetCartItemCount(i.ItemCount,null,d)):(_shopdetail.IsMemPkgReqToBook,_onlineCheckout.GetCartItemCount(i.ItemCount,h,d)):(e("#licartIcon a").attr("data-isbypass","true"),e("#licartIcon a").click()),void 0!==bkEvent.SelectedPackages&&null!=bkEvent.SelectedPackages&&bkEvent.SelectedPackages.length>0&&(_onlineCheckout.CustomPackageAddToCart(bkEvent.SelectedPackages),IsPkgAdded=!0),bkEvent.SelectedMembership=null),e(t).attr("aria-label","Membership has been added successfully to cart.").focus(),setTimeout(function(){e(t).removeAttr("aria-label")},600)},v.datamodel.data=Data,v.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},v.Post()},_onlineCheckout.escape=function(e){return e.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\/]/g,"\\/").replace(/[\b]/g,"\\b").replace(/[\f]/g,"\\f").replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r").replace(/[\t]/g,"\\t")},_onlineCheckout.GiftCertificateAddToCart=function(t){var i="";if("Send Now"==e("#txtScheduleDate").val()?(e("#txtReciverPhoneNo").prop("required",!1),e("#txtGCEmail").prop("required",!1)):(e("#txtReciverPhoneNo").prop("required",!0),e("#txtGCEmail").prop("required",!0)),!String.isNullOrUndefineOrBlank(e("#txtGCEmail").val())&&String.isNullOrUndefineOrBlank(e("#txtfullname").val())?e("#txtfullname").prop("required",!0):e("#txtfullname").prop("required",!1),String.isNullOrUndefineOrBlank(e("#txtfullname").val())||e("#txtGCEmail").prop("required",!0),e("#div_gcContainer").valid()){if(2==activetabtype){if(""==e("#txtSalonServicesForGC").val())return e(".txtSalonServicesForGCerrortext").show(),e("#txtSalonServicesForGC").addClass("errorInput"),!1;e(".txtSalonServicesForGCerrortext").hide(),e("#txtSalonServicesForGC").removeClass("errorInput")}if(UserID<=0)return objGiftCertificateAddToCart=t,showCommonLoginPopup("GiftCertificateAddToCart"),!1;var n=e(t).closest("#div_gcContainer"),o=0,a="",s="",r=n.find("#paytype .w--current").attr("data-val");if("service"!=r)if(void 0!==e(n.find("#txtGCPromoAmount")).data("selecteddetail")&&""!=e(n.find("#txtGCPromoAmount")).data("selecteddetail")&&e("#txtGCPromoAmount").is(":visible")){var l=JSON.parse(e(n.find("#txtGCPromoAmount")).data("selecteddetail"));o=l.Price,a=l.promotionDetail,s=l.PromotionTitle}else if(n.find("#txtAmount").val()>0&&e("#txtAmount").is(":visible"))o=n.find("#txtAmount").val();else{if(!(n.find("#txtGCPromoAmount").val()>0&&e("#txtGCPromoAmount").is(":visible")))return e(".txtAmounterrortext").show(),e("#txtAmount").addClass("errorInput"),!1;o=n.find("#txtGCPromoAmount").val()}var c={};c.GiftCertificatePhotoID=n.find("#gcpreview").attr("data-photoid"),c.FullName=n.find("#txtfullname").val(),c.Email=n.find("#txtGCEmail").val(),c.Type=r,c.Price="service"==c.Type?e("#hdnServicePriceForGC").val():o,""!=e("#txtSalonServicesForGC").val()&&"service"==c.Type?c.ServiceId=JSON.parse(e("#txtSalonServicesForGC").data("choice")).id:c.ServiceId=0,c.NoOfVisit="service"==c.Type?n.find("#txtMaxQuantity").val():1,c.Message=_onlineCheckout.escape(n.find("#txtmessage").val()),c.TotalPrice=parseFloat(c.Price)*parseInt(c.NoOfVisit),c.businessID=businessID,c.promotiondetail=a,c.promotiontitle=s,c.ReciverPhoneNo=n.find("#txtReciverPhoneNo").val();var d={};if(!String.isNullOrUndefineOrBlank(c.ReciverPhoneNo)){if(!reciverPhoneNumber.validatePhoneNumber())return!1;d=reciverPhoneNumber.getPhoneData(),c.ReciverPhoneNo=d.phoneNo}i="";"Send Now"!=e("#txtScheduleDate").val()&&(i=getdatepickervalue(txtScheduleDate,null,!0,null,!0)),String.isNullOrUndefineOrBlank(i)?c.ScheduleDate=null:c.ScheduleDate=moment(i).format("YYYY-MM-DD HH:mm:ss"),ShowLoader(!0);var u=new vagaro.ajax;u.datamodel.Token=ApiURLEnumOnlineCheckout.giftcertificateaddtocart,u.datamodel.IsNewVagaroAPI=!0,u.datamodel.callback=function(i){ShowLoader(!1);i.IsSuccess,e(t).attr("aria-label","Giftcertificate has been added successfully to cart.").focus(),setTimeout(function(){e(t).removeAttr("aria-label")},600),i.IsSuccess&&(_onlineCheckout.GetCartItemCount(i.ItemCount,n,o),e("#ancShoppingCartIcon").attr("data-isbypass","true"),e("#ancShoppingCartIcon").click())},u.datamodel.data=c,u.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},u.Post()}else 2==activetabtype?""==e("#txtSalonServicesForGC").val()?(e(".txtSalonServicesForGCerrortext").show(),e("#txtSalonServicesForGC").addClass("errorInput")):(e(".txtSalonServicesForGCerrortext").hide(),e("#txtSalonServicesForGC").removeClass("errorInput")):1==activetabtype&&(""==e("#txtGCPromoAmount").val()?(e(".txtAmounterrortext").show(),e("#txtGCPromoAmount").addClass("errorInput")):(e(".txtAmounterrortext").hide(),e("#txtGCPromoAmount").removeClass("errorInput")))},_onlineCheckout.ServiceAddToCart=function(t,i){if(UserID<=0)return objServiceAddToCart=t,showCommonLoginPopup("ServiceAddToCart"),!1;var n=!1,o=t[0];for(var a in o)if("ItemId"===a){n=!0;break}if(n){Data={},Data.businessID=businessID,Data.IsFromClass=!0;var s=[];t.forEach(function(e){var t={};t.ServiceId=String(e.ItemId),t.BillingCycle=e.BillingCycle,t.IsAmount=e.IsAmount,t.IsInitialDiscount=e.IsInitialDiscount,t.InitialDiscount=e.InitialDiscount,t.NoOfVisit=0,t.isCustomPackage=!0,t.promotionDetail=e.PromotionDetail,t.PromotionTitle=e.PromotionTitle,t.IsFromClass=!0,t.eventType=4,s.push(t)}),Data.PackageData=s,ShowLoader(!0),(k=new vagaro.ajax).datamodel.Token=ApiURLEnumOnlineCheckout.serviceaddtocart,k.datamodel.IsNewVagaroAPI=!0,k.datamodel.callback=function(i){ShowLoader(!1);0==i.IsSuccess&&(null!=i.Message&&null!=i.Message&&i.Message),e(t).attr("aria-label","Service has been added successfully to cart.").focus(),setTimeout(function(){e(t).removeAttr("aria-label")},600),i.IsSuccess&&("Redirect"==S?(ManageAddtoCart(t),_onlineCheckout.GetCartItemCount(i.ItemCount,null,d)):1==_shopdetail.IsMemPkgReqToBook?_onlineCheckout.GetCartItemCount(i.ItemCount,null,d):_onlineCheckout.GetCartItemCount(i.ItemCount,r,d)),bkEvent.SelectedPackages=[]},k.datamodel.data=Data,k.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},k.Post()}else{var r=e(t).closest(".service-50"),l=r.find("#pServiceDesc").text();if(t.ItemId>0)var c=t.ItemId;else c=r.attr("data-serviceid");var d=0;"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(d=r.data("price"));var u;u=r.attr("data-promotionDetail");var p;p=r.attr("data-promotiontitle");var h=!1,m=0,g=!1,v=0;void 0===u||""==u?(h=r.attr("data-isinitialdiscount"),m=r.attr("data-initialdiscount"),g=r.attr("data-isamount"),v=r.attr("data-billingcycle")):v=r.attr("data-billingcycle");var f=0;r.attr("data-noofvisit")&&(f=r.attr("data-noofvisit"));var C=!1;r.attr("data-iscustompackage")&&void 0===(C=r.attr("data-iscustompackage"))&&(C=!1);var S="NoRedirect";if("undefined"!=typeof businessID&&1!=i||"undefined"!=e("#hdnBusinessId").val()&&(businessID=e("#hdnBusinessId").val(),S="Redirect",cookieManager.setCookie("Referral","DailyDealToCart",.0833,cookieManager.defaultPath,cookieManager.defaultDomain,!0,!1)),parseFloat(c)>0){if("true"!=C){var y=_shopdetail.CreateAddonCollection();if(!String.isNullOrUndefineOrBlank(y)&&y.length>0&&"undefined"!=typeof iscustompackage&&1!=iscustompackage&&"true"!=iscustompackage){var b=0;e.grep(y,function(e){b=_onlineCheckout.parseTodecimal(b+e.Price,2)}),d=_onlineCheckout.parseTodecimal(d,2)+_onlineCheckout.parseTodecimal(b,2)}}var k;ShowLoader(!0),(k=new vagaro.ajax).datamodel.Token=ApiURLEnumOnlineCheckout.serviceaddtocart,k.datamodel.IsNewVagaroAPI=!0,k.datamodel.callback=function(i){ShowLoader(!1);0==i.IsSuccess&&(null!=i.Message&&null!=i.Message&&i.Message),e(t).attr("aria-label","Service has been added successfully to cart.").focus(),setTimeout(function(){e(t).removeAttr("aria-label")},600),i.IsSuccess&&("Redirect"==S?(ManageAddtoCart(t),_onlineCheckout.GetCartItemCount(i.ItemCount,null,d)):1==_shopdetail.IsMemPkgReqToBook?_onlineCheckout.GetCartItemCount(i.ItemCount,null,d):_onlineCheckout.GetCartItemCount(i.ItemCount,r,d)),bkEvent.SelectedPackages=[]},Data={},Data.businessID=businessID,Data.serviceId=c,Data.noOfVisit=f,Data.isCustomPackage=C,Data.promotionDetail=u,Data.promotionTitle=p,Data.IsInitialDiscount=h,Data.InitialDiscount=m,Data.IsAmount=g,Data.BillingCycle=v,Data.ServiceDesc=l,Data.lstAddonService=y,Data.IsFromClass=!1,k.datamodel.data=Data;try{var _={Action:"Add to Cart",Category:"Deal",PageName:"Deal"};null!=e("#lblSalonName")&&null!=e("#lblSalonName").text()&&(_.BusinessName=e("#lblSalonName").text()),_.BusinessID=businessID,_.isDealDetails=!0,_.IsListPage=!0,_.IsMapPage=!1,_.isFiltered=!1,_.DealName=p,_vgLogEvent.LogData(_)}catch(e){}k.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},k.Post()}}e("#divAddonPopupSection input[type='checkbox']:checked").prop("checked",!1),e("#divAddonPopupSection input[type='radio']:checked").prop("checked",!1)},_onlineCheckout.setCartCountLabel=function(t){1==IsWebsiteBuilderCommunication?wbc._postMessage('{"eventType": "updateCartCount","cartCount": "'+t+'"}'):e(".cart-number").html(t)},_onlineCheckout.GetCartItemCount=function(e,t,i){try{if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&void 0!==i&&void 0!==e&&""!=e&&null!=e&&""!=e&&1==e&&_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.add_to_cart,JSAdjustEventToken.add_to_cart_eventtoken,i),null!=e&&""!=e&&null!=e&&""!=e)void 0!==t&&null!=t&&null!=t?setTimeout(function(){t.animate_from_to(".cart-number:visible",{pixels_per_second:2e3,callback:function(){_onlineCheckout.setCartCountLabel(e)}})},100):_onlineCheckout.setCartCountLabel(e);else if(UserID>0&&businessID>0){var n=new vagaro.ajax;n.datamodel.Token=ApiURLEnumOnlineCheckout.getcartcount,n.datamodel.IsNewVagaroAPI=!0,n.datamodel.callback=function(e){_onlineCheckout.setCartCountLabel(e)},n.datamodel.data={businessID:businessID},n.datamodel.Error=function(e){},n.Post()}else _onlineCheckout.setCartCountLabel("0")}catch(e){_onlineCheckout.setCartCountLabel("0")}},_onlineCheckout.ensureFamilyAndFriendsDetailsLoadedSync=function(){if(!("undefined"==typeof UserID||UserID<=0||null!=_onlineCheckout.FamilyAndFriendsDetails)){var e=new vagaro.ajax;e.datamodel.Token="GetFamilyAndFriendsDetailsByUserID",e.datamodel.data={objRequest:{businessID:businessID,loginUserID:UserID,UserID:UserID,IsLoadFromOffline:!0,strLoginUserId:strUserID,parentPage:"OnlineShoppingCart"}},e.datamodel.async=!1,e.datamodel.callback=function(e){null!=e&&(_onlineCheckout.FamilyAndFriendsDetails=e)},e.datamodel.Error=function(e){},e.Post()}},_onlineCheckout.isFamilyMemberCustomerId=function(t){if(null==t||""===t||null==_onlineCheckout.FamilyAndFriendsDetails)return!1;var i=_onlineCheckout.FamilyAndFriendsDetails;return!e.isArray(i)&&i&&e.isArray(i.Data)&&(i=i.Data),!!e.isArray(i)&&e.grep(i,function(e){return null!=e&&e.UserID==t}).length>0},_onlineCheckout.classAddToCart=function(t,i){var n=!1;_vgClassSessionSelection.isCallFromPublic()&&(businessID=_publicEvent.objEventDetails.BusinessID,n=!0);var o={businessID:businessID,events:t,loginUserID:UserID,ischeckinApp:isCheckInApp,IsLiveStream:n},a=0;"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(a=parseFloat(e("#hdnAdjustClassTotalPrice").val()),e("#hdnAdjustClassTotalPrice").val("0"));var s=new vagaro.ajax;s.datamodel.Token=ApiURLEnumOnlineCheckout.classaddtocart,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=function(n){if(_onlineCheckout.GetCartItemCount(n.ItemCount,null,a),1==_shopdetail.IsMemPkgReqToBook&&(e.grep(t,function(t){var i=t.eventEnrollment;e.grep(i,function(e){e.eventID==_vgClassSessionSelection.commonProperty.eventID&&null!=bkEvent.SelectedMembership&&(e.customerID==UserID?_onlineCheckout.MembershipAddToCart(bkEvent.SelectedMembership):(_onlineCheckout.ensureFamilyAndFriendsDetailsLoadedSync(),_onlineCheckout.isFamilyMemberCustomerId(e.customerID)&&_onlineCheckout.MembershipAddToCart(bkEvent.SelectedMembership)))})}),null==bkEvent.SelectedMembership&&void 0!==bkEvent.SelectedPackages&&null!=bkEvent.SelectedPackages&&bkEvent.SelectedPackages.length>0&&_onlineCheckout.CustomPackageAddToCart(bkEvent.SelectedPackages)),1==i)if(_vgClassSessionSelection.isCallFromPublic()&&(1==e("#live-stream-classes-popup").is(":visible")&&e("#live-stream-classes-popup").modal("hide"),window.location.href="/"+_publicEvent.objEventDetails.VagaroURL+"/shopping-bag/live-stream"),0==isCheckInApp){var o=e("#ancShoppingCartIcon");o.length>0&&(o.attr("data-isbypass","true"),o.click())}else e("#licartIcon a").attr("data-isbypass","true"),e("#licartIcon a").click()},s.datamodel.data=o,s.datamodel.Error=function(t){if(vagaro.alert("Some error occured. Please try again."),1==i)if(0==isCheckInApp){var n=e("#ancShoppingCartIcon");n.length>0&&(n.attr("data-isbypass","true"),n.click())}else e("#licartIcon a").attr("data-isbypass","true"),e("#licartIcon a").click()},s.Post()},_onlineCheckout.checkoutGotoNextStep=function(t){if(e("#page-wrapper").animate({scrollTop:0},"slow"),1==t){if(1==_onlineCheckout.IsCalledFromLiveStream())return void("undefined"!=typeof vgAppicationType&&1==vgAppicationType?e("#custmobileBack").click():window.history.go(-1));_onlineCheckout.loadNewCCandShip=!1,_onlineCheckout._checkoutPageVisitedLogged=!1,e("#txtPromoCode").val(""),e("#divApplyPromocode").empty(),e("#shoppingcartfirst").show(),e("#shoppingcartsecond").hide(),e("#chkreturnpolicy").prop("checked",!1),e("#lblreturnpolicy").css("color",""),_onlineCheckout.LoadShoppingCartExternal(),_onlineCheckout.rebindCartDataAfterPartialCheckOut()}else{e("#shoppingcartfirst").hide(),e("#shoppingcartsecond").show(),_onlineCheckout.FireOnlineCheckoutPageVisited(),setTimeout(function(){e("#h1InBusinessName").attr("tabindex",-1).focus()},1e3);var i=[];if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&(i=e.grep(onlineShoppingCart.Inventories,function(e){return 1==e.IsDropShip})),4==ShippingID?e("#btnShipToAddress").hide():"false"==IsEnablePickUpInStore.toString().toLowerCase()||i.length>0?(e("#btnShipToAddress").click(),e("#btnInStorePickup").hide()):(e("#btnInStorePickup").click(),e("#btnInStorePickup").show()),newShippingAddress=e("#txtNewShippingAddress").GoogleAddressPlugin({Address2Control:"#txtNewShippingAptSuite",CurrentLocationCountryID:"undefined"!=typeof BusinessCountryID&&null!=BusinessCountryID&&""!=BusinessCountryID?parseInt(BusinessCountryID):_onlineCheckout.CountryID,CountryDropDownRole:0}),_onlineCheckout.rightSideCartDataBind(),e("#btnShipToAddress").click(function(){e("#aOldUserAddress").click()}),e("#btnInStorePickup").click(function(){e("#divPickupDateError").hide(),e("#txtPickupDateTime").removeClass("errorInput"),setTimeout(function(){_onlineCheckout.setShippingAddressObject()},100)}),e("#saveaddressinfo").click(function(){e("#saveaddressinfo").prop("checked")?e("#lblsaveaddressinfo").attr("aria-checked","true"):e("#lblsaveaddressinfo").attr("aria-checked","false")}),e("#chkgcprint").click(function(){e("#chkgcprint").prop("checked")?e("#lblgcprint").attr("aria-checked",!0):e("#lblgcprint").attr("aria-checked",!1)}),e("#chkgcsendmail").click(function(){e("#chkgcsendmail").prop("checked")?e("#lblgcsendmail").attr("aria-checked",!0):e("#lblgcsendmail").attr("aria-checked",!1)}),e("#chkreturnpolicy").click(function(){e("#chkreturnpolicy").prop("checked")?e("#lblreturnpolicy").attr("aria-checked",!0):e("#lblreturnpolicy").attr("aria-checked",!1)}),e("#chkinvoicereturnpolicy").click(function(){e("#chkinvoicereturnpolicy").prop("checked")?e("#lblinvoicereturnpolicy").attr("aria-checked",!0):e("#lblinvoicereturnpolicy").attr("aria-checked",!1)}),e("#aOldUserAddress").unbind("click"),e("#aOldUserAddress").click(function(t){e("#txtNewShipFirstName").val(""),e("#txtNewShipLastName").val(""),e("#txtNewShippingAddress").select2("data",{id:"",text:""}),e("#txtNewShippingAptSuite").val(""),e("#txtNewShipPhone").val(""),e("#saveaddressinfo").attr("checked",!1);var i={};i.country="undefined"!=typeof BusinessCountryID&&null!=BusinessCountryID&&""!=BusinessCountryID?parseInt(BusinessCountryID):_onlineCheckout.CountryID,newShippingAddress.setAddressData(i),_onlineCheckout.clearShippingMethod(),onlineShoppingCart.IsAddressOnFile=!0,setTimeout(function(){_onlineCheckout.setShippingAddressObject()},100)}),e("#aDiffUserAddress").unbind("click"),e("#aDiffUserAddress").click(function(e){_onlineCheckout.clearShippingMethod(),onlineShoppingCart.IsAddressOnFile=!1,setTimeout(function(){_onlineCheckout.setShippingAddressObject()},100),_onlineCheckout.LoadStatesByMultipleCountryID(),_onlineCheckout.ValidateVPl(!1)}),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Packages)&&onlineShoppingCart.Packages.length>0&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.GiftCertificates)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Memberships)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Events))for(var n=0;n<onlineShoppingCart.Packages.length;n++){if("Package"==onlineShoppingCart.Packages[n].ParentServiceTitle){e("#divreturnpolicy").show();break}e("#divreturnpolicy").hide()}else e("#divreturnpolicy").show();_onlineCheckout.isValidForCheckoutInvoice()&&("true"==IsOnLineShoppingCart.toLowerCase()?(e("#divreturnpolicy").hide(),e("#divreturnpolicyPayInvoice").show()):(e("#divreturnpolicy").hide(),e("#divreturnpolicyPayInvoice").hide())),!String.isNullOrUndefineOrBlank(onlineShoppingCart)&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.GiftCertificates)&&onlineShoppingCart.GiftCertificates.length>0?e("#gcprintandsendmailcheckbox").show():e("#gcprintandsendmailcheckbox").hide(),_onlineCheckout.getBusinessWorkingHours(),"undefined"!=typeof isBrandedAppForApproval&&null!=isBrandedAppForApproval&&1==isBrandedAppForApproval?(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide()):(onlineShoppingCart.PartialPrice!=(void 0===onlineShoppingCart.PartialPrice||String.isNullOrUndefineOrBlank(onlineShoppingCart.PartialPrice))&&onlineShoppingCart.PartialPrice,parseFloat(onlineShoppingCart.ccAmt)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining)-parseFloat(onlineShoppingCart.FeeDepositsRemaining)>0||1==_onlineCheckout.IsCCDetailEnable()&&parseFloat(onlineShoppingCart.classFinalTotal-parseFloat(onlineShoppingCart.DepositsRemaining)-parseFloat(onlineShoppingCart.PartialPrice))>0||1==_onlineCheckout.isValidForCheckoutInvoice()||parseFloat(onlineShoppingCart.tipValue)>0||1==_onlineCheckout.IsLoadCCIframForMemrship()||IsDailyDealFeeCCOFF&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Memberships)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Packages)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.GiftCertificates)?_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout"):(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide())),1==_onlineCheckout.Model.IsPaymentOption&&e("#dvCheckoutBookingPaymentMethod").show(),_onlineCheckout.PromoBox(),setTimeout(_onlineCheckout.setShippingAddressObject,100),_onlineCheckout.ClearCheckOutValidationMessage(),0==_onlineCheckout.loadNewCCandShip&&_onlineCheckout.clearShippingMethod(),_onlineCheckout.loadNewCCandShip=!0,_onlineCheckout.CheckLiveStreamAddressVisibleOrNot();var o=!1;void 0!==onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(e){e.paidType==_onlineCheckout.arrpaidType.PaidClass&&(o=!0)})}),null!=onlineShoppingCart.ServiceInvoice&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){e.paidType==_onlineCheckout.arrpaidType.Paid&&(o=!0)}),_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(isAllowTipForInvoice)&&"true"!=isAllowTipForInvoice.toLowerCase().trim()&&(o=!1),onlineShoppingCartmain.IsFullDeposit&&void 0!==onlineShoppingCartmain.TipOption&&null!=onlineShoppingCartmain.TipOption&&""!=onlineShoppingCartmain.TipOption&&"0"!=onlineShoppingCartmain.TipOption&&o?(e("#divTip").show(),_onlineCheckout.ShowTipOptions()):e("#divTip").hide(),_onlineCheckout.isValidForCheckoutInvoice()&&setTimeout(function(){e("#h1InBusinessName").attr("tabindex",-1).focus()},1e3),e("#divTotalDuePrice").focusin(function(){e("#divTotalDuePrice").removeAttr("tabindex"),e("#ancBuyNow").attr("aria-labelledby","divTotalTitle divfinalTotalPrice lblGcEndingNumber lblGCRedeemAmt divTotalDueNow divCartPrepaypricewithoutGC divTotalDueNowTitle divcartdepositpricewithoutgc divTotalDueAtBusinessTitle divcarttotalduepriceatbusiness ancBuyNow")}),e("#divTotalDuePrice").focusout(function(){e("#divTotalDuePrice").attr("tabindex",0),e("#ancBuyNow").attr("tabindex",-1).focus()}),e("#ancBuyNow").focusout(function(){e("#ancBuyNow").attr("aria-labelledby","ancBuyNow")})}},_onlineCheckout.ShowTipOptions=function(){_onlineCheckout.ShowHideTipOptions(!0),e("#divfinalCheckoutTipAmount").show(),0==onlineShoppingCart.tipValue&&(e("#lstTipTabList").is(":visible")||_onlineCheckout.CreateHtmlTip())},_onlineCheckout.HideTipOptions=function(){onlineShoppingCart.tipValue=0,onlineShoppingCart.tipPercent=0,e("#divfinalCheckoutTipAmount").html(""),e("#divfinalCheckoutTipAmount").html(currencysymbol+"0.00"),e("#divfinalCheckoutTipAmount").hide(),e("#txtOnlineCustomerTip").val("0.00"),e("#divTip").hide(),_onlineCheckout.displayFinalCalculatedPrice(),parseFloat(onlineShoppingCart.ccAmt)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining)>0||1==_onlineCheckout.IsCCDetailEnable()&&parseFloat(onlineShoppingCart.classFinalTotal-parseFloat(onlineShoppingCart.DepositsRemaining))>0||parseFloat(onlineShoppingCart.tipValue)>0||1==_onlineCheckout.IsLoadCCIframForMemrship()?_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout"):(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide(),e("#divVplTracking").hide())},_onlineCheckout.GetTotalCartAmountforTip=function(){var t=0;return _onlineCheckout.TotalPaidCount=0,null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(i){i.paidType==_onlineCheckout.arrpaidType.PaidClass&&(_onlineCheckout.TotalPaidCount=++_onlineCheckout.TotalPaidCount,t=1==i.isPackage||1==i.isPointApply||i.isMembershipApply||i.isPresetApply||void 0!==i.PromotionID&&null!=i.PromotionID&&i.PromotionID>0?_onlineCheckout.parseTodecimal(t+i.Originalprice,2):_onlineCheckout.parseTodecimal(t+i.price,2)),null!=i.lstAddonService&&e.grep(i.lstAddonService,function(e){e.paidType==_onlineCheckout.arrpaidType.PaidClass&&(_onlineCheckout.TotalPaidCount=++_onlineCheckout.TotalPaidCount,t=1==e.isPackage||1==e.isPointApply||e.isMembershipApply||i.isPresetApply?_onlineCheckout.parseTodecimal(t+e.Originalprice,2):_onlineCheckout.parseTodecimal(t,2)+_onlineCheckout.parseTodecimal(isNaN(e.price)?e.Price:e.price,2))})})}),t},_onlineCheckout.CreateHtmlTip=function(){"undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart&&void 0!==onlineShoppingCart.tipPercent&&null!=onlineShoppingCart.tipPercent&&(onlineShoppingCart.tipPercent=0),void 0!==onlineShoppingCartmain.TipType&&null!=onlineShoppingCartmain.TipType&&""!=onlineShoppingCartmain.TipType&&(tipType=onlineShoppingCartmain.TipType.toLowerCase());var t=onlineShoppingCartmain.TipOption.split(","),i="";e("#lstTipTabList").html(""),e("#dvTipBlock").html(""),_shopdetail.VisibleControlLength("#mobile-check")>0?(e("#divCartTipSelectionMobile").html(""),e("#divCartTipSelectionMobile").html('<div class="checkout-title">Tip</div><div class="tip-tablist vagaro-segment vagaro-segment-mobile-full" id="lstTipTabList"></div><div class="tipBlock" id="dvTipBlock" style="display: none;"></div>')):(e("#divCartTipSelection").html(""),e("#divCartTipSelection").html('<div class="tip-tablist vagaro-segment vagaro-segment-mobile-full" id="lstTipTabList"></div><div class="tipBlock" id="dvTipBlock" style="display: none;"></div>'));var n=0;n=onlineShoppingCartmain.IsFullDeposit&&"true"!=_onlineCheckout.isFromInvoice.toString().toLowerCase()?_onlineCheckout.GetTotalCartAmountforTip():_onlineCheckout.GetSumOfProdcutOrService();for(var o=0;o<t.length;o++){var a,s;"dollar"===tipType?(a=parseFloat(t[o]),s=currencysymbol+a):(a=n*parseFloat(t[o])/100,s=t[o]+"%");var r="dollar"===tipType?"":"<div class='text-blockNew text-secondary'>("+currencysymbol+a.toFixed(2)+")</div>";i="<a href='javascript:void(0);' class='tip-tab vg-filter-mobile-tab' tip-amount='"+a.toFixed(2)+"' tip-percentage='"+t[o]+"' onClick='_onlineCheckout.setTipValueOnline("+t[o]+",this)'><div>"+s+"</div>"+r+"</a>",o==t.length-1&&(i+="<a href='javascript:void(0);' class='tip-tab vg-filter-mobile-tab' tip-amount='0' tip-percentage='0' onClick='_onlineCheckout.showOtherTipOption(true,1,this)'><div>Custom</div></a>"),e("#lstTipTabList").append(i)}var l="<div class='tipInputHolder vagaro-input-prefix-text'><div id='dvServiceDollarSign' class='dollersign doller-icon' style='display: block;'>"+currencysymbol+"</div><input Id='txtOnlineCustomerTip' type='text' class='tipInputField vagaro-input tip-currency' onkeypress='return _onlineCheckout.validateCustomTipKeyPress(this, event);' maxlength='6' tip-amount='0' placeholder='Custom' onBlur='validateDecimal(this,1,2);_onlineCheckout.setTipValueOnline(-1);' onkeyup='pasteHandlerKeyup(this,event,1);_onlineCheckout.enforceCustomTipMinimum(this);' onfocus='_onlineCheckout.setFocusinCustomTip();' value='0.00' /></div>";void 0!==i&&null!=i&&""!=i&&e("#dvTipBlock").append(l)},_onlineCheckout.directClassGoBack=function(){e("#divFormsDirectClass").hide(),e("#shoppingcartfirst").show()},_onlineCheckout.clearShippingMethod=function(){e(".upsFedexIcoN").removeClass("uspsIcon");var t=e("#divShippingTab"),i=t.find(".divshpopt"),n=t.find(".divshpcontent");2==_onlineCheckout.IsVPLAddress||String.isNullOrUndefineOrBlank(onlineShoppingCart)||(onlineShoppingCart.SelectedShippingMethod=null,onlineShoppingCart.shippingOptions=null),e("#divShippingerrorTab").hide(),e(i).html(""),e(n).html("")},_onlineCheckout.saveNewPopAddrss=function(t){if(e("#divNewShippingAddressPopup").valid()){0==t&&_onlineCheckout.clearShippingMethod();var i=e("#txtNewStreet").val(),n=e("#txtNewCity").val(),o=e("#txtNewState").val(),a=e("#txtNewZip").val(),s=i;s=(s=(s=s+(""!=s?", ":"")+n)+(""!=s?", ":"")+o)+(""!=s?", ":"")+a,0==_onlineCheckout.IsVPLAddress?(e("#txtNewShippingAddress").select2("val",s),e("#txtNewShippingAddress").attr("data-preval",s)):(e("#txtAddressVPL").select2("val",s),e("#txtAddressVPL").attr("data-preval",s),_onlineCheckout.setAddressControl()),e("#divNewShippingAddressPopup").modal("hide");var r={};if(r.street=s,r.city=n,r.state=o,r.zip=a,r.countryId=e("#cboCountryshopping").val(),r.countrytext=countryMapping[e("#cboCountryshopping").val()],e("#txtNewShippingAptSuite").val(e("#txtStreet1").val()),r.streetNo=e("#txtNewShippingAptSuite").val(),r.stateID=_onlineCheckout.getMappingStateId(r.countryId,r.state),e("#hdnNewAddressDataCheckout").val(JSON.stringify(r)),0!=_onlineCheckout.IsVPLAddress)return!0;_onlineCheckout.setShippingAddressObject()}return!1},_onlineCheckout.GetCityByZipCode=function(t){var i=0,n="";if("1"==e("#divaddressonfile .w--current").attr("data-adval")?(i=e("#divaddressonfile .w--current").attr("data-countryid"),n=e("#divaddressonfile .w--current").attr("data-zip")):(i=e("#cboCountryshopping").val(),n=new String(e("#txtNewZip").val())),!String.isNullOrUndefineOrBlank(t)&&String.isNullOrUndefineOrBlank(n)&&(n=e(t).val()),""!=n&&i>0){ShowLoader(!0);var o=new vagaro.ajax,a={CountryID:parseInt(i),strZipCode:n.toString()};o.datamodel.async=!1,o.datamodel.Token=_onlineCheckout.GetCoreAPIURLWithToken(ApiURLEnumOnlineCheckout.getStateCode,groupID),o.datamodel.IsNewVagaroAPI=!0,o.datamodel.data=a,o.datamodel.callback=function(t){if(ShowLoader(!1),1e3==t.CustomCode){var n=t.Data,o=n.split("|")[0],a=1*n.split("|")[1],s=n.split("|")[2];e("#txtNewCity").val(o),e("#txtNewState").val(s),e(".ddlState").val(a),""==t?(e("#txtNewState").val(""),e("#txtNewZip").val("")):e("#txtNewState").attr("disabled",!0),e("#hdnNewCountrycode").val(countryMapping[i]),e("#hdnNewCountryName").val(countryNameMapping[i])}},o.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},o.Post()}},_onlineCheckout.getMappingStateId=function(t,i){if(null!=_onlineCheckout.StatesList&&null!=_onlineCheckout.StatesList&&_onlineCheckout.StatesList.length>0){var n=e.grep(_onlineCheckout.StatesList,function(e){return e.CountryID==t&&e.StateName==i});if(null!=n&&null!=n&&n.length>0)return n[0].StateID}return 0},_onlineCheckout.LoadStatesByMultipleCountryID=function(){if(null!=_onlineCheckout.StatesList&&null!=_onlineCheckout.StatesList||(_onlineCheckout.StatesList=[]),null!=_onlineCheckout.StatesList&&null!=_onlineCheckout.StatesList&&_onlineCheckout.StatesList.length<=0){var e=new vagaro.ajax;e.datamodel.Token=ApiURLEnumOnlineCheckout.getstatesbymultiplecountryid,e.datamodel.IsNewVagaroAPI=!0;e.datamodel.data={CountryIDs:[1,2,3,4]},e.datamodel.callback=function(e){_onlineCheckout.StatesList=e},e.datamodel.Error=function(e){},e.Post()}},_onlineCheckout.validateNewShippingAddressData=function(){
//!String.isNullOrUndefineOrBlank($('#txtNewShippingAddress').val())
return!(String.isNullOrUndefineOrBlank(e("#txtNewStreet").val())||String.isNullOrUndefineOrBlank(e("#txtNewZip").val())||String.isNullOrUndefineOrBlank(e("#txtNewState").val())||String.isNullOrUndefineOrBlank(e("#txtNewCity").val()))||(_onlineCheckout.GetState(),_onlineCheckout.ChangeCountry(_onlineCheckout.selectedCountryId),_onlineCheckout.openCloseAddresspopup(1),!1)},_onlineCheckout.ClearNewShippingAddressValue=function(t){e("#txtNewStreet").val(""),e("#txtNewCity").val(""),e("#txtNewState").val(""),e("#txtNewZip").val(""),_onlineCheckout.clearShippingMethod()},_onlineCheckout.openCloseAddresspopup=function(t){return 1==t?(e("#txtNewState").attr("disabled",!0),GatherClickElement("#txtNewShippingAddress"),e("#divNewShippingAddressPopup").modal("show"),e("#txtStreet1").val(e("#txtNewShippingAptSuite").val()),!1):(e("#divNewShippingAddressPopup").modal("hide"),e("#txtNewShippingAddress").focus(),!1)},_onlineCheckout.getShippingMethods=function(){var t,i=e("#divaddressonfile .w--current").attr("data-adval"),n="",o="",a="",s="",r="",l="";if("1"==i)n=e("#divaddressonfile .w--current").attr("data-countrycode"),o=e("#divaddressonfile .w--current").attr("data-countryname"),a=e("#divaddressonfile .w--current").attr("data-zip"),s=e("#divaddressonfile .w--current").attr("data-fullname"),r=e("#divaddressonfile .w--current").attr("data-street"),l=e("#divaddressonfile .w--current").attr("data-city");else{var c={};if(!newShippingAddress.validateAddressData())return!1;c=newShippingAddress.getAddressData(),n=String.isNullOrUndefineOrBlank(c.countryCode)?e("#hdnNewCountrycode").val():c.countryCode,o=String.isNullOrUndefineOrBlank(c.countryName)?e("#hdnNewCountryName").val():c.countryName,a=c.zip,s=e("#txtNewShipFirstName").val()+" "+e("#txtNewShipLastName").val(),r=c.address,l=c.city}if(""==a||null==a||""==a)return swal("Please enter valid shipping address"),!1;String.isNullOrUndefineOrBlank(onlineShoppingCart)||String.isNullOrUndefineOrBlank(onlineShoppingCart.Address)||(t=onlineShoppingCart.Address.countryID),ShowLoader(!0);var d={};"undefined"!=typeof BusinessDetail&&null!=BusinessDetail&&(d.businessName=BusinessDetail.BusinessName,d.businessStreet=BusinessDetail.Street,d.businessCity=BusinessDetail.City),d.businessId=businessID,d.businessCountryID=BusinessCountryID,d.businessZipCode=BusinessZipCode,d.countryCode=n,d.countryName=o,d.zipCode=a,d.name=s,d.street=r,d.city=l,d.isAddressOnFile=i,d.CurrencyCode=currencyCode,d.CountryID=t,d.IsWebsiteBuilder=void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication;var u=new vagaro.ajax;u.datamodel.Token="GetShippingMethods_New",u.datamodel.callback=_onlineCheckout.OnLoadShippingMethodSuccess,u.datamodel.data=[d],u.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},u.Post()},_onlineCheckout.OnLoadShippingMethodSuccess=function(t){if(ShowLoader(!1),e("#divShippingerrorTab").hide(),null!=t){var i,n="",a=e("#divShippingTab"),s=a.find(".divshpopt"),r=a.find(".divshpcontent");if(e(s).html(""),e(r).html(""),0==t.Success)return t.Errors[0].indexOf("administrator")>-1||t.Errors[0].indexOf("Invalid XML")>-1?void vagaro.alert("Some error occured."):void vagaro.alert(t.Errors[0]);if(i=t.ShippingOptions,onlineShoppingCart.shippingOptions=t.ShippingOptions,onlineShoppingCart.IsFreeShip=t.IsFreeShip,onlineShoppingCart.shippingOptionsInd=t.ShippingOptionsInd,1==onlineShoppingCart.IsFreeShip){var l=[];e(i).each(function(e,t){l.push(t.Rate)}),o=Math.min.apply(Math,l)}e(i).each(function(t,i){if(i.Rate==o){e(s).append('<a class="shipping-method w-inline-block w-tab-link" data-w-tab="tab_shp_'+t+'" onclick="_onlineCheckout.clickShipingMethod('+t+');"><div>'+i.Name+" <font color='red'>(Free Shipping)</font></div></a>")}else e(s).append('<a class="shipping-method w-inline-block w-tab-link" data-w-tab="tab_shp_'+t+'" onclick="_onlineCheckout.clickShipingMethod('+t+');"><div>'+i.Name+" "+currencysymbol+i.Rate.format("#.##")+"</div></a>");e(r).append('<div class="w-tab-pane" data-w-tab="tab_shp_'+t+'"></div>'),0==t&&(n=i.ShippingRateComputationMethodSystemName)}),""!=n&&("usps"==n.toLowerCase()?(e(".upsFedexIcoN").removeClass("upsIcon"),e(".upsFedexIcoN").removeClass("fedexIcon"),e(".upsFedexIcoN").removeClass("evriicon"),e(".upsFedexIcoN").removeClass("royalmail"),e(".upsFedexIcoN").addClass("uspsIcon"),e(".upsFedexIcoN").show()):"ups"==n.toLowerCase()?(e(".upsFedexIcoN").removeClass("uspsIcon"),e(".upsFedexIcoN").removeClass("fedexIcon"),e(".upsFedexIcoN").removeClass("evriicon"),e(".upsFedexIcoN").removeClass("royalmail"),e(".upsFedexIcoN").addClass("upsIcon"),e(".upsFedexIcoN").show()):"fedex"==n.toLowerCase()?(e(".upsFedexIcoN").removeClass("uspsIcon"),e(".upsFedexIcoN").removeClass("upsIcon"),e(".upsFedexIcoN").removeClass("evriicon"),e(".upsFedexIcoN").removeClass("royalmail"),e(".upsFedexIcoN").addClass("fedexIcon"),e(".upsFedexIcoN").show()):"evri"==n.toLowerCase()?(e(".upsFedexIcoN").removeClass("upsIcon"),e(".upsFedexIcoN").removeClass("fedexIcon"),e(".upsFedexIcoN").removeClass("uspsIcon"),e(".upsFedexIcoN").removeClass("royalmail"),e(".upsFedexIcoN").addClass("evriicon"),e(".upsFedexIcoN").show()):"royalmail"==n.toLowerCase()&&(e(".upsFedexIcoN").removeClass("upsIcon"),e(".upsFedexIcoN").removeClass("fedexIcon"),e(".upsFedexIcoN").removeClass("uspsIcon"),e(".upsFedexIcoN").removeClass("evriicon"),e(".upsFedexIcoN").addClass("royalmail"),e(".upsFedexIcoN").show())),_onlineCheckout.initWebFlowtab()}else vagaro.alert("Invalid zip/postal code.");ShowLoader(!1)},_onlineCheckout.getFinalCCAmount=function(){var e=0;return"undefined"!=typeof onlineShoppingCart&&void 0!==onlineShoppingCart.FinalCCAmount&&(e=onlineShoppingCart.FinalCCAmount),e},_onlineCheckout.clickShipingMethod=function(t){if(onlineShoppingCart.SelectedShippingMethod=onlineShoppingCart.shippingOptions[t],onlineShoppingCart.SelectedShippingMethod.Rate==o&&(onlineShoppingCart.SelectedShippingMethod.Rate=0),_onlineCheckout.displayFinalCalculatedPrice(),e("#divShippingerrorTab").hide(),e("#divShippingerrorTab").html(""),(0==e("#dvCheckoutBookingPaymentMethod").is(":visible")||0==e(_onlineCheckout.Controls.DvcheckoutBookingTabs).is(":visible"))&&onlineShoppingCart.SelectedShippingMethod.Rate>0)_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout");else{var i=_onlineCheckout.getFinalCCAmount();0==parseFloat(i)&&0==_onlineCheckout.IsLoadCCIframForMemrship()?(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide(),e("#divcheckoutSelectPaymentMethodTitle").html("")):_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout")}_onlineCheckout.PromoBox();var n=null,a=null;null!=e("#divcartdepositprice")[0]&&null!=e("#divcartdepositprice")[0].innerHTML&&(a=e("#divcartdepositprice")[0].innerHTML.replace(currencysymbol,"")),null!=e("#lblGCRedeemAmt")[0]&&(n=(n=e("#lblGCRedeemAmt")[0].innerHTML.replace("$(","")).replace(")","")),null!=a&&null!=a&&0!=a?(totalDueAmt=e("#divfinalTotalPrice")[0].innerHTML.replace(currencysymbol,"")-a,FinalCCAmount=totalDueAmt,e("#VplAmount")[0].innerHTML=currencysymbol+_onlineCheckout.ConvertDecimalWithFixed(FinalCCAmount,!0,2)):null!=n&&null!=n&&0!=n?(totalDueAmt=e("#divfinalTotalPrice")[0].innerHTML.replace(currencysymbol,"")-onlineShoppingCart.gcAmt,FinalCCAmount=totalDueAmt,e("#VplAmount")[0].innerHTML=currencysymbol+_onlineCheckout.ConvertDecimalWithFixed(FinalCCAmount,!0,2)):(FinalCCAmount=e("#divfinalTotalPrice")[0].innerHTML.replace(currencysymbol,""),e("#VplAmount")[0].innerHTML=e("#divfinalTotalPrice")[0].innerHTML),!String.isNullOrUndefineOrBlank(BusinessDetail)&&FinalCCAmount<=BusinessDetail.MaximumAmount&&FinalCCAmount>=BusinessDetail.MinimumAmount&&"Free"==e("#divfinalTotalPrice")[0].innerHTML&&e("#divVplTracking").hide(),e("#VplAmount").length>0&&(e("#VplAmount")[0].innerHTML=currencysymbol+_onlineCheckout.ConvertDecimalWithFixed(FinalCCAmount,!0,2)),1==e("#tabVagaroPayLater").hasClass("w--current")&&FinalCCAmount>0&&_vgVPLOnline.PaymentSchedule(FinalCCAmount,_onlineCheckout.PaymentSchduleSuccess,_onlineCheckout.PaymentSchdulefail),1==onlineShoppingCartmain.IsEnableVCFFee&&_onlineCheckout.IsVCFFeeExists()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.ShippingMethod))},_onlineCheckout.shipToAddressClick=function(e){return!1},_onlineCheckout.checkIfProductExists=function(){e('.shopping-bag-items [data-type="inventory"]').length>0?e("#divshippinginfo").show():e("#divshippinginfo").hide()},_onlineCheckout.rightSideCartDataBind=function(){if(!String.isNullOrUndefineOrBlank(onlineShoppingCart)){e("#divcartcheckoutsummary").html("");var t="";if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0){var i=e.grep(onlineShoppingCart.Inventories,function(e){return 0==e.MasterInventoryId});e.each(i,function(i,n){var o="";if(!String.isNullOrUndefineOrBlank(n.InventoryBundleCartDetails)){var a=n.InventoryBundleCartDetails.split("|^|");e.each(a,function(e,i){if(!String.isNullOrUndefineOrBlank(i)){var n=i.split("~");t+="Product Name is "+n[0]+" and BrandName is "+n[1]+" ",a.length>2&&!String.isNullOrUndefineOrBlank(n[2])?o+='<li class="bundle-product web-body-font"><div class="product-name thm-textColor web-caption-text web-builder-font-color">'+n[2]+'</div><div class="product-name thm-textColor web-caption-text web-builder-font-color">'+n[0]+'</div><div class="brand-name-checkout thm-textColor web-caption-text web-builder-font-color">'+n[1]+"</div></li>":o+='<li class="bundle-product web-body-font"><div class="product-name thm-textColor web-caption-text web-builder-font-color">'+n[0]+'</div><div class="brand-name-checkout thm-textColor web-caption-text web-builder-font-color">'+n[1]+"</div></li>"}}),n.BrandName="",n.BundleName=t,0==n.OriginalPrice&&(n.OriginalPrice=n.Price/n.Quantity)}n.InventoryBundleCartDetailsHtml=o}),e("#temlcartcheckoutinventoriessummary").tmpl(i).appendTo("#divcartcheckoutsummary"),onlineVPLCheckout=1}if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&(e("#temlcartcheckoutpackagessummary").tmpl(onlineShoppingCart.Packages).appendTo("#divcartcheckoutsummary"),onlineVPLCheckout=1),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&(e("#temlcartcheckoutGiftCertificatessummary").tmpl(onlineShoppingCart.GiftCertificates).appendTo("#divcartcheckoutsummary"),onlineVPLCheckout=1),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&(e("#temlcartcheckoutmembershipssummary").tmpl(onlineShoppingCart.Memberships).appendTo("#divcartcheckoutsummary"),onlineVPLCheckout=1),null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(e("#temlcartcheckoutEventssummary").tmpl(onlineShoppingCart.Events).appendTo("#divcartcheckoutsummary"),_vgLogEvent.model.EventDurationRemain=parseInt(onlineShoppingCart.Events[0].eventEnrollment[0].EventDurationRemain),_vgLogEvent.model.EventDurationRemain<6?_vgLogEvent.model.buttonText="Join Now":_vgLogEvent.model.buttonText="Sign Up",onlineVPLCheckout=null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0?1:0),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e("#scptService").tmpl(onlineShoppingCart.ServiceInvoice).appendTo("#divcartcheckoutsummary"),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.invoiceDetails&&null!=onlineShoppingCart.invoiceDetails){try{onlineShoppingCart.invoiceDetails.DueDate=moment(onlineShoppingCart.invoiceDetails.DueDate).format("MMM D, YYYY"),4==onlineShoppingCart.invoiceDetails.Status?onlineShoppingCart.invoiceDetails.isOverdue=!0:onlineShoppingCart.invoiceDetails.isOverdue=!1}catch(e){}_onlineCheckout.FillInvoiceLeftSideDetails(onlineShoppingCart.invoiceDetails)}_onlineCheckout.ImgLazyLoad()}_onlineCheckout.isValidForCheckoutInvoice()&&e("#invShowOrderSummary").is(":visible")&&"none"==e(".order-summary").parent().css("display")&&(e("#invShowOrderSummary").mousedown(),e("#invShowOrderSummary").trigger("click")),_onlineCheckout.IsValidatedOnePerUser||_onlineCheckout.ValidateOnePerUserDeal()},_onlineCheckout.ValidateOnePerUserDeal=function(t){_onlineCheckout.IsValidatedOnePerUser=!0;var i=[];null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&e.grep(onlineShoppingCart.GiftCertificates,function(e){if(e.PromotionID>0&&"1"==e.PerTransactionOne){var t={};t.autoId=e.autoId,t.PromotionID=e.PromotionID,t.Discount=e.discount,t.EnrollAutoID=0,i.push(t)}}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(e){try{if(e.PromotionID>0){if(PromotionDetails&&Array.isArray(PromotionDetails)){var t=PromotionDetails.filter(function(t){return t.PromotionID===e.PromotionID});t.length>0&&(e.PerTransactionOne=t[0].PerTransactionOne?"1":"0")}if("1"==e.PerTransactionOne){var n=e.NoOfVisit;e.SellPackageServiceID>0&&(n=1);var o={};o.autoId=e.autoId,o.PromotionID=e.PromotionID,o.Discount=e.discount/n,o.EnrollAutoID=0,i.push(o)}}}catch(e){}}),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(e){if(e.PromotionID>0&&"1"==e.PerTransactionOne){var t={};t.autoId=e.autoId,t.PromotionID=e.PromotionID,t.Discount=e.productDisc,t.EnrollAutoID=0,i.push(t)}}),null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(n){if(n.PromotionID>0&&"1"==n.PerTransactionOne&&1!=n.isPointApply&&1!=n.isPackage){var o={};o.autoId=t.autoId,o.PromotionID=n.PromotionID,o.Discount=t.discountdd,o.EnrollAutoID=n.autoID,i.push(o)}!String.isNullOrUndefineOrBlank(n.lstAddonService)&&n.lstAddonService.length>0&&e.grep(n.lstAddonService,function(e){if(e.PromotionID>0&&"1"==e.PerTransactionOne&&1!=e.isPointApply&&1!=e.isPackage){var t={};t.autoId=e.autoId,t.PromotionID=e.PromotionID,t.Discount=e.discountdd,t.EnrollAutoID=e.autoID,i.push(t)}})})}),null!=i&&i.length>1?_onlineCheckout.RemoveExtraDeals(i,!1,t):1==i.length&&_onlineCheckout.RemoveDealOnSimplePkgMultiQty(i[0],t)},_onlineCheckout.ValidateOnePerUserDealForDirectClassCheckout=function(){var t=[],i=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);null!=i&&i.length>0&&e.grep(i,function(i){e.grep(i.eventEnrollment,function(e){if(e.PromotionID>0&&"1"==e.PerUserOne&&1!=e.isPointApply&&1!=e.isPackage){var n={};n.autoId=i.autoId,n.PromotionID=e.PromotionID,n.Discount=e.discount,n.EnrollAutoID=e.autoID,t.push(n)}})}),null!=t&&t.length>1&&_onlineCheckout.RemoveExtraDeals(t,!0)},_onlineCheckout.RemoveExtraDeals=function(t,i,n){if(null!=t&&t.length>1){var o=[];e.grep(t,function(e){-1==o.indexOf(e.PromotionID)&&o.push(e.PromotionID)});var a=[];e.grep(o,function(i){var n=e.grep(t,function(e){return e.PromotionID==i});n.length>1&&a.push(n)}),a.length>0&&e.grep(a,function(t){var o,a=0;e.grep(t,function(e){e.Discount>a&&(a=e.Discount,o=e)}),void 0!==o&&(e.grep(t,function(e){e.autoId.toString()+e.EnrollAutoID.toString()!=o.autoId.toString()+o.EnrollAutoID.toString()&&(i?_onlineCheckout.RemoveDealOnClassEvent(e.autoId,e.EnrollAutoID,e.Discount):_onlineCheckout.RemoveDealOnItem(e.autoId,e.EnrollAutoID,e.Discount,n))}),i||_onlineCheckout.RemoveDealOnSimplePkgMultiQty(o,n))})}},_onlineCheckout.RemoveDealOnClassEvent=function(t,i,n){var o=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);null!=o&&o.length>0&&e.grep(_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage),function(o){e.grep(o.eventEnrollment,function(e){o.autoId==t&&e.autoID==i&&(e.discount=e.discount-n,e.price=_onlineCheckout.parseTodecimal(e.price+e.discount,2),e.actualPrice=e.price,e.actualTaxprice=_onlineCheckout.parseTodecimal(e.price*o.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+e.discount,2),o.calssdiscountprice=_onlineCheckout.parseTodecimal(o.calssdiscountprice+e.discount,2),e.isPresetApply=!1,e.isPointApply=!1,e.isPackage,e.PromotionID=0,e.IsAmount=!1,e.AmountValue=0,e.taxprice=e.actualTaxprice,e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.price,e),null!=e.gcId&&0==e.isPackage&&(e.redeemTax=e.actualTaxprice,e.redeemAmt=e.actualPrice,onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed+n))})})},_onlineCheckout.RemoveDealOnItem=function(t,i,n,o){null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&e.grep(onlineShoppingCart.GiftCertificates,function(e){e.autoId==t&&(e.Price=_onlineCheckout.parseTodecimal(e.TotalPrice,2),e.discount=0,e.ActualPrice=_onlineCheckout.parseTodecimal(e.Price,2),e.isPresetApply=!1,e.PromotionID=0,e.IsAmount=!1,e.AmountValue=0)}),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(e){e.autoId==t&&(e.productDisc=e.productDisc-n,e.Price=e.Price,e.ActualPrice=_onlineCheckout.parseTodecimal(e.ActualPrice+n,2),e.calculatedTax=_onlineCheckout.parseTodecimal(e.ActualPrice*e.Tax/100,3),e.ActualTax=e.calculatedTax,e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.ActualPrice,e),e.isPresetApply=!1,e.PromotionID=0,e.IsAmount=!1,e.AmountValue=0)}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(e){if(e.autoId==t){var i=e.NoOfVisit;e.SellPackageServiceID>0&&(i=1),n*=i,e.discount=e.discount-n,e.Price=_onlineCheckout.parseTodecimal(e.Price+n,2),e.ActualPrice=e.Price,e.calculatedTax=_onlineCheckout.parseTodecimal(e.Price*e.Tax/100,3),e.ActualTax=e.calculatedTax,e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.Price,e),e.isPresetApply=!1,e.PromotionID=0,e.IsAmount=!1,e.AmountValue=0}}),null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(o){e.grep(o.eventEnrollment,function(a){if(o.autoId==t&&a.autoID==i&&(a.discount=a.discount-n,a.price=_onlineCheckout.parseTodecimal(a.price+a.discount,2),a.actualPrice=a.price,a.actualTaxprice=_onlineCheckout.parseTodecimal(a.price*o.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+a.discount,2),o.calssdiscountprice=_onlineCheckout.parseTodecimal(o.calssdiscountprice+a.discount,2),a.isPresetApply=!1,a.isPointApply=!1,a.isPackage,a.PromotionID=0,a.IsAmount=!1,a.AmountValue=0,a.taxprice=a.actualTaxprice,a.BusinessTax=_onlineCheckout.ApplyMultipleTax(a.price,a),null!=a.gcId&&0==a.isPackage&&(a.redeemTax=a.actualTaxprice,a.redeemAmt=a.actualPrice,onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed+n)),a.isMembershipApply){var s=e.grep(onlineShoppingCart.lstMembership,function(e){return 2==e.ItemType});if(null!=s&&s.length>0){var r=e.grep(s,function(e){return a.customerID>0&&e.UserID>0&&a.customerID==e.UserID||a.customerID<=0&&e.UserID>0&&a.cUserEmail==e.EmailId});e.each(r,function(e,t){t.VisitRemaining+=1})}}})}),_onlineCheckout.RecalcGCONAllItemsAfterPreset(),void 0!==o&&1==o||_onlineCheckout.ReApplyDiscounts(!0)},_onlineCheckout.RemoveDealOnSimplePkgMultiQty=function(e,t){},_onlineCheckout.FillInvoiceLeftSideDetails=function(t){e("#divInvoiceDetails").html(""),e("#scptInvoiceDetails").tmpl(t).appendTo("#divInvoiceDetails")},_onlineCheckout.dateformate=function(e,t){return countryDateFormat(moment(e),VagaroCountryDateFormat.SmallDate)},_onlineCheckout.decimalFormate=function(e){return parseFloat(Math.round(100*e)/100).toFixed(2)},_onlineCheckout.DisplayAmountOnCart=function(e,t){var i=parseFloat(Math.round(100*parseFloat(t))/100);return i>0?e+i.toFixed(2):"Free"},_onlineCheckout.calculateSubTotalForFirstStep=function(){if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmain)){if(e("#newCartSummaryDectail123").html(""),!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Events)&&onlineShoppingCartmain.Events.length>0){for(var t={randomForWorkShop:"asc",cUserEmail:"asc"},i=0;i<onlineShoppingCartmain.Events.length;i++)onlineShoppingCartmain.Events[i].eventEnrollment.length>0&&onlineShoppingCartmain.Events[i].eventEnrollment[0].IsWorkShop&&onlineShoppingCartmain.Events[i].eventEnrollment.keySort(t);_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCartmain.Events)}"true"==IsClassReschedule.toLowerCase()&&"true"==IsPaid.toString().toLowerCase()?_onlineCheckout.CalculateSubtotal_ShowDiscount(1):_onlineCheckout.isValidForCheckoutInvoice()||(_onlineCheckout.Clear_ShowDiscount(),_onlineCheckout.getUserGCDetail_ShowDiscount(1,!1))}},_onlineCheckout.calculatePromotionAmt=function(e,t,i,n,o){var a=n*o;return e>0&&("1"==t?(n<i&&(i=n),a-=i*o):a-=a*i/100),parseFloat(_onlineCheckout.decimalFormate(a))},_onlineCheckout.getBusinessWorkingHours=function(){if(null!=_onlineCheckout.businessWorkinghour&&null!=_onlineCheckout.businessWorkinghour&&_onlineCheckout.businessWorkinghour.length<=0){var t=new vagaro.ajax;t.datamodel.Token=ApiURLEnumOnlineCheckout.getbusinesshourslist,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.data={businessID:businessID},t.datamodel.callback=function(t){var i=[1,2,3,4,5,6,7];if(_onlineCheckout.businessWorkinghour=t,e.each(t,function(e,t){i.indexOf(t.DayID)>-1&&i.splice(i.indexOf(t.DayID),1)}),e.each(i,function(e,t){i[e]=t-1}),onlineShoppingCart.PickupDate=moment(Date())._d,_onlineCheckout.businessWorkinghour.length>0){var o=onlineShoppingCart.PickupDate.getDay()+1,s=new Date,r=_onlineCheckout.businessWorkinghour.filter(function(e){return e.DayID===o})[0];if(null!=r&&null!=r){s=onlineShoppingCart.PickupDate<=new Date(BusinessDate)?new Date(BusinessDate):new Date(onlineShoppingCart.PickupDate),Converttimeformat(r.ToTime)<=s.getHours()&&(onlineShoppingCart.PickupDate=new Date(onlineShoppingCart.PickupDate.setDate(onlineShoppingCart.PickupDate.getDate()+1)));var l=_onlineCheckout.businessWorkinghour.filter(function(e){return e.DayID===o})[0]}for(var c=0,d=0,u=0;u<7;u++){for(var p=0;p<i.length;p++){if(i[p]==onlineShoppingCart.PickupDate.getDay()){onlineShoppingCart.PickupDate=new Date(onlineShoppingCart.PickupDate.setDate(onlineShoppingCart.PickupDate.getDate()+1)),c=0,d=1;break}c=1}if(1==c)break}onlineShoppingCart.PickupDate<=new Date(BusinessDate)?onlineShoppingCart.PickupDate=new Date(BusinessDate):onlineShoppingCart.PickupDate;var h=onlineShoppingCart.PickupDate.getDay()+1;if(null!=typeof(l=_onlineCheckout.businessWorkinghour.filter(function(e){return e.DayID===h})[0])&&null!=l){var m=new Date;m.setHours(0,0,0,0),(n=new Date(onlineShoppingCart.PickupDate)).setHours(0,0,0,0),n.getTime()==m.getTime()&&new Date(onlineShoppingCart.PickupDate).setHours(Converttimeformat(l.FromTime),ConverttimeformattoMiniut(l.FromTime),0,0)>=(new Date).setHours(0,0,0,0)&&(Converttimeformat(l.FromTime)>(new Date).getHours()?onlineShoppingCart.PickupDate.setHours(Converttimeformat(l.FromTime),ConverttimeformattoMiniut(l.FromTime),0,0):onlineShoppingCart.PickupDate.setHours((new Date).getHours(),(new Date).getMinutes(),0,0));var g=Converttimeformat(l.ToTime),v=0;g<=onlineShoppingCart.PickupDate.getHours()&&n<=m&&0==d?(v=1,_onlineCheckout.objChecktime=1):g<=onlineShoppingCart.PickupDate.getHours()&&n>m&&0==d&&(d=1);var f=Converttimeformat(l.FromTime),C=onlineShoppingCart.PickupDate;C.setDate(C.getDate()+v),1!=v&&1!=d||C.setHours(f,ConverttimeformattoMiniut(l.FromTime),0,0),_onlineCheckout.minDate=C;var S=g,y=new Date(C);y.setDate(y.getDate()+v),y.setHours(S,ConverttimeformattoMiniut(l.ToTime),0,0),_onlineCheckout.currentTime=y,_onlineCheckout.objMin=l.FromTime,_onlineCheckout.objMax=l.ToTime,applydatepicker({divid:"#divPickupDateTime",textid:"#txtPickupDateTime",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDateWithTime),defaultDateTime:C,pickTime:!0,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,disabledWeekDays:i,disabledTimePicker:[l.FromTime,l.ToTime],disabledMobileTimePicker:_onlineCheckout.businessWorkinghour,callBackOnChange:a}),wHour=_onlineCheckout.businessWorkinghour}else applydatepicker({divid:"#divPickupDateTime",textid:"#txtPickupDateTime",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDateWithTime),defaultDateTime:onlineShoppingCart.PickupDate,pickTime:!0,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,disabledWeekDays:i,disabledMobileTimePicker:_onlineCheckout.businessWorkinghour,callBackOnChange:a})}else applydatepicker({divid:"#divPickupDateTime",textid:"#txtPickupDateTime",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDateWithTime),defaultDateTime:onlineShoppingCart.PickupDate,pickTime:!0,formatTime:"h:mm A",contentWindow:datePicker_contentWindow,disabledWeekDays:i,callBackOnChange:a})},t.datamodel.Error=function(e){},t.Post()}};var a=function(t){e("#divPickupDateError").hide(),e("#txtPickupDateTime").removeClass("errorInput"),setTimeout(function(){onlineShoppingCart.PickupDate=moment(getdatepickervalue("#txtPickupDateTime"))._d;var e=onlineShoppingCart.PickupDate.getDay()+1;if(_onlineCheckout.businessWorkinghour.length>0){var t=_onlineCheckout.businessWorkinghour.filter(function(t){return t.DayID===e})[0];if(null!=typeof t&&null!=t){var i;Converttimeformat(t.ToTime);i=_onlineCheckout.objChecktime;var n=Converttimeformat(t.FromTime),o=new Date(_onlineCheckout.minDate);o.setDate(o.getDate()+i),o.setHours(n,ConverttimeformattoMiniut(t.FromTime),0,0),_onlineCheckout.minDate=o;var a=Converttimeformat(t.ToTime),s=new Date(_onlineCheckout.minDate);s.setDate(s.getDate()+i),s.setHours(a,ConverttimeformattoMiniut(t.ToTime),0,0),_onlineCheckout.currentTime=s,_onlineCheckout.objMin=t.FromTime,_onlineCheckout.objMax=t.ToTime,setMinMaxTimeValue({divid:"#divPickupDateTime",textid:"#txtPickupDateTime",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDateWithTime),disabledTimePicker:[t.FromTime,t.ToTime]})}}},1e3)};_onlineCheckout.CalculatePriceAndTaxOnCartForClass=function(t,i,n,o){for(var a=!0,s=!1,r=1==onlineShoppingCart.IsIncludeTaxInOnlinePricing||_onlineCheckout.IsCCDetailEnable(),l=0;l<=t.length-1;l++){var c=t[l].eventEnrollment,d=t[l].sessiondetail,u=c.uniqueObjects(["customerID","cUserEmail"]);if(u.length>0){for(var p=0;p<=u.length-1;p++){var h=[];if((1==i||0==i)&&null!=n&&n.length>0){var m=e.grep(n,function(e){return(u[p].customerID>0&&e.assignTo==u[p].customerID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,u[p].customerID)||u[p].customerID<=0&&e.emailId==u[p].cUserEmail)&&null!=e.serviceID&&(e.serviceID==t[l].eventID||e.serviceName.toLowerCase().trim()==t[l].eventName.toLowerCase().trim()&&8!=e.eventType)});null!=m&&m.length>0&&(h=m)}var g=1,v=0,f=0;e.grep(t[l].eventEnrollment,function(e){(u[p].customerID>0&&e.customerID==u[p].customerID||u[p].customerID<=0&&e.cUserEmail==u[p].cUserEmail)&&(0==e.StreamingStatus?f+=1:1==e.StreamingStatus&&(v+=1))});var C=1;v>0&&f>0?(C=2,g=3):0==f&&v>0&&(g=2);for(var S=1;S<=C;S++){var y=e.grep(t[l].eventEnrollment,function(e){return 1==S&&3==g||1==g?(u[p].customerID>0&&e.customerID==u[p].customerID||u[p].customerID<=0&&e.cUserEmail==u[p].cUserEmail)&&0==e.StreamingStatus:(u[p].customerID>0&&e.customerID==u[p].customerID||u[p].customerID<=0&&e.cUserEmail==u[p].cUserEmail)&&1==e.StreamingStatus}),b=0;b=null!=_onlineCheckout.GetRescheduleDetail()?y[0].oldPrice:1==y[0].IsWorkShop?_vgClassSessionSelection.CalcSessionPriceForOnlineWorkShop(y):1==S&&3==g||1==g?_vgClassSessionSelection.CalcSessionPrice(d,y.length,1,!1,!1):_vgClassSessionSelection.CalcSessionPrice(d,y.length,1,!1,!0);var k=_vgClassSessionSelection.ConvertTodecimal(b/y.length,2,!0),_=b/y.length,D=0,I=0,w=0;if(1==r&&(w=_vgClassSessionSelection.ConvertTodecimal(b*t[l].tax/100,2,!0),D=_vgClassSessionSelection.ConvertTodecimal(w/y.length,2,!0),I=b*t[l].tax/100/y.length),null!=y&&y.length>0){var P=0,A=0,T=0,x=0,F=0,$=0,O=0,M=0;e.each(y,function(c,d){void 0===d.IsOutsideBilling&&(d.IsOutsideBilling=!1),void 0===d.IsWaivedApply&&(d.IsWaivedApply=!1),void 0===d.isPaid&&(d.isPaid=!1);var u=c==y.length-1?_vgClassSessionSelection.ConvertTodecimal(_vgClassSessionSelection.ConvertTodecimal(b,2,!0)-P,2,!0):k;_onlineCheckout.isValidForCheckoutInvoice()&&1==d.IsWorkShop&&(u=d.price),P=_vgClassSessionSelection.ConvertTodecimal(P+u,2,!0);var p=0;if(p=1==r?c==y.length-1?_vgClassSessionSelection.ConvertTodecimal(_vgClassSessionSelection.ConvertTodecimal(w,2,!0)-A,2,!0):D:0,A=_vgClassSessionSelection.ConvertTodecimal(A+p,2,!0),d.discount=0,void 0!==d.PromotionID&&0!=d.PromotionID){var m=0;m=1==d.IsAmount?d.AmountValue:_*d.AmountValue/100,_<m&&(m=_),d.discount=m,d.discount>0&&_==d.discount&&1!=d.isPointApply&&("1"==d.PerUserOne?0==s?(s=!0,a=!1):a=!0:a=!1)}var g={};if(1==d.isPackage&&(g.price=d.price,g.actualPrice=d.actualPrice,g.actualTaxprice=d.actualTaxprice,g.taxprice=d.taxprice,g.pkgName=d.pkgName),_onlineCheckout.isValidForCheckoutInvoice()&&1!=d.isPointApply&&(void 0!==d.Originalprice?(d.price=d.Originalprice,d.actualPrice=d.Originalprice,d.actualTaxprice=d.Originaltaxprice,d.taxprice=d.Originaltaxprice):(d.price=d.actualPrice,d.actualPrice=d.actualPrice,d.actualTaxprice=d.actualTaxprice,d.taxprice=d.taxprice)),!_onlineCheckout.isValidForCheckoutInvoice()&&1!=d.isPointApply){d.price=u,d.actualPrice=_,d.actualTaxprice=I,d.taxprice=p;var v=_onlineCheckout.IsItemFmbEligible(d.PromotionID),f=_onlineCheckout.GetEffectiveIsForNewCustomer();v&&!0===f?(d.dailydealFee=(d.actualPrice-d.discount)*dailyDealFeeValue/100,d.FMBPercentage=dailyDealFeeValue):v&&!1===f?(d.dailydealFee=(d.actualPrice-d.discount)*dailyDealFeeValue_ExistingUser/100,d.FMBPercentage=dailyDealFeeValue_ExistingUser):(d.dailydealFee=0,d.FMBPercentage=0),Number(d.dailydealFee)>0&&(d.isPointApply=!1,1!=d.isPackage&&(d.gcId=0,d.isPriceBaseGCApply=!1),e("#divGiftCertificateCart").hide(),e("#divCheckoutBookingPromoCode").hide()),!String.isNullOrUndefineOrBlank(d.lstAddonService)&&d.lstAddonService.length>0&&e.each(d.lstAddonService,function(t,i){var n=_onlineCheckout.IsItemFmbEligible(i.PromotionID),o=_onlineCheckout.GetEffectiveIsForNewCustomer();n&&!0===o?(i.dailydealFee=(i.Originalprice-i.AmountValue)*dailyDealFeeValue/100,i.FMBPercentage=dailyDealFeeValue):n&&!1===o?(i.dailydealFee=(i.Originalprice-i.AmountValue)*dailyDealFeeValue_ExistingUser/100,i.FMBPercentage=dailyDealFeeValue_ExistingUser):(i.dailydealFee=0,i.FMBPercentage=0),(Number(i.dailydealFee)>0||Number(d.dailydealFee)>0)&&(i.isPointApply=!1,1!=i.isPackage&&(i.gcId=0,i.isPriceBaseGCApply=!1),e("#divCheckoutBookingPromoCode").hide())})}if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==d.isPresetApply&&1==d.isPresetApply)d.isDecisionTaken=!1;else if((1!=d.isDecisionTaken&&(1==i||0==i)||1==o&&1==d.isDecisionTaken&&(1==d.isPackage||0==d.isPackage))&&h.length>0&&d.price>0)if(1==i||1==o){var C=[];if(1!=d.isPointApply&&0==d.isPaid&&(C=e.grep(h,function(e){return null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(d.eventDate).format("YYYY/MM/DD"))>new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))&&null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(d.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))&&(0==d.IsOutsideBilling&&(d.strAdvanceLimitDate=e.strAdvanceLimitDate),d.IsWaivedApply=!0,d.AppliedName=e.pkgName),(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(d.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strValidUpto).format("YYYY/MM/DD")))})),Number(d.dailydealFee)>0&&(C=e.grep(C,function(e){return e&&1==e.isPackage})),C.length>0){var S=C[0];if(0==S.isPackage)1==a&&(d.redeemAmt=d.price,S.quantity-=1,S.currentBalance-=d.redeemAmt);else if(1==a){var B=0,E=[];1==S.isCustomPackage?E=e.grep(n,function(e){if(1==e.isCustomPackage&&null==e.serviceID&&e.giftCertificateID==S.giftCertificateID)return B=0==e.quantity?0:Math.floor(parseFloat((e.currentBalance/e.quantity*100).toFixed(2)))/100,!0}):B=Math.floor(parseFloat((S.currentBalance/S.quantity*100).toFixed(2)))/100,1==S.isCustomPackage&&void 0!==S.serviceID&&S.serviceID>0&&(d.RedeemServiceId=S.serviceID),-1==S.quantity&&(B=0),d.redeemAmt=B,d.price=B,d.actualPrice=B,d.actualTaxprice=0,d.taxprice=0,1==S.isCustomPackage?(null!=S.groupID&&0!=S.groupID&&-1!=S.quantity?e.grep(n,function(e){e.giftCertificateID==S.giftCertificateID&&e.groupID==S.groupID&&(e.quantity=e.quantity-1)}):null==S.groupID&&-1!=S.quantity&&(S.quantity=S.quantity-1),E.length>0&&-1!=S.quantity&&(E[0].currentBalance=parseFloat(parseFloat(E[0].currentBalance)-B),E[0].quantity=E[0].quantity-1)):(S.quantity-=1,S.currentBalance-=B)}1==a?(d.gcId=S.giftCertificateID,d.giftCertificateNo=S.giftCertificateNo,d.isPackage=S.isPackage,d.pkgName=S.pkgName,0==S.isCustomPackage&&String.isNullOrUndefineOrBlank(S.pkgName)&&(d.pkgName=S.serviceName),d.isDecisionTaken=!0):(d.gcId=0,d.isPackage=null)}else d.gcId=0,d.isPackage=null}else 0==i&&(d.isPackage=null,d.isDecisionTaken=!0);else 1==d.isPackage&&1==g.hasOwnProperty("price")&&(d.price=g.price,d.actualPrice=g.actualPrice,d.actualTaxprice=g.actualTaxprice,d.taxprice=g.taxprice,d.pkgName=g.pkgName,0==g.isCustomPackage&&String.isNullOrUndefineOrBlank(g.pkgName)&&(d.pkgName=g.serviceName));if(1==r&&(1!=d.isPackage?(F=_vgClassSessionSelection.ConvertTodecimal(F+d.price,2,!0),$=_vgClassSessionSelection.ConvertTodecimal($+d.actualPrice,10,!0),M+=1):1==d.isPackage&&(O+=1),T=_vgClassSessionSelection.ConvertTodecimal(T+d.taxprice,2,!0),x=_vgClassSessionSelection.ConvertTodecimal(x+d.actualTaxprice,10,!0),O>0&&M>0&&c==y.length-1))for(var L=_vgClassSessionSelection.ConvertTodecimal(F*t[l].tax/100,2,!0),N=parseFloat((L-T).toFixed(2)),U=_vgClassSessionSelection.ConvertTodecimal($*t[l].tax/100,2,!0),R=parseFloat((U-x).toFixed(2)),W=y.length-1;W>=0;W--)if(1!=y[W].isPackage){y[W].actualTaxprice=_vgClassSessionSelection.ConvertTodecimal(y[W].actualTaxprice+R,10,!0),y[W].taxprice=_vgClassSessionSelection.ConvertTodecimal(y[W].taxprice+N,2,!0);break}var G=!0;e.each(d.lstAddonService,function(t,r){var l=[];if((1==i||0==i)&&null!=n&&n.length>0){var c=e.grep(n,function(e){return(r.customerID>0&&e.assignTo==r.customerID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,r.customerID)||r.customerID<=0&&e.emailId==r.cUserEmail)&&null!=e.serviceID&&(e.serviceID==r.ServiceId||e.serviceName.toLowerCase().trim()==r.ServiceTitle.toLowerCase().trim()&&2!=e.eventType)});null!=c&&c.length>0&&(l=c)}if(void 0===r.IsOutsideBilling&&(r.IsOutsideBilling=!1),void 0===r.IsWaivedApply&&(r.IsWaivedApply=!1),void 0===r.isPaid&&(r.isPaid=!1),r.discount=0,void 0!==r.PromotionID&&0!=r.PromotionID){var u=0;u=1==r.IsAmount?r.AmountValue:r.Originalprice*r.AmountValue/100,r.Originalprice<u&&(u=r.Originalprice),r.discount=u,r.discount>0&&r.Originalprice==r.discount&&1!=r.isPointApply&&("1"==r.PerUserOne?0==s?(s=!0,G=!1):G=!0:G=!1)}var p={};if(1==r.isPackage&&(p.price=r.Price,p.actualPrice=r.actualPrice,p.actualTaxprice=r.actualTaxprice,p.taxprice=r.taxprice,p.pkgName=r.pkgName),_onlineCheckout.isValidForCheckoutInvoice()&&1!=r.isPointApply&&(void 0!==r.Originalprice?(r.Price=r.Originalprice,r.actualPrice=r.Originalprice,r.actualTaxprice=r.Originaltaxprice,r.taxprice=r.Originaltaxprice):(r.Price=r.actualPrice,r.actualPrice=r.actualPrice,r.actualTaxprice=r.actualTaxprice,r.taxprice=r.taxprice)),_onlineCheckout.isValidForCheckoutInvoice()||1==r.isPointApply||(r.Price=r.Originalprice,r.actualPrice=r.Price,r.actualTaxprice=parseFloat(r.Price)*r.tax/100,r.taxprice=_vgClassSessionSelection.ConvertTodecimal(parseFloat(r.Price)*r.tax/100,2,!0)),_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==r.isPresetApply&&1==r.isPresetApply)r.isDecisionTaken=!1;else if((1!=r.isDecisionTaken&&(1==i||0==i)||1==o&&1==r.isDecisionTaken&&(1==r.isPackage||0==r.isPackage))&&l.length>0&&r.Price>0)if(1==i||1==o){var h=[];if(1!=r.isPointApply&&0==r.isPaid&&(h=e.grep(l,function(e){return null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(d.eventDate).format("YYYY/MM/DD"))>new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))&&null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(d.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))&&(0==r.IsOutsideBilling&&(r.strAdvanceLimitDate=e.strAdvanceLimitDate),r.IsWaivedApply=!0,r.AppliedName=e.pkgName),(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(d.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strValidUpto).format("YYYY/MM/DD")))})),Number(r.dailydealFee)>0&&(h=e.grep(h,function(e){return e&&1==e.isPackage})),h.length>0){var m=h[0];if(0==m.isPackage)1==G&&(r.redeemAmt=r.Price,m.quantity-=1,m.currentBalance-=r.redeemAmt);else if(1==G){var g=0,v=[];1==m.isCustomPackage?v=e.grep(n,function(e){if(1==e.isCustomPackage&&null==e.serviceID&&e.giftCertificateID==m.giftCertificateID)return g=0==e.quantity?0:Math.floor(parseFloat((e.currentBalance/e.quantity*100).toFixed(2)))/100,!0}):g=Math.floor(parseFloat((m.currentBalance/m.quantity*100).toFixed(2)))/100,1==m.isCustomPackage&&void 0!==m.serviceID&&m.serviceID>0&&(r.RedeemServiceId=m.serviceID),-1==m.quantity&&(g=0),r.redeemAmt=g,r.Price=g,r.actualPrice=g,r.actualTaxprice=0,r.taxprice=0,1==m.isCustomPackage?(null!=m.groupID&&0!=m.groupID&&-1!=m.quantity?e.grep(n,function(e){e.giftCertificateID==m.giftCertificateID&&e.groupID==m.groupID&&(e.quantity=e.quantity-1)}):null==m.groupID&&-1!=m.quantity&&(m.quantity=m.quantity-1),v.length>0&&-1!=m.quantity&&(v[0].currentBalance=parseFloat(parseFloat(v[0].currentBalance)-g),v[0].quantity=v[0].quantity-1)):(m.quantity-=1,m.currentBalance-=g)}1==a?(r.gcId=m.giftCertificateID,r.giftCertificateNo=m.giftCertificateNo,r.isPackage=m.isPackage,r.pkgName=m.pkgName,0==m.isCustomPackage&&String.isNullOrUndefineOrBlank(m.pkgName)&&(r.pkgName=m.serviceName),r.isDecisionTaken=!0):(r.gcId=0,r.isPackage=null)}else r.gcId=0,r.isPackage=null}else 0==i&&(r.isPackage=null,r.isDecisionTaken=!0);else 1==r.isPackage&&1==p.hasOwnProperty("price")&&(r.Price=p.price,r.actualPrice=p.actualPrice,r.actualTaxprice=p.actualTaxprice,r.taxprice=p.taxprice,r.pkgName=p.pkgName)})})}}if(p==u.length-1){var B,E=0,L=0,N=0,U=0,R=0,W=0,G=0,V=0,H=0,j=!1,Y=0,q=0;if(e.grep(t[l].eventEnrollment,function(e){e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.price,e),e.IsPartialPoint=void 0!==e.IsPartialPoint&&e.IsPartialPoint,E=e.IsPartialPoint&&1==_onlineCheckout.isValidForCheckoutInvoice()?void 0!==e.depositsPercentage&&!String.isNullOrUndefineOrBlank(e.depositsPercentage)&&e.depositsPercentage<100?_vgClassSessionSelection.ConvertTodecimal(E+e.Originalprice,2,!0):_vgClassSessionSelection.ConvertTodecimal(E+e.price,2,!0):e.IsPartialPoint&&"undefined"!=typeof onlineShoppingCartmain&&void 0!==onlineShoppingCartmain.DepositsPer&&onlineShoppingCartmain.DepositsPer<100?_vgClassSessionSelection.ConvertTodecimal(E+e.Originalprice,2,!0):_vgClassSessionSelection.ConvertTodecimal(E+e.price,2,!0),1==e.IsPartialPoint&&(H=_vgClassSessionSelection.ConvertTodecimal(H+e.PartialPrice,2,!0),Y=_vgClassSessionSelection.ConvertTodecimal(Y+(e.Originalprice-e.discount),2,!0),q=_vgClassSessionSelection.ConvertTodecimal(q+(e.Originalprice-e.PartialPrice),2,!0),j=!0),L=_vgClassSessionSelection.ConvertTodecimal(L+e.taxprice,2,!0),N=_vgClassSessionSelection.ConvertTodecimal(N+e.actualPrice,10,!0),U="undefined"==typeof onlineShoppingCart||null==onlineShoppingCart||void 0===onlineShoppingCart.BusinessID||null==onlineShoppingCart.BusinessID||241902!=onlineShoppingCart.BusinessID&&306501!=onlineShoppingCart.BusinessID?_vgClassSessionSelection.ConvertTodecimal(U+e.actualTaxprice,10,!0):0==U&&0==e.actualTaxprice?0:_shopdetail.ConvertDecimalCustomRound(_vgClassSessionSelection.ConvertTodecimal(U+e.actualTaxprice,10,!0),!0,2),parseFloat(e.deposit)>0&&(G=_vgClassSessionSelection.ConvertTodecimal(G+e.deposit,2,!0)),_onlineCheckout.ApplyMultipleAddonTax(e.lstAddonService);var t=_onlineCheckout.GetTotalPriceAddonEvent(e);R=_vgClassSessionSelection.ConvertTodecimal(R+t.TotalAddonPrice,2,!0),W=_vgClassSessionSelection.ConvertTodecimal(W+t.TotalAddonTax,2,!0),V=_vgClassSessionSelection.ConvertTodecimal(V+t.TotalAddonDeposit,2,!0)}),u.length>1)if(E!=N||1==r&&L!=U){for(var z=t[l].eventEnrollment.length-1;z>=0&&1==(B=t[l].eventEnrollment[z]).isPackage;z--);if(E!=N){var X=0;X=parseFloat((N-E).toFixed(2)),B.price=_vgClassSessionSelection.ConvertTodecimal(B.price+X,2,!0),E=_vgClassSessionSelection.ConvertTodecimal(E+X,2,!0)}if(1==r&&L!=U){var Z=0;Z=parseFloat((U-L).toFixed(2)),B.taxprice=_vgClassSessionSelection.ConvertTodecimal(B.taxprice+Z,2,!0),L=_vgClassSessionSelection.ConvertTodecimal(L+Z,2,!0)}}t[l].actualPrice=N,t[l].roundedPrice=E,t[l].actualTaxprice=U,t[l].roundedTaxprice=L,t[l].deposit=G,t[l].calcAddonTotalPrice=R,t[l].calcPerAddonTotalTax=W,t[l].addonDeposit=V,t[l].TotalPartialPrice=H,t[l].IsPartialPoint=j,t[l].DisplayOriginalprice=Y,t[l].DisplayAfterPartialPointPrice=q}}1==u.length&&u[0].customerID==parseInt(UserID)&&e.each(t[l].eventEnrollment,function(){this.IsshowUserName=!1})}if(l==t.length-1){var J=0,Q=0,K=0,ee=0,te=0,ie=0,ne=0,oe=0,ae=0;if(e.grep(t,function(e){J=_vgClassSessionSelection.ConvertTodecimal(J+e.roundedPrice,2,!0),Q=_shopdetail.CheckPriceWithTaxSwitch()&&_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(e.deposit)&&e.deposit>0?_onlineCheckout.parseTodecimal(e.deposit*e.tax/100,2):_vgClassSessionSelection.ConvertTodecimal(Q+e.roundedTaxprice,2,!0),oe=_vgClassSessionSelection.ConvertTodecimal(oe+e.TotalPartialPrice,2,!0),_onlineCheckout.parseTodecimal(e.deposit,2)>0&&(K=_vgClassSessionSelection.ConvertTodecimal(K+e.deposit,2,!0)),ee+=e.actualPrice,te+=e.actualTaxprice,ie=_vgClassSessionSelection.ConvertTodecimal(ie+e.calcAddonTotalPrice,2,!0),ne=_vgClassSessionSelection.ConvertTodecimal(ne+e.calcPerAddonTotalTax,2,!0),ae=_vgClassSessionSelection.ConvertTodecimal(ae+e.addonDeposit,2,!0)}),ee=_vgClassSessionSelection.ConvertTodecimal(ee,2,!0),te=_vgClassSessionSelection.ConvertTodecimal(te,2,!0),oe=_vgClassSessionSelection.ConvertTodecimal(oe,2,!0),t.length>1&&(ee!=J||1==r&&Q!=te)){var se,re;e:for(var le=t.length-1;le>=0;le--)for(var ce=t[le].eventEnrollment.length-1;ce>=0;ce--)if(se=t[le].eventEnrollment[ce],re=t[le],1!=se.isPackage)break e;if(ee!=J){X=0;X=parseFloat((ee-J-oe).toFixed(2)),se.price=_vgClassSessionSelection.ConvertTodecimal(se.price+X,2,!0),re.roundedPrice=_vgClassSessionSelection.ConvertTodecimal(re.roundedPrice+X,2,!0),J=_vgClassSessionSelection.ConvertTodecimal(J+X,2,!0)}if(1==r&&Q!=te){Z=0;Z=parseFloat((te-Q).toFixed(2)),se.taxprice=_vgClassSessionSelection.ConvertTodecimal(se.taxprice+Z,2,!0),re.roundedTaxprice=_vgClassSessionSelection.ConvertTodecimal(re.roundedTaxprice+Z,2,!0),Q=_vgClassSessionSelection.ConvertTodecimal(Q+Z,2,!0)}}var de=0,ue=0;e.grep(t,function(t){var i=0,n=0,o=0;t.classGCUsed=0,e.grep(t.eventEnrollment,function(a){if(1==a.isPackage?(ue=_vgClassSessionSelection.ConvertTodecimal(ue+a.price,2,!0),n=_vgClassSessionSelection.ConvertTodecimal(n+a.price,2,!0),t.classGCUsed=_vgClassSessionSelection.ConvertTodecimal(t.classGCUsed+a.price,2,!0)):0==a.isPackage&&(de=_vgClassSessionSelection.ConvertTodecimal(de+a.price,2,!0),i=_vgClassSessionSelection.ConvertTodecimal(i+a.price,2,!0),t.classGCUsed=_vgClassSessionSelection.ConvertTodecimal(t.classGCUsed+a.price,2,!0)),void 0!==a.discount&&(o+=a.discount),null!=a.lstAddonService&&null!=a.lstAddonService&&a.lstAddonService.length>0){e.grep(a.lstAddonService,function(e){e.classAddonGCUsed=0,e.discountdd=0,e.IsPartialPoint=void 0!==e.IsPartialPoint&&null!=e.IsPartialPoint&&""!=e.IsPartialPoint,1==e.isPackage?(ue=_vgClassSessionSelection.ConvertTodecimal(ue+e.Price,2,!0),e.classAddonGCUsed=_vgClassSessionSelection.ConvertTodecimal(e.Price,2,!0)):0==e.isPackage&&(de=_vgClassSessionSelection.ConvertTodecimal(de+e.Price,2,!0),e.classAddonGCUsed=_vgClassSessionSelection.ConvertTodecimal(e.Price,2,!0)),void 0!==e.discount&&(e.discountdd=e.discount),1==e.IsPartialPoint&&"undefined"!=typeof onlineShoppingCartmain&&void 0!==onlineShoppingCartmain.DepositsPer&&onlineShoppingCartmain.DepositsPer<100?e.displayroundedPrice=_vgClassSessionSelection.ConvertTodecimal(e.Originalprice-e.discount,2,!0):e.displayroundedPrice=_vgClassSessionSelection.ConvertTodecimal(e.Price,2,!0),e.roundedPrice=_vgClassSessionSelection.ConvertTodecimal(e.Price,2,!0),1==e.IsPartialPoint&&(e.DisplayOriginalprice=e.actualPrice,e.DisplayAfterPartialPointPrice=_vgClassSessionSelection.ConvertTodecimal(e.actualPrice-e.PartialPrice,2,!0))})}}),t.displayroundedPrice=parseFloat(t.roundedPrice.toFixed(2)),t.roundedPrice=parseFloat((t.roundedPrice-(i+n)).toFixed(2)),t.actualPrice=t.roundedPrice,t.displayPartialRoundedPrice=parseFloat(t.TotalPartialPrice.toFixed(2)),t.IsPartialPoint=t.IsPartialPoint,t.DisplayOriginalprice=t.DisplayOriginalprice,t.DisplayAfterPartialPointPrice=t.DisplayAfterPartialPointPrice,t.discountdd=o});var pe=parseFloat((J+Q+ie+ne-(de+ue)).toFixed(2));onlineShoppingCart.classSubTotal=parseFloat((J+ie).toFixed(2)),_onlineCheckout.parseTodecimal(K,2)>0&&(onlineShoppingCart.depositTotal=onlineShoppingCart.depositTotal+_onlineCheckout.parseTodecimal(K,2)+_onlineCheckout.parseTodecimal(ae,2)),onlineShoppingCart.classTax=parseFloat((Q+ne).toFixed(2)),onlineShoppingCart.classGCUsed=de,onlineShoppingCart.classPackageUsed=ue,onlineShoppingCart.classFinalTotal=pe}}return t},_onlineCheckout.GetRescheduleDetail=function(){var t=e("#hdnRescheduleDetail");if(""==t.val())return null;try{return JSON.parse(t.val())}catch(e){return null}},_onlineCheckout.IsCCDetailEnable=function(){try{return!!_onlineCheckout.isValidForCheckoutInvoice()||"true"==IsEnableMerchantAccount.toLowerCase()&&"true"==isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsOnLineShoppingCart.toLowerCase()&&(("true"!=IsClassReschedule.toLowerCase()||"true"!=IsPaid.toString().toLowerCase())&&1!=e("#tabVagaroPayLater").hasClass("w--current"))}catch(e){return!1}},_onlineCheckout.IsDepositItemExists=function(t){if((null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0||null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0||null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0||!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&("true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove)&&("false"==IsClassReschedule.toLowerCase()||"true"==IsClassReschedule.toLowerCase()&&("undefined"==typeof IsPaid||"false"==IsPaid.toString().toLowerCase()))||null!=t&&1==t.isSaveClassCard))&&null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0||null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&_onlineCheckout.IsVCFFeeApplied()||1==_onlineCheckout.IsPaidClass())return!0;var i=!0;return null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&e.grep(t.eventEnrollment,function(e){e.paidType!=_onlineCheckout.arrpaidType.PaidClass&&e.paidType!=_onlineCheckout.arrpaidType.Paid&&(i=!1)})}),!!((null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0||null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0||null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0||!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&1==i)&&null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0)},_onlineCheckout.IsPaidClass=function(){var t=!0;return null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(e.grep(onlineShoppingCart.Events,function(i){!String.isNullOrUndefineOrBlank(i.eventEnrollment)&&i.eventEnrollment.length>0&&e.grep(i.eventEnrollment,function(e){e.paidType!=_onlineCheckout.arrpaidType.PaidClass&&e.paidType!=_onlineCheckout.arrpaidType.Paid&&e.paidType!=_onlineCheckout.arrpaidType.DepositsClass&&(t=!1)})}),!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&1==t)},_onlineCheckout.IsCalculateAndDisplayFeeOnline=function(e){return e?"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove:!(1==_onlineCheckout.IsClassBookingOnly(!0)&&"true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove))||"false"!=IsClassReschedule.toLowerCase()&&("true"!=IsClassReschedule.toLowerCase()||"undefined"!=typeof IsPaid&&"false"!=IsPaid.toString().toLowerCase())},_onlineCheckout.loginUserClassCheckoutAmount=function(){var t=0;if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Events))e.grep(onlineShoppingCartmain.Events,function(i){if(void 0!==i.eventEnrollment&&i.eventEnrollment.length>0)e.grep(i.eventEnrollment,function(e){t=_onlineCheckout.parseTodecimal(t+e.price-e.discount,2)})});return t},_onlineCheckout.validatePhone=function(t,i){var n=_onlineCheckout.CountryID,o=e(t),a=o.val().replace(/([()-\s])+/g,""),s=a.length;if(s<=0)return"txtCell"==o.attr("id")?(e(i).show(),e(i).html("required."),o.addClass("errorInput"),!1):(e(i).hide(),e(i).html(""),o.removeClass("errorInput"),!0);if(s>0)if(2!=n&&11==s&&0==a[0]&&(s=(a=a.substring(1)).length),1==n||3==n){if(10!=s)return o.val(a),"#revtxtnightphoneCust"==i?(e("#revtxtnightphoneCust").attr("style","display:inline"),e(i).html("Night phone should be of 10 digits.")):"#revtxtdayphoneCust"==i?(e("#revtxtdayphoneCust").attr("style","display:inline"),e(i).html("Day phone should be of 10 digits.")):("#divInvalidMobileMessage"==i&&e("#divInvalidMobileMessage").attr("style","display:inline"),e(i).html("Phone number should be of 10 digits")),o.addClass("errorInput"),e(i).show(),!1}else if(2==n){if(s<10||s>11)return o.val(a),"#revtxtnightphoneCust"==i?(e("#revtxtnightphoneCust").attr("style","display:inline"),e(i).html("Night phone should be of 10 or 11 digits.")):"#revtxtdayphoneCust"==i?(e("#revtxtdayphoneCust").attr("style","display:inline"),e(i).html("Day phone should be of 10 or 11 digits.")):("#divInvalidMobileMessage"==i&&e("#divInvalidMobileMessage").attr("style","display:inline"),e(i).html("Phone number should be of 10 or 11 digits")),o.addClass("errorInput"),e(i).show(),!1;10==s&&0!=a[0]?s=(a=0+a).length:(s<=10||12==s)&&0==a[0]&&(s=(a=a.substring(1)).length),o.val(a.replace(/(\d{3})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3"))}else if(4==n){if(s<9||s>10)return o.val(a),"#revtxtnightphoneCust"==i?(e("#revtxtnightphoneCust").attr("style","display:inline"),e(i).html("Night phone should be of 9 or 10 digits.")):"#revtxtdayphoneCust"==i?(e("#revtxtdayphoneCust").attr("style","display:inline"),e(i).html("Day phone should be of 9 or 10 digits.")):("#divInvalidMobileMessage"==i&&e("#divInvalidMobileMessage").attr("style","display:inline"),e(i).html("Phone number should be of 9 or 10 digits")),o.addClass("errorInput"),e(i).show(),!1;9==s&&0!=a[0]?s=(a=0+a).length:(s<=9||s>10)&&0==a[0]&&(s=(a=a.substring(1)).length),o.val(a.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3"))}return e(i).hide(),o.removeClass("errorInput"),!0},_onlineCheckout.Phone_format=function(t,i,n){null!=typeof(n=_onlineCheckout.CountryID)&&null!=n&&""!=n&&(countryID=n);var o=e(t);/\D/g.test(o.val())&&o.val(o.val().replace(/\D/g,"")),1==countryID?o.removeClass("cntry-ca").addClass("cntry-us"):3==countryID?o.removeClass("cntry-us").addClass("cntry-ca"):o.removeClass("cntry-ca cntry-us");var a=o.val().replace(/([()-\s])+/g,""),s=a.length;if(!(s<=0)){o.removeClass("errorInput");return String.isNullOrUndefineOrBlank(a)||/^\d+$/.test(a)?(e(i).hide(),2!=countryID&&11==s&&0==a[0]&&(s=(a=a.substring(1)).length),1!=countryID&&3!=countryID||10!=s?2==countryID?(10==s&&0!=a[0]?s=(a=0+a).length:(s<=10||12==s)&&0==a[0]&&(s=(a=a.substring(1)).length),10==s||11==s?(o.val(a.replace(/(\d{3})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3")),!0):o.val(a)):4==countryID?(9==s&&0!=a[0]?s=(a=0+a).length:(s<=9||s>10)&&0==a[0]&&(s=(a=a.substring(1)).length),9==s||10==s?(o.val(a.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3")),!0):o.val(a)):o.val(a):(3==countryID?o.val(a.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"$1-$2-$3")):o.val(a.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"($1) $2-$3")),!0),!0):(event.preventDefault(),!1)}},_onlineCheckout.ValidateEmail=function(){return""==e("#emailid").val()?(e("#lblInvalidEmail").hide(),!0):_onlineCheckout.isValidEmailAddress(e("#emailid").val())?(e("#lblInvalidEmail").hide(),e("#emailid").removeClass("errorInput"),e('[id*="spanVendorEmailRequire"]').hide(),!0):(e("#lblInvalidEmail").show(),e("#emailid").removeClass("errorInput"),e('[id*="spanVendorEmailRequire"]').hide(),e("#emailid").addClass("errorInput"),!1)},_onlineCheckout.isValidEmailAddress=function(e){return new RegExp(/^[A-Za-z0-9_\+-]+(\.[A-Za-z0-9_\+-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.([A-Za-z]{2,10})$/g).test(e)},_onlineCheckout.ShowCountry=function(){return e(".countryselectmyacprofile").is(":visible")?void e(".countryselectmyacprofile").hide():void e(".countryselectmyacprofile").show()},_onlineCheckout.setDialingCode=function(t){var i="";switch(e(".txtCell").removeClass(function(e,t){return(t.match(/(^|\s)cntry-\S+/g)||[]).join(" ")}),e("#txtNightPhone").removeClass(function(e,t){return(t.match(/(^|\s)cntry-\S+/g)||[]).join(" ")}),e("#txtDayPhone").removeClass(function(e,t){return(t.match(/(^|\s)cntry-\S+/g)||[]).join(" ")}),t){case 1:i="+1",e(".txtCell").addClass("cntry-us"),e("#txtNightPhone").addClass("cntry-us"),e("#txtDayPhone").addClass("cntry-us");break;case 2:i="+44";break;case 3:i="+1",e(".txtCell").addClass("cntry-ca"),e("#txtNightPhone").addClass("cntry-ca"),e("#txtDayPhone").addClass("cntry-ca");break;case 4:i="+61"}e(".country-icon").text(i)},_onlineCheckout.selectCountry=function(t){e("#txtAddressVPL").select2("val"," "),e(".selectedCountrudiv").attr("data-country",t),e(".selectedCountrudiv").removeClass().addClass("selectedcountry "+U[t]+" Selected selectedCountrudiv"),e("#temphdncountryid").val(t),e("#txtAddressVPL").select2("focus"),_onlineCheckout.setDialingCode(t),_onlineCheckout.Phone_format(".txtCell","#divInvalidMobileMessage",t),_onlineCheckout.BindState(),e(".countryselectoption").hide()},_onlineCheckout.UpdateAffirmUserData=function(){if(String.isNullOrUndefineOrBlank(e("#emailid").val()))return _onlineCheckout.WarningMessage("Please enter emailId"),!1;if(0==_onlineCheckout.ValidateEmail())return _onlineCheckout.WarningMessage("Please enter valid emailId"),!1;if(String.isNullOrUndefineOrBlank(e("#txtAddressVPL").val()))return _onlineCheckout.WarningMessage("Please enter address"),!1;if(_onlineCheckout.IsVPLAddress=1,""!=e("#txtAddressVPL").val().trim()){if(!_onlineCheckout.validateNewShippingAddressData())return!1}else e(".cboRState").val("-1");return _onlineCheckout.CustomerDetails=JSON.parse(e("#hdnUserDetails").val()),_onlineCheckout.CustomerDetails.EmailId=e("#emailid").val().trim(),_onlineCheckout.CustomerDetails.Cell=ShoppingBagVPLCell.getPhoneData().phoneNo,_onlineCheckout.CustomerDetails.Street=e("#txtNewStreet").val().trim(),_onlineCheckout.CustomerDetails.BirthDate=new Date(e("#cboYear").val()+"-"+e("#cboMonth").val()+"-"+e("#cboDay").val()),_onlineCheckout.CustomerDetails.City=e("#txtNewCity").val().trim(),_onlineCheckout.CustomerDetails.CountryID=_onlineCheckout.CountryID,_onlineCheckout.CustomerDetails.Zip=e("#txtNewZip").val().trim(),_onlineCheckout?.selectedAddressData?.statecode&&(_onlineCheckout.CustomerDetails.StateCode=_onlineCheckout.selectedAddressData.statecode),e("#hdnUserDetails").val(JSON.stringify(_onlineCheckout.CustomerDetails)),e("#lblterms").removeClass("termsConditionText"),!0},_onlineCheckout.ProccessBank=function(){if(!ShoppingBagVPLCell.validatePhoneNumber(!0)){var t=ShoppingBagVPLCell.getValidateMessage();return 1==t.WarningType?_onlineCheckout.WarningMessage("Please enter mobile no"):_onlineCheckout.WarningMessage(t.WarningMessage),!1}if(String.isNullOrUndefineOrBlank(e("#emailid").val()))return _onlineCheckout.WarningMessage("Please enter emailId"),!1;if(0==_onlineCheckout.ValidateEmail())return _onlineCheckout.WarningMessage("Please enter valid emailId"),!1;if(0==_siteBuilderDetail.isAffirmEnable&&(!_onlineCheckout.checkBirthDate()||"-1"==e("#cboDay").val()&&"-1"==e("#cboMonth").val()&&"-1"==e("#cboYear").val()))return _onlineCheckout.WarningMessage("Invalid Birth Date"),!1;if(String.isNullOrUndefineOrBlank(e("#txtAddressVPL").val()))return _onlineCheckout.WarningMessage("Please enter address"),!1;if(_onlineCheckout.IsVPLAddress=1,""!=e("#txtAddressVPL").val().trim()){if(!_onlineCheckout.validateNewShippingAddressData())return!1}else e(".cboRState").val("-1");IsEmailPhoneChanged=!1;var i=e("#hdnEmailBeforeChange").val(),n=e("#hdnCellNoBeforeChange").val(),o=i!=e("#emailid").val(),a=n!=ShoppingBagVPLCell.getPhoneData().phoneNo;if(1!=o&&1!=a||(_onlineCheckout.VPLTwoFactorStatus=1==o&&1==a?_onlineCheckout.VPLTwoFactor.EmailAndCell:1==o?_onlineCheckout.VPLTwoFactor.Email:_onlineCheckout.VPLTwoFactor.Cell),_onlineCheckout.VPLTwoFactorStatus!=_onlineCheckout.VPLTwoFactor.None)if(e("#dvtwostepemailcodeinfo").length<=0&&e("body").append('<div id="dvtwostepemailcodeinfo" role="none"></div>'),currentPage="ShoppingBag",TwoFactorPageType=currentPage,e("#hdnEmailAndCell2FScreenVPL").val()>_twoFactor.EmailAndCell2FScreen.None){if(_onlineCheckout.VPLTwoFactorStatus==_onlineCheckout.VPLTwoFactor.EmailAndCell||_onlineCheckout.VPLTwoFactorStatus==_onlineCheckout.VPLTwoFactor.Email){authenticationMode=_twoFactor.AuthCodeReceiveMode.Email,IsEmailPhoneChanged=_onlineCheckout.VPLTwoFactorStatus==_onlineCheckout.VPLTwoFactor.EmailAndCell;var s='"strUserName" :""';s+=',"strEmailID" :"'+e("#emailid").val()+'"',s+=',"UserID" :'+parseInt(_onlineCheckout.CustomerDetails.UserID),CallWebServicehed("MySampleService.asmx/CheckUserNameAvailabilityWithUserID",s,_onlineCheckout.CallSuccessWithEmail,_onlineCheckout.CallFailed)}else _onlineCheckout.VPLTwoFactorStatus==_onlineCheckout.VPLTwoFactor.Cell&&(authenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,_onlineCheckout.GetfilterrequestDataByEmail());IsEmailPhoneChanged=!0}else _onlineCheckout.SaveVPLUSerDetailProfile();else _onlineCheckout.SaveVPLUSerDetailProfile()},_onlineCheckout.GetfilterrequestDataByEmail=function(){ShowLoader(!0);var t={};String.isNullOrUndefineOrBlank(fpDeviceId)||(t.UserAgent=navigator.userAgent,t.VisitorID=fpDeviceId),t.UserEmail=e("#emailid").val(),t.OwnersPhone=ShoppingBagVPLCell.getPhoneData().phoneNo,t.IP=e("#hdnIPAddress").val(),t.UserId=parseInt(_onlineCheckout.CustomerDetails.UserID);var i=new vagaro.ajax;i.datamodel.Token="websiteapi/myaccount/getdatabybrowservisitorid",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=t,i.datamodel.callback=function(t){if(null!=typeof t&&null!=t&&(userccattemptdata=t),null!=typeof userccattemptdata&&null!=userccattemptdata){if(1==userccattemptdata.IsBlock)return ShowLoader(!1),String.isNullOrUndefineOrBlank(userccattemptdata.BlockErrorCode)||"XJ140"!=userccattemptdata.BlockErrorCode||(e("#divConfirmBox").find(".w-button-default").attr("value","Ok"),_onlineCheckout.showConfirmbox(_twoFactor.FailOTPMessage(),"","Error Code: XJ140",!1,!1)),void(IsBlocked=!0);if(IsBlocked=!1,"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.ShoppingBag){TwoFactorPageType=_twoFactor.PageType.ShoppingBag;var i={};i.emailid=e("#emailid").val(),i.phone=ShoppingBagVPLCell.getPhoneData().phoneNo,i.fullname=_onlineCheckout.CustomerDetails.FirstName+" "+_onlineCheckout.CustomerDetails.LastName,i.CountryID=ShoppingBagVPLCell.getPhoneData().countryId,i.IP=e("#hdnIPAddress").val(),i.IsEmailPhoneChanges=IsEmailPhoneChanged,i.NoOfLoginAttemptemail=NoOfLoginAttemptemail,i.AuthenticationMode=authenticationMode,i.IsFromBusinessSignup=!0,_twoFactor.SendTowFactorAuthenticationCode(i)}}else IsBlocked=!1,ShowLoader(!1)},i.datamodel.Error=function(){ShowLoader(!1)},i.Post()},_onlineCheckout.CallSuccessWithEmail=function(e){1*e.d==1?(_onlineCheckout.WarningMessage("Email already exists."),ShowLoader(!1)):_onlineCheckout.GetfilterrequestDataByEmail()},_onlineCheckout.CallFailed=function(){var e="Some error occured.Please try again later.";"true"==isWidget?vagaro.alertsmall(e):_common.PassiveAlertfail(e),ShowLoader(!1)},_onlineCheckout.SaveVPLUSerDetailProfile=function(){if(!ShoppingBagVPLCell.validatePhoneNumber(!0)){var t=ShoppingBagVPLCell.getValidateMessage();return 1==t.WarningType?_onlineCheckout.WarningMessage("Please enter mobile no"):_onlineCheckout.WarningMessage(t.WarningMessage),!1}if(String.isNullOrUndefineOrBlank(e("#emailid").val()))return _onlineCheckout.WarningMessage("Please enter emailId"),!1;if(0==_onlineCheckout.ValidateEmail())return _onlineCheckout.WarningMessage("Please enter valid emailId"),!1;if(0==_siteBuilderDetail.isAffirmEnable&&(!_onlineCheckout.checkBirthDate()||"-1"==e("#cboDay").val()&&"-1"==e("#cboMonth").val()&&"-1"==e("#cboYear").val()))return _onlineCheckout.WarningMessage("Invalid Birth Date"),!1;if(String.isNullOrUndefineOrBlank(e("#txtAddressVPL").val()))return _onlineCheckout.WarningMessage("Please enter address"),!1;if(_onlineCheckout.IsVPLAddress=1,""!=e("#txtAddressVPL").val().trim()){if(!_onlineCheckout.validateNewShippingAddressData())return!1}else e(".cboRState").val("-1");_onlineCheckout.VPLTwoFactorStatus=_onlineCheckout.VPLTwoFactor.None,ShowLoader(!0);var i={};i.UserID=_onlineCheckout.CustomerDetails.UserID,i.strFirstName=_onlineCheckout.CustomerDetails.FirstName,i.strLastName=_onlineCheckout.CustomerDetails.LastName,i.CustomerEmail=e("#emailid").val().trim(),i.strStreet=e("#txtNewStreet").val().trim(),i.CountryID=_onlineCheckout.CountryID.toString(),i.strState=String.isNullOrUndefineOrBlank(e(".ddlState").val())?String.isNullOrUndefineOrBlank(_onlineCheckout.selectedAddressData)||String.isNullOrUndefineOrBlank(_onlineCheckout.selectedAddressData.statecode)?e(".ddlState").val():_onlineCheckout.selectedAddressData.statecode:e(".ddlState").val(),i.strCity=e("#txtNewCity").val().trim(),i.strZip=e("#txtNewZip").val().trim(),i.Cell=ShoppingBagVPLCell.getPhoneData().phoneNo,i.DayPhone="",i.NightPhone="","-1"==e("#cboMonth").val()&&"-1"==e("#cboMonth").val()?(i.Month=null,i.Day=null,i.Year=null):(i.Month=e("#cboMonth").val(),i.Day=e("#cboDay").val(),i.Year=e("#cboYear").val()),String.isNullOrUndefineOrBlank(e("#txtSuite").val())?i.strStreetNo="":i.strStreetNo=e("#txtSuite").val(),i.strStateName=String.isNullOrUndefineOrBlank(e("#txtState").val())?String.isNullOrUndefineOrBlank(_onlineCheckout.selectedAddressData)||String.isNullOrUndefineOrBlank(_onlineCheckout.selectedAddressData.state)?e("#txtState").val():_onlineCheckout.selectedAddressData.state:e("#txtState").val(),i.strCellProvider="-1",i.strExp=_onlineCheckout.CustomerDetails.BusinessSummary,i.Gender=_onlineCheckout.CustomerDetails.Gender,i.IsFromOnline=!0;var n={};n.objCustInfo=i,n.ObjCustomerprofile=null,e.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:"/WebServices/VagaroWebOffline.asmx/AddEditCustomer",dataType:"json",beforeSend:function(t){try{"function"==typeof EncH&&t.setRequestHeader("H",EncH())}catch(e){}t.setRequestHeader("K",getek()),t.setRequestHeader("I",getei()),t.setRequestHeader("Val",EncIV()),"undefined"!=typeof keepAlive&&t.setRequestHeader("keepAlive",keepAlive),1==e("#hdnToken1").length&&void 0!==e("#hdnToken1").val()&&t.setRequestHeader("token1",e("#hdnToken1").val()),1==e("#hdnToken2").length&&void 0!==e("#hdnToken2").val()&&t.setRequestHeader("token2",e("#hdnToken2").val()),1==e("#hdnToken0").length&&void 0!==e("#hdnToken0").val()&&t.setRequestHeader("token0",e("#hdnToken0").val())},data:JSON.stringify(n),success:function(t){e("#dvtwostepemailcodeinfo").remove(),t=t.d,ShowLoader(!1),null==t?_onlineCheckout.FailedMessage("something went wrong"):t.UserID<=0?_onlineCheckout.WarningMessage(t.Message):(_onlineCheckout.CustomerDetails=JSON.parse(e("#hdnUserDetails").val()),_onlineCheckout.CustomerDetails.EmailId=e("#emailid").val().trim(),_onlineCheckout.CustomerDetails.Cell=ShoppingBagVPLCell.getPhoneData().phoneNo,_onlineCheckout.CustomerDetails.Street=e("#txtNewStreet").val().trim(),_onlineCheckout.CustomerDetails.BirthDate=new Date(e("#cboYear").val()+"-"+e("#cboMonth").val()+"-"+e("#cboDay").val()),String.isNullOrUndefineOrBlank(t.City)||(_onlineCheckout.CustomerDetails.City=t.City),String.isNullOrUndefineOrBlank(t.CountryID)||(_onlineCheckout.CustomerDetails.CountryID=t.CountryID),String.isNullOrUndefineOrBlank(t.Zip)||(_onlineCheckout.CustomerDetails.Zip=t.Zip),String.isNullOrUndefineOrBlank(t.StateCode)||(String.isNullOrUndefineOrBlank(t.CountryID)||1!=t.CountryID?_onlineCheckout.CustomerDetails.StateCode=t.StateCode:_onlineCheckout.CustomerDetails.StateCode=t.StateCode.includes("-")?t.StateCode.split("-")[1]:t.StateCode),e("#hdnUserDetails").val(JSON.stringify(_onlineCheckout.CustomerDetails)),e("#lblterms").removeClass("termsConditionText"),1==_siteBuilderDetail.isAffirmEnable||(e("#divActiveDialog").modal("show"),e("#chkDialogAggree").attr("checked",!1),e("#divVplAddBankDetails").hide()))},error:function(e){ShowLoader(!1),ShowHideFailedMessageCommon("Something went wrong, Try Again."),console.log(e)}})},_onlineCheckout.showConfirmbox=function(t,i,n,o,a){e("#divConfirmBox").find("#confirmmsg").html(t),e("#divConfirmBox").find("#confirmTitle").html(n),e("#divConfirmBox").find(".w-button-primary").show(),e("#divConfirmBox").find(".close-modal").show(),e("#divConfirmBox").fadeIn(),e("html").addClass("popupscroll"),e("body").css("overflow","hidden"),e("#divConfirmBox").addClass("in"),o||e("#divConfirmBox").find(".w-button-primary").hide(),0==a&&e("#divConfirmBox").find(".close-modal").hide()},_onlineCheckout.hideConfirmbox=function(){e("#divConfirmBox").fadeOut(),e("#divConfirmBox").removeClass("in"),e("html").removeClass("popupscroll"),e("body").css("overflow","auto"),CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,_onlineCheckout.CallFailed),CallbackforMobileApp(0,0,"","",0,6)},_onlineCheckout.WarningMessage=function(t,i){String.isNullOrUndefineOrBlank(i)&&(i=2e3),e(".warning").show(),e("#wartext").text(t),setTimeout(function(){e(".warning").hide()},i)},_onlineCheckout.FailedMessage=function(t,i){String.isNullOrUndefineOrBlank(i)&&(i=2e3),e(".fail").show(),e("#failtext").text(t),setTimeout(function(){e(".fail").hide()},i)},_onlineCheckout.checkBirthDate=function(){var e=document.getElementById("cboDay").value,t=document.getElementById("cboMonth").value,i=document.getElementById("cboYear").value,n=!1;return"-1"!=e&&"-1"!=t&&"-1"!=i&&(n=chkDate(t+"/"+e+"/"+i,!0)),n},_onlineCheckout.setAddressControl=function(){var t=e("#txtAddressVPL").select2({searchInputPlaceholder:"Address Line 1",minimumInputLength:1,combobox:!0,dropdownCssClass:"select-location-icons select2-drop-active select-customdropdown",selectOnClick:!1,multiple:!1,closeOnSelect:!0,formContainer:"#page-wrapper",allowClear:!0,ajax:{type:"POST",contentType:"application/json; charset=utf-8",url:"/WebServices/CommonWebService.asmx/GetLocationOrPlaceDetail",dataType:"json",quietMillis:250,transport:function(t){return t.beforeSend=function(t){try{"function"==typeof EncH&&t.setRequestHeader("H",EncH())}catch(e){}t.setRequestHeader("K",getek()),t.setRequestHeader("I",getei()),t.setRequestHeader("Val",EncIV()),"undefined"!=typeof keepAlive&&t.setRequestHeader("keepAlive",keepAlive),1==e("#hdnToken1").length&&void 0!==e("#hdnToken1").val()&&t.setRequestHeader("token1",e("#hdnToken1").val()),1==e("#hdnToken2").length&&void 0!==e("#hdnToken2").val()&&t.setRequestHeader("token2",e("#hdnToken2").val()),1==e("#hdnToken0").length&&void 0!==e("#hdnToken0").val()&&t.setRequestHeader("token0",e("#hdnToken0").val())},e.ajax(t)},data:function(){return{searchText:e("#txtAddressVPL").val(),countryFilter:countryMapping[_onlineCheckout.CountryID],Location:"0,0"}},results:function(e,t){return{results:e}},params:{error:function(e){try{if(403===e.status)return void location.reload(!0)}catch(e){}}},cache:!1},formatNoMatches:function(){return e("#select2-drop").css("display","block"),"No matches found"},formatSearching:function(){return e("#select2-drop").css("display","block"),"Searching"},formatInputTooShort:function(t,i){return e("#select2-drop").css("display","none"),""},initSelection:function(t,i){i({id:e("#txtAddressVPL").val(),text:e("#txtAddressVPL").val()})},formatResult:function(t){return e("#select2-drop").css("display","block"),'<div data-placeid="'+t.place_id+'"><span class="fullocation">'+t.FormattedAddress+"</span></div>"}});t.on("select2-loaded",function(t){e(".select2-result-unselectable").addClass("select2-result-selectable").removeClass("select2-result-unselectable")}),t.on("select2-blur",function(e){e.preventDefault()}),t.on("selected",function(t){e(t.currentTarget).select2("val",t.choice.CityState),e(t.currentTarget).data("selectedid",t.choice.CityState),e.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:"/WebServices/CommonWebService.asmx/GetPlaceDetailByPlaceId",dataType:"json",beforeSend:function(t){try{"function"==typeof EncH&&t.setRequestHeader("H",EncH())}catch(e){}t.setRequestHeader("K",getek()),t.setRequestHeader("I",getei()),t.setRequestHeader("Val",EncIV()),"undefined"!=typeof keepAlive&&t.setRequestHeader("keepAlive",keepAlive),1==e("#hdnToken1").length&&void 0!==e("#hdnToken1").val()&&t.setRequestHeader("token1",e("#hdnToken1").val()),1==e("#hdnToken2").length&&void 0!==e("#hdnToken2").val()&&t.setRequestHeader("token2",e("#hdnToken2").val()),1==e("#hdnToken0").length&&void 0!==e("#hdnToken0").val()&&t.setRequestHeader("token0",e("#hdnToken0").val())},data:JSON.stringify({placeId:t.choice.place_id,description:t.choice.CityState}),success:function(t){if(null!=t&&"null"!=t){var i=null!=(t=t.d)&&null==t.City?"":t.City.split(",")[0],n=null==t.State?"":t.State;n=n.trim();var o={};o.street=t.Address,o.city=i,o.state=n,o.zip=t.ZipCode,o.country=t.CountryID,o.countrytext=countryMapping[t.CountryID],o.statecode=t.StateCode,o.stateID=_onlineCheckout.getMappingStateId(o.country,o.state),_onlineCheckout.selectedAddressData=o,e("#txtNewStreet").val(t.Address),e("#txtNewCity").val(i),e("#txtNewState").val(n),e("#txtNewZip").val(t.ZipCode),_onlineCheckout.GetCityByZipCode(e("#txtNewZip")),e("#txtSuite").focus(),e("#hdnNewCountrycode").val(countryMapping[t.CountryID]),e("#hdnNewCountryName").val(countryNameMapping[t.CountryID]),e("#cboCountryshopping").val(o.country),e(".ddlState").val(o.stateID)}},error:function(e){console.log(e)}})})},_onlineCheckout.addbankclick=function(){_onlineCheckout.addbankDetails()},_onlineCheckout.DisplayAffirmEmailValidation=function(){return e("#txtAffirmEmailId").data("EmailId",""),e("#dvAffirmEmailAddress").modal("show"),!1},_onlineCheckout.CloseAffirmEmail=function(t){ShowLoader(!0),1==t?_shopdetail.ResetVPLPaymentMethod(!0,!0):_shopdetail.ResetVPLPaymentMethod(!1,!0),_onlineCheckout.AuthorisePaymnetCount=0,_onlineCheckout.AuthoriseListData=[],e("#dvAffirmEmailAddress").modal("hide"),ShowLoader(!1)},_onlineCheckout.ContinueAffirmEmail=function(t){return ShowLoader(!0),1==_onlineCheckout.ValidateAffirmEmail()?(e("#dvAffirmEmailAddress").modal("hide"),e("#txtAffirmEmailId").data("EmailId",e("#txtAffirmEmailId").val()),1==t?_onlineCheckout.VPLFinalSubmit(!0):_shopdetail.VPLFinalSubmit(!0),!0):(ShowLoader(!1),!1)},_onlineCheckout.ValidateAffirmEmail=function(){return""==e("#txtAffirmEmailId").val()?(e("#lblAffirmInvalidEmail").hide(),e('[id*="spanAffirmVendorEmailRequire"]').show(),!1):_onlineCheckout.isValidEmailAddress(e("#txtAffirmEmailId").val())?(e("#lblAffirmInvalidEmail").hide(),e("#txtAffirmEmailId").removeClass("errorInput"),e('[id*="spanAffirmVendorEmailRequire"]').hide(),!0):(e("#lblAffirmInvalidEmail").show(),e("#txtAffirmEmailId").removeClass("errorInput"),e('[id*="spanAffirmVendorEmailRequire"]').hide(),e("#txtAffirmEmailId").addClass("errorInput"),e("#txtAffirmEmailId").focus(),!1)},_onlineCheckout.addbankDetails=function(){if(_onlineCheckout.CustomerDetails=JSON.parse(e("#hdnUserDetails").val()),e("#txtCellVPL").length>0&&!e("#txtCellVPL").data("phone-init")?(ShoppingBagVPLCell=e("#txtCellVPL").PhonePlugin({UserRole:String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.UserType)||"1"!=_onlineCheckout.CustomerDetails.UserType?1:2,ControlText:"Mobile Phone",IsPhoneNoRequire:!0,CurrentLocationCountryID:"undefined"!=typeof cookie&&null!=cookie?parseInt(cookie.countryid):1,CountryId:_onlineCheckout.CustomerDetails.CellCountryID>0?_onlineCheckout.CustomerDetails.CellCountryID:1}),e("#txtCellVPL").data("phone-init",!0)):e("#txtvplCartcell").length>0&&!e("#txtvplCartcell").data("phone-init")&&(ShoppingBagVPLCell=e("#txtvplCartcell").PhonePlugin({UserRole:String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.UserType)||"1"!=_onlineCheckout.CustomerDetails.UserType?1:2,ControlText:"Mobile Phone",IsPhoneNoRequire:!0,CurrentLocationCountryID:"undefined"!=typeof cookie&&null!=cookie?parseInt(cookie.countryid):1,CountryId:_onlineCheckout.CustomerDetails.CellCountryID>0?_onlineCheckout.CustomerDetails.CellCountryID:1}),e("#txtvplCartcell").data("phone-init",!0)),_onlineCheckout.LoadStatesByMultipleCountryID(),String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.EmailId)||String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.Cell)||String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.Street)||String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.BirthDate)||1==_siteBuilderDetail.isAffirmEnable){if(e("#hdncountryid").val(_onlineCheckout.CustomerDetails.CountryID),e("#txtAddressVPL").on("select2-focus",function(t){e(".countryselectmyacprofile").is(":visible")&&e(".countryselectmyacprofile").hide()}),_onlineCheckout.setAddressControl(),String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.Cell)?_onlineCheckout.VPLTwoFactorStatus=_onlineCheckout.VPLTwoFactor.Cell:(e("#hdnCellNoBeforeChange").val(_onlineCheckout.CustomerDetails.Cell),ShoppingBagVPLCell.setPhoneData(_onlineCheckout.CustomerDetails.CellCountryID,_onlineCheckout.CustomerDetails.Cell)),String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.EmailId)?_onlineCheckout.VPLTwoFactorStatus=_onlineCheckout.VPLTwoFactorStatus!=_onlineCheckout.VPLTwoFactor.None?_onlineCheckout.VPLTwoFactor.EmailAndCell:_onlineCheckout.VPLTwoFactor.Email:(e("#hdnEmailBeforeChange").val(_onlineCheckout.CustomerDetails.EmailId),e("#emailid").val(_onlineCheckout.CustomerDetails.EmailId)),0==_siteBuilderDetail.isAffirmEnable&&!String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.BirthDate)){var t=new Date(parseInt(_onlineCheckout.CustomerDetails.BirthDate.slice(6,19)));e("#cboMonth").val(t.getMonth()+1),e("#cboDay").val(t.getDate()),e("#cboYear").val(t.getFullYear())}e(".selectedCountrudiv").removeClass().addClass("selectedcountry "+U[_onlineCheckout.CustomerDetails.CountryID]+" Selected selectedCountrudiv");var i,n,o,a;if(i=String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.Street)?"":_onlineCheckout.CustomerDetails.Street+", ",n=String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.City)?"":_onlineCheckout.CustomerDetails.City+", ",o=String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.StateName)?"":_onlineCheckout.CustomerDetails.StateName+", ",a=String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.Zip)?"":_onlineCheckout.CustomerDetails.Zip,e("#txtAddressVPL").select2("val",i+n+o+a),e("#txtNewStreet").val(i),e("#txtNewCity").val(n),e("#txtNewState").val(o),e("#txtNewZip").val(a),e("#hdnNewCountrycode").val(countryMapping[_onlineCheckout.CustomerDetails.CountryID]),e("#hdnNewCountryName").val(countryNameMapping[_onlineCheckout.CustomerDetails.CountryID]),String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.StreetNo)||e("#txtSuite").val(_onlineCheckout.CustomerDetails.StreetNo),_onlineCheckout.IsVPLAddress=2,1==_siteBuilderDetail.isAffirmEnable){if(e("#btnProccessBank").text("Save"),e("#affirmBirthdate").hide(),e("#affirmphoneno").hide(),e("#btnProccessBank").hide(),e("#divVplAddBankDetails").show(),String.isNullOrUndefineOrBlank(_onlineCheckout.CustomerDetails.EmailId))return;e("#divVplAddBankDetails").show()}else e("#divVplAddBankDetails").show()}else e("#lblterms").removeClass("termsConditionText"),e("#divActiveDialog").modal("show"),e("#chkDialogAggree").attr("checked",!1)},_onlineCheckout.BankRadioClick=function(t){e("#addBankList input:radio").attr("checked",!1),e(t).prop("checked","checked")};var s,r,l,c=2,d=3,u=7,p=8,h=15,m=17,g=18,v=20,f=21,C=28,S=1,y=2,b=3,k=4,_=5,D="GC",I="Pkg",w="MS",P="CLS",A="addon",T=1,x=2,F=3;_onlineCheckout.isOnlyLiveStreamClass=function(){try{var t=!1,i=!1;return!String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&Array.isArray(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&e.each(onlineShoppingCart.Events,function(n,o){!String.isNullOrUndefineOrBlank(o.eventEnrollment)&&Array.isArray(o.eventEnrollment)&&o.eventEnrollment.length>0&&e.each(o.eventEnrollment,function(e,n){String.isNullOrUndefineOrBlank(n.StreamingStatus)||1!==parseInt(n.StreamingStatus,10)?1==n.isPointApply||1==n.isPackage||1==n.isMembershipApply||n.isPriceBaseGCApply||n.isPresetApply||!String.isNullOrUndefineOrBlank(n.gcId)&&n.gcId>0||(t=!0):i=!0})}),i&&!t}catch(e){return!1}},_onlineCheckout.ValidatePaymentMethodInfo=function(t,i){if(1==e("#tabVagaroPayLater").hasClass("w--current")||1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")||1==e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current"))return!0;var n=1==i&&"true"==isCCRequiredForOnlineClass.toLowerCase()&&t>0||1!=i&&t>0,o="true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove),a=!String.isNullOrUndefineOrBlank(_onlineCheckout.zenSwipeCardDetails)&&!String.isNullOrUndefineOrBlank(_onlineCheckout.zenSwipeCardDetails.card_token),s=!String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile)&&!String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId);return!((o||n)&&!a&&!s)},_onlineCheckout.IsDisplayGoogleAppleMethod=function(){return null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0||null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0||null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||1==_onlineCheckout.CheckLiveStreamClass()||1==_onlineCheckout.isValidForCheckoutInvoice()||(1==_onlineCheckout.IsCalculateAndDisplayFeeOnline(!0)||1==_onlineCheckout.IsDepositItemExists(null))},_onlineCheckout.IsOtherCheckoutExceptClass=function(e){return null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0||null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0||null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0||!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&("true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove)&&("false"==IsClassReschedule.toLowerCase()||"true"==IsClassReschedule.toLowerCase()&&("undefined"==typeof IsPaid||"false"==IsPaid.toString().toLowerCase()))||null!=e&&1==e.isSaveClassCard)||1==_onlineCheckout.isCheckoutVPLChanged||1==_onlineCheckout.IsDepositItemExists(e)&&null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0||null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&1==_onlineCheckout.IsDepositItemExists(e)},_onlineCheckout.IsValidCartDepositInfo=function(e){var t=!0;try{if(void 0!==e&&null!=e&&void 0!==e.objValidateClassBookingData&&null!=e.objValidateClassBookingData){var i=parseFloat(onlineShoppingCart.classFinalTotal-parseFloat(onlineShoppingCart.DepositsRemaining)-parseFloat(onlineShoppingCart.PartialPrice)),n=e.checkoutRequest;if(0==(void 0!==n&&null!=n&&void 0!==n.vplAmt&&null!=n.vplAmt&&n.vplAmt>0)){var o="true"==isCCRequiredForOnlineClass.toLowerCase()&&i>0,a="true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove),s=!String.isNullOrUndefineOrBlank(_onlineCheckout.zenSwipeCardDetails)&&!String.isNullOrUndefineOrBlank(_onlineCheckout.zenSwipeCardDetails.card_token),r=!String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile)&&!String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId);if((null==e.objCardDetails||null!=e.objCardDetails&&0===Object.keys(e.objCardDetails).length)&&String.isNullOrUndefineOrBlank(e.objValidateClassBookingData.strUserCCXML)&&(null==e.objValidateClassBookingData.objUserCCDetails||null!=e.objValidateClassBookingData.objUserCCDetails&&0===Object.keys(e.objValidateClassBookingData.objUserCCDetails).length)&&(s=!1,r=!1),1==_onlineCheckout.isOnlyLiveStreamClass()&&1==a&&(a=!1),(a||o)&&!s&&!r){t=!1;var l={},c={AppointmentData:e,BusinessDetail:onlineShoppingCart,UserDetail:""};l.BusinessID=onlineShoppingCart.BusinessID,l.UserID=String.isNullOrUndefineOrBlank(onlineShoppingCart.loginUserId)?0:onlineShoppingCart.loginUserId,l.Step=141,l.PageURL=window.location.href,l.Device="Online",l.AppointmentDetail=JSON.stringify(c),l.UserAgent=null!=navigator.userAgent.toLowerCase()?navigator.userAgent.toLowerCase():"";var d=[];d.push(l);var u=new vagaro.ajax;return u.datamodel.Token="CCCaptureLogError",u.datamodel.data=d,u.datamodel.callback=function(e){},u.datamodel.Error=function(e){},u.Post(),swal({title:"Your business requires a deposit or credit card on file to complete this booking. Please add a card to proceed.",text:"",confirmButtonColor:"#DD6B55",confirmButtonText:"Ok",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model"},function(e){swal.close(),location.reload(),t=!1}),t}}}return t}catch(e){return!0}},_onlineCheckout.SaveOnlineCheckout=function(){if(oldCardDetails={},_onlineCheckout.IsBuyGC=!0,0!=_onlineCheckout.ValidateCheckOutForm()){_onlineCheckout.isValidForCheckoutInvoice()&&ShowLoader(!0);var t=!1,i=null;if(0==_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){var n="Online";!_onlineCheckout.IsVagaroMarketplace()&&1!=vgAppicationType||IsFromCreateLink||(n="Online Marketplace"),String.isNullOrUndefineOrBlank(_common.GetGoogleToken(businessID))&&(isGoogle="false"),"undefined"!=typeof isFacebook&&"true"==isFacebook.toLowerCase()||0==isCheckInApp&&void 0!==_shopdetail.IsBookFromFacebook&&"true"==_shopdetail.IsBookFromFacebook.toLowerCase()?n="Facebook":"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&(n="Widget"),1!=_siteBuilderDetail.isFromAppleClip&&1!=_siteBuilderDetail.isFromAppClip||(n="AppleMaps"),"true"==isGoogle&&1!=_siteBuilderDetail.isFromAppleClip&&1!=_siteBuilderDetail.isFromAppClip&&(n="Google"),1==isCheckInApp&&(n="CheckInApp"),"undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.isFBExtensions&&1==vagaroFBExtensions.isFBExtensions&&(n="Insta",1==vagaroFBExtensions.isExtensions_FB_Android?n="FBAndroid":1==vagaroFBExtensions.isExtensions_FB_iOS?n="FBiOS":1==vagaroFBExtensions.isExtensions_Insta_Android||1==vagaroFBExtensions.isExtensions_Android_Mobile?n="InstaAndroid":1!=vagaroFBExtensions.isExtensions_Insta_iOS&&1!=vagaroFBExtensions.isExtensions_iOS_Mobile||(n="InstaiOS")),!String.isNullOrUndefineOrBlank(PromotionID)&&_onlineCheckout.IsVagaroDailDeal()&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.IsDailyDealEnable)&&onlineShoppingCart.IsDailyDealEnable&&(n="DailyDeal"),String.isNullOrUndefineOrBlank(PromotionAppointmentID)||(n="Marketing Campaign"),!String.isNullOrUndefineOrBlank(PromotionAppointmentID)&&isFromTextMarketing&&(n="Text Marketing Campaign");var o=getQueryStringData("Type");void 0!==o&&""!=o&&"Builder"==o&&(n+=" MySite"),void 0!==getCookie("connectroute")&&null!=getCookie("connectroute")&&getCookie("connectroute")?n+=" Connect":void 0!==getCookie("connectairoute")&&null!=getCookie("connectairoute")&&getCookie("connectairoute")&&(n+=" Connect AI"),String.isNullOrUndefineOrBlank(getCookie("loginTypeValue"))||8!=getCookie("loginTypeValue")||(n="Alexa");var a="undefined"!=typeof _shopdetail&&_shopdetail&&"function"==typeof _shopdetail.IsNewCustomerFeesUK&&_shopdetail.IsNewCustomerFeesUK()&&"function"==typeof _shopdetail.IsMarketplaceDevice&&_shopdetail.IsMarketplaceDevice(n)&&!("function"==typeof _onlineCheckout.isDailyDealExistsInItems&&_onlineCheckout.isDailyDealExistsInItems(onlineShoppingCart));!String.isNullOrUndefineOrBlank(totalDailyDealFeeOfAllCart_PMGCA)&&totalDailyDealFeeOfAllCart_PMGCA>0&&!a&&(n.toLowerCase().includes("google")||n.toLowerCase().includes("yelp")?IsForNewCustomer&&(n+=" Vera"):n+=" Vera"),"undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart&&null!=onlineShoppingCart&&String.isNullOrUndefineOrBlank(onlineShoppingCart.loginUserId)&&"undefined"!=typeof isWidget&&null!=isWidget&&null!=isWidget&&"true"==isWidget&&void 0!==_shopdetail.GetRescheduleUserID()&&null!=_shopdetail.GetRescheduleUserID()&&null!=_shopdetail.GetRescheduleUserID()&&(onlineShoppingCart.loginUserId=parseInt(_shopdetail.GetRescheduleUserID()));var s=parseFloat(onlineShoppingCart.classFinalTotal-parseFloat(onlineShoppingCart.DepositsRemaining)-parseFloat(onlineShoppingCart.PartialPrice));if(0==_onlineCheckout.ValidatePaymentMethodInfo(s,1))return ShowLoader(!1),vagaro.alert("Please select payment method"),!1;var r=_onlineCheckout.SaveClassCheckout(onlineShoppingCart.loginUserId,1==_onlineCheckout.IsCCDetailEnable()?1:2,n);if(0==r)return;if(i=r,_onlineCheckout.isValidForCheckoutInvoice()?i.invoiceID=_onlineCheckout.InvoiceID:i.invoiceID=0,i.HasFMBFee=_onlineCheckout.GetFirstVisitFlagCart(),i.IsFMBEnableForBusiness="undefined"!=typeof IsFMBEnableForBusiness&&!0===IsFMBEnableForBusiness,i.FMBFeeType="function"==typeof _onlineCheckout.GetFMBFeeTypeCart?_onlineCheckout.GetFMBFeeTypeCart(onlineShoppingCart):0,t=!0,0==_onlineCheckout.IsOtherCheckoutExceptClass(i)&&(e(_onlineCheckout.Controls.tabGooglePay).is(":visible")||e(_onlineCheckout.Controls.tabApplePay).is(":visible"))&&(1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")||1==e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")))if(String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId)||void 0===_onlineCheckout.ccCardOnFile.IsTokenGenerated||null==_onlineCheckout.ccCardOnFile.IsTokenGenerated||""==typeof _onlineCheckout.ccCardOnFile.IsTokenGenerated||1!=_onlineCheckout.ccCardOnFile.IsTokenGenerated){if(!String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId)&&void 0!==_onlineCheckout.ccCardOnFile.IsTokenGenerated&&null!=_onlineCheckout.ccCardOnFile.IsTokenGenerated&&""!=typeof _onlineCheckout.ccCardOnFile.IsTokenGenerated)return vagaro.alert("Please select "+e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")==1?"google":"apple pay payment method"),!1;if(1!=_onlineCheckout.ccCardOnFile.IsTokenGenerated)return e(_onlineCheckout.Controls.tabGooglePay).is(":visible")&&1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")?(ShowLoader(!0),_shopdetail.OpenGoogleApplePaymentInfoPopup(1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")?PaymentMethod.GooglePay:PaymentMethod.ApplePay,!0,s)):e(_onlineCheckout.Controls.tabApplePay).is(":visible")&&1==e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")&&startApplePaySession(),!1}else;}var l=!1,c=null;if(1==_onlineCheckout.IsOtherCheckoutExceptClass(i)){if(l=!0,c={},"undefined"==typeof vui||String.isNullOrUndefineOrBlank(vui.stripeRadarSession)||(c.StripeRadarSession=vui.stripeRadarSession),_onlineCheckout.isValidForCheckoutInvoice()||1==_onlineCheckout.IsPaidClass()){if(onlineShoppingCart.PartialPrice==typeof onlineShoppingCart.PartialPrice!="undefined"&&onlineShoppingCart.PartialPrice,c.ccAmt=parseFloat(onlineShoppingCart.ccAmt)+parseFloat(onlineShoppingCart.classFinalTotal)+parseFloat(onlineShoppingCart.tipValue)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining+onlineShoppingCart.DepositsRemaining+onlineShoppingCart.FeeDepositsRemaining+onlineShoppingCart.PartialPrice),_onlineCheckout.IsTaxCalculated)try{var d=0;onlineShoppingCart.Packages?.forEach(e=>e.BusinessTax?.forEach(e=>d+=e.CalculatedTax||0)),c.tax=parseFloat(ConvertTodecimalMorePrecious(onlineShoppingCart.classTax+(d||0),!0,2))}catch(e){c.tax=parseFloat(ConvertTodecimalMorePrecious(onlineShoppingCart.classTax,!0,2))}else c.tax=parseFloat(onlineShoppingCart.tax)+parseFloat(onlineShoppingCart.classTax)+parseFloat(1==String.isNullOrUndefineOrBlank(onlineShoppingCart.classAddonTotalTaxPrice)?0:onlineShoppingCart.classAddonTotalTaxPrice);c.amtPaid=parseFloat(onlineShoppingCart.amtPaid)+parseFloat(onlineShoppingCart.classSubTotal)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining+onlineShoppingCart.DepositsRemaining+onlineShoppingCart.FeeDepositsRemaining),c.gcAmt=parseFloat(onlineShoppingCart.gcAmt)+parseFloat(onlineShoppingCart.classGCUsed),c.vplAmt=parseFloat(onlineShoppingCart.vplAmt)+parseFloat(onlineShoppingCart.classFinalTotal)+parseFloat(onlineShoppingCart.tipValue)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining+onlineShoppingCart.DepositsRemaining)}else c.gcAmt=onlineShoppingCart.gcAmt,c.ccAmt=onlineShoppingCart.ccAmt-parseFloat(onlineShoppingCart.FeeDepositsRemaining),c.amtPaid=onlineShoppingCart.amtPaid-parseFloat(onlineShoppingCart.FeeDepositsRemaining),c.tax=onlineShoppingCart.tax-parseFloat(onlineShoppingCart.FeeTaxDepositsRemaining),c.vplAmt=onlineShoppingCart.vplAmt;if((e(_onlineCheckout.Controls.tabGooglePay).is(":visible")||e(_onlineCheckout.Controls.tabApplePay).is(":visible"))&&(1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")||1==e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")))if(String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId)||void 0===_onlineCheckout.ccCardOnFile.IsTokenGenerated||null==_onlineCheckout.ccCardOnFile.IsTokenGenerated||""==typeof _onlineCheckout.ccCardOnFile.IsTokenGenerated||1!=_onlineCheckout.ccCardOnFile.IsTokenGenerated){if(!String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId)&&void 0!==_onlineCheckout.ccCardOnFile.IsTokenGenerated&&null!=_onlineCheckout.ccCardOnFile.IsTokenGenerated&&""!=typeof _onlineCheckout.ccCardOnFile.IsTokenGenerated)return vagaro.alert("Please select "+e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")==1?"google":"apple pay payment method"),!1;if(1!=_onlineCheckout.ccCardOnFile.IsTokenGenerated){if(e(_onlineCheckout.Controls.tabGooglePay).is(":visible")&&1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")){ShowLoader(!0);var u=_onlineCheckout.ConvertDecimalWithFixed(onlineShoppingCart.FinalCCAmount,!1,2);_shopdetail.OpenGoogleApplePaymentInfoPopup(1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")?PaymentMethod.GooglePay:PaymentMethod.ApplePay,!0,u)}else e(_onlineCheckout.Controls.tabApplePay).is(":visible")&&1==e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")&&startApplePaySession();return!1}}else;if(0==_onlineCheckout.ValidatePaymentMethodInfo(c.ccAmt,2))return ShowLoader(!1),vagaro.alert("Please select payment method"),!1;c.businessID=onlineShoppingCart.BusinessID,c.CurrencyCode=currencyCode,c.loginUserID=onlineShoppingCart.loginUserId,void 0!==_onlineCheckout.zenSwipeCardDetails&&null!=_onlineCheckout.zenSwipeCardDetails&&""!=_onlineCheckout.zenSwipeCardDetails&&void 0!==_onlineCheckout.zenSwipeCardDetails.save_card&&null!=_onlineCheckout.zenSwipeCardDetails.save_card&&""!=_onlineCheckout.zenSwipeCardDetails.save_card&&1==_onlineCheckout.zenSwipeCardDetails.save_card?(c.isSaveCard=!0,c.isCCSaveCard=!0):c.isSaveCard=!1,c.IsNewCCIframeOpen=!1,void 0!==_onlineCheckout.zenSwipeCardDetails&&null!=_onlineCheckout.zenSwipeCardDetails&&""!=_onlineCheckout.zenSwipeCardDetails&&void 0!==_onlineCheckout.zenSwipeCardDetails.save_card&&null!=_onlineCheckout.zenSwipeCardDetails.save_card&&""!==_onlineCheckout.zenSwipeCardDetails.save_card&&0==_onlineCheckout.zenSwipeCardDetails.save_card&&1==_onlineCheckout.isCheckoutCCChanged&&(c.IsNewCCIframeOpen=!0),c.isUserCardonFile=!1,c.onlineGCDevice="",null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&1==_onlineCheckout.IsPaidClass()?c.IsOnlineClassCheckout=!0:c.IsOnlineClassCheckout=!1,1==_onlineCheckout.isCheckoutVPLChanged&&(c.ccDetails={},c.ccAmt=0),(c.isSaveCard||c.isUserCardonFile)&&(c.isUserCardonFile=!0);var h=[];if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0){var m=e.grep(onlineShoppingCart.Inventories,function(e){return 1==String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)});_onlineCheckout.setProductCheckoutData(m,h,c)}if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&_onlineCheckout.setMembershipCheckoutData(onlineShoppingCart.Memberships,h,c),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&(_onlineCheckout.setGCCheckoutData(onlineShoppingCart.GiftCertificates,h,c),void 0!==_siteBuilderDetail.IsFromGoogleMyBusiness&&1==_siteBuilderDetail.IsFromGoogleMyBusiness&&(c.onlineGCDevice="google")),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&_onlineCheckout.setPackageCheckoutData(onlineShoppingCart.Packages,h,c),null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&(_onlineCheckout.UpdateBusinessTaxForBusinessFee(),_onlineCheckout.setBusinessFeesCheckoutData(onlineShoppingCart.BusinessFee,h,c),c.TotalFeeAmount=onlineShoppingCart.totalFeeAmount,c.TotalFeeTax=onlineShoppingCart.totalFeeTax),1==_onlineCheckout.IsThisNewCustomer)for(var g=0;g<=h.length-1;g++)h[g].isNewCustomer=_onlineCheckout.IsThisNewCustomer;if(_shopdetail.EnableFMBFee()&&_onlineCheckout.RecomputeDailyDealFeeOnRemaining(onlineShoppingCart.Events,onlineShoppingCart.Packages,onlineShoppingCart.Memberships),(1==_onlineCheckout.IsPaidClass()||_onlineCheckout.isValidForCheckoutInvoice())&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(_onlineCheckout.setClassCheckoutData(onlineShoppingCart.Events,h,c,!1),Array.isArray(h)&&h.some(e=>e.recordType===p)&&_onlineCheckout.fixWorkshopSessionMismatch(h)),_shopdetail.EnableFMBFee()&&Array.isArray(h)&&h.some(e=>Number(e?.dailydealFee||0)>0)&&_onlineCheckout.setdailydealFeesCheckoutData(onlineShoppingCart,h,c),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&_onlineCheckout.setServiceCheckoutData(onlineShoppingCart.ServiceInvoice,h,c),_onlineCheckout.isValidForCheckoutInvoice()?(c.invoiceID=_onlineCheckout.InvoiceID,null==onlineShoppingCart.invoiceDetails||String.isNullOrUndefineOrBlank(onlineShoppingCart.invoiceDetails.InvoiceGridObject.isExpiryDate)||1!=onlineShoppingCart.invoiceDetails.InvoiceGridObject.isExpiryDate?c.invExpiredMonthForGCPackage=0:c.invExpiredMonthForGCPackage=String.isNullOrUndefineOrBlank(onlineShoppingCart.invoiceDetails.InvoiceGridObject.ExpiryMonths)?parseInt(0):parseFloat(onlineShoppingCart.invoiceDetails.InvoiceGridObject.ExpiryMonths),c.tip=onlineShoppingCart.tipValue,(void 0===c.loginUserID||null==c.loginUserID||0==c.loginUserID)&&void 0!==onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId&&null!=onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId&&onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId>0&&(c.loginUserID=onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId)):(c.invoiceID=0,c.tip=0),"undefined"==typeof hdnPriceWithTaxSwitch||null==hdnPriceWithTaxSwitch||null==hdnPriceWithTaxSwitch||String.isNullOrUndefineOrBlank(hdnPriceWithTaxSwitch.value)||"1"!=hdnPriceWithTaxSwitch.value||(c.IsIncludeTaxInOnlinePricing=!0),0==(1==e("#tabVagaroPayLater").hasClass("w--current")&&!String.isNullOrUndefineOrBlank(_onlineCheckout.isCheckoutVPLChanged)&&1==_onlineCheckout.isCheckoutVPLChanged)&&(c.ccAmt>0||null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&(c.isCCMust&&!String.isNullOrUndefineOrBlank(_onlineCheckout.isCheckoutVPLChanged)&&0==_onlineCheckout.isCheckoutVPLChanged||onlineShoppingCart.Inventories.filter(function(e){return e.shippingAmount>0}).length>0)||1==_onlineCheckout.IsLoadCCIframForMemrship()&&0==e("#tabVagaroPayLater").hasClass("w--current"))){if(ccDetails={},1==_onlineCheckout.isCheckoutCCChanged){if(ccDetails.ccNo=_onlineCheckout.zenSwipeCardDetails.cc_no,ccDetails.ccSecurityCode=_onlineCheckout.zenSwipeCardDetails.cvv,ccDetails.ccFirstName=_onlineCheckout.zenSwipeCardDetails.first_name,ccDetails.ccMiddleName=_onlineCheckout.zenSwipeCardDetails.middle_name,ccDetails.ccLastName=_onlineCheckout.zenSwipeCardDetails.last_name,ccDetails.ccType=_onlineCheckout.zenSwipeCardDetails.cc_type,ccDetails.cardTokenId=_onlineCheckout.zenSwipeCardDetails.card_token,void 0!==_onlineCheckout.zenSwipeCardDetails.expire_month&&null!=_onlineCheckout.zenSwipeCardDetails.expire_month&&""!=_onlineCheckout.zenSwipeCardDetails.expire_month&&(ccDetails.ExpMonth=_onlineCheckout.zenSwipeCardDetails.expire_month),void 0!==_onlineCheckout.zenSwipeCardDetails.expire_year&&null!=_onlineCheckout.zenSwipeCardDetails.expire_year&&""!=_onlineCheckout.zenSwipeCardDetails.expire_year&&(ccDetails.ExpYear=_onlineCheckout.zenSwipeCardDetails.expire_year),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0)c.isSaveCCForMembership=!0;else if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){e.grep(onlineShoppingCart.Packages,function(e){return void 0!==e.IsRecurring&&1==e.IsRecurring}).length>0&&(c.isSaveCCForMembership=!0)}}else ccDetails.ccNo=_onlineCheckout.ccCardOnFile.CreditCardNumber,ccDetails.ccSecurityCode=_onlineCheckout.ccCardOnFile.SecurityCode,ccDetails.ccFirstName=_onlineCheckout.ccCardOnFile.CCFirstName,ccDetails.ccMiddleName=_onlineCheckout.ccCardOnFile.CCMiddleName,ccDetails.ccLastName=_onlineCheckout.ccCardOnFile.CCLastName,ccDetails.ccType=_onlineCheckout.ccCardOnFile.CreditCardType,ccDetails.cardTokenId=_onlineCheckout.ccCardOnFile.CardTokenId,void 0!==_onlineCheckout.ccCardOnFile.ExpMonth&&null!=_onlineCheckout.ccCardOnFile.ExpMonth&&""!=_onlineCheckout.ccCardOnFile.ExpMonth&&(ccDetails.ExpMonth=_onlineCheckout.ccCardOnFile.ExpMonth),void 0!==_onlineCheckout.ccCardOnFile.ExpYear&&null!=_onlineCheckout.ccCardOnFile.ExpYear&&""!=_onlineCheckout.ccCardOnFile.ExpYear&&(ccDetails.ExpYear=_onlineCheckout.ccCardOnFile.ExpYear),void 0!==_onlineCheckout.ccCardOnFile&&null!=_onlineCheckout.ccCardOnFile&&void 0!==_onlineCheckout.ccCardOnFile.IsSaveCard&&null!=_onlineCheckout.ccCardOnFile.IsSaveCard&&1==_onlineCheckout.ccCardOnFile.IsSaveCard&&(c.isCCSaveCard=!0);if(1==e("#dvcheckoutBookingTabs").find(".w--current").data("isothercard")||1==_onlineCheckout.isCheckoutCCChanged)if(void 0!==_onlineCheckout.BusSavedCard&null!=_onlineCheckout.BusSavedCard&&(oldCardDetails.CreditCardType=_onlineCheckout.BusSavedCard.CreditCardType,oldCardDetails.CreditCardNumber=_onlineCheckout.BusSavedCard.CreditCardNumber,oldCardDetails.SecurityCode=_onlineCheckout.BusSavedCard.SecurityCode,oldCardDetails.ExpMonth=_onlineCheckout.BusSavedCard.ExpMonth,oldCardDetails.ExpYear=_onlineCheckout.BusSavedCard.ExpYear,oldCardDetails.CCFirstName=_onlineCheckout.BusSavedCard.CCFirstName,oldCardDetails.CCMiddleName=_onlineCheckout.BusSavedCard.CCMiddleName,oldCardDetails.CCLastName=_onlineCheckout.BusSavedCard.CCLastName,oldCardDetails.CardTokenId=_onlineCheckout.BusSavedCard.CardTokenId,oldCardDetails.BusinessID=_onlineCheckout.BusSavedCard.BusinessID,oldCardDetails.businessCount=_onlineCheckout.BusSavedCard.businessCount),1==e("#dvcheckoutBookingTabs").find(".w--current").data("isothercard")?(oldCardDetails.isMongo=e("#dvcheckoutBookingTabs").find(".w--current").data("ismongo"),oldCardDetails.UsedCardTokenId=_onlineCheckout.ccCardOnFile.CardTokenId):(oldCardDetails.isMongo=!1,oldCardDetails.UsedCardTokenId=_onlineCheckout.zenSwipeCardDetails.card_token),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0)c.isSaveCCForMembership=!0;else if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){e.grep(onlineShoppingCart.Packages,function(e){return void 0!==e.IsRecurring&&1==e.IsRecurring}).length>0?c.isSaveCCForMembership=!0:oldCardDetails=null}else null!=onlineShoppingCart.Events&&0!=onlineShoppingCart.Events.length||(oldCardDetails=null);else oldCardDetails=null;var v=1;!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&("true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove)||null!=i&&1==i.isSaveClassCard)&&(1!=c.isSaveCCForMembership&&null==onlineShoppingCart.Inventories&&null==onlineShoppingCart.GiftCertificates&&null==onlineShoppingCart.Packages&&null==onlineShoppingCart.Memberships?(c.isSaveCCForMembership=!0,v=2):1!=c.isSaveCCForMembership?(c.isSaveCCForMembership=!0,v=3):v=3),c.isCCSaveForClassBooking=v,ccDetails.isCcSwipe=!1,c.ccDetails=ccDetails,e.each(h,function(e,t){t.CardTokenIdForRenew=ccDetails.cardTokenId,(void 0===t.DepositsRemaining||null==t.DepositsRemaining||isNaN(t.DepositsRemaining))&&(t.DepositsRemaining=0),(void 0===t.DepositsPaid||null==t.DepositsPaid||isNaN(t.DepositsPaid))&&(t.DepositsPaid=0)})}c.RedeemedByGC=onlineShoppingCart.RedeemedByGC,c.checkoutGridrow=h,c.HasFMBFee=_onlineCheckout.GetFirstVisitFlagCart(),c.IsFMBEnableForBusiness="undefined"!=typeof IsFMBEnableForBusiness&&!0===IsFMBEnableForBusiness,c.IsNewCustomerFees="undefined"!=typeof _shopdetail&&_shopdetail&&"function"==typeof _shopdetail.IsUKBusiness&&_shopdetail.IsUKBusiness()&&!("undefined"!=typeof IsFMBEnableForBusiness&&!0===IsFMBEnableForBusiness),c.FMBFeeType="undefined"!=typeof _onlineCheckout&&_onlineCheckout&&"function"==typeof _onlineCheckout.GetFMBFeeTypeCart?_onlineCheckout.GetFMBFeeTypeCart(onlineShoppingCart):0}var f=0;if(1==t&&1==l?f=3:1==t?(c=null,f=2):1==l&&(i=null,f=1),1==isCheckInApp&&(onlineShoppingCart.ChekoutType=f),void 0!==i&&null!=i&&(i.ShoppingCartStep=_onlineCheckout.ShoppingCartStep),"undefined"!=typeof vui&&(null!=c&&(c.StripeRadarSession=vui.stripeRadarSession),null!=i&&(i.StripeRadarSession=vui.stripeRadarSession)),void 0!==c&&null!=c&&void 0!==c.ccDetails&&null!=typeof c.ccDetails&&_onlineCheckout.AuthoriseListData.length>0&&(c.ccDetails.AuthorisePayment=_onlineCheckout.AuthoriseListData.filter(function(e){return e.Type==_onlineCheckout.ItemType.Other})),void 0!==c&&null!=c&&void 0!==c.ccDetails&&null!=typeof c.ccDetails&&null!=i&&_onlineCheckout.AuthoriseListData.length>0&&(i.AuthorisePayment=_onlineCheckout.AuthoriseListData.filter(function(e){return e.Type==_onlineCheckout.ItemType.Class})),void 0!==c&&null!=c&&(c.VPLGatewayType=0),1==_onlineCheckout.isCheckoutVPLChanged?(c.ccAmt=0,c.IsVPLPayment=_onlineCheckout.isCheckoutVPLChanged,c.vplAmt=_onlineCheckout.ConvertDecimalWithFixed(onlineShoppingCart.FinalCCAmount,!1,2),c.vplDetails={},c.vplDetails.VplBankMasterId=1==_siteBuilderDetail.isAffirmEnable?"":SelectedBank[0].Id,c.vplDetails.BankAccountId=1==_siteBuilderDetail.isAffirmEnable?"":SelectedBank[0].BankId,c.vplDetails.ConsumerId=1==_siteBuilderDetail.isAffirmEnable?"":SelectedBank[0].CertegyConsumerTokenID,c.vplDetails.AccountNumber=1==_siteBuilderDetail.isAffirmEnable?"":SelectedBank[0].AccountNumber,0==_siteBuilderDetail.isAffirmEnable&&(c.vplDetails.BillingAddress={city_locality:NewUser[0].City,postal_code:NewUser[0].Zip,line_1:NewUser[0].Street,line_2:NewUser[0].StreetNo,country_code:NewUser[0].CountryName,state_province:NewUser[0].StateCode}),c.IsVPLDistributionRequired=!0,c.VPLGatewayType=1==_siteBuilderDetail.isAffirmEnable?_vgVPLOnline.VPLGatewayType.Affirm:_vgVPLOnline.VPLGatewayType.Certegy,c.PayLaterInfo=_onlineCheckout.AffirmVPLCapture(!1)):null!=c&&(c.vplAmt=0),null!=c&&""!=CyberTrackingID&&"undefind"!=CyberTrackingID&&(c.TrackingId=CyberTrackingID),null!=c&&(1==isCheckInApp?"undefined"!=typeof _siteBuilderDetail&&_siteBuilderDetail&&_siteBuilderDetail.AllDetailCommon&&_siteBuilderDetail.AllDetailCommon.BusinessDetail&&void 0!==_siteBuilderDetail.AllDetailCommon.BusinessDetail.IsMobileServiceMandatory?c.mobileServiceData=_siteBuilderDetail.AllDetailCommon.BusinessDetail.IsMobileServiceMandatory:c.mobileServiceData=0:c.mobileServiceData=_siteBuilderDetail.AllDetailCommon.BusinessDetail.IsMobileServiceMandatory),objChkRequest={},objChkRequest.checkoutRequest=c,objChkRequest.objValidateClassBookingData=i,objChkRequest.OnlineCheckoutType=f,objChkRequest.objCardDetails=oldCardDetails,String.isNullOrUndefineOrBlank(objChkRequest.objValidateClassBookingData)||("undefined"!=typeof ClassCartInvoiceNum&&null!=ClassCartInvoiceNum?objChkRequest.objValidateClassBookingData.InvoiceNum=ClassCartInvoiceNum:"undefined"!=typeof _common&&(ClassCartInvoiceNum=_common.GenerateRandomNo(10,onlineShoppingCart.BusinessID),objChkRequest.objValidateClassBookingData.InvoiceNum=ClassCartInvoiceNum)),String.isNullOrUndefineOrBlank(objChkRequest.checkoutRequest)||("undefined"!=typeof CartInvoiceNum&&null!=CartInvoiceNum?objChkRequest.checkoutRequest.InvoiceNum=CartInvoiceNum:"undefined"!=typeof _common&&(CartInvoiceNum=_common.GenerateRandomNo(10,onlineShoppingCart.BusinessID),objChkRequest.checkoutRequest.InvoiceNum=CartInvoiceNum)),"true"==IsCCCapturedAllowed.toLowerCase()&&1!=f&&e("#dvCheckoutBookingPaymentMethod").is(":visible")&&e(_onlineCheckout.Controls.DvcheckoutBookingTabs).is(":visible")&&(0==_onlineCheckout.isCheckoutCCChanged&&"undefined"!=_onlineCheckout.ccCardOnFile&&null!=_onlineCheckout.ccCardOnFile&&"undefined"!=_onlineCheckout.ccCardOnFile.CardTokenId&&null!=_onlineCheckout.ccCardOnFile.CardTokenId&&""!=_onlineCheckout.ccCardOnFile.CardTokenId||1==_onlineCheckout.isCheckoutCCChanged&&"undefined"!=_onlineCheckout.zenSwipeCardDetails&&null!=_onlineCheckout.zenSwipeCardDetails&&"undefined"!=_onlineCheckout.zenSwipeCardDetails.card_token&&null!=_onlineCheckout.zenSwipeCardDetails.card_token&&""!=_onlineCheckout.zenSwipeCardDetails.card_token)&&null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){ShowLoader(!0);var C=[],S=!1;if(e.grep(onlineShoppingCart.Events,function(t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&e.grep(t.eventEnrollment,function(e){var t=e.eventDate;C.push(new Date(moment(t))),e.paidType!=_onlineCheckout.arrpaidType.PaidClass&&e.paidType!=_onlineCheckout.arrpaidType.Paid||(S=!0)})}),0==_onlineCheckout.IsValidCartDepositInfo(objChkRequest))return!1;if(S){if(0==DisableFinalSubmitButton(!1))return ShowLoader(!0),!1;ShowLoader(!0),(_=new vagaro.ajax).datamodel.Token="SaveOnlineCheckoutNew",_.datamodel.callback=function(e){DisableFinalSubmitButton(!0),ShowLoader(!1),_onlineCheckout.ChekoutResponse(e),onlineVPLCheckout=0},_.datamodel.data=[objChkRequest],_.datamodel.Error=function(e){DisableFinalSubmitButton(!0),ShowLoader(!1),_onlineCheckout.SetCheckoutAuthResult("fail","",null,"","Checkout request failed (network/server error)"),_onlineCheckout.FireOnlineCheckoutCompleted(),vagaro.alert("Some error occured. Please try again.")},_.Post()}else{var y=new Date(Math.max.apply(null,C)),b={};b.businessId=onlineShoppingCart.BusinessID,b.loginUserID=onlineShoppingCart.loginUserId,1==_onlineCheckout.isCheckoutCCChanged?b.CardTokenId=_onlineCheckout.zenSwipeCardDetails.card_token:b.CardTokenId=_onlineCheckout.ccCardOnFile.CardTokenId,b.app_Date=y;var k=new vagaro.ajax;k.datamodel.async=!1,k.datamodel.Token="GetValidateCardExpiry",k.datamodel.data=[b],k.datamodel.callback=function(t){if(null!=t&&null!=t.data&&1e3==t.custom_code){if(1==t.data.isExpiredCard)return ShowLoader(!1),swal({title:"",text:"This credit card will expire before the appointment date. Please update your credit card to finish booking the appointment.",showCancelButton:!1,html:!0,customClass:"sweet-alert-model text-justify-align"},function(t){e("#tabCheckoutBooking2").click()}),setTimeout(function(){e(".gencutom-title").html("Credit Card Will Expire Before Appointment")},100),1==_onlineCheckout.isCheckoutCCChanged&&(_onlineCheckout.zenSwipeCardDetails=null),!1;if(0==DisableFinalSubmitButton(!1))return ShowLoader(!0),!1;ShowLoader(!0);var i=new vagaro.ajax;i.datamodel.Token="SaveOnlineCheckoutNew",i.datamodel.callback=function(e){DisableFinalSubmitButton(!0),ShowLoader(!1),_onlineCheckout.ChekoutResponse(e),onlineVPLCheckout=0},i.datamodel.data=[objChkRequest],i.datamodel.Error=function(e){DisableFinalSubmitButton(!0),ShowLoader(!1),_onlineCheckout.SetCheckoutAuthResult("fail","",null,"","Checkout request failed (network/server error)"),_onlineCheckout.FireOnlineCheckoutCompleted(),vagaro.alert("Some error occured. Please try again.")},i.Post()}else ShowLoader(!1),_common.PassiveAlertFailed("Some error occured. Please try again.")},k.datamodel.Error=function(e){ShowLoader(!1),_common.PassiveAlertFailed("Some error occured. Please try again.")},k.Post()}}else{if(0==_onlineCheckout.IsValidCartDepositInfo(objChkRequest))return!1;var _;if(0==DisableFinalSubmitButton(!1))return ShowLoader(!0),!1;ShowLoader(!0),(_=new vagaro.ajax).datamodel.Token="SaveOnlineCheckoutNew",_.datamodel.callback=function(t){if(DisableFinalSubmitButton(!0),null!=t.checkoutResponse&&"0"==t.checkoutResponse.resultType&&t.checkoutResponse.resultMessage.includes("Certegy")&&"0"==t.checkoutResponse.userPaymentMstID){ShowLoader(!1),e(".customeb-body p").html("");var i=t.checkoutResponse.resultMessage.split("|~|");e("#vpl-payment-fail-popup").modal("show");var n=i[0],o=i[1];e(".customeb-body p").html(n),e(".customeb-body-last #certegydate").html(String.format("{0}",(new Date).format("MMMM dd, yyyy hh:mm"))),e(".customeb-body-last #certegyref").text(o),e(".modal:visible").each(function(e,t){centerModal(t)}),_onlineCheckout.SetCheckoutAuthResult("fail","",null,"",t.checkoutResponse&&t.checkoutResponse.resultMessage?t.checkoutResponse.resultMessage:"Certegy/VPL payment failed"),_onlineCheckout.FireOnlineCheckoutCompleted(),onlineVPLCheckout=0}else ShowLoader(!1),_onlineCheckout.ChekoutResponse(t),onlineVPLCheckout=0},_.datamodel.data=[objChkRequest],_.datamodel.Error=function(e){DisableFinalSubmitButton(!0),ShowLoader(!1),_onlineCheckout.SetCheckoutAuthResult("fail","",null,"","Checkout request failed (network/server error)"),_onlineCheckout.FireOnlineCheckoutCompleted(),vagaro.alert("Some error occured. Please try again.")},_.Post()}}else 1==_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.invoiceDetails&&0==_onlineCheckout.IsCCSupportedCountry()&&(ShowLoader(!1),vagaro.alert("Some error occured. Please contact business owner."))},_onlineCheckout.fixWorkshopSessionMismatch=function(e){try{if(!e||!e.length)return;for(var t=function(e){return Number(e||0).toFixed(2)},i={},n=0;n<e.length;n++){!(g=e[n]).calculatedTax||g.calculatedTax<=0||(i[g.itemID]||(i[g.itemID]=[]),i[g.itemID].push(g))}for(var o in i){var a=i[o];if(a&&!(a.length<=1)){for(var s={},r=0;r<a.length;r++){var l=t(a[r].price);s[l]=(s[l]||0)+1}var c=null,d=0;for(var u in s)(s[u]>d||s[u]===d&&(null===c||parseFloat(u)<parseFloat(c)))&&(d=s[u],c=u);if(c){for(var p=null,h=0;h<a.length;h++)if(t(a[h].price)===c){p=a[h];break}if(p)for(var m=0;m<a.length;m++){var g=a[m],v=Math.abs(Number(g.price)-Number(p.price));if(v>0&&v<=.02&&(g.price=p.price,g.discountedPrice>0&&(g.discountedPrice=p.discountedPrice),g.ConstantOriginalServicePrice>0&&(g.ConstantOriginalServicePrice=p.ConstantOriginalServicePrice),g.originalServicePriceForPackage>0&&(g.originalServicePriceForPackage=p.originalServicePriceForPackage),g.calculatedTax>0&&(g.calculatedTax=p.calculatedTax),g.BusinessTax&&p.BusinessTax))for(var f=0;f<g.BusinessTax.length;f++){var C=g.BusinessTax[f],S=p.BusinessTax.find(e=>e.BusinessTaxID===C.BusinessTaxID);if(S){var y=Math.abs(Number(C.CalculatedTax)-Number(S.CalculatedTax));y>0&&y<=.02&&(C.CalculatedTax=S.CalculatedTax)}}}}}}}catch(e){"undefined"!=typeof _vgLogEvent&&"function"==typeof _vgLogEvent.LogEventData&&_vgLogEvent.LogEventData({Category:"fixWorkshopSessionMismatch",Action:"Exception",Message:e&&e.message?e.message:String(e)})}},_HighRiskEmailCheck.CertegyFailedEmail=function(){ShowLoader(!0);var t=JSON.parse(e("#hdnUserDetails").val()).EmailId,i=e(".customeb-body p").text(),n=e(".customeb-body-last #certegydate").text(),o=e(".customeb-body-last #certegyref").text(),a=new vagaro.ajax;a.datamodel.Token="SendMailForCertegyHighRisk",a.datamodel.callback=function(e){},a.datamodel.data=[t,i,n,o],a.datamodel.Error=function(e){},a.Post(),e("#vpl-payment-fail-popup").modal("show"),e(".customeb-body a").replaceWith("<p>Email is sent to your email ID. Please check Inbox.</p>"),ShowLoader(!1)},_onlineCheckout.SaveClassCheckout=function(t,i,n){_onlineCheckout.IsTaxCalculated=!1,onlineShoppingCart.classBookXML="";var o=parseInt(checkoutcountryID),a=parseInt(onlineShoppingCart.BusinessID),s=onlineShoppingCartmain.UsersPoints,r=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);if(r.length<=0)return _vgClassSessionSelection.commonMessageAlert("Something went wrong. Please search again."),!1;var l=e("<XMLDocument/>");l.append(_vgClassSessionSelection.createXmlElement("EventList"));var c=null,d=!1,u=[],p=_onlineCheckout.TipApplyCounter,h=_onlineCheckout.TipAppliedSum;e.each(r,function(t,n){var o=_vgClassSessionSelection.createXmlElement("event");o.append(_vgClassSessionSelection.createXmlElement("eventId",n.eventID)),o.append(_vgClassSessionSelection.createXmlElement("eventname",n.eventName.trim())),o.append(_vgClassSessionSelection.createXmlElement("eventimage",n.smallimage)),e.each(n.eventEnrollment,function(t,a){if(1==i&&a.paidType==_onlineCheckout.arrpaidType.PaidClass)if(u.length>0){var r=!1;if(e.grep(u,function(e,t){e.SPID==a.sPID&&(++e.TransactionCount,r=!0)}),!r)(l={}).SPID=a.sPID,l.TransactionCount=1,u.push(l)}else{var l;(l={}).SPID=a.sPID,l.TransactionCount=1,u.push(l)}if(null==(c=null)||null==c){c=_vgClassSessionSelection.createXmlElement("appointment");var m;m=a.isHandleDuetoException,c.append(_vgClassSessionSelection.createXmlElement("isHandleDuetoException",1==m?"1":"0")),c.append(_vgClassSessionSelection.createXmlElement("appId",a.appointmentID)),c.append(_vgClassSessionSelection.createXmlElement("spid",a.sPID)),c.append(_vgClassSessionSelection.createXmlElement("spname",function(t){try{return e(e('#txtSP5Mobile option[value="'+t+'"]')[0]).text()}catch(e){return""}}(a.sPID))),c.append(_vgClassSessionSelection.createXmlElement("isworkshop",a.IsWorkShop)),c.append(_vgClassSessionSelection.createXmlElement("appstarttime",new Date(a.eventDate).format("yyyy-MM-dd")+" "+a.startTime)),o.append(c)}else c=c.parent();if(c.append(_vgClassSessionSelection.createXmlElement("fname",a.cFirstName)),c.append(_vgClassSessionSelection.createXmlElement("lname",a.cLastName)),c.append(_vgClassSessionSelection.createXmlElement("email",a.cUserEmail)),c.append(_vgClassSessionSelection.createXmlElement("cellno",a.cUserCellNo)),c.append(_vgClassSessionSelection.createXmlElement("cellcountryid",a.cCellcountryID)),c.append(_vgClassSessionSelection.createXmlElement("dialingcode",a.cDialingCode)),c.append(_vgClassSessionSelection.createXmlElement("paidtype",a.paidType)),c.append(_vgClassSessionSelection.createXmlElement("streamingstatus",a.StreamingStatus)),String.isNullOrUndefineOrBlank(a.IsWaivedApply)||c.append(_vgClassSessionSelection.createXmlElement("IsWaivedApply",a.IsWaivedApply)),String.isNullOrUndefineOrBlank(a.CustomerStartTime)||(c.append(_vgClassSessionSelection.createXmlElement("customerstarttime",a.CustomerStartTime)),c.append(_vgClassSessionSelection.createXmlElement("customertimezonename",a.CustomerTimeZone))),(a.paidType==_onlineCheckout.arrpaidType.DepositsClass||a.paidType==_onlineCheckout.arrpaidType.PartiallyPaidClass)&&void 0!==a.depositsPaid){if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&a.depositsPercentage<100){var g=parseFloat(_onlineCheckout.ConvertDecimalWithFixed(100*parseFloat(a.depositsPaid)/a.price,!0,2));a.depositsPercentage=g}c.append(_vgClassSessionSelection.createXmlElement("depositspercentage",a.depositsPercentage)),c.append(_vgClassSessionSelection.createXmlElement("depositspaid",a.depositsPaid)),c.append(_vgClassSessionSelection.createXmlElement("payableamount",a.price)),c.append(_vgClassSessionSelection.createXmlElement("depositsremaining",_onlineCheckout.parseTodecimal(a.price-a.depositsPaid,2)))}if(onlineShoppingCart.tipPercent>0&&a.paidType==_onlineCheckout.arrpaidType.PaidClass){p=++p;var v=_onlineCheckout.parseTodecimal(a.price,2);(1==a.isPackage||1==a.isPointApply||a.isMembershipApply||void 0!==a.isPresetApply&&a.isPresetApply||void 0!==a.PromotionID&&null!=a.PromotionID&&a.PromotionID>0)&&(v=_onlineCheckout.parseTodecimal(a.Originalprice,2));var f=0;f=p==_onlineCheckout.TotalPaidCount?_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-h,2):_onlineCheckout.parseTodecimal(v*onlineShoppingCart.tipPercent/100,2),c.append(_vgClassSessionSelection.createXmlElement("tipAmount",f)),h+=f}var C=0;void 0!==a.PromotionID&&a.PromotionID>0&&1!=a.isPointApply&&(null==a.gcId||0==a.gcId||a.gcId>0&&0==a.isPackage)&&(C=a.PromotionID,c.append(_vgClassSessionSelection.createXmlElement("presetdiscountamount",a.discount))),c.append(_vgClassSessionSelection.createXmlElement("promotionid",C)),void 0!==a.isPresetApply&&1==a.isPresetApply&&(c.append(_vgClassSessionSelection.createXmlElement("discountid",a.DiscountID)),c.append(_vgClassSessionSelection.createXmlElement("ispresetapply",a.isPresetApply))),void 0!==a.IsAmount&&c.append(_vgClassSessionSelection.createXmlElement("isamount",a.IsAmount)),void 0!==a.AmountValue&&c.append(_vgClassSessionSelection.createXmlElement("amountvalue",a.AmountValue));var S="";0==a.customerID?(S=k=e.grep(s,function(e){return 0==a.customerID&&e.emailId==a.cUserEmail}),null!=k&&k.length>0?c.append(_vgClassSessionSelection.createXmlElement("userid",k[0].userId)):c.append(_vgClassSessionSelection.createXmlElement("userid",a.customerID))):(S=e.grep(s,function(e){return e.userId==a.customerID}),c.append(_vgClassSessionSelection.createXmlElement("userid",a.customerID)));if(null!=S&&S.length>0&&c.append(_vgClassSessionSelection.createXmlElement("isnewcustomer",S[0].isNewCustomer)),1==i&&(1==a.isPackage||0==a.isPackage)&&(a.gcId>0||a.gcId<0&&1==a.isPackage)||1==a.isPriceBaseGCApply){var y=[],b=[];1==a.isPriceBaseGCApply?(a.isPackage=!1,c.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!0))):c.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!1)),c.append(_vgClassSessionSelection.createXmlElement("ispackage",a.isPackage)),1==a.isPriceBaseGCApply&&e.each(a.GCDetail,function(e,t){y.push(t.GCId),b.push(t.GCAmount)}),void 0!==a.gcId&&null!=a.gcId&&a.gcId<0&&c.append(_vgClassSessionSelection.createXmlElement("price",a.price)),c.append(_vgClassSessionSelection.createXmlElement("packageid",a.gcId<0?_onlineCheckout.GetPackageId(a.gcId):0)),c.append(_vgClassSessionSelection.createXmlElement("gcid",void 0===a.gcId||null==a.gcId?0:a.gcId)),c.append(_vgClassSessionSelection.createXmlElement("gcids",0==y.length?0:y.join(","))),c.append(_vgClassSessionSelection.createXmlElement("gcamount",0==b.length?0:b.join(","))),a.RedeemServiceId>0&&c.append(_vgClassSessionSelection.createXmlElement("redeemserviceid",a.RedeemServiceId))}if(1==i&&1==a.isPointApply&&(c.append(_vgClassSessionSelection.createXmlElement("ispointapply",a.isPointApply)),c.append(_vgClassSessionSelection.createXmlElement("pointsredeem",a.pointsRedeem))),1==i&&(c.append(_vgClassSessionSelection.createXmlElement("taxes",a.TaxValue)),c.append(_vgClassSessionSelection.createXmlElement("calculatedTaxTypeWise",String.isNullOrUndefineOrBlank(a.BusinessTax)?"[]":JSON.stringify(a.BusinessTax).toString())),null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&e.grep(onlineShoppingCart.lstGCPkgData,function(t){t.giftCertificateID==a.gcId&&null!=t.Taxes&&(c.append(_vgClassSessionSelection.createXmlElement("taxes","0")),e.grep(a.BusinessTax,function(e){onlineShoppingCart.classFinalTotal=parseFloat(ConvertTodecimalMorePrecious(parseFloat(onlineShoppingCart.classFinalTotal)-e.CalculatedTax,!0,2)),onlineShoppingCart.classTax=parseFloat(ConvertTodecimalMorePrecious(parseFloat(onlineShoppingCart.classTax)-e.CalculatedTax,!0,2)),_onlineCheckout.IsTaxCalculated=!0,e.CalculatedTax=0}))})),1==i&&1==a.isMembershipApply&&null!=a.membershipUniqueID&&null!=a.membershipUniqueID&&""!=a.membershipUniqueID){c.append(_vgClassSessionSelection.createXmlElement("ismembershipapply",a.isMembershipApply)),c.append(_vgClassSessionSelection.createXmlElement("membershipdiscountpercentage",a.membershipDiscount)),c.append(_vgClassSessionSelection.createXmlElement("membershipuserid",a.membershipuserid)),c.append(_vgClassSessionSelection.createXmlElement("membershipuniqueid",a.membershipUniqueID));var k,_=null;if((_=_vgClassSessionSelection.createXmlElement("membershipredeemeddetails")).append(_vgClassSessionSelection.createXmlElement("businessid",a.BusinessID)),_.append(_vgClassSessionSelection.createXmlElement("redeembusinessid",a.RedeemBusinessId)),0==a.customerID)null!=(k=e.grep(s,function(e){return 0==a.customerID&&e.emailId==a.cUserEmail}))&&k.length>0?_.append(_vgClassSessionSelection.createXmlElement("userid",k[0].userId)):_.append(_vgClassSessionSelection.createXmlElement("userid",a.customerID));else _.append(_vgClassSessionSelection.createXmlElement("userid",a.customerID));_.append(_vgClassSessionSelection.createXmlElement("membershipuserid",a.membershipuserid)),_.append(_vgClassSessionSelection.createXmlElement("redeemuserid",a.membershipuserid)),_.append(_vgClassSessionSelection.createXmlElement("itemtype",8)),_.append(_vgClassSessionSelection.createXmlElement("type",8)),_.append(_vgClassSessionSelection.createXmlElement("membershipid",a.MembershipID)),_.append(_vgClassSessionSelection.createXmlElement("membershipitemid",a.MembershipItemId)),_.append(_vgClassSessionSelection.createXmlElement("groupid",a.GroupId)),_.append(_vgClassSessionSelection.createXmlElement("isunlimitedvisit",-1==a.VisitRemaining)),_.append(_vgClassSessionSelection.createXmlElement("serviceproductname",n.eventName.trim())),c.append(_)}if(0==isCheckInApp){var D=!1;e(".cartremoverdtl").each(function(t,i){void 0!==e(i).attr("data-isWorkShop")&&"true"==e(i).attr("data-isWorkShop").toLowerCase()&&(D=!0)});var I=_shopdetail.GetRescheduleDetail();null!=I&&(D||(d=!0),c.append(_vgClassSessionSelection.createXmlElement("eventsessionattendeeid",I.EventSessionAttendeesId)))}c.append(_vgClassSessionSelection.createXmlElement("isAddon",!1)),c.append(_vgClassSessionSelection.createXmlElement("isupsell",(!String.isNullOrUndefineOrBlank(a.isMembershipApply)&&0!=a.isMembershipApply||!String.isNullOrUndefineOrBlank(a.isMembershipApply)&&0!=a.isPackage)&&_onlineCheckout.IsCheckMemPkgUpsellExists(a.isMembershipApply,a.MembershipID))),c.append(_vgClassSessionSelection.createXmlElement("uniqueAddonID","addon"+a.appointmentID+a.autoID)),c.append(_vgClassSessionSelection.createXmlElement("ispartialpointapply",void 0!==a.IsPartialPoint&&a.IsPartialPoint)),c.append(_vgClassSessionSelection.createXmlElement("partialserviceprice",a.price)),"undefined"!=typeof isFromTextMarketing&&0==String.isNullOrUndefineOrBlank(isFromTextMarketing)&&c.append(_vgClassSessionSelection.createXmlElement("revenueisfromtextmarketing",isFromTextMarketing)),"undefined"!=typeof PromotionAppointmentID&&0==String.isNullOrUndefineOrBlank(PromotionAppointmentID)&&c.append(_vgClassSessionSelection.createXmlElement("revenuepromotionid",parseInt(PromotionAppointmentID))),null!=a.lstAddonService&&a.lstAddonService.length>0&&_onlineCheckout.CreateAddonXMl(a.lstAddonService,a,o,i)}),l.find("EventList").append(o)});var m="",g={},v={};v.businessId=a,v.loggedInUserId=t,v.countryId=o,v.classXmlData=l.html().replace(new RegExp("&nbsp;","g")," "),v.operationType=i,v.device=n,v.isCardOnFile=!1,v.isSaveClassCard=!1,v.isReschedule=d,v.CurrencyCode=currencyCode;var f=e("#dvcheckoutBookingTabs").find(".w--current").attr("id");void 0===f||""==f||"tabCheckoutBooking1"!=f&&"tabCheckoutBooking2"!=f&&1!=e("#dvcheckoutBookingTabs").find(".w--current").data("isothercard")?v.isSharedCC=!0:v.isSharedCC=!1,v.userFullName=FullUserName,v.userEmail=onlineShoppingCart.loginUserEmail,v.currencySymbol=currencysymbol;var C="",S="",y="",b="",k="",_="",D="";if((1==_onlineCheckout.IsCCDetailEnable()&&parseFloat(onlineShoppingCart.classFinalTotal+parseFloat(onlineShoppingCart.tipValue)-parseFloat(onlineShoppingCart.DepositsRemaining))>0||1==_onlineCheckout.IsLoadCCIframForMemrship()&&0==e("#tabVagaroPayLater").hasClass("w--current"))&&(1==_onlineCheckout.isCheckoutCCChanged&&null!=_onlineCheckout.zenSwipeCardDetails?(v.isSaveClassCard=!0,C=_onlineCheckout.zenSwipeCardDetails.cc_type,S=_onlineCheckout.zenSwipeCardDetails.cc_no,y=_onlineCheckout.zenSwipeCardDetails.cvv,b=_onlineCheckout.zenSwipeCardDetails.first_name,k=_onlineCheckout.zenSwipeCardDetails.middle_name,_=_onlineCheckout.zenSwipeCardDetails.last_name,D=_onlineCheckout.zenSwipeCardDetails.card_token):("block"==e("#dvcheckoutBookingTabs").css("display").toLowerCase()||"flex"==e("#dvcheckoutBookingTabs").css("display").toLowerCase()||e("#dvcheckoutBookingTabs").is(":visible")&&0==e("#tabVagaroPayLater").hasClass("w--current"))&&(v.isCardOnFile=!0,C=_onlineCheckout.ccCardOnFile.CreditCardType,S=_onlineCheckout.ccCardOnFile.CreditCardNumber,y=_onlineCheckout.ccCardOnFile.SecurityCode,b=_onlineCheckout.ccCardOnFile.CCFirstName,k=_onlineCheckout.ccCardOnFile.CCMiddleName,_=_onlineCheckout.ccCardOnFile.CCLastName,D=_onlineCheckout.ccCardOnFile.CardTokenId),1==e("#dvcheckoutBookingTabs").find(".w--current").data("isothercard")||1==_onlineCheckout.isCheckoutCCChanged&&null!=_onlineCheckout.zenSwipeCardDetails?(void 0!==_onlineCheckout.BusSavedCard&null!=_onlineCheckout.BusSavedCard&&(oldCardDetails.CreditCardType=_onlineCheckout.BusSavedCard.CreditCardType,oldCardDetails.CreditCardNumber=_onlineCheckout.BusSavedCard.CreditCardNumber,oldCardDetails.SecurityCode=_onlineCheckout.BusSavedCard.SecurityCode,oldCardDetails.ExpMonth=_onlineCheckout.BusSavedCard.ExpMonth,oldCardDetails.ExpYear=_onlineCheckout.BusSavedCard.ExpYear,oldCardDetails.CCFirstName=_onlineCheckout.BusSavedCard.CCFirstName,oldCardDetails.CCMiddleName=_onlineCheckout.BusSavedCard.CCMiddleName,oldCardDetails.CCLastName=_onlineCheckout.BusSavedCard.CCLastName,oldCardDetails.CardTokenId=_onlineCheckout.BusSavedCard.CardTokenId,oldCardDetails.BusinessID=_onlineCheckout.BusSavedCard.BusinessID,oldCardDetails.businessCount=_onlineCheckout.BusSavedCard.businessCount),1==e("#dvcheckoutBookingTabs").find(".w--current").data("isothercard")?(oldCardDetails.isMongo=e("#dvcheckoutBookingTabs").find(".w--current").data("ismongo"),oldCardDetails.UsedCardTokenId=_onlineCheckout.ccCardOnFile.CardTokenId,v.isSaveClassCard=!0):(oldCardDetails.isMongo=!1,oldCardDetails.UsedCardTokenId=_onlineCheckout.zenSwipeCardDetails.card_token)):oldCardDetails=null,m="<root>",m+="<UserCCDetail><UCCType>"+C+"</UCCType>",m+="<UCCNo>"+S.substr(S.length-4)+"</UCCNo>",m+="<UCCSecurityCode>"+y+"</UCCSecurityCode>",v.isSharedCC&&(m+="<UCCExpMonth>"+_onlineCheckout.ccCardOnFile.ExpMonth+"</UCCExpMonth>",m+="<UCCExpYear>"+_onlineCheckout.ccCardOnFile.ExpYear+"</UCCExpYear>",m+="<isSharedCCdetail>1</isSharedCCdetail>"),m+="<UCCFirstName>"+b.escapeHtml()+"</UCCFirstName>",m+="<UCCMiddleName>"+(void 0===k?"":k.escapeHtml())+"</UCCMiddleName>",m+="<UCCLastName>"+_.escapeHtml()+"</UCCLastName>",m+="<UCCTokenID>"+D+"</UCCTokenID>",m+="</UserCCDetail></root>",g.UCCNo=S,g.UCCType=C,g.UCCSecurityCode=y,g.UCCFirstName=b,g.UCCMiddleName=k,g.UCCLastName=_,g.CardTokenId=D,void 0!==_onlineCheckout.ccCardOnFile&&null!=_onlineCheckout.ccCardOnFile&&void 0!==_onlineCheckout.ccCardOnFile.IsSaveCard&&null!=_onlineCheckout.ccCardOnFile.IsSaveCard&&1==_onlineCheckout.ccCardOnFile.IsSaveCard&&(v.isSaveClassCard=!0)),v.objUserCCDetails=g,v.strUserCCXML=m,v.bookText=checkoutClassBookText,0==isCheckInApp){var I=_shopdetail.GetRescheduleDetail();1==d&&null!=I&&(v.OldSPID=I.providerID,v.OldAppDate=e("#hdnDate").val()+" "+BookingTime)}return onlineShoppingCart.classBookXML=l,"undefined"!=typeof _onlineCheckout&&void 0!==_onlineCheckout.updateAppIdforms&&null!=_onlineCheckout.updateAppIdforms&&_onlineCheckout.updateAppIdforms.length>0&&(v.lstUpdateAppIdInForm=_onlineCheckout.updateAppIdforms),"undefined"!=typeof _onlineCheckout&&void 0!==_onlineCheckout.formResponseIds&&null!=_onlineCheckout.formResponseIds&&_onlineCheckout.formResponseIds.length>0&&(v.lstFormResponseIds=_onlineCheckout.formResponseIds),v},_onlineCheckout.removeEventSessionAttendies=function(e,t,i){var n=" (Website Online)";if("undefined"!=typeof isWindowsApp&&1==isWindowsApp)n=" (Windows Online)";else if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){n="(CustomerApp Online)";var o=null!=navigator.userAgent?navigator.userAgent:"";o.toLowerCase().indexOf("customerios")>-1?n=" (iOS Online)":o.toLowerCase().indexOf("customerandroid amazon")>-1?n=" (Amazon Online)":o.toLowerCase().indexOf("customerandroid")>-1&&(n=" (Android Online)")}else if(2==vgAppicationType)n=" (CheckIn Online)";else if(_shopdetail.VisibleControlLength("#mobile-check")>0){n=" (MobileWeb";var a=navigator.userAgent;OpenedFrom={iphone:a.match(/(iPhone|iPod)/),blackberry:a.match(/BlackBerry/),kindle:a.match(/Silk/),android:a.match(/Android/),windows:a.match(/Windows/),ipad:a.match(/iPad/)},OpenedFrom.windows?n+=" Windows Phone Online)":OpenedFrom.iphone?n+=" iPhone Online)":OpenedFrom.android?n+=" Android Online)":OpenedFrom.blackberry?n+=" Blackberry Online)":OpenedFrom.ipad?n+=" iPad Online)":OpenedFrom.kindle&&(n+=" kindle Online)")}var s={};s.ApptIds=e.eventSsnAtIds,s.userId=e.userId,s.status=e.status,s.eventConfirmBy=e.userId,s.price=null,s.pointGiven=null,s.pointRedeem=null,s.isPaid=null,s.confirmDevice=e.device+n,s.denyComments=e.denyComments,s.modifiedBy=e.userId,s.isCancelledByCustomer=e.isCancelledByCustomer,s.device=e.device+n,s.isFromMyAccount=!1,s.isWorkShop=e.isWorkshop,s.isSendMailToCustomer=e.isSendMail,s.businessID=parseInt(businessID);var r=new vagaro.ajax;r.datamodel.Token=ApiURLEnumOnlineCheckout.updateeventsessionattendees,r.datamodel.IsNewVagaroAPI=!0,r.datamodel.data=s,r.datamodel.callback=t,r.datamodel.Error=i,r.Post()},_onlineCheckout.setProductCheckoutData=function(t,i,n){var a=_onlineCheckout.hideShippingMethodsForFlatRateShippingProducts().Inventories,s=0,r=!1,l=0;if(1==IsChargeMostExpensive&&t.length>0){var d=0,u=0;e.grep(t,function(e,t){(e.FlatRateShippingPrice>d||e.FlatRateShippingPrice==d&&e.AdditionShippingPrice>u)&&(d=e.FlatRateShippingPrice,u=e.AdditionShippingPrice,l=e.InventoryId)})}for(var p=0;p<=t.length-1;p++){if(checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?t[p].autoId:1,checkoutGridrow.userName="",checkoutGridrow.userID=t[p].userID,checkoutGridrow.serviceProviderID=t[p].serviceProviderID,checkoutGridrow.serviceProviderName=t[p].serviceProviderName,checkoutGridrow.itemName=t[p].ProductName,checkoutGridrow.InventoryMasterID=t[p].InventoryMasterID,checkoutGridrow.InventoryMasterName=t[p].InventoryMasterName,checkoutGridrow.itemID=t[p].InventoryId,checkoutGridrow.InventoryBundleId=t[p].MasterInventoryId,checkoutGridrow.IsPartial=t[p].IsPartial,checkoutGridrow.UnitAbbreviation=t[p].UnitAbbreviation,checkoutGridrow.LotId=t[p].LotId,checkoutGridrow.SerialNumber=t[p].SerialNumber,checkoutGridrow.ReceiptSetting=t[p].ReceiptSetting,checkoutGridrow.InventoryBundleId>0){var h=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==t[p].MasterInventoryId});h.length>0&&(checkoutGridrow.InventoryBundleName=h[0].ProductName)}if(checkoutGridrow.bundleQuantity=t[p].bundleQuantity,checkoutGridrow.IsDropShip=t[p].IsDropShip,checkoutGridrow.VendorEmail=t[p].VendorEmail,checkoutGridrow.VendorName=t[p].VendorName,checkoutGridrow.recordType=c,checkoutGridrow.barcodeID=t[p].barcodeID,void 0!==t[p].isPackageApplied&&1==t[p].isPackageApplied?(checkoutGridrow.price=_onlineCheckout.parseTodecimal(t[p].Price,2),checkoutGridrow.discount=0,checkoutGridrow.packageAssignStatus=void 0!==t[p].isPackageApplied&&t[p].isPackageApplied?1:0,checkoutGridrow.pointsRedeem=0,checkoutGridrow.membershipDiscount=0):(void 0!==t[p].isMembershipApply&&1==t[p].isMembershipApply?(checkoutGridrow.price=_onlineCheckout.parseTodecimal(t[p].Price+t[p].discount,2),checkoutGridrow.discount=t[p].discount,checkoutGridrow.membershipDiscount=t[p].membershipDiscount,checkoutGridrow.pointsRedeem=0):void 0!==t[p].isPresetApply&&1==t[p].isPresetApply?(t[p]&&null!=t[p].Quantity&&t[p].Quantity>1?checkoutGridrow.price=_onlineCheckout.parseTodecimal(t[p].OriginalPrice*t[p].Quantity,2):checkoutGridrow.price=_onlineCheckout.parseTodecimal(t[p].OriginalPrice,2),checkoutGridrow.discount=t[p].discount,checkoutGridrow.membershipDiscount=0,checkoutGridrow.pointsRedeem=t[p].pointsRedeem):(checkoutGridrow.price=_onlineCheckout.parseTodecimal(t[p].Price,2),checkoutGridrow.discount=t[p].discount,checkoutGridrow.membershipDiscount=0,checkoutGridrow.pointsRedeem=t[p].pointsRedeem),checkoutGridrow.packageAssignStatus=0),checkoutGridrow.discountedPrice=t[p].Price,e.grep(a,function(e,i){t[p].InventoryId==e.InventoryId&&(r=!0)}),checkoutGridrow.IsFlatRateShipping=r,r=!1,checkoutGridrow.pointsGained=_onlineCheckout.isValidForCheckoutInvoice()?t[p].pointsGained:t[p].pointsGained*t[p].Quantity,checkoutGridrow.quantity=t[p].Quantity,void 0!==t[p].isPointApply&&1==t[p].isPointApply?checkoutGridrow.pointAssignStatus=parseInt(parseInt(t[p].pointsRedeem)>0?1:0):checkoutGridrow.pointAssignStatus=0,checkoutGridrow.costToBusiness=t[p].costToBusiness,checkoutGridrow.totalQty=t[p].TotalQty,checkoutGridrow.lowQtyWarning=t[p].lowQtyWarning,onlineShoppingCart.tipPercent>0&&null==onlineShoppingCart.ServiceInvoice&&null==onlineShoppingCart.Events){_onlineCheckout.TipApplyCounter=++_onlineCheckout.TipApplyCounter;var m=0;m=_onlineCheckout.TipApplyCounter==_onlineCheckout.TotalPaidCount||0==t[p].ActualPrice&&1==t.length?_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-_onlineCheckout.TipAppliedSum,2):_onlineCheckout.parseTodecimal(t[p].ActualPrice*onlineShoppingCart.tipPercent/100,2),checkoutGridrow.calculatedTip=m,_onlineCheckout.TipAppliedSum+=m}else if(onlineShoppingCart.tipValue>0&&null==onlineShoppingCart.ServiceInvoice&&null==onlineShoppingCart.Events){m=0;m=_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-_onlineCheckout.TipAppliedSum,2),checkoutGridrow.calculatedTip=m,_onlineCheckout.TipAppliedSum+=m}if(checkoutGridrow.DiscountID=t[p].DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[p].DiscountType)?1==t[p].IsAmount?2:1:t[p].DiscountType:1==t[p].IsAmount?2:1,checkoutGridrow.AmountValue=t[p].AmountValue,checkoutGridrow.ConstantOriginalServicePrice=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[p].ConstantOriginalServicePrice)?t[p].Price:t[p].ConstantOriginalServicePrice:t[p].Price,checkoutGridrow.OriginalDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[p].OriginalDiscountRights)?0:t[p].OriginalDiscountRights:0,checkoutGridrow.OriginalDiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[p].OriginalDiscountType)?1:t[p].OriginalDiscountType:1,checkoutGridrow.ApprovedBy=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[p].ApprovedBy)?0:t[p].ApprovedBy:0,checkoutGridrow.IsAskApprovalPopup=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[p].IsAskApprovalPopup)?0:t[p].IsAskApprovalPopup:0,checkoutGridrow.IsShowApprovalPriceDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[p].IsShowApprovalPriceDiscount)?0:t[p].IsShowApprovalPriceDiscount:0,"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,checkoutGridrow.calculatedTaxTypeWise="[]",checkoutGridrow.pointsRedeem>0?(checkoutGridrow.calculatedTax=0,t[p].IsPartialPoint&&(checkoutGridrow.calculatedTax=_onlineCheckout.parseTodecimal(t[p].ActualTax,3),checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(t[p].BusinessTax)?"[]":JSON.stringify(t[p].BusinessTax))):void 0!==t[p].isPackageApplied&&1==t[p].isPackageApplied?(checkoutGridrow.calculatedTax=0,t[p].BusinessTax=0,checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(t[p].BusinessTax)?"[]":JSON.stringify(t[p].BusinessTax)):(checkoutGridrow.calculatedTax=_onlineCheckout.parseTodecimal(t[p].calculatedTax,3),checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(t[p].BusinessTax)?"[]":JSON.stringify(t[p].BusinessTax)),checkoutGridrow.taxes=t[p].TaxValue,checkoutGridrow.shippingAmount=t[p].shippingAmount,1==onlineShoppingCart.IsPickupInStore)checkoutGridrow.shippingSurcharge=0,checkoutGridrow.shippingAmount=0;else{if(checkoutGridrow.shippingSurcharge=0,1==t[p].IsFreeShipping){var g=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==checkoutGridrow.InventoryBundleId});checkoutGridrow.shippingSurcharge=0==t[p].MasterInventoryId?t[p].Quantity*t[p].ShippingSurcharge:t[p].ShippingSurcharge*g[0].Quantity}e.grep(a,function(i,n){if(t[p].InventoryId!=i.InventoryId&&t[p].MasterInventoryId!=i.InventoryId||(s+=i.FlatRateShippingPrice*i.Quantity),(checkoutGridrow.InventoryBundleId>0?checkoutGridrow.InventoryBundleId==i.InventoryId:checkoutGridrow.itemID==i.InventoryId)&&0==_onlineCheckout.isValidForCheckoutInvoice()){var o=0;if(1==IsChargeMostExpensive?checkoutGridrow.itemID==l?(o+=i.FlatRateShippingPrice,o+=(i.Quantity-1)*i.AdditionShippingPrice):o+=i.Quantity*i.AdditionShippingPrice:(o+=i.FlatRateShippingPrice,i.Quantity>1&&(o+=(i.Quantity-1)*i.AdditionShippingPrice)),checkoutGridrow.InventoryBundleId>0){var a=e.grep(t,function(e){return e.MasterInventoryId==checkoutGridrow.InventoryBundleId});checkoutGridrow.shippingAmount=o/a.length}else checkoutGridrow.shippingAmount=o}})}if(0==p){if(objOnlineProductDetail={},objOnlineProductDetail.isPickupInStore=onlineShoppingCart.IsPickupInStore,1==onlineShoppingCart.IsPickupInStore)objOnlineProductDetail.fullName=FullUserName,objOnlineProductDetail.totalShippingAmount=0,objOnlineProductDetail.originalTotalShippingPrice=0,objOnlineProductDetail.totalShippingSurcharge=0,objOnlineProductDetail.strEstimatedPickupDate=moment(onlineShoppingCart.PickupDate).format("MMM-DD-YYYY hh:mm A");else if(objOnlineProductDetail.strEstimatedPickupDate=null,void 0===onlineShoppingCart.SelectedShippingMethod||String.isNullOrUndefineOrBlank(onlineShoppingCart.SelectedShippingMethod)){if(s>0&&0==_onlineCheckout.isValidForCheckoutInvoice()){s=0;v=_onlineCheckout.getFinalCCAmount();0==parseFloat(v)?n.isCCMust=!1:n.isCCMust=!0,void 0===objOnlineProductDetail.totalShippingSurcharge&&(objOnlineProductDetail.totalShippingSurcharge=0),objOnlineProductDetail.totalShippingSurcharge+=checkoutGridrow.shippingSurcharge,0==onlineShoppingCart.IsAddressOnFile?objOnlineProductDetail.isAddressSaveinProfile=onlineShoppingCart.Address.isSaveAddressinfo:objOnlineProductDetail.isAddressSaveinProfile=!1,objOnlineProductDetail.fullName=onlineShoppingCart.Address.fullName,objOnlineProductDetail.street=onlineShoppingCart.Address.street,objOnlineProductDetail.streetNo=onlineShoppingCart.Address.streetNo,objOnlineProductDetail.stateID=onlineShoppingCart.Address.stateID,objOnlineProductDetail.stateName=onlineShoppingCart.Address.stateName,objOnlineProductDetail.countryID=onlineShoppingCart.Address.countryID,objOnlineProductDetail.city=onlineShoppingCart.Address.city,objOnlineProductDetail.zip=onlineShoppingCart.Address.zip,objOnlineProductDetail.dayPhone=onlineShoppingCart.Address.dayPhone}}else{var v=_onlineCheckout.getFinalCCAmount();0==parseFloat(v)?n.isCCMust=!1:n.isCCMust=!0,objOnlineProductDetail.totalShippingAmount=onlineShoppingCart.SelectedShippingMethod.Rate,null!=o&&null!=o&&""!=o&&0==onlineShoppingCart.SelectedShippingMethod.Rate&&(objOnlineProductDetail.originalTotalShippingPrice=o),objOnlineProductDetail.shippingServiceName=onlineShoppingCart.SelectedShippingMethod.ShippingRateComputationMethodSystemName,objOnlineProductDetail.shippingServiceMethod=onlineShoppingCart.SelectedShippingMethod.Name,objOnlineProductDetail.shippingServiceCode=onlineShoppingCart.SelectedShippingMethod.Code,objOnlineProductDetail.isAddressSaveinProfile=onlineShoppingCart.IsAddressOnFile,0==onlineShoppingCart.IsAddressOnFile?objOnlineProductDetail.isAddressSaveinProfile=onlineShoppingCart.Address.isSaveAddressinfo:objOnlineProductDetail.isAddressSaveinProfile=!1,objOnlineProductDetail.fullName=onlineShoppingCart.Address.fullName,objOnlineProductDetail.street=onlineShoppingCart.Address.street,objOnlineProductDetail.streetNo=onlineShoppingCart.Address.streetNo,objOnlineProductDetail.stateID=onlineShoppingCart.Address.stateID,objOnlineProductDetail.stateName=onlineShoppingCart.Address.stateName,objOnlineProductDetail.countryID=onlineShoppingCart.Address.countryID,objOnlineProductDetail.city=onlineShoppingCart.Address.city,objOnlineProductDetail.zip=onlineShoppingCart.Address.zip,objOnlineProductDetail.dayPhone=onlineShoppingCart.Address.dayPhone,objOnlineProductDetail.totalShippingSurcharge=0}n.OnlineProductDetail=objOnlineProductDetail}void 0===objOnlineProductDetail.totalShippingAmount&&(objOnlineProductDetail.totalShippingAmount=0);var f=!1;if(e.grep(onlineShoppingCart.Inventories,function(e,t){checkoutGridrow.InventoryBundleId==e.InventoryId&&1==e.IsFlatRateShipping&&(f=!0)}),1!=checkoutGridrow.IsFlatRateShipping&&1!=f||(objOnlineProductDetail.totalShippingAmount+=checkoutGridrow.shippingAmount),t[p].isMembershipApply){var C={};C.BusinessID=t[p].BusinessID,C.RedeemBusinessId=t[p].RedeemBusinessId,C.UserID=_onlineCheckout.isValidForCheckoutInvoice()?n.loginUserID:t[p].userID,C.MembershipID=t[p].MembershipID,C.MembershipItemId=t[p].MembershipItemId,C.ItemType=t[p].IsPartial?_PackageMembership.PartialProduct:_PackageMembership.Product,C.VisitUsed=t[p].VisitUsed,C.Type=2,C.GroupId=t[p].GroupId,C.IsUnlimitedVisit=-1==t[p].Visit,C.ServiceProductName=checkoutGridrow.itemName,checkoutGridrow.MembershipRedeemedDetails=C}if(t[p].isPackageApplied)for(var S=e.grep(onlineShoppingCart.lstGCPkgData,function(e){return e.giftCertificateID===t[p].MembershipID}),y=0;y<S.length;y++)if(void 0!==t[p]&&"undefined"!=t[p].InventoryId&&(t[p].IsPartial?t[p].InventoryMasterID:t[p].InventoryId)==S[y].serviceID){objGC={},objGC.giftcertificateId=S[y].giftCertificateID,objGC.giftCertificateNo=S[y].giftCertificateNo,objGC.serviceId=t[p].IsPartial?t[p].InventoryId:S[y].serviceID;var b=0;if(S[y].quantity>0){for(var k=e.grep(onlineShoppingCart.lstGCPkgData,function(e){return 1==e.isCustomPackage&&e.giftCertificateID==S[y].giftCertificateID&&null!=e.serviceID&&""!=e.serviceName}),_=0,D=0;D<k.length;D++){var I=k[D];I.quantity>0&&(_+=I.quantity)}_>0?(b=Math.floor(_shopdetail.parseTodecimal(S[y].currentBalance/(_+(t[p].IsPartial?_shopdetail.parseTodecimal(t[p].Quantity):parseInt(t[p].Quantity)))*100))/100,b*=t[p].IsPartial?_shopdetail.parseTodecimal(t[p].Quantity):parseInt(t[p].Quantity)):b=0}objGC.redeemAmt=b,objGC.uniqID=1,objGC.RedeemServiceId=t[p].IsPartial?t[p].InventoryId:S[y].serviceID,objGC.gcAfterbalance=S[y].quantity,S[y].quantity=objGC.gcAfterbalance,objGC.GcPkgType=3,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,objGC.ItemType=3;var w=!1;e.each(onlineShoppingCart.RedeemedByGC,function(e,t){if(t.giftcertificateId===objGC.giftcertificateId)return w=!0,!1}),w||onlineShoppingCart.RedeemedByGC.push(objGC)}t[p].IsPartialPoint&&(checkoutGridrow.payableAmount=t[p].OriginalPrice-t[p].PartialPrice),"undefined"!=typeof isFromTextMarketing&&0==String.isNullOrUndefineOrBlank(isFromTextMarketing)&&(checkoutGridrow.RevenueIsFromTextMarketing=isFromTextMarketing),"undefined"!=typeof PromotionAppointmentID&&0==String.isNullOrUndefineOrBlank(PromotionAppointmentID)&&(checkoutGridrow.RevenuePromotionID=parseInt(PromotionAppointmentID)),i.push(checkoutGridrow)}},_onlineCheckout.setMembershipCheckoutData=function(e,t,i,n){for(var o=0;o<=e.length-1;o++){checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()||1==n?e[o].autoId:1,checkoutGridrow.userName="",checkoutGridrow.userID=e[o].userID,checkoutGridrow.serviceProviderID=e[o].serviceProviderID,checkoutGridrow.itemName=e[o].MembershipName,checkoutGridrow.itemID=e[o].MembershipId,checkoutGridrow.recordType=u,checkoutGridrow.barcodeID=w,checkoutGridrow.FmbFee=e[o].dailydealFee,checkoutGridrow.FMBPercentage=e[o].FMBPercentage,checkoutGridrow.DealBookingType=_onlineCheckout.GetDealBookingType(e[o].dailydealFee,e[o].FMBPercentage),checkoutGridrow.price=e[o].Price,checkoutGridrow.membershipchangeprice=e[o].Price;try{void 0!==e[o].dailydealFee&&null!=e[o].dailydealFee&&Number(e[o].dailydealFee)>0&&(checkoutGridrow.dailydealFee=e[o].dailydealFee)}catch(e){}void 0!==e[o].isPresetApply&&1==e[o].isPresetApply||0!=e[o].PromotionID||void 0!==e[o].IsInitialDiscount&&1==e[o].IsInitialDiscount?(checkoutGridrow.productDisc=e[o].productDisc,checkoutGridrow.discountedPrice=e[o].Price-e[o].productDisc):(checkoutGridrow.discount=_onlineCheckout.isValidForCheckoutInvoice()?e[o].productDisc:0,checkoutGridrow.discountedPrice=_onlineCheckout.isValidForCheckoutInvoice()?e[o].Price-e[o].productDisc:e[o].Price),void 0!==e[o].dailydealFee&&null!=e[o].dailydealFee&&Number(e[o].dailydealFee)>0&&(checkoutGridrow.price=Math.max(0,checkoutGridrow.price-e[o].dailydealFee),checkoutGridrow.discountedPrice=Math.max(0,checkoutGridrow.discountedPrice-e[o].dailydealFee)),checkoutGridrow.ConstantOriginalServicePrice=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(e[o].ConstantOriginalServicePrice)?e[o].Price:e[o].ConstantOriginalServicePrice:e[o].Price,checkoutGridrow.OriginalDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(e[o].OriginalDiscountRights)?0:e[o].OriginalDiscountRights:0,checkoutGridrow.OriginalDiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(e[o].OriginalDiscountType)?1:e[o].OriginalDiscountType:1,checkoutGridrow.ApprovedBy=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(e[o].ApprovedBy)?0:e[o].ApprovedBy:0,checkoutGridrow.IsAskApprovalPopup=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(e[o].IsAskApprovalPopup)?0:e[o].IsAskApprovalPopup:0,checkoutGridrow.IsShowApprovalPriceDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(e[o].IsShowApprovalPriceDiscount)?0:e[o].IsShowApprovalPriceDiscount:0,checkoutGridrow.pointsGained=e[o].pointsGained,checkoutGridrow.pointsRedeem=0,checkoutGridrow.quantity=1,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.isAutoRenewalMembership=e[o].IsRecurring,checkoutGridrow.membershipPaymentToBeTaken=e[o].IsRecurring,checkoutGridrow.productDisc=e[o].productDisc,checkoutGridrow.serviceDisc=e[o].serviceDisc,checkoutGridrow.chargeFrequency=e[o].ChargeFrequency,checkoutGridrow.isCarryBal=1==checkoutGridrow.isAutoRenewalMembership&&void 0!==e[o].IsCarryForwardBal&&null!=e[o].IsCarryForwardBal&&"true"==e[o].IsCarryForwardBal.toString().toLowerCase(),checkoutGridrow.Relationships=e[o].Relationships,checkoutGridrow.ChildAge=e[o].ChildAge,checkoutGridrow.MaxNoFamilyFriends=null!=e[o].MaxNoFamilyFriends?e[o].MaxNoFamilyFriends:0,null!=_onlineCheckout.SelectedFamilyFriendsArr&&_onlineCheckout.SelectedFamilyFriendsArr.length>0?checkoutGridrow.SelectedFamilyFriends=_onlineCheckout.SelectedFamilyFriendsArr.join(","):"true"==_onlineCheckout.isFromInvoice.toString().toLowerCase()&&(checkoutGridrow.SelectedFamilyFriends=e[o].SelectedFamilyFriends),checkoutGridrow.recurringLimit=e[o].RecurringLimit,checkoutGridrow.message=_onlineCheckout.isValidForCheckoutInvoice()?e[o].message:"",checkoutGridrow.calculatedTax=_onlineCheckout.parseTodecimal(e[o].calculatedTax,3),checkoutGridrow.Taxation=e[o].Taxation,checkoutGridrow.calculatedTaxTypeWise="[]",String.isNullOrUndefineOrBlank(e[o].BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(e[o].BusinessTax)?"[]":JSON.stringify(e[o].BusinessTax)),checkoutGridrow.taxes=e[o].TaxValue,checkoutGridrow.PromotionID=e[o].PromotionID,checkoutGridrow.DiscountID=e[o].DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(e[o].DiscountType)?1==e[o].IsAmount?2:1:e[o].DiscountType:1==e[o].IsAmount?2:1,checkoutGridrow.AmountValue=e[o].AmountValue,1==isCheckInApp&&""!=glbMembershipData.membershipCardNo&&null!=glbMembershipData.membershipCardNo&&null!=glbMembershipData.membershipCardNo&&(checkoutGridrow.message=glbMembershipData.membershipCardNo),checkoutGridrow.isInitialDiscount=e[o].IsInitialDiscount,checkoutGridrow.initialDiscount=e[o].InitialDiscount,checkoutGridrow.isAmountInitialDiscount=e[o].IsAmountForInitialDiscount,checkoutGridrow.billingCycle=e[o].BillingCycle,!String.isNullOrUndefineOrBlank(e[o].UsedInBiling)&&e[o].UsedInBiling>0?checkoutGridrow.usedInBiling=e[o].UsedInBiling:0!=typeof e[o].BillingCycle&&(checkoutGridrow.usedInBiling=1),"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,"undefined"!=typeof isFromTextMarketing&&0==String.isNullOrUndefineOrBlank(isFromTextMarketing)&&(checkoutGridrow.RevenueIsFromTextMarketing=isFromTextMarketing),"undefined"!=typeof PromotionAppointmentID&&0==String.isNullOrUndefineOrBlank(PromotionAppointmentID)&&(checkoutGridrow.RevenuePromotionID=parseInt(PromotionAppointmentID)),t.push(checkoutGridrow)}},_onlineCheckout.setPackageCheckoutData=function(t,i,n,o){for(var a=Math.max.apply(Math,t.map(function(e){return e.autoId})),s=0;s<=t.length-1;s++){checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()||1==o?t[s].autoId:1,checkoutGridrow.userName=t[s].userName,checkoutGridrow.userID=t[s].userID,checkoutGridrow.serviceProviderID=t[s].serviceProviderID,4==t[s].eventType?(checkoutGridrow.itemID=t[s].SellPackageServiceID,checkoutGridrow.packageDetailId=t[s].ServiceId,!String.isNullOrUndefineOrBlank(t[s].GCUpdatePendingID)&&t[s].GCUpdatePendingID<0?(checkoutGridrow.GCUpdatePendingID=t[s].GCUpdatePendingID,checkoutGridrow.uniqID=t[s].autoId):checkoutGridrow.GCUpdatePendingID=0):checkoutGridrow.itemID=t[s].ServiceId,checkoutGridrow.itemName=t[s].ServiceTitle,checkoutGridrow.pointsGained=t[s].pointsGained,checkoutGridrow.pointsRedeem=0,checkoutGridrow.recordType=d,checkoutGridrow.barcodeID=I,checkoutGridrow.FmbFee=t[s].dailydealFee,checkoutGridrow.FMBPercentage=t[s].FMBPercentage,checkoutGridrow.DealBookingType=_onlineCheckout.GetDealBookingType(t[s].dailydealFee,t[s].FMBPercentage),checkoutGridrow.price=t[s].TotalPrice,checkoutGridrow.giftCertificateChangePrice=t[s].TotalPrice,void 0!==t[s].dailydealFee&&null!=t[s].dailydealFee&&Number(t[s].dailydealFee)>0&&(checkoutGridrow.dailydealFee=t[s].dailydealFee),checkoutGridrow.Relationships=t[s].Relationships,checkoutGridrow.ChildAge=t[s].ChildAge,checkoutGridrow.MaxNoFamilyFriends=null!=t[s].MaxNoFamilyFriends?t[s].MaxNoFamilyFriends:0,checkoutGridrow.ConstantOriginalServicePrice=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[s].ConstantOriginalServicePrice)?t[s].TotalPrice:t[s].ConstantOriginalServicePrice:t[s].TotalPrice,checkoutGridrow.OriginalDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[s].OriginalDiscountRights)?0:t[s].OriginalDiscountRights:0,checkoutGridrow.OriginalDiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[s].OriginalDiscountType)?1:t[s].OriginalDiscountType:1,checkoutGridrow.ApprovedBy=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[s].ApprovedBy)?0:t[s].ApprovedBy:0,checkoutGridrow.IsAskApprovalPopup=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[s].IsAskApprovalPopup)?0:t[s].IsAskApprovalPopup:0,checkoutGridrow.IsShowApprovalPriceDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[s].IsShowApprovalPriceDiscount)?0:t[s].IsShowApprovalPriceDiscount:0,null==_onlineCheckout.PackageSharingDetail&&(_onlineCheckout.PackageSharingDetail=[]);var r=e.grep(_onlineCheckout.PackageSharingDetail,function(e){return e.ServiceId==t[s].ServiceId&&e.autoId==t[s].autoId});null!=r&&r.length>0?checkoutGridrow.SelectedFamilyFriends=r[0].SelectedFamilyFriends:"true"==_onlineCheckout.isFromInvoice.toString().toLowerCase()&&(checkoutGridrow.SelectedFamilyFriends=t[s].SelectedFamilyFriends),void 0!==t[s].isPresetApply&&1==t[s].isPresetApply||0!=t[s].PromotionID||void 0!==t[s].IsInitialDiscount&&1==t[s].IsInitialDiscount?(checkoutGridrow.discount=t[s].discount,checkoutGridrow.discountedPrice=t[s].TotalPrice-t[s].discount):(checkoutGridrow.discount=_onlineCheckout.isValidForCheckoutInvoice()?t[s].discount:0,checkoutGridrow.discountedPrice=_onlineCheckout.isValidForCheckoutInvoice()?t[s].Price:t[s].TotalPrice),void 0!==t[s].dailydealFee&&null!=t[s].dailydealFee&&Number(t[s].dailydealFee)>0&&(checkoutGridrow.price=Math.max(0,checkoutGridrow.price-t[s].dailydealFee),checkoutGridrow.discountedPrice=Math.max(0,checkoutGridrow.discountedPrice-t[s].dailydealFee)),checkoutGridrow.quantity=t[s].NoOfVisit,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.isSendEmailToRecipient=!1,checkoutGridrow.isSendEmailToSender=!0,checkoutGridrow.isPrint=!1,checkoutGridrow.assignTo=t[s].userID,checkoutGridrow.expiresOn="never",checkoutGridrow.imagePath="",checkoutGridrow.message="",checkoutGridrow.calculatedTax=_onlineCheckout.parseTodecimal(t[s].calculatedTax,3),checkoutGridrow.calculatedTaxTypeWise="[]",String.isNullOrUndefineOrBlank(t[s].BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(t[s].BusinessTax)?"[]":JSON.stringify(t[s].BusinessTax)),checkoutGridrow.taxes=t[s].TaxValue,checkoutGridrow.GCAssignToName="",checkoutGridrow.GCServiceName="",checkoutGridrow.GCColor="",checkoutGridrow.gCPreviewURL="",checkoutGridrow.isRecurring=t[s].IsRecurring,checkoutGridrow.isRecurring?(checkoutGridrow.renewalOn=t[s].ChargeFrequency,checkoutGridrow.RecurringLimit=0==t[s].RecurringLimit?-1:t[s].RecurringLimit,checkoutGridrow.isCarryBal=3!=t[s].ChargeFrequency&&t[s].IsCarryForwardBal):(checkoutGridrow.renewalOn=0,checkoutGridrow.RecurringLimit=0,checkoutGridrow.isCarryBal=!1),checkoutGridrow.recGiftCertificateID=_onlineCheckout.isValidForCheckoutInvoice()||!String.isNullOrUndefineOrBlank(t[s].RecGiftCertificateId)&&t[s].RecGiftCertificateId>0?t[s].RecGiftCertificateId:0,"true"==isWidget.toLowerCase()?checkoutGridrow.purchasedAt="My Widget":"true"==isCustomWebsite.toLowerCase()?checkoutGridrow.purchasedAt="My Vagaro Website":checkoutGridrow.purchasedAt="My Vagaro Page",checkoutGridrow.PromotionID=t[s].PromotionID,checkoutGridrow.DiscountID=t[s].DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[s].DiscountType)?1==t[s].IsAmount?2:1:t[s].DiscountType:1==t[s].IsAmount?2:1,checkoutGridrow.AmountValue=t[s].AmountValue,checkoutGridrow.isInitialDiscount=t[s].IsInitialDiscount,checkoutGridrow.initialDiscount=t[s].InitialDiscount,checkoutGridrow.isAmountInitialDiscount=t[s].IsAmountForInitialDiscount,checkoutGridrow.billingCycle=t[s].BillingCycle,!String.isNullOrUndefineOrBlank(t[s].UsedInBiling)&&t[s].UsedInBiling>0?checkoutGridrow.usedInBiling=t[s].UsedInBiling:String.isNullOrUndefineOrBlank(t[s].BillingCycle)||0==t[s].BillingCycle||(checkoutGridrow.usedInBiling=1),"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,checkoutGridrow.AddOnsServiceIds=_onlineCheckout.GetAddonsServiceId(t[s].lstAddonService),checkoutGridrow.AddonServiceDetials=t[s].lstAddonService,"undefined"!=typeof isFromTextMarketing&&0==String.isNullOrUndefineOrBlank(isFromTextMarketing)&&(checkoutGridrow.RevenueIsFromTextMarketing=isFromTextMarketing),"undefined"!=typeof PromotionAppointmentID&&0==String.isNullOrUndefineOrBlank(PromotionAppointmentID)&&(checkoutGridrow.RevenuePromotionID=parseInt(PromotionAppointmentID)),i.push(checkoutGridrow),a=_onlineCheckout.setAddonServicePackageCheckoutData(t[s],t[s].lstAddonService,i,a)}},_onlineCheckout.setServiceCheckoutData=function(t,i,n){for(var o=0;o<=t.length-1;o++){if(checkoutGridrow={},checkoutGridrow.uniqID=t[o].AppSrNo,checkoutGridrow.userName=t[o].userName,checkoutGridrow.userID=t[o].userID,checkoutGridrow.serviceProviderID=t[o].serviceProviderID,checkoutGridrow.itemID=t[o].serviceid,checkoutGridrow.packageDetailId=t[o].packageDetailId,checkoutGridrow.itemName=t[o].servicename,checkoutGridrow.pointsGained=void 0!==t[o].isPointApply&&t[o].isPointApply?t[o].pointsGained:t[o].pointgiven,checkoutGridrow.pointsRedeem=void 0!==t[o].isPointApply&&t[o].isPointApply?t[o].pointsRedeem:t[o].pointredeem,checkoutGridrow.recordType=t[o].recordType,checkoutGridrow.barcodeID=t[o].barcodeID,checkoutGridrow.price=void 0!==t[o].isPackageApplied&&t[o].isPackageApplied||void 0!==t[o].DiscountType&&2==t[o].DiscountType&&t[o].depositsPercentage>0?t[o].price:t[o].ServiceOrginalPrice,checkoutGridrow.discount=t[o].discount,checkoutGridrow.discountedPrice=void 0!==t[o].isPointApply&&t[o].isPointApply?t[o].ServiceOrginalPrice:t[o].price,checkoutGridrow.quantity=1,checkoutGridrow.packageAssignStatus=void 0!==t[o].isPackageApplied&&t[o].isPackageApplied?1:0,checkoutGridrow.pointAssignStatus=void 0!==t[o].isPointApply&&t[o].isPointApply?1:0,checkoutGridrow.calculatedTax=void 0!==t[o].isPointApply&&t[o].isPointApply?0:_onlineCheckout.parseTodecimal(t[o].calculatedTax,3),checkoutGridrow.BusinessTax=void 0!==t[o].isPointApply&&t[o].isPointApply?null:t[o].BusinessTax,checkoutGridrow.appointmentDate=t[o].appointmentDate,checkoutGridrow.appointmentID=t[o].appointmentID,checkoutGridrow.appointmentTime=t[o].appointmentTime,checkoutGridrow.serviceProviderName=t[o].serviceProviderName,checkoutGridrow.startTime=t[o].startTime,checkoutGridrow.originalServicePriceForPackage=t[o].ServiceOrginalPrice,checkoutGridrow.businessPackageID=t[o].businessPackageID,checkoutGridrow.PromotionID=t[o].PromotionId,checkoutGridrow.redeemID=void 0===t[o].redeemID||""==t[o].redeemID||null==t[o].redeemID?0:t[o].redeemID,checkoutGridrow.ConstantOriginalServicePrice=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].ConstantOriginalServicePrice)?t[o].ServiceOrginalPrice:t[o].ConstantOriginalServicePrice:t[o].ServiceOrginalPrice,checkoutGridrow.OriginalDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].OriginalDiscountRights)?0:t[o].OriginalDiscountRights:0,checkoutGridrow.OriginalDiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].OriginalDiscountType)?1:t[o].OriginalDiscountType:1,checkoutGridrow.ApprovedBy=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].ApprovedBy)?0:t[o].ApprovedBy:0,checkoutGridrow.IsAskApprovalPopup=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].IsAskApprovalPopup)?0:t[o].IsAskApprovalPopup:0,checkoutGridrow.IsShowApprovalPriceDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].IsShowApprovalPriceDiscount)?0:t[o].IsShowApprovalPriceDiscount:0,checkoutGridrow.parentAppointmentID=t[o].parentAppointmentID,t[o].isMembershipApply){var a={};a.BusinessID=t[o].BusinessID,a.RedeemBusinessId=t[o].RedeemBusinessId,a.UserID=_onlineCheckout.isValidForCheckoutInvoice()?n.loginUserID:t[o].userID,a.MembershipID=t[o].MembershipID,a.MembershipItemId=t[o].MembershipItemId,a.ItemType=t[o].ItemType,a.VisitUsed=t[o].VisitUsed,a.Type=2,a.GroupId=t[o].GroupId,a.IsUnlimitedVisit=-1==t[o].Visit,a.ServiceProductName=checkoutGridrow.itemName,checkoutGridrow.MembershipRedeemedDetails=a}if(checkoutGridrow.DiscountID=t[o].DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].DiscountType)?1==t[o].IsAmount?2:1:t[o].DiscountType:1==t[o].IsAmount?2:1,checkoutGridrow.AmountValue=t[o].AmountValue,t[o].isPaid&&(t[o].paidType==_onlineCheckout.arrpaidType.Deposits&&(checkoutGridrow.price=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(t[o].payableAmount,2)-_onlineCheckout.parseTodecimal(t[o].deposit,2),2)),checkoutGridrow.isPaid=t[o].isPaid,checkoutGridrow.paidType=t[o].paidType,checkoutGridrow.DiscountID=0,checkoutGridrow.PromotionID=0),t[o].paidType==_onlineCheckout.arrpaidType.Paid)if(onlineShoppingCart.tipPercent>0){_onlineCheckout.TipApplyCounter=++_onlineCheckout.TipApplyCounter;var s=_onlineCheckout.parseTodecimal(t[o].ServiceOrginalPrice-t[o].discount,2),r=0;r=_onlineCheckout.TipApplyCounter==_onlineCheckout.TotalPaidCount||0==s&&o==t.length-1?_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-_onlineCheckout.TipAppliedSum,2):_onlineCheckout.parseTodecimal(s*onlineShoppingCart.tipPercent/100,2),checkoutGridrow.calculatedTip=r,_onlineCheckout.TipAppliedSum+=r}else{r=0;onlineShoppingCart.tipValue>0&&(r=_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-_onlineCheckout.TipAppliedSum,2)),checkoutGridrow.calculatedTip=r,_onlineCheckout.TipAppliedSum+=r}t[o].paidType!=_onlineCheckout.arrpaidType.OfflineDeposit&&t[o].paidType!=_onlineCheckout.arrpaidType.OfflineDepositPrepay||(checkoutGridrow.payableAmount=_onlineCheckout.parseTodecimal(t[o].payableAmount,2),checkoutGridrow.DepositsRemaining=_onlineCheckout.parseTodecimal(t[o].DepositsRemaining,2),checkoutGridrow.DepositsPaid=_onlineCheckout.parseTodecimal(t[o].DepositsPaid,2),checkoutGridrow.depositsPercentage=_onlineCheckout.parseTodecimal(t[o].depositsPercentage,3),checkoutGridrow.paidType=t[o].paidType,t[o].paidType!=_onlineCheckout.arrpaidType.OfflineDepositPrepay&&(checkoutGridrow.calculatedTax=0,checkoutGridrow.BusinessTax=null)),checkoutGridrow.calculatedTaxTypeWise="[]",String.isNullOrUndefineOrBlank(t[o].BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(t[o].BusinessTax)?"[]":JSON.stringify(t[o].BusinessTax)),checkoutGridrow.taxes=t[o].TaxValue,null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&e.grep(onlineShoppingCart.lstGCPkgData,function(e){if(void 0!==t[o].GCDetail&&null!=t[o].GCDetail&&t[o].GCDetail.length>0)for(var i=0;i<t[o].GCDetail.length;i++)e.giftCertificateID==t[o].GCDetail[i].GCId&&null!=e.Taxes&&(checkoutGridrow.taxes="",checkoutGridrow.calculatedTax=0,checkoutGridrow.BusinessTax=null,checkoutGridrow.tax=0,checkoutGridrow.calculatedTaxTypeWise="[]")}),9==t[o].OriginalpaidType&&(checkoutGridrow.paidType=t[o].OriginalpaidType,checkoutGridrow.IsChargeFee=t[o].IsChargeFee),"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,1==t[o].IsPartialPoint&&(checkoutGridrow.payableAmount=t[o].ServiceOrginalPrice-t[o].PartialPrice,checkoutGridrow.price=t[o].ServiceOrginalPrice),i.push(checkoutGridrow)}},_onlineCheckout.setClassCheckoutData=function(t,i,n,o){for(var a=0;a<=t.length-1;a++)for(var s=t[a].eventEnrollment,r=0;r<=s.length-1;r++)if(t[a].eventID==s[r].eventID){if(checkoutGridrow={},checkoutGridrow.emailId=s[r].cUserEmail,checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?s[r].autoID:_onlineCheckout.GetMaxChkGridRowuniqueId(i),checkoutGridrow.userName="",checkoutGridrow.userID=null==s[r].tmpcustomerID?s[r].customerID:s[r].tmpcustomerID,checkoutGridrow.serviceProviderID=s[r].sPID,checkoutGridrow.itemID=s[r].eventID,checkoutGridrow.packageDetailId=String.isNullOrUndefineOrBlank(s[r].gcId)?0:s[r].gcId,checkoutGridrow.itemName=t[a].eventName,checkoutGridrow.pointsGained=t[a].PointGiven,checkoutGridrow.pointsRedeem=s[r].pointsRedeem,checkoutGridrow.recordType=p,checkoutGridrow.barcodeID=P,checkoutGridrow.FmbFee=s[r].dailydealFee,checkoutGridrow.FMBPercentage=s[r].FMBPercentage,checkoutGridrow.DealBookingType=_onlineCheckout.GetDealBookingType(s[r].dailydealFee,s[r].FMBPercentage),checkoutGridrow.price=void 0!==s[r].isPointApply&&s[r].isPointApply?s[r].Originalprice:parseFloat(String.isNullOrUndefineOrBlank(s[r].price)?0:s[r].price)+parseFloat(String.isNullOrUndefineOrBlank(s[r].discount)?0:s[r].discount),checkoutGridrow.discount=String.isNullOrUndefineOrBlank(s[r].discount)?0:s[r].discount,checkoutGridrow.discountedPrice=void 0!==s[r].isPointApply&&s[r].isPointApply?s[r].Originalprice:s[r].price,void 0!==s[r].dailydealFee&&null!=s[r].dailydealFee&&Number(s[r].dailydealFee)>0&&(checkoutGridrow.price=Math.max(0,checkoutGridrow.price-s[r].dailydealFee),checkoutGridrow.discountedPrice=Math.max(0,checkoutGridrow.discountedPrice-s[r].dailydealFee)),checkoutGridrow.quantity=1,checkoutGridrow.packageAssignStatus=void 0!==s[r].isPackage&&s[r].isPackage?1:0,checkoutGridrow.pointAssignStatus=void 0!==s[r].isPointApply&&s[r].isPointApply?1:0,checkoutGridrow.appointmentDate=s[r].eventDate,checkoutGridrow.appointmentID=s[r].appointmentID,checkoutGridrow.appointmentTime=s[r].startTime,checkoutGridrow.serviceProviderName=s[r].sPName,checkoutGridrow.startTime=s[r].startTime,checkoutGridrow.originalServicePriceForPackage=s[r].Originalprice,checkoutGridrow.businessPackageID=0,checkoutGridrow.PromotionID=s[r].PromotionID,checkoutGridrow.ConstantOriginalServicePrice=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(s[r].ConstantOriginalServicePrice)?s[r].Originalprice:s[r].ConstantOriginalServicePrice:s[r].Originalprice,checkoutGridrow.OriginalDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(s[r].OriginalDiscountRights)?0:s[r].OriginalDiscountRights:0,checkoutGridrow.OriginalDiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(s[r].OriginalDiscountType)?1:s[r].OriginalDiscountType:1,checkoutGridrow.ApprovedBy=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(s[r].ApprovedBy)?0:s[r].ApprovedBy:0,checkoutGridrow.IsAskApprovalPopup=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(s[r].IsAskApprovalPopup)?0:s[r].IsAskApprovalPopup:0,checkoutGridrow.IsShowApprovalPriceDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(s[r].IsShowApprovalPriceDiscount)?0:s[r].IsShowApprovalPriceDiscount:0,checkoutGridrow.membershipDiscount=0,s[r].isMembershipApply){checkoutGridrow.membershipDiscount=String.isNullOrUndefineOrBlank(s[r].membershipDiscount)?0:s[r].membershipDiscount,checkoutGridrow.membershipDiscountOnReceipt=String.isNullOrUndefineOrBlank(s[r].membershipDiscountOnReceipt)?0:s[r].membershipDiscountOnReceipt;var l={};l.BusinessID=s[r].BusinessID,l.RedeemBusinessId=s[r].RedeemBusinessId,l.UserID=null==s[r].tmpcustomerID?s[r].customerID:s[r].tmpcustomerID,l.MembershipID=s[r].MembershipID,l.MembershipItemId=s[r].MembershipItemId,l.ItemType=2,l.VisitUsed=1,l.Type=2,l.GroupId=s[r].GroupId,l.IsUnlimitedVisit=-1==s[r].VisitRemaining,l.ServiceProductName=t[a].eventName,checkoutGridrow.MembershipRedeemedDetails=l}if(s[r].isPackage)objGC={},objGC.giftcertificateId=s[r].gcId,objGC.serviceId=s[r].eventID,objGC.redeemAmt=s[r].redeemAmt,objGC.RedeemServiceId=s[r].RedeemServiceId,objGC.uniqID=checkoutGridrow.uniqID,objGC.AppointmentID=s[r].appointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,o?onlineShoppingCart.RedeemedByGCDistri.push(objGC):onlineShoppingCart.RedeemedByGC.push(objGC);else if(!String.isNullOrUndefineOrBlank(s[r].gcId)&&s[r].gcId>0)if(objGC={},objGC.giftcertificateId=s[r].gcId,objGC.serviceId=s[r].eventID,void 0!==s[r].redeemTax&&null!==s[r].redeemTax?objGC.redeemAmt=(s[r].redeemAmt||0)+s[r].redeemTax:objGC.redeemAmt=s[r].redeemAmt||0,null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&e.grep(onlineShoppingCart.lstGCPkgData,function(e){e.giftCertificateID==s[r].gcId&&null!=e.Taxes&&(s[r].redeemTax=0,s[r].TaxValue="0",s[r].taxprice=0)}),objGC.RedeemServiceId=s[r].RedeemServiceId,objGC.uniqID=checkoutGridrow.uniqID,objGC.AppointmentID=s[r].appointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,o)onlineShoppingCart.RedeemedByGCDistri.push(objGC);else{for(var c=onlineShoppingCart.RedeemedByGC,d=0;d<c.length;d++)if(c[d].giftcertificateId===objGC.giftcertificateId&&0===c[d].serviceId){c.splice(d,1);break}objGC.serviceId>0&&objGC.giftcertificateId>0&&onlineShoppingCart.RedeemedByGC.push(objGC)}if(checkoutGridrow.calculatedTax=_onlineCheckout.parseTodecimal(s[r].taxprice,3),checkoutGridrow.BusinessTax=s[r].BusinessTax,checkoutGridrow.DiscountID=s[r].DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(s[r].DiscountType)?1==s[r].IsAmount?2:1:s[r].DiscountType:1==s[r].IsAmount?2:1,checkoutGridrow.AmountValue=s[r].AmountValue,checkoutGridrow.sessionAttendeeID=s[r].sessionAttendeeID,s[r].isPaid&&(s[r].paidType==_onlineCheckout.arrpaidType.Deposits&&(checkoutGridrow.price=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(s[r].payableAmount,2)-_onlineCheckout.parseTodecimal(s[r].deposit,2),2)),checkoutGridrow.isPaid=s[r].isPaid,checkoutGridrow.paidType=s[r].paidType,checkoutGridrow.DiscountID=0,checkoutGridrow.PromotionID=0),(s[r].paidType==_onlineCheckout.arrpaidType.PaidClass||s[r].paidType==_onlineCheckout.arrpaidType.Paid)&&onlineShoppingCart.tipPercent>0){_onlineCheckout.TipApplyCounter=++_onlineCheckout.TipApplyCounter;var u=_onlineCheckout.parseTodecimal(s[r].price,2);!String.isNullOrUndefineOrBlank(s[r].deposit)&&s[r].deposit>0&&(u=_onlineCheckout.parseTodecimal(s[r].price,2)+_onlineCheckout.parseTodecimal(s[r].deposit,2)),(1==s[r].isPackage||1==s[r].isPointApply||s[r].isMembershipApply||void 0!==s[r].PromotionID&&null!=s[r].PromotionID&&s[r].PromotionID>0)&&(u=_onlineCheckout.parseTodecimal(s[r].Originalprice,2));var h=0;h=_onlineCheckout.TipApplyCounter==_onlineCheckout.TotalPaidCount||0==u?_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-_onlineCheckout.TipAppliedSum,2):_onlineCheckout.parseTodecimal(u*onlineShoppingCart.tipPercent/100,2),checkoutGridrow.calculatedTip=h,_onlineCheckout.TipAppliedSum+=h}s[r].paidType!=_onlineCheckout.arrpaidType.OfflineDeposit&&s[r].paidType!=_onlineCheckout.arrpaidType.OfflineDepositPrepay&&s[r].paidType!=_onlineCheckout.arrpaidType.DepositsClass||(checkoutGridrow.payableAmount=_onlineCheckout.parseTodecimal(s[r].payableAmount,2),"undefined"==s[r].depositsRemaining||null==s[r].depositsRemaining||isNaN(s[r].depositsRemaining)?checkoutGridrow.DepositsRemaining=0:checkoutGridrow.DepositsRemaining=_onlineCheckout.parseTodecimal(s[r].depositsRemaining,2),"undefined"==s[r].depositsPaid||null==s[r].depositsPaid||isNaN(s[r].depositsPaid)?checkoutGridrow.DepositsPaid=0:s[r].IsPartialPoint&&!s[r].IsDepositsOver?checkoutGridrow.DepositsPaid=_onlineCheckout.parseTodecimal(s[r].depositsPaid+s[r].PartialPrice,2):checkoutGridrow.DepositsPaid=_onlineCheckout.parseTodecimal(s[r].depositsPaid,2),checkoutGridrow.depositsPercentage=_onlineCheckout.parseTodecimal(s[r].depositsPercentage,3),checkoutGridrow.paidType=s[r].paidType,s[r].paidType!=_onlineCheckout.arrpaidType.OfflineDepositPrepay&&(checkoutGridrow.calculatedTax=0,checkoutGridrow.BusinessTax=null)),1==s[r].IsPartialPoint&&(checkoutGridrow.payableAmount=s[r].IsPartialDeposits?s[r].price-s[r].PartialPrice:s[r].price),checkoutGridrow.calculatedTaxTypeWise="[]",String.isNullOrUndefineOrBlank(s[r].BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(s[r].BusinessTax)?"[]":JSON.stringify(s[r].BusinessTax)),checkoutGridrow.taxes=s[r].TaxValue,9==s[r].OriginalpaidType&&(checkoutGridrow.paidType=s[r].OriginalpaidType,checkoutGridrow.IsChargeFee=s[r].IsChargeFee),"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,"undefined"==typeof hdnPriceWithTaxSwitch||null==hdnPriceWithTaxSwitch||null==hdnPriceWithTaxSwitch||String.isNullOrUndefineOrBlank(hdnPriceWithTaxSwitch.value)||"1"!=hdnPriceWithTaxSwitch.value||(checkoutGridrow.IsIncludeTaxInOnlinePricing=!0);try{void 0!==s[r].dailydealFee&&null!=s[r].dailydealFee&&Number(s[r].dailydealFee)>0&&(checkoutGridrow.dailydealFee=s[r].dailydealFee)}catch(e){}i.push(checkoutGridrow),_onlineCheckout.setClassAddonCheckoutData(s[r].lstAddonService,i,s[r],checkoutGridrow.uniqID)}},_onlineCheckout.setGCCheckoutData=function(t,i,n){for(var o=0;o<=t.length-1;o++){var a=t[o].ServiceId>0;checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?t[o].autoId:1,checkoutGridrow.userName=_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.invoiceDetails.CustomerName)?onlineShoppingCart.invoiceDetails.CustomerName:""==t[o].userName?FullUserName:t[o].userName,checkoutGridrow.userID=t[o].userID,checkoutGridrow.serviceProviderID=t[o].serviceProviderID,checkoutGridrow.itemID=t[o].ServiceId,checkoutGridrow.itemName=_onlineCheckout.isValidForCheckoutInvoice()?t[o].serviceTitle:"",checkoutGridrow.pointsGained=0,checkoutGridrow.pointsRedeem=0,checkoutGridrow.recordType=d,checkoutGridrow.barcodeID=D,checkoutGridrow.FmbFee=t[o].dailydealFee,checkoutGridrow.DealBookingType=_onlineCheckout.GetDealBookingType(t[o].dailydealFee,t[o].FMBPercentage),checkoutGridrow.price=t[o].TotalPrice;try{void 0!==t[o].dailydealFee&&null!=t[o].dailydealFee&&Number(t[o].dailydealFee)>0&&(checkoutGridrow.dailydealFee=t[o].dailydealFee)}catch(e){}checkoutGridrow.discount=t[o].discount,checkoutGridrow.discountedPrice=checkoutGridrow.itemID>0?t[o].TotalPrice:t[o].Price,void 0!==t[o].dailydealFee&&null!=t[o].dailydealFee&&Number(t[o].dailydealFee)>0&&(checkoutGridrow.price=Math.max(0,checkoutGridrow.price-t[o].dailydealFee),checkoutGridrow.discountedPrice=Math.max(0,checkoutGridrow.discountedPrice-t[o].dailydealFee)),checkoutGridrow.quantity=1==a?t[o].NoOfVisit:0,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.isPrint=e("#chkgcprint").prop("checked"),checkoutGridrow.assignTo=_onlineCheckout.isValidForCheckoutInvoice()?t[o].assignTo:0,checkoutGridrow.expiresOn=1==_onlineCheckout.isValidForCheckoutInvoice()?void 0===t[o].ExpiresOn||null==t[o].ExpiresOn||""==t[o].ExpiresOn||"NEVER"==t[o].ExpiresOn.toUpperCase()?"never":t[o].ExpiresOn:"never",checkoutGridrow.giftCertificateCatID=t[o].GiftCertificateCatID,checkoutGridrow.giftCertificatePhotoID=t[o].GiftCertificatePhotoID,checkoutGridrow.imagePath=t[o].imagePath,checkoutGridrow.isAdminImage=t[o].isAdminImage,checkoutGridrow.message=t[o].Message,checkoutGridrow.calculatedTax=t[o].calculatedTax,checkoutGridrow.GCAssignToName=t[o].FullName,checkoutGridrow.GCAssignToEmailId=t[o].Email,checkoutGridrow.GCServiceName=_onlineCheckout.isValidForCheckoutInvoice()&&1==a?t[o].GCServiceName:1==a?t[o].serviceTitle:"",checkoutGridrow.GCColor=t[o].GCFontColor,checkoutGridrow.gCPreviewURL="",checkoutGridrow.isRecurring=!1,checkoutGridrow.renewalOn=0,checkoutGridrow.isCarryBal=!1,checkoutGridrow.recGiftCertificateID=0,checkoutGridrow.ConstantOriginalServicePrice=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].ConstantOriginalServicePrice)?t[o].TotalPrice:t[o].ConstantOriginalServicePrice:t[o].TotalPrice,checkoutGridrow.OriginalDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].OriginalDiscountRights)?0:t[o].OriginalDiscountRights:0,checkoutGridrow.OriginalDiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].OriginalDiscountType)?1:t[o].OriginalDiscountType:1,checkoutGridrow.ApprovedBy=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].ApprovedBy)?0:t[o].ApprovedBy:0,checkoutGridrow.IsAskApprovalPopup=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].IsAskApprovalPopup)?0:t[o].IsAskApprovalPopup:0,checkoutGridrow.IsShowApprovalPriceDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].IsShowApprovalPriceDiscount)?0:t[o].IsShowApprovalPriceDiscount:0,"true"==isWidget.toLowerCase()?checkoutGridrow.purchasedAt="My Widget":"true"==isCustomWebsite.toLowerCase()?checkoutGridrow.purchasedAt="My Vagaro Website":checkoutGridrow.purchasedAt="My Vagaro Page",checkoutGridrow.PromotionID=t[o].PromotionID,checkoutGridrow.DiscountID=t[o].DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(t[o].DiscountType)?1==t[o].IsAmount?2:1:t[o].DiscountType:1==t[o].IsAmount?2:1,checkoutGridrow.AmountValue=t[o].AmountValue,"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,checkoutGridrow.calculatedTaxTypeWise="[]",String.isNullOrUndefineOrBlank(t[o].BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(t[o].BusinessTax)?"[]":JSON.stringify(t[o].BusinessTax)),checkoutGridrow.taxes=t[o].TaxValue,checkoutGridrow.SenderPhoneNo=t[o].SenderPhoneNo,checkoutGridrow.ReciverPhoneNo=t[o].ReciverPhoneNo,String.isNullOrUndefineOrBlank(t[o].ScheduleDate)?(checkoutGridrow.ScheduleDate=t[o].ScheduleDate,checkoutGridrow.isSendEmailToRecipient=!0,checkoutGridrow.isSendEmailToSender=!0,checkoutGridrow.MailStatus=1):(checkoutGridrow.ScheduleDate=t[o].ScheduleDate,checkoutGridrow.isSendEmailToRecipient=!1,checkoutGridrow.isSendEmailToSender=!1,checkoutGridrow.MailStatus=0),window.location.href.includes("/shopping-bag/invoice")&&String.isNullOrUndefineOrBlank(t[o].ScheduleDate)&&(t[o].IsSendMailtoReceiptInvoice?checkoutGridrow.isSendEmailToRecipient=!0:checkoutGridrow.isSendEmailToRecipient=!1),"undefined"!=typeof isFromTextMarketing&&0==String.isNullOrUndefineOrBlank(isFromTextMarketing)&&(checkoutGridrow.RevenueIsFromTextMarketing=isFromTextMarketing),"undefined"!=typeof PromotionAppointmentID&&0==String.isNullOrUndefineOrBlank(PromotionAppointmentID)&&(checkoutGridrow.RevenuePromotionID=parseInt(PromotionAppointmentID)),i.push(checkoutGridrow)}},_onlineCheckout.setBusinessFeesCheckoutData=function(e,t,i){for(var n=0;n<=e.length-1;n++)if(e[n].DisplayCalculatedFees>0){checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?e[n].autoId:_onlineCheckout.GetMaxChkGridRowuniqueId(t),checkoutGridrow.itemID=e[n].BusinessFeeID,1==e[n].FeeType?checkoutGridrow.recordType=f:checkoutGridrow.recordType=g,checkoutGridrow.itemName=e[n].FeeName,checkoutGridrow.price=e[n].DisplayCalculatedFees,checkoutGridrow.AmountType=e[n].AmountType,checkoutGridrow.ApplyType=e[n].ApplyType,checkoutGridrow.TransactionType=e[n].TransactionType,checkoutGridrow.AutoApplyFees=e[n].AutoApplyFees,checkoutGridrow.quantity=e[n].Qty,checkoutGridrow.taxes=e[n].TaxValue,checkoutGridrow.calculatedTaxTypeWise="[]";var o=0;String.isNullOrUndefineOrBlank(e[n].BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(e[n].BusinessTax)?"[]":JSON.stringify(e[n].BusinessTax),o=GetCalculateTaxValue(e[n].BusinessTax)),checkoutGridrow.calculatedTax=o,checkoutGridrow.serviceProviderID=e[n].ShopOwnerId,checkoutGridrow.userID=UserID,checkoutGridrow.barcodeID=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Fee,checkoutGridrow.redeemID=0,checkoutGridrow.pointsRedeem=0,checkoutGridrow.pointsGained=0,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.originalServicePriceForPackage=e[n].DisplayCalculatedFees,checkoutGridrow.discount=0,checkoutGridrow.discountedPrice=e[n].DisplayCalculatedFees,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.appointmentID=0,checkoutGridrow.FeeAccountType=String.isNullOrUndefineOrBlank(e[n].FeeAccountType)?1:e[n].FeeAccountType,t.push(checkoutGridrow)}},_onlineCheckout.isValidDailyDealFee=function(e){return Number(e||0)>0},_onlineCheckout.setdailydealFeesCheckoutData=function(t,i,n){String.isNullOrUndefineOrBlank(t.Memberships)||e.each(t.Memberships,function(e,t){if(!_onlineCheckout.isValidDailyDealFee(t.dailydealFee))return!0;checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?t.autoId:_onlineCheckout.GetMaxChkGridRowuniqueId(i),checkoutGridrow.itemID=t.MembershipID||0,checkoutGridrow.recordType=C,checkoutGridrow.itemName="Vagaro Fee",checkoutGridrow.price=t.dailydealFee,checkoutGridrow.AmountType=0,checkoutGridrow.ApplyType="",checkoutGridrow.TransactionType=0,checkoutGridrow.AutoApplyFees=0,checkoutGridrow.quantity=1,checkoutGridrow.taxes="",checkoutGridrow.calculatedTaxTypeWise="[]";checkoutGridrow.calculatedTax=0,checkoutGridrow.serviceProviderID=t.serviceProviderID,checkoutGridrow.userID=t.userID,checkoutGridrow.barcodeID=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.dailyDealFee,checkoutGridrow.redeemID=0,checkoutGridrow.pointsRedeem=0,checkoutGridrow.pointsGained=0,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.originalServicePriceForPackage=t.dailydealFee,checkoutGridrow.discount=0,checkoutGridrow.discountedPrice=t.dailydealFee,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.appointmentID=0,checkoutGridrow.FeeAccountType=1,i.push(checkoutGridrow)}),String.isNullOrUndefineOrBlank(t.Packages)||e.each(t.Packages,function(e,t){if(!_onlineCheckout.isValidDailyDealFee(t.dailydealFee))return!0;checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?t.autoId:_onlineCheckout.GetMaxChkGridRowuniqueId(i),checkoutGridrow.itemID=t.PackageID||0,checkoutGridrow.recordType=C,checkoutGridrow.itemName="Vagaro Fee",checkoutGridrow.price=t.dailydealFee,checkoutGridrow.AmountType=0,checkoutGridrow.ApplyType="",checkoutGridrow.TransactionType=0,checkoutGridrow.AutoApplyFees=0,checkoutGridrow.quantity=1,checkoutGridrow.taxes="",checkoutGridrow.calculatedTaxTypeWise="[]";checkoutGridrow.calculatedTax=0,checkoutGridrow.serviceProviderID=t.serviceProviderID,checkoutGridrow.userID=t.userID,checkoutGridrow.barcodeID=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.dailyDealFee,checkoutGridrow.redeemID=0,checkoutGridrow.pointsRedeem=0,checkoutGridrow.pointsGained=0,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.originalServicePriceForPackage=t.dailydealFee,checkoutGridrow.discount=0,checkoutGridrow.discountedPrice=t.dailydealFee,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.appointmentID=0,checkoutGridrow.FeeAccountType=1,i.push(checkoutGridrow)}),String.isNullOrUndefineOrBlank(t.Events)||e.each(t.Events,function(t,n){!String.isNullOrUndefineOrBlank(n.eventEnrollment)&&n.eventEnrollment.length>0&&e.each(n.eventEnrollment,function(t,n){if(!_onlineCheckout.isValidDailyDealFee(n.dailydealFee))return!0;checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?n.autoId:_onlineCheckout.GetMaxChkGridRowuniqueId(i),checkoutGridrow.itemID=n.EventID||0,checkoutGridrow.recordType=C,checkoutGridrow.itemName="Vagaro Fee",checkoutGridrow.price=n.dailydealFee,checkoutGridrow.AmountType=0,checkoutGridrow.ApplyType="",checkoutGridrow.TransactionType=0,checkoutGridrow.AutoApplyFees=0,checkoutGridrow.quantity=1,checkoutGridrow.taxes="",checkoutGridrow.calculatedTaxTypeWise="[]";if(checkoutGridrow.calculatedTax=0,checkoutGridrow.serviceProviderID=n.sPID,checkoutGridrow.userID=n.customerID,checkoutGridrow.barcodeID=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.dailyDealFee,checkoutGridrow.redeemID=0,checkoutGridrow.pointsRedeem=0,checkoutGridrow.pointsGained=0,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.originalServicePriceForPackage=n.dailydealFee,checkoutGridrow.discount=0,checkoutGridrow.discountedPrice=n.dailydealFee,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.appointmentID=n.appointmentID||0,checkoutGridrow.FeeAccountType=1,i.push(checkoutGridrow),n.lstAddonService&&n.lstAddonService.length>0){var o=n.sPID||0;e.each(n.lstAddonService,function(e,t){if(!_onlineCheckout.isValidDailyDealFee(t.dailydealFee))return!0;checkoutGridrow={},checkoutGridrow.uniqID=_onlineCheckout.isValidForCheckoutInvoice()?t.autoId:_onlineCheckout.GetMaxChkGridRowuniqueId(i),checkoutGridrow.itemID=t.AddonID||0,checkoutGridrow.recordType=C,checkoutGridrow.itemName="Vagaro Fee",checkoutGridrow.price=t.dailydealFee,checkoutGridrow.AmountType=0,checkoutGridrow.ApplyType="",checkoutGridrow.TransactionType=0,checkoutGridrow.AutoApplyFees=0,checkoutGridrow.quantity=1,checkoutGridrow.taxes="",checkoutGridrow.calculatedTaxTypeWise="[]";checkoutGridrow.calculatedTax=0,checkoutGridrow.serviceProviderID=o,checkoutGridrow.userID=t.customerID,checkoutGridrow.barcodeID=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.dailyDealFee,checkoutGridrow.redeemID=0,checkoutGridrow.pointsRedeem=0,checkoutGridrow.pointsGained=0,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.originalServicePriceForPackage=t.dailydealFee,checkoutGridrow.discount=0,checkoutGridrow.discountedPrice=t.dailydealFee,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.appointmentID=0,checkoutGridrow.FeeAccountType=1,i.push(checkoutGridrow)})}})})},_onlineCheckout.GetMaxChkGridRowuniqueId=function(e){var t=1;if(!String.isNullOrUndefineOrBlank(e)&&e.length>0){var i=e[e.length-1];if(!String.isNullOrUndefineOrBlank(i.uniqID)&&i.uniqID>0&&null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&onlineShoppingCart.BusinessFee.some(function(e){return!0===e.isGCApply&&null!=e.GCDetail&&e.GCDetail.length>0}))return i.uniqID;t=e.keySort({uniqID:"desc"})[0].uniqID+1}return t},_onlineCheckout.getUserGCDetail=function(t){if(ShowLoader(!0),null!=onlineShoppingCart){if(1==isCheckInApp&&(onlineShoppingCart.loginUserId=glbDataCheckIn.scanUserID),void 0===onlineShoppingCart.loginUserId&&0==isCheckInApp)return showCommonLoginPopup(),!1;var i=e("<XMLDocument/>");i.append(_vgClassSessionSelection.createXmlElement("UsersDetail"));var n=_vgClassSessionSelection.createXmlElement("User");"undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget()&&void 0!==onlineShoppingCart.loginUserId?n.append(_vgClassSessionSelection.createXmlElement("userid",parseInt(onlineShoppingCart.loginUserId))):n.append(_vgClassSessionSelection.createXmlElement("userid",glbEncryptUserIdWithSafeURL)),n.append(_vgClassSessionSelection.createXmlElement("email","")),n.append(_vgClassSessionSelection.createXmlElement("isloginuser",!0)),n.append(_vgClassSessionSelection.createXmlElement("encryptuserid",glbEncryptUserIdWithSafeURL)),i.find("UsersDetail").append(n);for(var o=_vgClassSessionSelection.ManageEventTempAndRealData(!0,!0,!1),a=0;a<=o.length-1;a++){if(parseInt(onlineShoppingCart.loginUserId)!=parseInt(o[a].customerID))(n=_vgClassSessionSelection.createXmlElement("User")).append(_vgClassSessionSelection.createXmlElement("userid",parseInt(o[a].customerID))),n.append(_vgClassSessionSelection.createXmlElement("email",o[a].cUserEmail)),i.find("UsersDetail").append(n)}var c=e("<XMLDocument/>"),d="",u="";if(null!=onlineShoppingCartmain.Inventories&&onlineShoppingCartmain.Inventories.length>0){var p=_vgClassSessionSelection.createXmlElement("itms");for(a=0;a<onlineShoppingCartmain.Inventories.length;a++){(d=_vgClassSessionSelection.createXmlElement("itm")).append(_vgClassSessionSelection.createXmlElement("ity",1==onlineShoppingCartmain.Inventories[a].IsPartial?_PackageMembership.PartialProduct:_PackageMembership.Product)),u=_vgClassSessionSelection.createXmlElement("ns");var h=_vgClassSessionSelection.createXmlElement("n",onlineShoppingCartmain.Inventories[a].ProductName,!0);u.append(h),d.append(u),p.append(d)}c.append(p)}var m=e("<XMLDocument/>"),g=e("<XMLDocument/>");if(null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0){m.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",2)).append(_vgClassSessionSelection.createXmlElement("ns"))));for(a=0;a<onlineShoppingCartmain.Events.length;a++){var v=_vgClassSessionSelection.createXmlElement("n",onlineShoppingCartmain.Events[a].eventName.trim());m.find("ns").append(v)}var f=!0;for(a=0;a<onlineShoppingCartmain.Events.length;a++)e.each(onlineShoppingCartmain.Events[a].eventEnrollment,function(t,i){null!=i.lstAddonService&&null!=i.lstAddonService&&i.lstAddonService.length>0&&(f&&g.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",8)).append(_vgClassSessionSelection.createXmlElement("ns")))),e.each(i.lstAddonService,function(e,t){f&&(f=!1);var i=_vgClassSessionSelection.createXmlElement("n",t.ServiceTitle.trim());g.find("ns").append(i)}))})}var C=e("<XMLDocument/>");if(_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCartmain.ServiceInvoice&&onlineShoppingCartmain.ServiceInvoice.length>0){var S=_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",1)).append(_vgClassSessionSelection.createXmlElement("ns"));for(a=0;a<onlineShoppingCartmain.ServiceInvoice.length;a++)if(19!=onlineShoppingCartmain.ServiceInvoice[a].recordType){var y=_vgClassSessionSelection.createXmlElement("n",onlineShoppingCartmain.ServiceInvoice[a].servicename.trim());S.find("ns").append(y)}C.append(_vgClassSessionSelection.createXmlElement("itms").append(S));var b=onlineShoppingCartmain.ServiceInvoice.filter(function(e){return 19==e.recordType});if(!String.isNullOrUndefineOrBlank(b)&&b.length>0){for(var k=_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",7)).append(_vgClassSessionSelection.createXmlElement("ns")),_=0;_<b.length;_++){var D=_vgClassSessionSelection.createXmlElement("n",b[_].servicename.trim());k.find("ns").append(D)}C.find("itms").length>0&&C.append(C.find("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(k.html())))}}c.find("itms").length>0?(m.find("itms").length>0&&c.find("itms").append(m.find("itms").html()),_onlineCheckout.isValidForCheckoutInvoice()&&C.find("itms").length>0&&c.find("itms").append(C.find("itms").html()),g.find("itms").length>0&&c.find("itms").append(g.find("itms").html())):m.find("itms").length>0?(c=m,_onlineCheckout.isValidForCheckoutInvoice()&&C.find("itms").length>0&&c.find("itms").append(C.find("itms").html()),g.find("itms").length>0&&c.find("itms").append(g.find("itms").html())):_onlineCheckout.isValidForCheckoutInvoice()&&C.find("itms").length>0?(c=C,g.find("itms").length>0&&c.find("itms").append(g.find("itms").html())):g.find("itms").length>0&&(c=g);var I=!1;!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Events)&&isCCRequiredForOnlineClass&&(I=!0);var w=!1,P=!1;"undefined"!=typeof IsClassReschedule&&"true"==IsClassReschedule.toLowerCase()&&"undefined"!=typeof IsPaid&&"true"==IsPaid.toString().toLowerCase()?w=!1:String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Events)||e.grep(onlineShoppingCartmain.Events,function(t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&e.grep(t.eventEnrollment,function(e){1==e.StreamingStatus&&1==_onlineCheckout.IsCCSupportedCountry()&&(w=!0,I=!0),String.isNullOrUndefineOrBlank(e.IsFromHomePage)||1!=e.IsFromHomePage||(P=!0)})});var A={};A.userData=i.html(),A.businessID=onlineShoppingCart.BusinessID,A.productList=c.html(),A.isGetDepositsConfig=I,A.isZoomEvents=w,"undefined"==typeof PromotionID||String.isNullOrUndefineOrBlank(PromotionID)?A.promotionID=0:A.promotionID=parseInt(PromotionID),A.isWebsiteBuilder=void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication||"undefined"!=typeof vgAppicationType&&1==vgAppicationType;var T=new vagaro.ajax;T.datamodel.Token=ApiURLEnumOnlineCheckout.getgcpackageandpointforonlinecheckout,T.datamodel.IsNewVagaroAPI=!0,T.datamodel.callback=function(i){if(ShowLoader(!1),void 0!==i.IsCheckForVagaroAppApple&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&void 0!==i.IsCheckForVagaroAppApple){var n=_onlineCheckout.getiOSCustomerAppVersion()+"~false";i.IsCheckForVagaroAppApple.indexOf(n)>-1&&(i.depositsClassConfigForCheckout.isCCRequiredForOnlineClass=!1,i.depositsClassConfigForCheckout.depositsPer=0,IsCCCapturedAllowed="false")}if(_onlineCheckout.IsAnyDailyDealInCart()&&(i.lstUserListForCheckout?.forEach(e=>{e.pointsBalance=0}),i.lstGcAndPackagesForCheckout=e.grep(i.lstGcAndPackagesForCheckout||[],function(e){return e&&1==e.isPackage})),IsFMBEnableForBusiness=i.IsFMBEnableForBusiness,onlineShoppingCartmain.UsersPoints=i.lstUserListForCheckout,onlineShoppingCartmain.IsPromotionEnable=i.IsPromotionEnable,onlineShoppingCart.IsPromotionEnable=i.IsPromotionEnable,onlineShoppingCart.IsDailyDealEnable=i.depositsClassConfigForCheckout.IsDailyDealEnable,onlineShoppingCartmain.IsEnableVCFFee=i.depositsClassConfigForCheckout.IsEnableVCFFee,onlineShoppingCartmain.IsDailyDealEnable=i.depositsClassConfigForCheckout.IsDailyDealEnable,onlineShoppingCart.lstPromotionData=[],onlineShoppingCart.lstPromoDetails=[],onlineShoppingCartmain.DepositsPer=i.depositsClassConfigForCheckout.depositsPer,onlineShoppingCartmain.DepositsLimit=i.depositsClassConfigForCheckout.depositsLimit,onlineShoppingCartmain.IsCardNotPresent=i.depositsClassConfigForCheckout.IsCardNotPresent,onlineShoppingCartmain.DepositAmtType=i.depositsClassConfigForCheckout.IsClsDepositAmtType,onlineShoppingCartmain.TipOption=i.depositsClassConfigForCheckout.TipOption,onlineShoppingCartmain.TipType=i.depositsClassConfigForCheckout.TipType,_onlineCheckout.VPLUserBankDetails=onlineShoppingCartmain.VPLUserBankDetails=i.lstVPLUserAccount,0!=i.IsDepositNoshowFeatureOn||_onlineCheckout.isValidForCheckoutInvoice()||(onlineShoppingCartmain.TipOption=""),onlineShoppingCartmain.IsFullDeposit=!1,_onlineCheckout.isValidForCheckoutInvoice()||void 0===onlineShoppingCartmain.TipOption||null==onlineShoppingCartmain.TipOption||""==onlineShoppingCartmain.TipOption||"0"==onlineShoppingCartmain.TipOption||(onlineShoppingCart.tipValue=0,e("#divTip").show(),e("#divfinalCheckoutTipAmount").html(""),e("#divfinalCheckoutTipAmount").html(currencysymbol+"0.00"),e("#divfinalCheckoutTipAmount").hide(),e("#txtOnlineCustomerTip").hide(),e("#dvTipBlock").hide("")),void 0===s&&(s=isCCRequiredForOnlineClass,r=IsOnLineShoppingCart,l=t),w){var o=i.depositsClassConfigForCheckout.isCCRequiredForOnlineClass?"True":"False";i.depositsClassConfigForCheckout.isCCRequiredForOnlineClass&&(isCCRequiredForOnlineClass=o,IsOnLineShoppingCart=o,t=!1)}else isCCRequiredForOnlineClass=s,IsOnLineShoppingCart=r,t=l;if(1==P&&(t=!1),_onlineCheckout.PromoBox(),onlineShoppingCartmain.objGcPackagePointAndUserTaxDetail=e.extend(!0,[],i),1==t)_onlineCheckout.isConsiderForms&&"True"==e("#hdnIsFormsEnable").val()&&"false"==IsClassReschedule.toLowerCase()?(_onlineCheckout.isFormsDirectClass=!0,_onlineCheckout.GetFormsByIds(),_onlineCheckout.isConsiderForms=!1):_onlineCheckout.DirectClassCheckout();else{("true"==isCCRequiredForOnlineClass.toLowerCase()||"true"==IsOnLineShoppingCart.toLowerCase()&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0)&&_onlineCheckout.BindPaymentOption(i),_onlineCheckout.initWebFlowtab(),_onlineCheckout.ApplyDiscounts(i.lstGcAndPackagesForCheckout,i.lstUserListForCheckout,i.lstMembershipForCheckout,i.IsPromotionEnable);var a=!1;!String.isNullOrUndefineOrBlank(onlineShoppingCart)&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.GiftCertificates)&&onlineShoppingCart.GiftCertificates.length>0&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Packages)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Memberships)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&String.isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&(a=!0),_onlineCheckout.isConsiderForms&&"True"==e("#hdnIsFormsEnable").val()&&"false"==IsClassReschedule.toLowerCase()&&0==a&&(_onlineCheckout.isConsiderForms=!1,_onlineCheckout.isFormsDirectClass=!1,_onlineCheckout.GetFormsByIds())}if(_onlineCheckout.IsSelectGCEmployeeForWidget(),void 0===_onlineCheckout.IsMemPackageUpSell||1!=_onlineCheckout.IsMemPackageUpSell&&1!=_shopdetail.IsMemPkgReqToBook||_shopdetail.GetMembershipList(_onlineCheckout.ShoppingCartItemIds(!1,2,!0),onlineShoppingCart.loginUserId,!0,_onlineCheckout.ShoppingCartItemIds(!1,3)),null!=_onlineCheckout._fmbTipRestore){var c=_onlineCheckout._fmbTipRestore;_onlineCheckout._fmbTipRestore=null;var d=_onlineCheckout.parseTodecimal(c.tipValue,2);if(d>0&&!_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==onlineShoppingCartmain.TipOption&&null!=onlineShoppingCartmain.TipOption&&""!=onlineShoppingCartmain.TipOption&&"0"!=onlineShoppingCartmain.TipOption){_onlineCheckout.ShowTipOptions(),onlineShoppingCart.tipValue=d,onlineShoppingCart.tipPercent=c.tipPercent,e("#lstTipTabList .tip-tab").removeClass("active");var u=e("#lstTipTabList .tip-tab").filter(function(){var t=e(this).attr("tip-percentage");return null!=t&&"0"!=t&&parseFloat(t)==parseFloat(c.tipPercent)}).first();c.tipPercent>0&&u.length>0?(u.addClass("active"),e(".tipBlock").hide()):(e("#lstTipTabList .tip-tab[tip-percentage='0']").addClass("active"),e(".tipBlock").show(),e("#txtOnlineCustomerTip").val(d.toFixed(2)).show()),e("#divfinalCheckoutTipAmount").show(),_onlineCheckout.displayFinalCalculatedPrice(),parseFloat(onlineShoppingCart.tipValue)>0&&_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout"),_onlineCheckout.IsVCFEnable()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.ApplyTip),_onlineCheckout.displayFinalCalculatedPrice())}}},T.datamodel.data=A,T.datamodel.Error=function(e){window.location.reload(),ShowLoader(!1),1==t?_onlineCheckout.DirectClassCheckout():_onlineCheckout.checkoutGotoNextStep(!1)},T.Post()}else ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},_onlineCheckout.ApplyDiscounts=function(t,i,n,o,a){onlineShoppingCart=e.extend(!0,{},onlineShoppingCartmain),onlineShoppingCart.FinalCCAmount=0,onlineShoppingCart.ccAmt=0,onlineShoppingCart.amtPaid=0,onlineShoppingCart.tax=0,onlineShoppingCart.Rtax=0,onlineShoppingCart.taxdifference=0,onlineShoppingCart.gcAmt=0,onlineShoppingCart.RedeemedByGCtemp=[],onlineShoppingCart.RedeemedByGC=[],onlineShoppingCart.shippingSurcharge=0,onlineShoppingCart.PackageAmount=0,onlineShoppingCart.tipValue=0,onlineShoppingCart.depositTotal=0,onlineShoppingCart.classSubTotal=0,onlineShoppingCart.classTax=0,onlineShoppingCart.classGCUsed=0,onlineShoppingCart.classPackageUsed=0,onlineShoppingCart.classFinalTotal=0,onlineShoppingCart.discount=0,onlineShoppingCart.lstMembership=n,onlineShoppingCart.lstMembershipOld=JSON.parse(JSON.stringify(n)),onlineShoppingCart.classdiscount=0,onlineShoppingCart.IsPromotionEnable=o,onlineShoppingCart.lstPromotionData=[],onlineShoppingCart.lstPromoDetails=[],onlineShoppingCart.lstGCPkgData=JSON.parse(JSON.stringify(t)),!String.isNullOrUndefineOrBlank(onlineShoppingCart.lstGCPkgData)&&onlineShoppingCart.lstGCPkgData.length>0&&e.each(onlineShoppingCart.lstGCPkgData,function(e,t){t.ResetcurrentBalance=t.currentBalance}),onlineShoppingCart.DepositsRemaining=0,onlineShoppingCart.InvoiceDepositsRemaining=0,onlineShoppingCart.FeeDepositsRemaining=0,onlineShoppingCart.FeeTaxDepositsRemaining=0,onlineShoppingCart.PartialPrice=0,e("#divGiftCertificateCart").show(),1==_onlineCheckout.IsClassBookingOnly(!0)&&"true"!=isCCRequiredForOnlineClass.toLowerCase()||_onlineCheckout.createGiftCertificates(onlineShoppingCart.lstGCPkgData),e.grep(onlineShoppingCart.UsersPoints,function(e){e.userId==onlineShoppingCart.loginUserId&&e.userId>0&&(onlineShoppingCart.loginUserEmail=e.emailId)});var s=null!=a&&void 0!==a?a.giftCertificateNo:"",r=e.grep(onlineShoppingCart.lstGCPkgData,function(e,t){return!(1!=e.eventType&&7!=e.eventType||""!=s&&s==e.giftCertificateNo)}),l=e.grep(onlineShoppingCart.lstGCPkgData,function(e,t){return!(1!=e.eventType&&7!=e.eventType&&2!=e.eventType||""!=s&&s==e.giftCertificateNo)});if(null!=r&&r.length>0){var p={serviceID:"desc",GiftCertificateAmt:"asc"};r.keySort(p),null!=a&&void 0!==a&&null==a.serviceID&&r.splice(0,0,a)}else null!=a&&void 0!==a&&null==a.serviceID&&r.splice(0,0,a);if(_onlineCheckout.ApplyDailyDealONPackages(),_onlineCheckout.ApplyDailyDealONMemberships(),_onlineCheckout.ApplyDailyDealONGC(),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0){_onlineCheckout.isValidForCheckoutInvoice()&&_onlineCheckout.AddInvoiceDiscount(onlineShoppingCart.ServiceInvoice,m);var v=!1,f=e.grep(onlineShoppingCart.lstGCPkgData,function(e,t){return 1==e.isPackage&&(0==e.isCustomPackage||1==e.isCustomPackage&&null==e.serviceID)&&(1==e.isCustomPackage&&null==e.serviceID&&0==v&&(v=!0),!0)});if(null!=f&&f.length>0){p={expiresOn:"asc",quantity:"asc"};f.keySort(p);var C=[];1==v&&(e.grep(f,function(t){C.push(t);var i=e.grep(onlineShoppingCart.lstGCPkgData,function(e){return 1==e.isPackage&&1==e.isCustomPackage&&t.giftCertificateID==e.giftCertificateID&&null!=e.serviceID});i.length>0&&(C=C.concat(i))}),f=C)}_onlineCheckout.ApplyPackageOnServices(onlineShoppingCart.ServiceInvoice,f),_onlineCheckout.ApplyPointsONServices(onlineShoppingCart.ServiceInvoice,onlineShoppingCart.UsersPoints),_onlineCheckout.ApplyMembershipONServices(onlineShoppingCart.ServiceInvoice,n),_onlineCheckout.calculateDepositsOnInvoice(!0);var S=e.grep(r,function(e,t){return!e.isPackage&&null==e.serviceID||!e.isPackage&&null!=e.serviceID});if(null!=S&&S.length>0){p={serviceID:"desc",serviceName:"desc"};S.keySort(p)}_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.ServiceInvoice,S,m),_onlineCheckout.calculateDepositsOnInvoice(!1)}if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&(_onlineCheckout.isValidForCheckoutInvoice()&&_onlineCheckout.AddInvoiceDiscount(onlineShoppingCart.Memberships,u),_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.Memberships,r,u)),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&(_onlineCheckout.isValidForCheckoutInvoice()&&_onlineCheckout.AddInvoiceDiscount(onlineShoppingCart.GiftCertificates,d),_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.GiftCertificates,r,d)),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&(_onlineCheckout.isValidForCheckoutInvoice()&&_onlineCheckout.AddInvoiceDiscount(onlineShoppingCart.Packages,h),_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.Packages,r,h)),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0){_onlineCheckout.isValidForCheckoutInvoice()&&_onlineCheckout.AddInvoiceDiscount(onlineShoppingCart.Inventories,c);var y=_onlineCheckout.ApplyPointsONProduct(onlineShoppingCart.Inventories,onlineShoppingCart.UsersPoints);if(_onlineCheckout.IsPartialPointAllowed){var b=e.grep(onlineShoppingCart.Inventories,function(e){return void 0!==e.IsPartialPoint&&1==e.IsPartialPoint});null!=b&&b.length>0&&_onlineCheckout.ApplyGCONAllItems(b,r,c)}var k=e.grep(y,function(e){return 1==String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)});null!=k&&k.length>0&&(_onlineCheckout.ApplyMembershipONProduct(k,n),_onlineCheckout.ApplyGCONAllItems(k,l,c)),e.each(onlineShoppingCart.Inventories,function(t,i){if(!String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)){i.isPresetApply=!1,i.isGCApply=!1,i.isMembershipApply=!1,i.isPointApply=!1,i.isPointApplyPartial=!1,i.membershipName="",i.Price=0;var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==i.InventoryId}),o=0,a=[],s=[],r=!1,l=!1;if(e.each(n,function(e,t){void 0!==t.isPointApply&&0==t.isPointApply?i.Price+=t.Price:void 0!==t.isPointApply&&1==t.isPointApply&&1==t.IsPartialPoint?i.Price+=t.Price-t.PartialPrice:o+=1,void 0!==t.isPointApply&&1==t.isPointApply&&1==_onlineCheckout.IsPartialPointAllowed&&(i.pointsRedeem+=t.pointsRedeem),i.isPresetApply=1==i.isPresetApply||t.isPresetApply,i.isGCApply=1==i.isGCApply||t.isGCApply,i.isMembershipApply=1!=t.isPackageApplied&&(1==i.isMembershipApply||t.isMembershipApply),i.isPackageApplied=1==i.isPackageApplied||t.isPackageApplied,t.isPackageApplied&&(r=!0),t.isMembershipApply&&(l=!0),t.isMembershipApply&&-1==a.indexOf(t.membershipName)&&a.push(t.membershipName),t.isPackageApplied&&-1==s.indexOf(t.membershipName)&&s.push(t.membershipName)}),r&&null!=s&&s.length>0){var c=s.join();i.membershipName=c,i.packageName=c,i.isPackageBundleApplied=!0}if(l&&null!=a&&a.length>0){var d=a.join();i.membershipName=d,i.isMembershipBundleApplied=!0}n.length==o?i.isPointApply=!0:o>0&&(i.isPointApplyPartial=!0)}})}var _=!1;if(null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){v=!1;var D=e.grep(onlineShoppingCart.lstGCPkgData,function(e,t){return(2==e.eventType||8==e.eventType)&&(0==e.isCustomPackage||1==e.isCustomPackage&&null==e.serviceID)&&(1==e.isCustomPackage&&null==e.serviceID&&0==v&&(v=!0),!0)}),I=[];if(D.length>0&&(1==_onlineCheckout.IsCCDetailEnable()||1==_onlineCheckout.IsUpSellMemPkgAdd)){p={isPackage:"desc",expiresOn:"asc",quantity:"asc"};D.keySort(p),1==v?e.grep(D,function(t){I.push(t);var i=e.grep(onlineShoppingCart.lstGCPkgData,function(e){return(2==e.eventType||8==e.eventType)&&1==e.isPackage&&1==e.isCustomPackage&&t.giftCertificateID==e.giftCertificateID&&null!=e.serviceID});i.length>0&&(I=I.concat(i))}):I=D}_onlineCheckout.ApplyPointsONEvents(onlineShoppingCart.Events,onlineShoppingCart.UsersPoints,I),I.length>0?onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events,!0,I):onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events),_onlineCheckout.ApplyDailyDealONEvents(),_onlineCheckout.ApplyMembershipONEvents(onlineShoppingCart.Events,n),_onlineCheckout.calculateDepositsOnEvents(),_onlineCheckout.ApplyPriceBaseGCOnEvents(r,!1);e.grep(onlineShoppingCart.Events,function(t,i){return e.grep(t.eventEnrollment,function(e,t){return 4==e.paidType}).length>0&&(_=!0),_})}if(null!=onlineShoppingCart.ServiceInvoice&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){e.paidType==_onlineCheckout.arrpaidType.Paid&&(_=!0)}),onlineShoppingCartmain.IsFullDeposit=_,null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&(e.grep(onlineShoppingCart.BusinessFee,function(e){1==e.FeeType&&(e.ActualPrice=0,e.ActualTax=0,e.RemainingPrice=0,e.RemainingTax=0,e.CalculatedTax=0,e.CalculatedFeesForClass=0,e.CalculatedTaxForClass=0)}),_onlineCheckout.ApplyMultipleFeesonAllItems(0),_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.BusinessFee,r,g)),onlineShoppingCart.tax>0){var w=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax,2),P=onlineShoppingCart.tax;P!=w&&(onlineShoppingCart.taxdifference=_onlineCheckout.parseTodecimal(P-w,2),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax-onlineShoppingCart.taxdifference,2),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid-onlineShoppingCart.taxdifference,2),onlineShoppingCart.ccAmt>0&&onlineShoppingCart.ccAmt>onlineShoppingCart.taxdifference?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-onlineShoppingCart.taxdifference,2):onlineShoppingCart.gcAmt>0&&onlineShoppingCart.gcAmt>onlineShoppingCart.taxdifference&&(onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt-onlineShoppingCart.taxdifference,2)))}if(onlineShoppingCart.RedeemedByGCtemp.length>0){onlineShoppingCart.RedeemedByGC=[];var A=e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){return 1!=e.IsClass}),T=A.uniqueObjects(["GCId"]);e.grep(T,function(t){_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg==t.Type?(objGC={},objGC.giftcertificateId=t.giftcertificateId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=0,objGC.uniqID=t.uniqID,objGC.RedeemServiceId=t.serviceId,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,e.grep(A,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)):_onlineCheckout.CheckoutBarcodeCodePrepayOnline.srvcGC==t.Type?(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=0,objGC.uniqID=t.uniqID,objGC.RedeemServiceId=t.serviceId,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,e.grep(A,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),objGC.GCredeemAmtForDisc=objGC.redeemAmt,onlineShoppingCart.RedeemedByGC.push(objGC)):(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=0,objGC.redeemAmt=0,objGC.uniqID=0,objGC.AppointmentID=0,objGC.Type="GC",e.grep(A,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.GCAmount,3))}),onlineShoppingCart.RedeemedByGC.push(objGC))})}_onlineCheckout.PaymentOptionSelectDeselect(),_onlineCheckout.checkoutGotoNextStep(!1)},_onlineCheckout.calculateDepositsOnInvoice=function(t){var i=0;null!=onlineShoppingCart.ServiceInvoice&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){t&&(e.OriginalpaidType=e.paidType),e.paidType=_onlineCheckout.arrpaidType.Paid,void 0!==e.isPackageApplied&&0==e.isPackageApplied&&(void 0!==e.isPointApply&&0==e.isPointApply||e.IsPartialPoint)&&0==e.isServiceBaseGC&&e.OriginalpaidType==_onlineCheckout.arrpaidType.OfflineDeposit&&e.depositsPercentage>0&&(onlineShoppingCartmain.DepositsPer=e.depositsPercentage,e.depositsPaid=_onlineCheckout.parseTodecimal(e.price*e.depositsPercentage/100,2),e.paidType=_onlineCheckout.arrpaidType.OfflineDeposit,i=_onlineCheckout.parseTodecimal(i+_onlineCheckout.parseTodecimal(e.price+e.calculatedTax-e.depositsPaid,2),2)),e.BusinessTax=String.isNullOrUndefineOrBlank(e.Taxes)||"[]"==e.Taxes?"[]":JSON.parse(e.Taxes),void 0!==e.deposit&&null!=e.deposit&&e.deposit>0?1==onlineShoppingCart.IsIncludeTaxInOnlinePricing&&e.discount>0?e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.ServiceOrginalPrice-e.discount,e):e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.ServiceOrginalPrice,e):e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.price,e)}),onlineShoppingCart.InvoiceDepositsRemaining=i},_onlineCheckout.CalculateApplyPointsProductPrice=function(e,t){return 1==parseInt(e.Quantity)?t*e.Price/e.OriginalPointsRedeem:t*e.Price/(e.OriginalPointsRedeem*parseInt(e.Quantity))},_onlineCheckout.ApplyPointsONProduct=function(t,i){var n=[],o=0,a=e.grep(onlineShoppingCart.UsersPoints,function(e){return e.userId==onlineShoppingCart.loginUserId&&e.userId>0});return null!=a&&null!=a&&a.length>0&&(a=a[0],o=a.pointsBalance),e.grep(t,function(e){_onlineCheckout.isValidForCheckoutInvoice()?void 0!==e.isPresetApply&&1==e.isPresetApply&&(e.discount=e.discount):e.discount=0,_onlineCheckout.isValidForCheckoutInvoice()||!String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)||!String.isNullOrUndefineOrBlank(e.MasterInventoryId)&&e.MasterInventoryId>0?e.OriginalPrice=e.SellingPrice:void 0!==e.OriginalPointsRedeem&&e.OriginalPointsRedeem>0?e.OriginalPrice=parseFloat(e.Price):e.OriginalPrice=e.SellingPrice,1==e.IsFreeShipping&&0==e.MasterInventoryId&&(onlineShoppingCart.shippingSurcharge=_onlineCheckout.parseTodecimal(onlineShoppingCart.shippingSurcharge+e.Quantity*e.ShippingSurcharge,2)),void 0===e.OriginalPointsRedeem&&(e.OriginalPointsRedeem=e.pointsRedeem);var t=Math.round(e.OriginalPointsRedeem*(e.IsPartial?_onlineCheckout.parseTodecimal(e.Quantity,2):parseInt(e.Quantity)));if(e.originalpointsGained=e.pointsGained,t>0&&o>=t&&o>0)_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==e.isPresetApply&&1==e.isPresetApply?(e.isPointApply=!1,e.pointsRedeem=0):(e.discount=0,_onlineCheckout.isValidForCheckoutInvoice()&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount-e.originalDiscount,2)),e.isPointApply=!0,e.isPackageApplied=!1,e.pointsRedeem=t,e.pointsGained=0,o=parseInt(o-t),a.pointsBalance=o,onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(e.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(e.pointsRedeem),e.redeemAmt=0,e.redeemTax=0,e.ActualPrice=parseFloat(e.Price),e.ActualTax=parseFloat(e.calculatedTax),e.IsPartialPoint=!1);else if(_onlineCheckout.IsPartialPointAllowed&&t>0&&o>0)if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==e.isPresetApply&&1==e.isPresetApply)e.isPointApply=!1,e.pointsRedeem=0;else{parseInt(t-o);var i=parseInt(o);e.discount=0,_onlineCheckout.isValidForCheckoutInvoice()&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount-e.originalDiscount,2)),e.isPointApply=!0,e.isPackageApplied=!1,e.pointsRedeem=i,e.pointsGained=0,o=parseInt(o-i),a.pointsBalance=o,onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(e.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(e.pointsRedeem),e.redeemAmt=0,e.redeemTax=0,e.IsPartialPoint=!0,e.PartialPrice=parseFloat(_onlineCheckout.CalculateApplyPointsProductPrice(e,i)),e.ActualPrice=_onlineCheckout.parseTodecimal(parseFloat(e.Price-e.PartialPrice),2),e.ActualTax=_onlineCheckout.parseTodecimal(e.ActualPrice*e.Tax/100,3),e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.ActualPrice,e)}else e.isPointApply=!1,e.pointsRedeem=0,e.IsPartialPoint=!1,e.PartialPrice=0,e.ActualPrice=0;n.push(e)}),n},_onlineCheckout.ApplyMembershipONProduct=function(t,i){e.grep(t,function(t){null!=(i=e.grep(i,function(e){return e.ItemType==_PackageMembership.Product||e.ItemType==_PackageMembership.PartialProduct}))&&i.length>0&&e.each(i,function(n,o){if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==t.isPresetApply&&1==t.isPresetApply&&0==o.IsAllowPreSetDiscount)return!1;if(o.ServiceProductName==t.ProductName&&(o.VisitRemaining>0&&t.Quantity<=o.VisitRemaining||-1==o.VisitRemaining)){if(1==t.isMembershipApply&&_onlineCheckout.RemoveDicount(c,k,t.autoId),t.isMembershipApply=!0,String.isNullOrUndefineOrBlank(t.isPointApply)||1!=t.isPointApply||void 0!==onlineShoppingCart.UsersPoints&&null!=onlineShoppingCart.UsersPoints&&"undefined"!=onlineShoppingCart.UsersPoints[0].pointsBalance&&(onlineShoppingCart.UsersPoints[0].pointsBalance+=t.OriginalPointsRedeem),t.isPointApply=!1,t.isPackageApplied=!1,_onlineCheckout.isValidForCheckoutInvoice()){if(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount-t.originalDiscount,2),t.OriginalPrice=t.SellingPrice,void 0!==t.isPresetApply&&1==t.isPresetApply&&1==o.IsAllowPreSetDiscount){var a=_onlineCheckout.parseTodecimal(t.SellingPrice*o.Discount/100,2);t.discount=_onlineCheckout.parseTodecimal(t.discount,2)+_onlineCheckout.parseTodecimal(a,2)}else t.discount=_onlineCheckout.parseTodecimal(t.SellingPrice*o.Discount/100,2);t.Price=_onlineCheckout.parseTodecimal(t.SellingPrice-t.discount,2),t.ActualPrice=_onlineCheckout.parseTodecimal(t.Price,2),t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),t.ActualTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3)}else t.discount=_onlineCheckout.parseTodecimal(t.Price*o.Discount/100,2),t.Price=_onlineCheckout.parseTodecimal(t.Price-t.discount,2),t.ActualPrice=_onlineCheckout.parseTodecimal(t.Price,2),t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),t.ActualTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3);onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+t.discount,2),o.VisitRemaining=-1==o.VisitRemaining?o.VisitRemaining:o.VisitRemaining-t.Quantity,t.RedeemBusinessId=o.BusinessID,t.VisitUsed=t.Quantity,t.Visit=o.Visit,t.ItemType=o.ItemType,t.BusinessID=onlineShoppingCart.BusinessID,t.MembershipID=o.MembershipID,t.MembershipItemId=o.MembershipItemId,t.membershipName=o.MembershipName,t.GroupId=o.GroupId,t.membershipDiscount=t.discount;var s=e.grep(i,function(e){return 0!=o.GroupId&&o.GroupId==e.GroupId&&o.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&o.BusinessID==e.BusinessID});return e.each(s,function(e,t){t.GroupId==o.GroupId&&(t.VisitRemaining=o.VisitRemaining)}),!1}})})},_onlineCheckout.ApplyPointsONServices=function(t,i){var n=0,o=e.grep(i,function(e){return e.userId==onlineShoppingCart.loginUserId&&e.userId>0});null!=o&&null!=o&&o.length>0&&(o=o[0],n=o.pointsBalance),n>0&&e.each(t,function(e,t){if(void 0!==t.isPresetApply&&0==t.isPresetApply&&void 0!==t.isPackageApplied&&0==t.isPackageApplied&&t.PromotionId<=0&&0==t.isPaid){void 0===t.pointredeemOriginal&&(t.pointredeemOriginal=t.pointredeem);var i=t.pointredeemOriginal;if(i>0&&n>=i&&n>0)n=parseInt(n-i),t.pointAssignStatus=1,t.isPointApply=!0,t.pointsRedeem=i,t.pointsGained=0,o.pointsBalance=n,onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(t.pointredeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(t.pointredeem),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount-t.originalDiscount,2),t.redeemAmt=0,t.redeemTax=0,t.Tax=0,t.price=parseFloat(0),t.IsPartialPoint=!1;else if(_onlineCheckout.IsPartialPointAllowed&&i>0&&n>0){parseInt(i-n);var a=parseInt(n);t.isPointApply=!0,t.IsPartialPoint=!0,n=parseInt(n-a),t.pointAssignStatus=1,t.pointsRedeem=a,t.pointsGained=0,o.pointsBalance=n,onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(t.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(t.pointsRedeem),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount-t.originalDiscount,2),t.PartialPrice=parseFloat(_onlineCheckout.CalculateApplyPointsClassPrice(t.price,a,t.pointredeem)),t.redeemAmt=0,t.redeemTax=0,t.price=parseFloat(t.price-t.PartialPrice),t.ActualTax=_onlineCheckout.parseTodecimal(t.price*t.tax/100,3)}else t.isPointApply=!1,t.pointsRedeem=0}})},_onlineCheckout.AddInvoiceDiscount=function(t,i){e.grep(t,function(e){i==d&&0==e.PromotionID||i==c||i==m||i==h&&0==e.PromotionID?onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.discount,2):i==u&&0==e.PromotionID&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.productDisc,2))})},_onlineCheckout.ApplyMembershipONServices=function(t,i){e.grep(t,function(t){void 0!==t.isPackageApplied&&0==t.isPackageApplied&&void 0!==t.isPointApply&&0==t.isPointApply&&0==t.isPaid&&null!=(i=e.grep(i,function(e){return 1==e.ItemType||19==e.ItemType}))&&i.length>0&&e.each(i,function(n,o){if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==t.isPresetApply&&1==t.isPresetApply&&0==o.IsAllowPreSetDiscount)return!1;if(o.ServiceProductName==t.servicename&&(o.VisitRemaining>0&&1<=o.VisitRemaining||-1==o.VisitRemaining)&&(0==t.PromotionId||1==o.isPromotionalDiscount&&0!=t.PromotionId)&&(null==o.strValidUpto||""==o.strValidUpto||null!=o.strValidUpto&&""!=o.strValidUpto&&new Date(moment(t.startTime).format("YYYY/MM/DD"))<=new Date(moment(o.strValidUpto).format("YYYY/MM/DD")))){if(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount-t.originalDiscount,2),1==o.isPromotionalDiscount&&0!=t.PromotionId){var a=_onlineCheckout.parseTodecimal(t.ServiceOrginalPrice*o.Discount/100,2);t.discount=_onlineCheckout.parseTodecimal(t.discount,2)+_onlineCheckout.parseTodecimal(a,2)}else if(void 0!==t.isPresetApply&&1==t.isPresetApply&&1==o.IsAllowPreSetDiscount){a=_onlineCheckout.parseTodecimal(t.ServiceOrginalPrice*o.Discount/100,2);t.discount=_onlineCheckout.parseTodecimal(t.discount,2)+_onlineCheckout.parseTodecimal(a,2)}else t.discount=_onlineCheckout.parseTodecimal(t.ServiceOrginalPrice*o.Discount/100,2);t.ServiceOrginalPrice<t.discount&&(t.discount=t.ServiceOrginalPrice),t.price=_onlineCheckout.parseTodecimal(t.ServiceOrginalPrice-t.discount,2),t.calculatedTax=_onlineCheckout.parseTodecimal(t.price*t.tax/100,3),t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+t.discount,2),t.ActualPrice=_onlineCheckout.parseTodecimal(t.price,2),t.ActualTax=parseFloat(t.calculatedTax),o.VisitRemaining=-1==o.VisitRemaining?o.VisitRemaining:o.VisitRemaining-1,t.RedeemBusinessId=o.BusinessID,t.VisitUsed=1,t.Visit=o.Visit,t.ItemType=1,t.isMembershipApply=!0,t.BusinessID=onlineShoppingCart.BusinessID,t.MembershipID=o.MembershipID,t.MembershipItemId=o.MembershipItemId,t.GroupId=o.GroupId,t.membershipDiscount=t.discount;var s=e.grep(i,function(e){return 0!=o.GroupId&&o.GroupId==e.GroupId&&o.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&o.BusinessID==e.BusinessID});return e.each(s,function(e,t){t.GroupId==o.GroupId&&(t.VisitRemaining=o.VisitRemaining)}),!1}})})},_onlineCheckout.ApplyPackageOnServices=function(t,i){var n=e.grep(i,function(e){return 1==e.isCustomPackage||1==e.isPackage&&null!=e.serviceID});null!=n&&n.length>0&&e.grep(t,function(t){e.grep(n,function(i){if(i.serviceName.toLowerCase().trim()==t.servicename.toLowerCase().trim()&&(i.quantity>0||1==i.isCustomPackage&&-1==i.quantity)&&(null==i.strValidUpto||""==i.strValidUpto||null!=i.strValidUpto&&""!=i.strValidUpto&&new Date(moment(i.strValidUpto).format("YYYY/MM/DD"))>=new Date(moment(t.startTime).format("YYYY/MM/DD")))&&0==t.isPaid){var o=0,a=[];void 0!==t.isPresetApply&&0!=t.isPresetApply||void 0!==t.isPointApply&&0!=t.isPointApply||void 0!==t.isPackageApplied&&0!=t.isPackageApplied||void 0!==t.isMembershipApply&&0!=t.isMembershipApply||void 0!==t.isServiceBaseGC&&0!=t.isServiceBaseGC||void 0!==t.isGCApply&&0!=t.isGCApply||!(t.PromotionId<=0)||(1==i.isCustomPackage?a=e.grep(n,function(e){if(1==e.isCustomPackage&&null==e.serviceID&&e.giftCertificateID==i.giftCertificateID)return o=0==e.quantity?0:Math.floor(parseFloat((e.currentBalance/e.quantity*100).toFixed(2)))/100,!0}):o=Math.floor(parseFloat((i.currentBalance/i.quantity*100).toFixed(2)))/100,objGC={},objGC.giftcertificateId=i.giftCertificateID,objGC.serviceId=t.serviceid,objGC.uniqID=t.AppSrNo,objGC.AppointmentID=t.appointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,objGC.GCredeemAmtForDisc=0,objGC.redeemAmt=o,1==i.isCustomPackage&&void 0!==i.serviceID&&i.serviceID>0&&(objGC.RedeemServiceId=i.serviceID),onlineShoppingCart.RedeemedByGCtemp.push(objGC),1==i.isCustomPackage?(null!=i.groupID&&0!=i.groupID&&-1!=i.quantity?e.grep(n,function(e){e.giftCertificateID==i.giftCertificateID&&e.groupID==i.groupID&&(e.quantity=e.quantity-1)}):null==i.groupID&&-1!=i.quantity&&(i.quantity=i.quantity-1),a.length>0&&-1!=i.quantity&&(a[0].currentBalance=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(a[0].currentBalance,2)-o,2),a[0].quantity=a[0].quantity-1)):(i.currentBalance=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(i.currentBalance,2)-o,2),i.quantity=i.quantity-1),t.redeemID=i.giftCertificateID,t.pointgiven=0,t.pointredeem=0,t.price=o,t.calculatedTax=0,t.priceOriginal=o,t.GCDetail=objGC,t.redeemAmount=o,t.isPackageApplied=!0,onlineShoppingCart.PackageAmount=_onlineCheckout.parseTodecimal(onlineShoppingCart.PackageAmount+o,2),_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(t.PromotionId)&&t.PromotionId>0&&(t.discount=0,onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount-t.originalDiscount,2)))}})})},_onlineCheckout.ApplyMembershipONEvents=function(t,i){var n=e.grep(i,function(e){return 2==e.ItemType||e.ItemType==v}),o=0,a=0,s=0,r=0,l=0;if(null!=n&&n.length>0){onlineShoppingCart.classdiscount=0,e.each(t,function(t,i){e.each(i.eventEnrollment,function(t,r){var l=e.grep(n,function(e){return r.customerID>0&&e.UserID>0&&(r.customerID==e.UserID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,r.customerID))||r.customerID<=0&&e.UserID>0&&r.cUserEmail==e.EmailId});e.each(l,function(t,n){if(n.ServiceProductName.toLowerCase().trim()==i.eventName.toLowerCase().trim()&&null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(r.eventDate).format("YYYY/MM/DD"))>new Date(moment(n.strValidUpto).format("YYYY/MM/DD"))&&null!=n.strAdvanceLimitDate&&""!=n.strAdvanceLimitDate&&new Date(moment(r.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strAdvanceLimitDate).format("YYYY/MM/DD"))&&0==r.IsOutsideBilling&&0==r.IsWaivedApply&&(r.strAdvanceLimitDate=n.strAdvanceLimitDate,r.IsWaivedApply=!0,r.AppliedName=n.MembershipName),_onlineCheckout.isValidForCheckoutInvoice()&&(void 0!==r.isPresetApply&&1==r.isPresetApply&&0==n.IsAllowPreSetDiscount||0!=r.PromotionID&&0==n.isPromotionalDiscount))return!1;if(1==r.isMembershipRemove&&n.ServiceProductName.toLowerCase().trim()==i.eventName.toLowerCase().trim()&&n.Discount>0&&(r.customerID>0&&n.UserID>0&&(r.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,r.customerID))||r.customerID<=0&&n.UserID>0&&r.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)){n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining>0?n.VisitRemaining-1:n.VisitRemaining;var o=e.grep(l,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});e.each(o,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)});return 1==r.isPointApply||!(null==r.gcId||0==r.gcId||r.gcId>0&&0==r.isPackage)||0==r.PromotionID&&1!=r.isPresetApply||(r.discount,r.price=r.Originalprice-r.discount,r.taxprice=_onlineCheckout.parseTodecimal(r.price*i.tax/100,3),r.actualPrice=r.price,r.actualTaxprice=r.taxprice),!1}if(r.price>0&&1!=r.isPointApply&&1!=r.isPackage&&(null==r.gcId||0==r.gcId)&&n.ServiceProductName.toLowerCase().trim()==i.eventName.toLowerCase().trim()&&n.Discount>0&&(r.customerID>0&&n.UserID>0&&(r.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,r.customerID))||r.customerID<=0&&n.UserID>0&&r.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)&&(1==_onlineCheckout.IsUpSellMemPkgAdd||"true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&(0!=r.PromotionID&&1==n.isPromotionalDiscount||0==r.PromotionID||void 0===r.PromotionID)&&0==r.isPaid&&(null==n.strValidUpto||""==n.strValidUpto||null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(r.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strValidUpto).format("YYYY/MM/DD")))){var a=parseFloat(r.Originalprice);if(_onlineCheckout.isValidForCheckoutInvoice()){if(a=parseFloat(r.Originalprice),1==n.isPromotionalDiscount&&0!=r.PromotionID){var s=_onlineCheckout.parseTodecimal(r.Originalprice*n.Discount/100,2);r.discount=_onlineCheckout.parseTodecimal(r.discount,2)+_onlineCheckout.parseTodecimal(s,2)}else if(void 0!==r.isPresetApply&&1==r.isPresetApply&&1==n.IsAllowPreSetDiscount){s=_onlineCheckout.parseTodecimal(r.Originalprice*n.Discount/100,2);r.discount=_onlineCheckout.parseTodecimal(r.discount,2)+_onlineCheckout.parseTodecimal(s,2)}else r.discount=0,r.discount=_onlineCheckout.parseTodecimal(r.Originalprice*n.Discount/100,2);r.Originalprice=a}else r.discount=r.discount+_onlineCheckout.parseTodecimal(r.Originalprice*n.Discount/100,2);a<r.discount&&(r.discount=a),r.price=_onlineCheckout.parseTodecimal(r.Originalprice-r.discount,2),a>0&&(r.taxprice=_onlineCheckout.parseTodecimal(r.price*i.tax/100,2)),r.isMembershipApply=!0,r.membershipDiscount=n.Discount,r.membershipDiscountOnReceipt=r.discount,r.membershipUniqueID=n.MembershipUniqueId,r.membershipuserid=n.UserID,n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining-1,r.RedeemBusinessId=n.BusinessID,r.BusinessID=onlineShoppingCart.BusinessID,r.MembershipID=n.MembershipID,r.MembershipItemId=n.MembershipItemId,r.membershipName=n.MembershipName,r.GroupId=n.GroupId,r.VisitRemaining=n.VisitRemaining;o=e.grep(l,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});return e.each(o,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)}),!1}if(1!=r.isMembershipApply&&0==r.isPaid)if(r.discount=0,r.isMembershipApply=!1,r.membershipDiscount=0,r.membershipUniqueID=null,1!=r.isPointApply&&(null==r.gcId||0==r.gcId||r.gcId>0&&0==r.isPackage)&&void 0!==r.PromotionID&&0!=r.PromotionID){var c=0;c=1==r.IsAmount?r.AmountValue:r.Originalprice*r.AmountValue/100,r.discount=c,r.price=r.Originalprice-c,r.taxprice=_onlineCheckout.parseTodecimal(r.price*i.tax/100,3),r.actualPrice=r.price,r.actualTaxprice=r.taxprice}else _onlineCheckout.isValidForCheckoutInvoice()&&1!=r.isPointApply&&(null==r.gcId||0==r.gcId||r.gcId>0&&0==r.isPackage)&&(r.discount=r.originalDiscount,r.price=r.Originalprice-r.discount,r.taxprice=_onlineCheckout.parseTodecimal(r.price*i.tax/100,3),r.actualPrice=r.price,r.actualTaxprice=r.taxprice)}),r.BusinessTax=_onlineCheckout.ApplyMultipleTax(r.price,r),o=_onlineCheckout.parseTodecimal(o+r.price,2),a=_shopdetail.CheckPriceWithTaxSwitch()&&_onlineCheckout.isValidForCheckoutInvoice()&&!isNullOrUndefineOrBlank(r.paidType)&&r.paidType===_onlineCheckout.arrpaidType.Deposits?_onlineCheckout.parseTodecimal(i.deposit*i.tax/100,2):_onlineCheckout.parseTodecimal(a+r.taxprice,2),r.gcId>0&&0==r.isPackage&&(s=_onlineCheckout.parseTodecimal(s+r.price,2))}),i.calssdiscountprice=0,i.addonCalssdiscountprice=0,e.each(i.eventEnrollment,function(e,t){i.calssdiscountprice+=t.discount}),i.calssdiscountprice=_onlineCheckout.parseTodecimal(i.calssdiscountprice,2);var c=_onlineCheckout.ApplyMembershipONEventsAddon(i.eventEnrollment,n);o+=c.addonTotalPrice,l+=c.addonTotalTaxPrice,r+=c.addonTotalGCUsed,i.addonCalssdiscountprice=i.addonCalssdiscountprice+c.addonDiscountprice,onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+i.calssdiscountprice+i.addonCalssdiscountprice,2)});var c=parseFloat((o+a+l-(s+r+onlineShoppingCart.classPackageUsed)).toFixed(2));onlineShoppingCart.classTax=parseFloat(a.toFixed(2)),onlineShoppingCart.classGCUsed=s+r,onlineShoppingCart.classAddonGCUsed=r,onlineShoppingCart.classAddonTotalTaxPrice=l,onlineShoppingCart.classFinalTotal=c}},_onlineCheckout.ApplyPointsONEvents=function(t,i,n){var o=e.extend(!0,[],n);e.grep(t,function(t){t.calssdiscountprice=0,t.addonCalssdiscountprice=0;var a={IsDealGCApply:!0,PerUserOneFlag:!1};e.grep(t.eventEnrollment,function(s){var r=0,l=_onlineCheckout.GetPackageList(o,t,s,a);s.OriginalpaidType=s.paidType,e.grep(i,function(e){if(s.price>0)if(s.customerID>0&&e.userId>0&&s.customerID==e.userId||s.customerID<=0&&e.userId>0&&s.cUserEmail==e.emailId){r=e.pointsBalance;var i=t.PointRedeem;if(!(i>0&&r>0&&r>=i&&("true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==s.isPaid&&0==l.length)||Number(s.dailydealFee)>0||_shopdetail.EnableFMBFee()&&null!=s.PromotionID&&Number(s.PromotionID)>0)if(!(_onlineCheckout.IsPartialPointAllowed&&i>0&&r>0&&("true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==s.isPaid&&0==l.length)||Number(s.dailydealFee)>0||_shopdetail.EnableFMBFee()&&null!=s.PromotionID&&Number(s.PromotionID)>0)s.isPointApply=!1,s.pointsRedeem=0,(void 0===s.Originalprice||String.isNullOrUndefineOrBlank(s.Originalprice))&&(s.Originalprice=parseFloat(s.price)),s.Originaltaxprice=parseFloat(s.taxprice);else{var n=parseInt(r);if(s.isPointApply=!0,s.pointsRedeem=n,(void 0===s.Originalprice||String.isNullOrUndefineOrBlank(s.Originalprice))&&(s.Originalprice=parseFloat(s.price)),1==onlineShoppingCartmain.DepositAmtType){var o=_onlineCheckout.calculatedDepositsAmount(s.Originalprice);if(s.depositsPercentage=o,(C=Math.ceil(t.PointRedeem*onlineShoppingCartmain.DepositsPer/parseFloat(s.Originalprice)))>r){s.pointsRedeem=r,s.PartialPrice=_onlineCheckout.parseTodecimal(_onlineCheckout.CalculateApplyPointsClassPrice(s.price,s.pointsRedeem,t.PointRedeem),2);var a=_shopdetail.parseTodecimal(onlineShoppingCartmain.DepositsPer-s.PartialPrice);s.depositsPaid=a,s.price=_onlineCheckout.parseTodecimal(parseFloat(s.price-s.PartialPrice),2),s.IsDepositsOver=!1,s.IsPartialDeposits=!0}else s.depositsPaid=onlineShoppingCartmain.DepositsPer,s.pointsRedeem=C,s.PartialPrice=s.depositsPaid,s.price=_onlineCheckout.parseTodecimal(parseFloat(s.price-s.PartialPrice),2),s.IsDepositsOver=!0,s.IsPartialDeposits=!0}else if(0==onlineShoppingCartmain.DepositAmtType&&100!=onlineShoppingCartmain.DepositsPer&&s.price>0){var c=s.TaxValue,d=0,u=0;if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&""!=c&&null!=c&&"0"!=c){var p=c.split(","),h=[];if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.TaxesValues&&""!=_shopdetail.TaxesValues&&null!=_shopdetail.TaxesValues&&null!=p&&p.length>0){for(var m=0;m<p.length;m++){var g=JSON.parse(_shopdetail.TaxesValues).Taxes;if(g.length>0)for(var v=0;v<g.length;v++)if(g[v].BusinessTaxID==p[m]){h.push(g[v].Tax);break}}if(h.length>0){for(m=0;m<h.length;m++)u+=h[m];d=CalAccPriceWithTax(s.Originalprice,u)}}}else d=s.Originalprice;var f=_onlineCheckout.calculatedDepositsAmount(d),C=Math.ceil(t.PointRedeem*f/parseFloat(s.Originalprice));if(s.depositsPercentage=onlineShoppingCartmain.DepositsPer,C>r){s.pointsRedeem=r,s.PartialPrice=_onlineCheckout.parseTodecimal(_onlineCheckout.CalculateApplyPointsClassPrice(s.price,s.pointsRedeem,t.PointRedeem),2);a=_shopdetail.parseTodecimal(f-s.PartialPrice);s.depositsPaid=a,s.price=_onlineCheckout.parseTodecimal(parseFloat(s.price-s.PartialPrice),2),s.IsDepositsOver=!1,s.IsPartialDeposits=!0}else s.depositsPaid=f,s.pointsRedeem=C,s.PartialPrice=f,s.price=_onlineCheckout.parseTodecimal(parseFloat(s.price-s.PartialPrice),2),s.IsDepositsOver=!0,s.IsPartialDeposits=!0}else s.PartialPrice=_onlineCheckout.parseTodecimal(_onlineCheckout.CalculateApplyPointsClassPrice(s.price,n,t.PointRedeem),2),s.price=_onlineCheckout.parseTodecimal(parseFloat(s.price-s.PartialPrice),2);e.pointsBalance=parseInt(r-s.pointsRedeem),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(s.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(s.pointsRedeem),s.Originaltaxprice=parseFloat(s.taxprice),s.IsPartialPoint=!0,1==_onlineCheckout.isValidForCheckoutInvoice()?s.taxprice=0:s.taxprice=_onlineCheckout.parseTodecimal(s.price*t.tax/100,3)}else s.isPointApply=!0,s.pointsRedeem=i,e.pointsBalance=parseInt(r-i),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(s.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(s.pointsRedeem),(void 0===s.Originalprice||String.isNullOrUndefineOrBlank(s.Originalprice))&&(s.Originalprice=parseFloat(s.price)),s.price=0,s.Originaltaxprice=parseFloat(s.taxprice),s.taxprice=0,s.actualPrice=0,s.actualTaxprice=0,s.IsPartialPoint=!1}else _onlineCheckout.isValidForCheckoutInvoice()&&(s.isPointApply=!1,s.Originalprice=parseFloat(s.actualPrice),s.Originaltaxprice=parseFloat(s.actualTaxprice));else void 0!==s.isPointApply||s.isPointApply||(s.isPointApply=!1,s.Originalprice=parseFloat(s.actualPrice),s.Originaltaxprice=parseFloat(s.actualTaxprice))}),s.BusinessTax=_onlineCheckout.ApplyMultipleTax(s.price,s),_onlineCheckout.ApplyPointsOnAddonEvents(t,i,n,s.lstAddonService)})})},_onlineCheckout.CalculateApplyPointsClassPrice=function(e,t,i){return t*e/i},_onlineCheckout.ApplyGCONAllItems=function(t,i,n){null!=i&&i.length>0?e.grep(t,function(t){if(n==u)t.Price=parseFloat(t.Price),0!=t.PromotionID||t.IsInitialDiscount?t.ActualPrice=parseFloat(t.ActualPrice):t.ActualPrice=parseFloat(t.Price),_onlineCheckout.isValidForCheckoutInvoice()&&(0!=t.PromotionID||(t.ActualPrice=parseFloat(t.Price)-parseFloat(t.productDisc))),t.RemainingPrice=parseFloat(t.ActualPrice),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax);else if(n==d)t.TotalPrice=parseFloat(t.TotalPrice),t.ServiceId>0?(t.ActualPrice=parseFloat(t.TotalPrice),t.RemainingPrice=parseFloat(t.TotalPrice)):(t.ActualPrice=parseFloat(t.Price),t.RemainingPrice=parseFloat(t.Price)),_onlineCheckout.isValidForCheckoutInvoice()&&(t.ActualPrice=parseFloat(t.Price),t.RemainingPrice=parseFloat(t.Price)),"True"!=_onlineCheckout.isFromInvoice&&t.NoOfVisit>1&&(t.calculatedTax=t.calculatedTax*t.NoOfVisit),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax);else if(n==h){if(t.TotalPrice=parseFloat(t.TotalPrice),t.ActualPrice=parseFloat(t.TotalPrice),(0!=t.PromotionID||t.IsInitialDiscount)&&(t.ActualPrice=parseFloat(t.Price)),_onlineCheckout.isValidForCheckoutInvoice()&&(0!=t.PromotionID||(t.ActualPrice=parseFloat(t.Price))),null!=t.lstAddonService&&null!=t.lstAddonService&&t.lstAddonService.length>0){t.TotalAddonServicePrice=t.TotalAddonServicePrice,t.TotalAddonServiceTax=0;for(var o=0,a=0;a<t.lstAddonService.length;a++){var s=e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+t.ServiceId+'"]').find("#txtItemsQuantity").val();t.TotalAddonServiceTax=parseFloat(t.TotalAddonServiceTax)+parseFloat(t.lstAddonService[a].taxprice),t.lstAddonService[a].Price=parseFloat(t.lstAddonService[a].Originalprice)*s,t.lstAddonService[a].ActualPrice=parseFloat(t.lstAddonService[a].Originalprice)*s,t.lstAddonService[a].BillingCycle=t.BillingCycle,t.lstAddonService[a].TotalPrice=parseFloat(t.lstAddonService[a].Originalprice)*s,o+=parseFloat(t.lstAddonService[a].Originalprice)*s,e("#addprice_"+t.ServiceId+"_"+a).html(currencysymbol+_onlineCheckout.decimalFormate(parseFloat(t.lstAddonService[a].Originalprice)*s))}t.TotalAddonServicePrice=o}else t.TotalAddonServicePrice=0,t.TotalAddonServiceTax=0;t.RemainingPrice=parseFloat(t.ActualPrice),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax)}else n==c?_onlineCheckout.isValidForCheckoutInvoice()?null!=i&&i.length>0&&e.each(i,function(n,o){if(o.serviceName==t.ProductName&&o.currentBalance>0&&(t.IsPartial?t.InventoryMasterID:t.InventoryId)==o.serviceID&&(o.quantity>0&&t.Quantity<=o.quantity||-1==o.quantity)){var a=0;if(1==o.isCustomPackage&&o.quantity>0){for(var s=e.grep(i,function(e){return 1==e.isCustomPackage&&e.giftCertificateID==o.giftCertificateID&&null!=e.serviceID&&""!=e.serviceName}),r=0,l=0;l<s.length;l++){var c=s[l];c.quantity>0&&(r+=c.quantity)}r>0?(a=Math.floor(_shopdetail.parseTodecimal(o.currentBalance/r*100))/100,a*=t.IsPartial?parseFloat(t.Quantity):parseInt(t.Quantity)):a=0}t.Price=a,String.isNullOrUndefineOrBlank(t.IsPartialPoint)||1!=t.IsPartialPoint||(t.ActualPrice=0),t.ActualPrice=parseFloat(1==t.IsPartialPoint?t.ActualPrice:0),t.RemainingPrice=0,t.RemainingTax=0,t.ActualTax=0,t.ItemType=3,t.isMembershipApply=!1,String.isNullOrUndefineOrBlank(t.isPointApply)||1!=t.isPointApply||1!=t.IsPartialPoint||void 0!==onlineShoppingCart.UsersPoints&&null!=onlineShoppingCart.UsersPoints&&"undefined"!=onlineShoppingCart.UsersPoints[0].pointsBalance&&(onlineShoppingCart.UsersPoints[0].pointsBalance+=t.pointsRedeem),String.isNullOrUndefineOrBlank(t.isPointApply)||1!=t.isPointApply||0!=t.IsPartialPoint||void 0!==onlineShoppingCart.UsersPoints&&null!=onlineShoppingCart.UsersPoints&&"undefined"!=onlineShoppingCart.UsersPoints[0].pointsBalance&&(onlineShoppingCart.UsersPoints[0].pointsBalance+=t.OriginalPointsRedeem),t.isPointApply=!1,t.BusinessID=o.businessID,t.MembershipID=o.giftCertificateID,t.MembershipItemId=o.serviceID,t.membershipName=o.pkgName,o.quantity=t.IsPartial?o.quantity-parseFloat(t.Quantity):o.quantity-1,t.isPackageApplied=!0}else t.OriginalPrice=parseFloat(t.SellingPrice),t.Price=parseFloat(t.Price),t.ActualPrice=parseFloat(t.Price),t.RemainingPrice=parseFloat(t.Price),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax)}):null!=i&&i.length>0&&e.each(i,function(n,o){if(o.serviceName==t.ProductName&&o.currentBalance>0&&(t.IsPartial?t.InventoryMasterID:t.InventoryId)==o.serviceID&&(o.quantity>0&&t.Quantity<=o.quantity||-1==o.quantity)){var a=0;if(1==o.isCustomPackage&&o.quantity>0){for(var s=e.grep(i,function(e){return 1==e.isCustomPackage&&e.giftCertificateID==o.giftCertificateID&&null!=e.serviceID&&""!=e.serviceName}),r=0,l=0;l<s.length;l++){var c=s[l];c.quantity>0&&(r+=c.quantity)}r>0?(a=Math.floor(_shopdetail.parseTodecimal(o.currentBalance/r*100))/100,a*=parseInt(t.Quantity)):a=0}t.Price=a,String.isNullOrUndefineOrBlank(t.IsPartialPoint)||1!=t.IsPartialPoint||(t.ActualPrice=0),t.ActualPrice=parseFloat(1==t.IsPartialPoint?t.ActualPrice:0),t.RemainingPrice=0,t.RemainingTax=0,t.ActualTax=0,t.ItemType=3,t.isMembershipApply=!1,String.isNullOrUndefineOrBlank(t.isPointApply)||1!=t.isPointApply||1!=t.IsPartialPoint||void 0!==onlineShoppingCart.UsersPoints&&null!=onlineShoppingCart.UsersPoints&&"undefined"!=onlineShoppingCart.UsersPoints[0].pointsBalance&&(onlineShoppingCart.UsersPoints[0].pointsBalance+=t.pointsRedeem),String.isNullOrUndefineOrBlank(t.isPointApply)||1!=t.isPointApply||0!=t.IsPartialPoint||void 0!==onlineShoppingCart.UsersPoints&&null!=onlineShoppingCart.UsersPoints&&"undefined"!=onlineShoppingCart.UsersPoints[0].pointsBalance&&(onlineShoppingCart.UsersPoints[0].pointsBalance+=t.OriginalPointsRedeem),t.isPointApply=!1,t.BusinessID=o.businessID,t.MembershipID=o.giftCertificateID,t.MembershipItemId=o.serviceID,t.membershipName=o.pkgName,o.quantity=o.quantity-1,t.isPackageApplied=!0}else t.Price=parseFloat(1==t.isPointApply?0:t.Price),t.ActualPrice=parseFloat(1==t.IsPartialPoint?t.ActualPrice:t.Price),t.RemainingPrice=parseFloat(1==t.IsPartialPoint?t.ActualPrice:t.Price),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(1==t.isPointApply?0:t.calculatedTax),t.OriginalPrice=parseFloat(t.SellingPrice)}):n==m?(t.priceOriginal=parseFloat(t.ServiceOrginalPrice),_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(t.PromotionId)&&t.PromotionId>0&&(t.priceOriginal=parseFloat(t.price)),t.Price=parseFloat(t.price),t.RemainingPrice=parseFloat(t.price),t.RemainingTax=parseFloat(t.calculatedTax),1==t.isPackageApplied||1==t.isPointApply?(t.ActualPrice=parseFloat(t.price),t.ActualTax=parseFloat(0)):(t.ActualPrice=parseFloat(t.price),t.ActualTax=parseFloat(t.calculatedTax))):n==g&&(t.Price=parseFloat(t.CalculatedFees),t.paidType==_onlineCheckout.arrpaidType.Paid?(t.ActualPrice=parseFloat(t.CalculatedFees),t.ActualTax=parseFloat(t.CalculatedTax),t.RemainingPrice=parseFloat(t.Price),t.RemainingTax=parseFloat(t.CalculatedTax)):(t.ActualPrice=parseFloat(t.CalculatedFees),t.ActualTax=parseFloat(t.CalculatedTax),t.RemainingPrice=0,t.RemainingTax=0));t.redeemAmt=0,t.redeemTax=0,t.GCDetail=[],e.grep(i,function(e){!_onlineCheckout.isValidForCheckoutInvoice()||String.isNullOrUndefineOrBlank(e.serviceID)||String.isNullOrUndefineOrBlank(e.serviceName)||n!=m?(!String.isNullOrUndefineOrBlank(e.serviceID)||_onlineCheckout.isValidForCheckoutInvoice()&&n==d||!_onlineCheckout.isValidForCheckoutInvoice()||void 0!==t.isPointApply&&0!=t.isPointApply||void 0!==t.isPackageApplied&&0!=t.isPackageApplied)&&(_onlineCheckout.isValidForCheckoutInvoice()||n==d||!String.isNullOrUndefineOrBlank(e.serviceID))||(t.RemainingPrice>0&&e.currentBalance>0&&(_onlineCheckout.isValidForCheckoutInvoice()&&n==m&&t.paidType==_onlineCheckout.arrpaidType.OfflineDeposit&&(t.RemainingPrice=t.depositsPaid,t.RemainingTax=0),e.currentBalance>=t.RemainingPrice&&(void 0===t.isPackageApplied||0==t.isPackageApplied)&&"undefined"!=e.giftCertificateNo&&null!=e.giftCertificateNo?(t.isGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=t.RemainingPrice,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemAmt=_onlineCheckout.parseTodecimal(t.redeemAmt+t.RemainingPrice,3),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-t.RemainingPrice,3),t.RemainingPrice=0):t.RemainingPrice>e.currentBalance&&e.currentBalance>0&&(void 0===t.isPackageApplied||0==t.isPackageApplied)&&"undefined"!=e.giftCertificateNo&&null!=e.giftCertificateNo&&(t.isGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=e.currentBalance,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemAmt=_onlineCheckout.parseTodecimal(t.redeemAmt+e.currentBalance,3),t.RemainingPrice=_onlineCheckout.parseTodecimal(t.RemainingPrice-e.currentBalance,3),e.currentBalance=0)),t.RemainingTax>0&&e.currentBalance>0&&!String.isNullOrUndefineOrBlank(e.giftCertificateNo)&&void 0!==e.isCustomPackage&&0==e.isCustomPackage&&(t.RemainingTax=_onlineCheckout.parseTodecimal(t.RemainingTax,3),e.currentBalance>=t.RemainingTax?(objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=t.RemainingTax,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemTax=_onlineCheckout.parseTodecimal(t.redeemTax+t.RemainingTax,3),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-t.RemainingTax,3),t.RemainingTax=0):t.RemainingTax>e.currentBalance&&e.currentBalance>0&&(objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=e.currentBalance,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemTax=_onlineCheckout.parseTodecimal(t.redeemTax+e.currentBalance,3),t.RemainingTax=_onlineCheckout.parseTodecimal(t.RemainingTax-e.currentBalance,3),e.currentBalance=0))):void 0!==t.isPointApply&&0!=t.isPointApply||void 0!==t.isPackageApplied&&0!=t.isPackageApplied||void 0!==t.isMembershipApply&&0!=t.isMembershipApply||0!=t.isPaid||e.serviceID==t.serviceid&&e.serviceName.toLowerCase().trim()==t.servicename.toLowerCase().trim()&&e.quantity>0&&t.RemainingPrice>0&&(objGC={},objGC.GCId=e.giftCertificateID,objGC.giftCertificateNo=e.giftCertificateNo,objGC.serviceId=t.serviceid,objGC.redeemAmt=t.price,objGC.uniqID=t.AppSrNo,objGC.AppointmentID=t.appointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.srvcGC,onlineShoppingCart.RedeemedByGCtemp.push(objGC),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-t.price,2),e.quantity=e.quantity-1,t.redeemID=e.giftCertificateID,t.redeemAmt=t.price,t.GCDetail.push(objGC),t.isServiceBaseGC=!0,t.RemainingPrice=0,t.paidType=_onlineCheckout.arrpaidType.Paid,t.depositsPaid=0,null!=e.Taxes&&(t.RemainingTax=0,t.ActualTax=0))}),void 0===t.TotalAddonServicePrice&&void 0===t.TotalAddonServicePrice&&(t.TotalAddonServicePrice=0),void 0===t.TotalAddonServiceTax&&void 0===t.TotalAddonServiceTax&&(t.TotalAddonServiceTax=0),onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(t.ActualPrice+_onlineCheckout.parseTodecimal(t.ActualTax,3))-(t.redeemAmt+t.redeemTax)+t.TotalAddonServicePrice+t.TotalAddonServiceTax,3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(t.ActualPrice+_onlineCheckout.parseTodecimal(t.ActualTax,3)+t.TotalAddonServicePrice+t.TotalAddonServiceTax),3),_onlineCheckout.parseTodecimal(t.deposit,2)>0&&(onlineShoppingCart.depositTotal=_onlineCheckout.parseTodecimal(onlineShoppingCart.depositTotal+t.deposit,2)),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax+t.ActualTax+t.TotalAddonServiceTax,3),onlineShoppingCart.Rtax=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax+t.ActualTax+t.TotalAddonServiceTax,3),onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt+t.redeemAmt+t.redeemTax,3),_onlineCheckout.isValidForCheckoutInvoice()&&1==t.isPackageApplied?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-t.ActualPrice,2):void 0!==t.isPackageApplied&&1==t.isPackageApplied&&n==c&&(onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-(t.ActualPrice+t.ActualTax+t.TotalAddonServiceTax),2))}):(n==f&&(t=e.grep(t,function(e){return 1==e.FeeType})),e.grep(t,function(t){if(n==u)t.Price=parseFloat(t.Price),0!=t.PromotionID||t.IsInitialDiscount?t.ActualPrice=parseFloat(t.ActualPrice):t.ActualPrice=parseFloat(t.Price),_onlineCheckout.isValidForCheckoutInvoice()&&(0!=t.PromotionID||(t.ActualPrice=parseFloat(t.Price)-parseFloat(t.productDisc))),t.ActualTax=parseFloat(t.calculatedTax);else if(n==d)t.TotalPrice=parseFloat(t.TotalPrice),t.ServiceId>0?t.ActualPrice=parseFloat(t.TotalPrice):t.ActualPrice=parseFloat(t.Price),_onlineCheckout.isValidForCheckoutInvoice()&&(t.ActualPrice=parseFloat(t.Price)),"True"!=_onlineCheckout.isFromInvoice&&t.NoOfVisit>1&&(t.calculatedTax=t.calculatedTax*t.NoOfVisit),t.ActualTax=parseFloat(t.calculatedTax);else if(n==h){if(t.TotalPrice=parseFloat(t.TotalPrice),t.ActualPrice=parseFloat(t.TotalPrice),(0!=t.PromotionID||t.IsInitialDiscount)&&(t.ActualPrice=parseFloat(t.Price)),_onlineCheckout.isValidForCheckoutInvoice()&&(0!=t.PromotionID||(t.ActualPrice=parseFloat(t.Price))),t.TotalSAddPricex=0,t.TotalSAddTax=0,null!=t.lstAddonService&&null!=t.lstAddonService&&t.lstAddonService.length>0){for(var i=0,o=0;o<t.lstAddonService.length;o++){var a=e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+t.ServiceId+'"]').find("#txtItemsQuantity").val();t.lstAddonService[o].Price=parseFloat(t.lstAddonService[o].Originalprice)*a,t.lstAddonService[o].ActualPrice=parseFloat(t.lstAddonService[o].Originalprice)*a,t.lstAddonService[o].BillingCycle=t.BillingCycle,t.lstAddonService[o].TotalPrice=parseFloat(t.lstAddonService[o].Originalprice)*a,t.TotalSAddPricex=parseFloat(t.TotalSAddPricex)+parseFloat(t.lstAddonService[o].Price),t.TotalSAddTax=parseFloat(t.TotalSAddTax)+parseFloat(t.lstAddonService[o].taxprice),i+=parseFloat(t.lstAddonService[o].Originalprice)*a,e("#addprice_"+t.ServiceId+"_"+o).html(currencysymbol+_onlineCheckout.decimalFormate(parseFloat(t.lstAddonService[o].Originalprice)*a))}t.TotalAddonServicePrice=i}t.ActualTax=parseFloat(t.calculatedTax)}else n==c?(1==t.isPointApply&&1==t.IsPartialPoint&&(onlineShoppingCart.ccAmt=0,onlineShoppingCart.amtPaid=0,onlineShoppingCart.tax=0,onlineShoppingCart.Rtax=0),t.Price=parseFloat(1==t.isPointApply?0:t.Price),t.ActualPrice=parseFloat(1==t.IsPartialPoint?t.ActualPrice:t.Price),t.ActualTax=parseFloat(1==t.isPointApply&&0==t.IsPartialPoint?0:1==t.IsPartialPoint?t.ActualTax:t.calculatedTax),1==t.isPointApply&&0==t.Price&&0==t.ActualPrice&&0==t.ActualTax&&(t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t))):n==m?(_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(t.PromotionId)&&t.PromotionId>0?t.priceOriginal=parseFloat(t.price):t.priceOriginal=parseFloat(t.ServiceOrginalPrice),1==t.isPackageApplied||1==t.isPointApply?(t.ActualPrice=parseFloat(t.price),n==m&&t.IsPartialPoint&&t.isPointApply?t.ActualTax=parseFloat(t.ActualTax):t.ActualTax=parseFloat(0)):(t.ActualPrice=parseFloat(t.price),t.ActualTax=parseFloat(t.calculatedTax)),t.Price=parseFloat(t.price)):n!=g&&n!=f||(t.Price=parseFloat(t.CalculatedFees),t.ActualPrice=parseFloat(t.CalculatedFees),t.ActualTax=parseFloat(t.CalculatedTax));t.redeemAmt=0,t.redeemTax=0,void 0===t.TotalSAddPricex&&(t.TotalSAddPricex=0),void 0===t.TotalSAddTax&&(t.TotalSAddTax=0),onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(t.ActualPrice+_onlineCheckout.parseTodecimal(t.ActualTax,3)+_onlineCheckout.parseTodecimal(t.TotalSAddPricex,2)+_onlineCheckout.parseTodecimal(t.TotalSAddTax,2)),3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(t.ActualPrice+_onlineCheckout.parseTodecimal(t.ActualTax,3)+_onlineCheckout.parseTodecimal(t.TotalSAddPricex,2)+_onlineCheckout.parseTodecimal(t.TotalSAddTax,2)),3),_onlineCheckout.parseTodecimal(t.deposit,2)>0&&(onlineShoppingCart.depositTotal=_onlineCheckout.parseTodecimal(onlineShoppingCart.depositTotal+t.deposit,2)),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax+t.ActualTax,3)+_onlineCheckout.parseTodecimal(t.TotalSAddTax,3),onlineShoppingCart.Rtax=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax+t.ActualTax+t.TotalSAddTax,3),_onlineCheckout.isValidForCheckoutInvoice()&&1==t.isPackageApplied?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-t.ActualPrice,2):1==t.isPackageApplied&&(onlineShoppingCart.ccAmt=0)}))},_onlineCheckout.RemoveDicountForWorkShop=function(t,i,n,o,a){var s=e.grep(onlineShoppingCart.Events,function(e){return e.eventID==n});if(null!=s&&s.length>0){var r=e.grep(s[0].eventEnrollment,function(e){return e.randomForWorkShop==o&&e.cUserEmail==a});null!=r&&r.length>0&&e.each(r,function(e,o){void 0!==o&&null!=o&&_onlineCheckout.RemoveDicount(t,i,n,o.autoID)})}},_onlineCheckout.RemoveDicount=function(t,i,n,o){var a=[];if(t==c?null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&(a=onlineShoppingCart.Inventories,CartItemTypeEnumOnlineCheckout.Product):t==d?null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&(a=onlineShoppingCart.GiftCertificates,CartItemTypeEnumOnlineCheckout.GC):t==h?null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&(a=onlineShoppingCart.Packages,CartItemTypeEnumOnlineCheckout.Package):t==u?null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&(a=onlineShoppingCart.Memberships,CartItemTypeEnumOnlineCheckout.Membership):t==p?null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(a=onlineShoppingCart.Events,CartItemTypeEnumOnlineCheckout.Class):t==m?null!=onlineShoppingCart.ServiceInvoice&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&(a=onlineShoppingCart.ServiceInvoice,CartItemTypeEnumOnlineCheckout.Service):t==v&&null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(a=onlineShoppingCart.Events,CartItemTypeEnumOnlineCheckout.ClassAddon),1==_onlineCheckout.Model.IsPaymentOption&&_onlineCheckout.RemoveExistingGC(n,o),null!=a&&a.length>0)if(t==m&&i==b)e.grep(a,function(t){if(t.AppSrNo==n){var i=e.grep(onlineShoppingCart.UsersPoints,function(e){return e.userId==onlineShoppingCart.loginUserId&&e.userId>0});!String.isNullOrUndefineOrBlank(i)&&i.length>0&&((i=i[0]).pointsBalance=i.pointsBalance+t.pointsRedeem),onlineShoppingCart.AppliedPoints=onlineShoppingCart.AppliedPoints-t.pointsRedeem,t.pointsRedeem=0,t.pointsGained=t.pointredeemOriginal,t.price=parseFloat(t.ServiceOrginalPrice)-parseFloat(t.originalDiscount),t.ActualPrice=t.price,t.Tax=t.taxOriginalPrice,t.ActualTax=t.taxOriginalPrice,t.discount=parseFloat(t.originalDiscount),t.priceOriginal=parseFloat(t.ServiceOrginalPrice),t.isPointApply=!1,t.IsPartialPoint&&(t.IsPartialPoint=!1,t.PartialPrice=0)}});else if(t!=m||i!=S&&i!=y)if(t==m&&i==k)e.grep(a,function(e){e.AppSrNo==n&&(e.discount=parseFloat(e.originalDiscount),e.ActualPrice=parseFloat(e.ServiceOrginalPrice)-parseFloat(e.discount),e.price=parseFloat(e.ServiceOrginalPrice)-parseFloat(e.discount),e.isMembershipApply=!1,e.calculatedTax=e.taxOriginalPrice,e.ActualTax=parseFloat(e.calculatedTax))});else if(t==v&&i==b){var s=parseInt(o.split("_")[0]);e.grep(a,function(t){e.grep(t.eventEnrollment,function(t){t.eventID==n&&t.autoID==s&&e.grep(t.lstAddonService,function(i){if(i.autoID==o){i.isPointApply=!1,_onlineCheckout.isValidForCheckoutInvoice()?(i.actualPrice=parseFloat(i.Originalprice),i.actualTaxprice=parseFloat(i.Originaltaxprice),onlineShoppingCart.AppliedPoints=onlineShoppingCart.AppliedPoints-i.PointRedeem):onlineShoppingCart.AppliedPoints=onlineShoppingCart.AppliedPoints-i.pointsRedeem;var n=e.grep(onlineShoppingCart.UsersPoints,function(e){return t.customerID>0&&e.userId>0&&t.customerID==e.userId||t.customerID<=0&&e.userId>0&&t.cUserEmail==e.emailId});!String.isNullOrUndefineOrBlank(n)&&n.length>0&&((n=n[0]).pointsBalance=n.pointsBalance+i.pointsRedeem),i.pointsRedeem=0,i.Price=parseFloat(i.Originalprice),i.taxprice=parseFloat(i.Originaltaxprice),i.isMembershipRemove=!0,i.isMembershipApply=!1,i.IsPartialPoint=!1,i.PartialPrice=0}}),onlineShoppingCart.lstMembership=JSON.parse(JSON.stringify(onlineShoppingCart.lstMembershipOld))})}),_onlineCheckout.ApplyDailyDealONEvents()}else if(t!=p&&i==b){var r=e.grep(a,function(e){return e.autoId==n&&!String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)});e.grep(a,function(t){if(t.autoId==n||r.length>0&&t.MasterInventoryId==r[0].InventoryId){if(t.isPointApply=!1,r.length>0&&t.InventoryId==r[0].InventoryId)if(t.isPointApplyPartial=!1,r[0].isMembershipApply){var i=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==t.InventoryId});t.Price=0,e.each(i,function(e,i){t.Price+=parseFloat(i.Price)})}else t.Price=t.OriginalPrice;else{var o=e.grep(onlineShoppingCart.UsersPoints,function(e){return e.userId==onlineShoppingCart.loginUserId&&e.userId>0});!String.isNullOrUndefineOrBlank(o)&&o.length>0&&((o=o[0]).pointsBalance=o.pointsBalance+t.pointsRedeem),onlineShoppingCart.AppliedPoints=onlineShoppingCart.AppliedPoints-t.pointsRedeem}t.pointsRedeem=0,t.pointsGained=t.originalpointsGained,t.Price=t.OriginalPrice,t.ActualPrice=_onlineCheckout.parseTodecimal(t.Price,2),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),_onlineCheckout.isValidForCheckoutInvoice()&&(t.OriginalPrice=t.SellingPrice,t.discount=parseFloat(t.originalDiscount)),t.IsPartialPoint&&(t.IsDepositsOver=!1,t.PartialPrice=0,t.ActualPrice=t.Price,t.IsPartialPoint=!1,t.ActualTax=t.calculatedTax,t.GCDetail=[],t.isGCApply=!1,t.redeemAmt=0,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t))}}),t==c&&e.each(onlineShoppingCart.Inventories,function(t,i){if(!String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)){var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==i.InventoryId});i.Price=0,i.isMembershipApply=!1,i.membershipName="",i.packageName="";var o=[],a=[],s=!1;if(e.each(n,function(e,t){i.Price+=t.Price,i.isMembershipApply=1!=t.isPackageApplied&&(1==i.isMembershipApply||t.isMembershipApply),i.isPackageApplied=1==i.isPackageApplied||t.isPackageApplied,t.isPackageApplied&&(s=!0),t.isMembershipApply&&(isMembershipBundleApplied=!0),t.isMembershipApply&&-1==o.indexOf(t.membershipName)&&o.push(t.membershipName),t.isPackageApplied&&-1==a.indexOf(t.membershipName)&&a.push(t.membershipName)}),s){if(null!=a&&a.length>0){var r=a.join();i.membershipName=r}}else if(null!=o&&o.length>0){var l=o.join();i.membershipName=l}}})}else if(t==p&&i==b)e.grep(a,function(t){e.grep(t.eventEnrollment,function(i){if(i.eventID==n&&i.autoID==o){i.isPointApply=!1,_onlineCheckout.isValidForCheckoutInvoice()?(i.actualPrice=parseFloat(i.Originalprice),i.actualTaxprice=parseFloat(i.Originaltaxprice),onlineShoppingCart.AppliedPoints=onlineShoppingCart.AppliedPoints-t.PointRedeem):void 0!==t.pointsRedeem?onlineShoppingCart.AppliedPoints=onlineShoppingCart.AppliedPoints-t.pointsRedeem:onlineShoppingCart.AppliedPoints=i.IsPartialPoint?onlineShoppingCart.AppliedPoints-i.pointsRedeem:onlineShoppingCart.AppliedPoints-t.PointRedeem;var a=e.grep(onlineShoppingCart.UsersPoints,function(e){return i.customerID>0&&e.userId>0&&i.customerID==e.userId||i.customerID<=0&&e.userId>0&&i.cUserEmail==e.emailId});!String.isNullOrUndefineOrBlank(a)&&a.length>0&&((a=a[0]).pointsBalance=i.IsPartialPoint?a.pointsBalance+i.pointsRedeem:a.pointsBalance+t.PointRedeem),i.IsPartialPoint&&(i.IsPartialPoint=!1,i.PartialPrice=0,i.BusinessTax=_onlineCheckout.ApplyMultipleTax(i.Originalprice,t)),i.pointsRedeem=0,i.price=parseFloat(i.Originalprice),i.taxprice=parseFloat(i.Originaltaxprice),i.isMembershipRemove=!0}i.isMembershipApply=!1,onlineShoppingCart.lstMembership=JSON.parse(JSON.stringify(onlineShoppingCart.lstMembershipOld))})}),_onlineCheckout.ApplyDailyDealONEvents();else if(t!=v||i!=S&&i!=y)if(t!=p&&i==S)e.grep(a,function(e){e.autoId==n&&(_onlineCheckout.isValidForCheckoutInvoice()&&(e.discount=parseFloat(e.originalDiscount)),e.isGCApply=!1,e.GCDetail=[],e.redeemAmt=0,e.redeemTax=0)});else if(t!=p||i!=S&&i!=y)if(t!=c||i!=S&&i!=y)if(t==p&&i==k)e.grep(a,function(t){e.grep(t.eventEnrollment,function(e){if(e.eventID==n&&e.autoID==o&&(e.isMembershipRemove=!0,e.price=parseFloat(e.Originalprice),e.taxprice=parseFloat(e.Originaltaxprice),void 0!==e.PromotionID&&0!=e.PromotionID)){var i=0;i=1==e.IsAmount?e.AmountValue:e.Originalprice*e.AmountValue/100,e.Originalprice<i&&(i=e.Originalprice),e.discount=i,e.price=e.Originalprice-i,e.taxprice=_onlineCheckout.parseTodecimal(e.price*t.tax/100,3),e.actualPrice=e.price,e.actualTaxprice=e.taxprice}e.isMembershipApply=!1,onlineShoppingCart.lstMembership=JSON.parse(JSON.stringify(onlineShoppingCart.lstMembershipOld))})});else if(t==v&&i==k){s=parseInt(o.split("_")[0]);e.grep(a,function(t){e.grep(t.eventEnrollment,function(t){t.eventID==n&&t.autoID==s&&e.grep(t.lstAddonService,function(e){if(e.autoID==o){if(e.isMembershipRemove=!0,e.Price=parseFloat(e.Originalprice),e.taxprice=parseFloat(e.Originaltaxprice),void 0!==e.PromotionID&&0!=e.PromotionID){var t=0;t=1==e.IsAmount?e.AmountValue:e.Originalprice*e.AmountValue/100,e.Originalprice<t&&(t=e.Originalprice),e.discount=t,e.Price=e.Originalprice-t,e.taxprice=_onlineCheckout.parseTodecimal(e.Price*e.tax/100,3),e.actualPrice=e.Price,e.actualTaxprice=e.taxprice}e.isMembershipApply=!1}}),onlineShoppingCart.lstMembership=JSON.parse(JSON.stringify(onlineShoppingCart.lstMembershipOld))})})}else if(t!=p&&i==k){r=e.grep(a,function(e){return e.autoId==n&&!String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)});e.grep(a,function(t){if(t.autoId==n||r.length>0&&t.MasterInventoryId==r[0].InventoryId){if(_onlineCheckout.isValidForCheckoutInvoice())t.discount=parseFloat(t.originalDiscount),t.ActualPrice=parseFloat(t.OriginalPrice)-parseFloat(t.discount),t.Price=parseFloat(t.OriginalPrice)-parseFloat(t.discount);else if(t.discount=0,r.length>0&&t.InventoryId==r[0].InventoryId&&r[0].isPointApplyPartial){var i=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==t.InventoryId});t.Price=0,e.each(i,function(e,i){void 0!==i.isPointApply&&0==i.isPointApply&&(t.Price+=parseFloat(i.OriginalPrice))}),t.isMembershipBundleApplied=!1}else t.ActualPrice=parseFloat(t.OriginalPrice*t.Quantity),t.Price=parseFloat(t.OriginalPrice*t.Quantity);t.isMembershipApply=!1,t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.ActualTax=parseFloat(t.calculatedTax),t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t)}})}else t==p&&i==_&&(e.grep(a,function(t){e.grep(t.eventEnrollment,function(e){e.eventID==n&&e.autoID==o&&(e.strAdvanceLimitDate="",e.IsWaivedApply=!1,e.IsOutsideBilling=!0)})}),onlineShoppingCart.Events=a,_onlineCheckout.calculateDepositsOnEvents());else e.grep(a,function(t){if(t.autoId==n){if(i==y)if(String.isNullOrUndefineOrBlank(t.InventoryBundleCartDetails)){var o=onlineShoppingCart.lstGCPkgData.filter(function(e){return e.giftCertificateID==t.MembershipID&&e.serviceID==t.MembershipItemId});String.isNullOrUndefineOrBlank(o)||-1==o[0].quantity||(o[0].quantity=o[0].quantity+1,o[0].currentBalance=o[0].currentBalance+t.redeemAmt)}else{var a=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==t.InventoryId});t.Price=0,t.OriginalPrice=0,t.calculatedTax=0,t.ActualTax=0,e.each(a,function(e,i){t.Price+=parseFloat(i.OriginalPrice),t.OriginalPrice+=parseFloat(i.OriginalPrice),t.calculatedTax+=_onlineCheckout.parseTodecimal(parseFloat(i.OriginalPrice*i.Quantity)*i.Tax/100,3),t.ActualTax=parseFloat(t.calculatedTax),t.IsPartial=i.IsPartial}),t.isPackageBundleApplied=!1}t.gcId=null,t.isDecisionTaken=null,t.isPackageApplied=!1,t.redeemAmt=0,t.redeemTax=0,t.ActualPrice=t.IsPartial?t.OriginalPrice:parseFloat(t.OriginalPrice*t.Quantity),t.Price=t.IsPartial?t.OriginalPrice:parseFloat(t.OriginalPrice*t.Quantity),String.isNullOrUndefineOrBlank(t.InventoryBundleCartDetails)&&(t.calculatedTax=_onlineCheckout.parseTodecimal(parseFloat(t.OriginalPrice*t.Quantity)*t.Tax/100,3),t.ActualTax=parseFloat(t.calculatedTax))}});else e.grep(a,function(t){e.grep(t.eventEnrollment,function(e){if(e.eventID==n&&e.autoID==o){if(i==y){var t=onlineShoppingCart.lstGCPkgData.filter(function(t){return t.giftCertificateID==e.gcId&&t.serviceID==e.eventID});String.isNullOrUndefineOrBlank(t)||-1==t[0].quantity||(t[0].quantity=t[0].quantity+1,t[0].currentBalance=t[0].currentBalance+e.redeemAmt)}e.gcId=null,e.isDecisionTaken=null,e.isPackage=null,e.redeemAmt=0,e.isMembershipRemove=!0}e.isMembershipApply=!1,onlineShoppingCart.lstMembership=JSON.parse(JSON.stringify(onlineShoppingCart.lstMembershipOld))})});else{var s=parseInt(o.split("_")[0]);e.grep(a,function(t){e.grep(t.eventEnrollment,function(t){t.eventID==n&&t.autoID==s&&e.grep(t.lstAddonService,function(e){if(e.autoID==o){if(i==y){var t=onlineShoppingCart.lstGCPkgData.filter(function(t){return t.giftCertificateID==e.gcId&&t.serviceID==e.ServiceId});String.isNullOrUndefineOrBlank(t)||-1==t[0].quantity||(t[0].quantity=t[0].quantity+1,t[0].currentBalance=t[0].currentBalance+e.redeemAmt)}e.gcId=null,e.isDecisionTaken=null,e.isPackage=null,e.redeemAmt=0,e.isMembershipApply=!1,e.isMembershipRemove=!0}}),onlineShoppingCart.lstMembership=JSON.parse(JSON.stringify(onlineShoppingCart.lstMembershipOld))})})}else e.grep(a,function(e){e.AppSrNo==n&&(i==y&&(onlineShoppingCart.PackageAmount=parseFloat(onlineShoppingCart.PackageAmount)-parseFloat(e.price),e.calculatedTax=parseFloat(e.taxOriginalPrice)),e.paidType==_onlineCheckout.arrpaidType.Deposits?e.price=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(e.payableAmount,2)-(_onlineCheckout.parseTodecimal(e.deposit,2)+_onlineCheckout.parseTodecimal(e.discount,2)),2):e.price=parseFloat(e.ServiceOrginalPrice)-parseFloat(e.originalDiscount),e.priceOriginal=e.ServiceOrginalPrice,e.ActualPrice=parseFloat(e.price),e.ActualTax=parseFloat(e.taxOriginalPrice),e.GCDetail=[],e.redeemAmt=0,e.redeemTax=0,e.isGCApply=!1,e.isServiceBaseGC=!1,_onlineCheckout.isValidForCheckoutInvoice()&&(e.discount=parseFloat(e.originalDiscount)),e.isPackageApplied=!1)});_onlineCheckout.IsValidatedOnePerUser=!1,_onlineCheckout.ReApplyDiscounts(),!_onlineCheckout.isValidForCheckoutInvoice()&&onlineShoppingCartmain.IsFullDeposit&&void 0!==onlineShoppingCartmain.TipOption&&null!=onlineShoppingCartmain.TipOption&&""!=onlineShoppingCartmain.TipOption&&"0"!=onlineShoppingCartmain.TipOption&&(onlineShoppingCart.tipValue=0,e("#divTip").show(),e("#divfinalCheckoutTipAmount").html(""),e("#divfinalCheckoutTipAmount").html(currencysymbol+"0.00"),e("#divfinalCheckoutTipAmount").hide(),e("#txtOnlineCustomerTip").hide(),e("#dvTipBlock").hide(""),_onlineCheckout.ShowTipOptions()),_onlineCheckout.IsVCFEnable()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.RemoveDicount))},_onlineCheckout.ReApplyDiscounts=function(t){if(_onlineCheckout.HideTipOptions(),1!=t){var i=onlineShoppingCart.lstPromotionData.uniqueObjects(["PromotionID"]),n=onlineShoppingCart.lstPromotionData,o=onlineShoppingCart.lstPromoDetails;e.grep(i,function(e){_onlineCheckout.RemovePromoCode(e.PromotionID)}),e.grep(i,function(t){var i=e.grep(n,function(e){return e.PromotionID==t.PromotionID}),a=e.grep(o,function(e){return e.PromotionID==t.PromotionID});_onlineCheckout.ApplyPromoCodeOnCart(i,!0,a[0].PromoCodeStr,a[0].msg,a[0].PerTransactionOne,!0)})}_onlineCheckout.IsBuyGC||e("#divGiftCertificatelistCart > a").removeClass("w--current"),onlineShoppingCart.ccAmt=0,onlineShoppingCart.amtPaid=0,onlineShoppingCart.tax=0,onlineShoppingCart.Rtax=0,onlineShoppingCart.taxdifference=0,onlineShoppingCart.gcAmt=0,onlineShoppingCart.RedeemedByGCtemp=[],onlineShoppingCart.RedeemedByGC=[],onlineShoppingCart.shippingSurcharge=0,onlineShoppingCart.depositTotal=0,onlineShoppingCart.classSubTotal=0,onlineShoppingCart.classTax=0,onlineShoppingCart.classGCUsed=0,onlineShoppingCart.classPackageUsed=0,onlineShoppingCart.classFinalTotal=0,onlineShoppingCart.discount=0,onlineShoppingCart.classdiscount=0,onlineShoppingCart.DepositsRemaining=0,onlineShoppingCart.InvoiceDepositsRemaining=0,onlineShoppingCart.FeeDepositsRemaining=0,onlineShoppingCart.FeeTaxDepositsRemaining=0,null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.Memberships,u),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.GiftCertificates,d),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&(_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.Packages,h),_onlineCheckout.RecalcGCONAllAddonItems(onlineShoppingCart.Packages)),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.Inventories,c),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&(_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.ServiceInvoice,m),_onlineCheckout.calculateDepositsOnInvoice(!1));var a=e.extend(!0,[],onlineShoppingCart.lstGCPkgData),s=e.grep(a,function(e){return 1==e.eventType&&null==e.quantity&&1==e.assignStatus&&e.currentBalance>0}),r=!1;if(null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){if(onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events),_onlineCheckout.ApplyDailyDealONEvents(),onlineShoppingCart.lstMembership=e.extend(!0,[],onlineShoppingCart.lstMembershipOld),_onlineCheckout.ApplyMembershipONEvents(onlineShoppingCart.Events,onlineShoppingCart.lstMembership),null!=onlineShoppingCart.lstPromotionData&&onlineShoppingCart.lstPromotionData.length>0&&"true"==isCCRequiredForOnlineClass.toLowerCase()){i=onlineShoppingCart.lstPromotionData.uniqueObjects(["PromotionID"]);e.grep(i,function(t){var i=e.grep(onlineShoppingCart.lstPromotionData,function(e){return e.PromotionID==t.PromotionID}),n=e.grep(i,function(e){return 8==e.ItemTypeID||e.ItemTypeID==v});n.length>0&&_onlineCheckout.ApplyPresetDiscountOnEvents(onlineShoppingCart.Events,n,!1,null)})}_onlineCheckout.calculateDepositsOnEvents(),_onlineCheckout.ApplyPriceBaseGCOnEvents(s,!1);e.grep(onlineShoppingCart.Events,function(t,i){return e.grep(t.eventEnrollment,function(e,t){return 4==e.paidType}).length>0&&(r=!0),r})}if(null!=onlineShoppingCart.ServiceInvoice&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){e.paidType==_onlineCheckout.arrpaidType.Paid&&(r=!0)}),onlineShoppingCartmain.IsFullDeposit=r,null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&(e.grep(onlineShoppingCart.BusinessFee,function(e){1==e.FeeType&&(e.ActualPrice=0,e.ActualTax=0,e.RemainingPrice=0,e.RemainingTax=0,e.CalculatedTax=0,e.CalculatedFeesForClass=0,e.CalculatedTaxForClass=0)}),_onlineCheckout.ApplyMultipleFeesonAllItems(0),_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.BusinessFee,g)),onlineShoppingCart.tax>0){var l=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax,2),p=onlineShoppingCart.tax;p!=l&&(onlineShoppingCart.taxdifference=_onlineCheckout.parseTodecimal(p-l,2),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax-onlineShoppingCart.taxdifference,2),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid-onlineShoppingCart.taxdifference,2),onlineShoppingCart.ccAmt>0&&onlineShoppingCart.ccAmt>onlineShoppingCart.taxdifference?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-onlineShoppingCart.taxdifference,2):onlineShoppingCart.gcAmt>0&&onlineShoppingCart.gcAmt>onlineShoppingCart.taxdifference&&(onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt-onlineShoppingCart.taxdifference,2)))}if(onlineShoppingCart.RedeemedByGCtemp.length>0){onlineShoppingCart.RedeemedByGC=[],onlineShoppingCart.RedeemedByGCtemp=e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){return 1!=e.IsClass});var f=onlineShoppingCart.RedeemedByGCtemp.uniqueObjects(["GCId"]);e.grep(f,function(t){_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg==t.Type?(objGC={},objGC.giftcertificateId=t.giftcertificateId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=t.redeemAmt,objGC.uniqID=t.uniqID,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)):_onlineCheckout.CheckoutBarcodeCodePrepayOnline.srvcGC==t.Type?(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=0,objGC.uniqID=t.uniqID,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)):(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=0,objGC.redeemAmt=0,objGC.uniqID=0,objGC.AppointmentID=0,objGC.Type="GC",e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.GCAmount,2))}),e.grep(s,function(e){t.GCId==e.giftCertificateID&&(e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-objGC.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC))})}_onlineCheckout.PaymentOptionSelectDeselect(),_onlineCheckout.checkoutGotoNextStep(!1)},_onlineCheckout.RecalcGCONAllItems=function(t,i){e.grep(t,function(e){i==c&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.discount,2),1==e.IsFreeShipping&&0==e.MasterInventoryId&&(onlineShoppingCart.shippingSurcharge=_onlineCheckout.parseTodecimal(onlineShoppingCart.shippingSurcharge+e.Quantity*e.ShippingSurcharge,2))),i==h&&null!=e.discount&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.discount,2)),i==u&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.productDisc,2)),_onlineCheckout.isValidForCheckoutInvoice()&&i==m&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.discount,2)),i==d&&(onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.discount,2)),i==c&&1==!String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)&&(e.ActualTax=void 0===e.ActualTax?0:e.ActualTax,e.redeemAmt=void 0===e.redeemAmt?0:e.redeemAmt,e.redeemTax=void 0===e.redeemTax?0:e.redeemTax,(1!=e.isPointApply||e.IsPartialPoint&&e.isPointApply)&&((e.isGCApply=null!=e.GCDetail&&e.GCDetail.length>0)&&(onlineShoppingCart.RedeemedByGCtemp=onlineShoppingCart.RedeemedByGCtemp.concat(e.GCDetail),e.ActualTax=0),i==m&&e.IsPartialPoint&&e.isPointApply?(onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3))-(e.redeemAmt+e.redeemTax)-e.PartialPrice,3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3)-e.PartialPrice),3)):(onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3))-(e.redeemAmt+e.redeemTax),3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3)),3)),_onlineCheckout.parseTodecimal(e.deposit,2)>0&&(onlineShoppingCart.depositTotal=_onlineCheckout.parseTodecimal(onlineShoppingCart.depositTotal+_onlineCheckout.parseTodecimal(e.deposit,2),2)),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax+e.ActualTax,2),onlineShoppingCart.Rtax=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax+e.ActualTax,3),onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt+e.redeemAmt+e.redeemTax,2),_onlineCheckout.isValidForCheckoutInvoice()&&1==e.isPackageApplied?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-e.ActualPrice,2):1==e.isPackageApplied&&(onlineShoppingCart.ccAmt=0))),(i!=c||i==c&&1==String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails))&&(1!=e.isPointApply||e.IsPartialPoint&&e.isPointApply)&&((e.isGCApply=null!=e.GCDetail&&e.GCDetail.length>0)&&(onlineShoppingCart.RedeemedByGCtemp=onlineShoppingCart.RedeemedByGCtemp.concat(e.GCDetail)),i==m&&e.IsPartialPoint&&e.isPointApply?(onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3))-(e.redeemAmt+e.redeemTax)-e.PartialPrice,3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3)-e.PartialPrice),3)):(onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3))-(e.redeemAmt+e.redeemTax),3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3)),3)),_onlineCheckout.parseTodecimal(e.deposit,2)>0&&(onlineShoppingCart.depositTotal=_onlineCheckout.parseTodecimal(onlineShoppingCart.depositTotal+_onlineCheckout.parseTodecimal(e.deposit,2),2)),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax+e.ActualTax,2),onlineShoppingCart.Rtax=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax+e.ActualTax,3),onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt+e.redeemAmt+e.redeemTax,2),_onlineCheckout.isValidForCheckoutInvoice()&&1==e.isPackageApplied?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-e.ActualPrice,2):1==e.isPackageApplied&&(onlineShoppingCart.ccAmt>0?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3))-(e.redeemAmt+e.redeemTax),3):onlineShoppingCart.ccAmt=0))})},_onlineCheckout.parseTodecimal=function(e,t){const i=Number(e);return Number.isNaN(i)?0:parseFloat(Number(Math.round(e+"e"+t)+"e-"+t).toFixed(t))},_onlineCheckout.FinalResponseType={Fail:0,Success:1,Distrubution:2,PartialSuccess:3,OldVersion:4,TokenMissMatch:5,ConfigurationMismatch:6,AuthorizationFail:7,ServiceMismatch:8},_onlineCheckout.SomeErrorMessage="Something went wrong! Please refresh your browser and try again!",_onlineCheckout.RemoveClassOnly=function(){onlineShoppingCart.Events=[],onlineShoppingCartmain.Events=[];var e=[];e.push(4);var t=new vagaro.ajax,i={};i.businessID=onlineShoppingCart.BusinessID,i.loginUserID=UserID,i.itemType=e,i.ischeckinApp=isCheckInApp,i.isFromInvoice=_onlineCheckout.isFromInvoice,t.datamodel.Token=ApiURLEnumOnlineCheckout.removecheckoutitem,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.callback=function(e){_onlineCheckout.getUserGCDetail()},t.datamodel.data=i,t.datamodel.Error=function(e){vagaro.alert("error")},t.Post()},_onlineCheckout.CallAdjustEvent=function(){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof onlineShoppingCartmainSuccess&&null!=onlineShoppingCartmainSuccess){if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmainSuccess.Memberships)&&onlineShoppingCartmainSuccess.Memberships.length>0){var t=0;e.grep(onlineShoppingCartmainSuccess.Memberships,function(e){t=_onlineCheckout.parseTodecimal(t+e.Price,2)}),_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.membership_purchase_completed,JSAdjustEventToken.membership_purchase_completed_eventtoken,t)}if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmainSuccess.GiftCertificates)&&onlineShoppingCartmainSuccess.GiftCertificates.length>0){var i=0;e.grep(onlineShoppingCartmainSuccess.GiftCertificates,function(e){i=_onlineCheckout.parseTodecimal(i+e.Price,2)}),_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.gift_card_purchase_completed,JSAdjustEventToken.gift_card_purchase_completed_eventtoken,i)}if(!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0){var n=0;e.grep(onlineShoppingCart.Inventories,function(t){n=_onlineCheckout.parseTodecimal(n+t.ActualPrice,2),!String.isNullOrUndefineOrBlank(t.BusinessTax)&&t.BusinessTax.length>0&&e.grep(t.BusinessTax,function(e){n=_onlineCheckout.parseTodecimal(n+e.CalculatedTax,2)})}),_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.product_purchased_completed,JSAdjustEventToken.product_purchased_completed_eventtoken,n)}if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmainSuccess.Packages)&&onlineShoppingCartmainSuccess.Packages.length>0){var o=0;e.grep(onlineShoppingCartmainSuccess.Packages,function(e){o=_onlineCheckout.parseTodecimal(o+e.TotalPrice+e.TotalAddonServicePrice,2)});var a=e.grep(onlineShoppingCartmainSuccess.Packages,function(e){return null!=e.SellPackageServiceID}),s=e.grep(onlineShoppingCartmainSuccess.Packages,function(e){return null==e.SellPackageServiceID});null!=a&&a.length>0&&_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.package_purchase_completed,JSAdjustEventToken.package_purchase_completed_eventtoken,o),null!=s&&s.length>0&&_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.book_service_completed,JSAdjustEventToken.book_service_completed_eventtoken,o)}if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmainSuccess.Events)&&onlineShoppingCartmainSuccess.Events.length>0){var r=0;e.grep(onlineShoppingCartmainSuccess.Events,function(t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&e.grep(t.eventEnrollment,function(t){r=_onlineCheckout.parseTodecimal(r+t.price,2),!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){r=_onlineCheckout.parseTodecimal(r+e.Price,2)})})}),"Request"==e("#ancBuyNow").text()?_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.class_booking_requested,JSAdjustEventToken.class_booking_requested_eventtoken,r):_shopdetail.SendAdjustDataMobileApp(JSAdjustEventName.class_booking_completed,JSAdjustEventToken.class_booking_completed_eventtoken,r)}}},_onlineCheckout.CheckoutMSG=function(t,i,n){_onlineCheckout.CallAdjustEvent(),1==i&&(e("#ancCheckoutSuccess").removeAttr("onclick"),e("#ancCheckoutSuccess").attr("onclick","_onlineCheckout.SuccessCheckinAPP();")),Webflow.destroy(),Webflow.ready();var o=!1;if(1!=_onlineCheckout.IsCalledFromLiveStream()||"undefined"==typeof onlineShoppingCartmainSuccess||null==onlineShoppingCartmainSuccess||String.isNullOrUndefineOrBlank(onlineShoppingCartmainSuccess.Events)||e.grep(onlineShoppingCartmainSuccess.Events,function(t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&e.grep(t.eventEnrollment,function(e){1!=e.StreamingStatus||String.isNullOrUndefineOrBlank(e.IsFromHomePage)||1!=e.IsFromHomePage||(o=!0)})}),_onlineCheckout.isValidForCheckoutInvoice()?(e("#dvCheckoutSuccess").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;"),e("#dvCheckoutSuccessMSG").html("Invoice Paid"),e("#dvCheckoutSuccessMSG1").html("Thank you. Your invoice was paid successfully."),e("#dvCheckoutSuccessMSG1").show()):1==t?("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,"22|~|1"),0==o&&(void 0!==n&&null!=n&&""!=n&&n.length>0?_onlineCheckout.SetClassSuccessDetails(t,n):(e("#dvCheckoutSuccess").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;"),e("#dvCheckoutSuccessMSG").html("Successful Enrollment."),e("#dvCheckoutSuccessMSG1").hide()))):0==o&&(void 0!==n&&null!=n&&""!=n&&n.length>0?_onlineCheckout.SetClassSuccessDetails(t,n):(e("#dvCheckoutSuccess").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;"),e("#dvCheckoutSuccessMSG").html("Successful Checkout"),1==_onlineCheckout.isCheckoutVPLChanged?1==_siteBuilderDetail.isAffirmEnable?(e("#dvCheckoutSuccessMSG1").show(),e("#dvCheckoutVplAmt").hide(),e("#dvCheckoutVplPart").hide(),e("#dvCheckoutVplMsg").hide()):(e("#dvCheckoutSuccessMSG1").hide(),e("#dvCheckoutVplAmt").show(),e("#dvCheckoutVplPart").show(),e("#dvCheckoutVplMsg").show()):e("#dvCheckoutSuccessMSG1").show().css("display","flex"))),1==o){var a=[],s=0,r="",l="",c=!1;e.grep(onlineShoppingCartmainSuccess.Events,function(t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&e.grep(t.eventEnrollment,function(e){var i=new Date(e.workshopActualDate).format(_onlineCheckout.DateFormatdddMMM_ddYYYY),n=new Date(e.workshopActualDate).format(_onlineCheckout.DateFormatdddMMM_ddYYYY),o=e.startTime.replace(/^0+/,""),d="";String.isNullOrUndefineOrBlank(e.CustomerTimeZone)||(i=moment(e.CustomerStartTime).format(_onlineCheckout.DateFormatdddMMMDDYYYY),n=moment(e.CustomerStartTime).format(_onlineCheckout.DateFormatdddMMMDDYYYY),o=moment(e.CustomerStartTime).format("h:mm A"),d=" ("+e.CustomerTimeZone+")");var u={};u.autoId=s,u.date=i,u.dateLable=n,u.time=o+d,u.image=e.SpPhoto,u.servicename=t.eventName,u.spname=e.sPName,u.ZoomURL=e.ZoomURL,u.IsFromHomePage=!1,String.isNullOrUndefineOrBlank(e.IsFromHomePage)||1!=e.IsFromHomePage||(u.IsFromHomePage=!0),u.spinit=FindInitials(e.sPName,"SP"),1==e.StreamingStatus?u.LiveStreamingStatus=!0:u.LiveStreamingStatus=!1,u.ShowLiveStream=!1,e.EventDurationRemain<6&&(u.ShowLiveStream=!0),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&(u.lstAddonService=e.lstAddonService),a.push(u),""==l?(l=u.date,c=!1):u.date!=l&&(c=!0),r=moment(e.workshopActualDate),String.isNullOrUndefineOrBlank(e.CustomerTimeZone)||(r=moment(e.CustomerStartTime)),s++})});var d=e("#divClassBookSuccess");e("#classDateBox").hide(),0==c&&(e("#classDateBox").show(),d.find("#classDateBox").attr("aria-label",r.format("MMMM").toUpperCase()+r.format("D")).attr("role","banner"),d.find(".booked-month").html(r.format("MMM").toUpperCase()).attr("aria-hidden",!0),d.find(".booked-date").html(r.format("D")).attr("aria-hidden",!0),d.find("#divstatusicon").attr("class","green-circle-div").attr("aria-hidden",!0).html("&#xf00c;")),s>1?d.find("#divappttitletext").html("You're signed up for the classes."):d.find("#divappttitletext").html("You're signed up for the class."),d.find("#divapptparagraphtext").html("You're all set with "+businessName+"."),e("#divclassbooking").html(""),e("#divtempclassbooking").tmpl(a).appendTo("#divclassbooking"),e(".apptproviderimg").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload"),e("#divClassBookSuccess").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;")}"undefined"!=typeof onlineShoppingCartmainSuccess&&(onlineShoppingCartmainSuccess=null),e("#shoppingcartsecond").hide(),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,29),e(_cardIntendent.Controls.frame3d_cardintent).hide(),e(_cardIntendent.Controls.zenswipepaymentframe).removeClass("showpopup")},_onlineCheckout.threeDSSuccessCheckout=function(e){if(void 0!==e&&null!=e){if(_onlineCheckout.AuthorisePaymnetCount=_onlineCheckout.AuthorisePaymnetCount+1,_onlineCheckout.AuthoriseListData.length>_onlineCheckout.AuthorisePaymnetCount)return _onlineCheckout.AuthoriseListData[_onlineCheckout.AuthorisePaymnetCount-1].PaymentIntentId=e.PaymentIntentResponse.PaymentIntentId,_onlineCheckout.AuthorisePayment(),!1;_onlineCheckout.AuthoriseListData[_onlineCheckout.AuthorisePaymnetCount-1].PaymentIntentId=e.PaymentIntentResponse.PaymentIntentId,_onlineCheckout.ValidateCartData()}},_onlineCheckout.threeDSFailCheckout=function(t){_onlineCheckout.SetCheckoutAuthResult("fail","",t&&t.paymentGateway?t.paymentGateway:null,t&&t.subResponseCode?t.subResponseCode:"",t&&t.Message?t.Message:"3DS/SCA authorization failed"),_onlineCheckout.FireOnlineCheckoutCompleted(),e("#tabCheckoutBooking2").hasClass("w--current")&&(_onlineCheckout.LoadBalnkCCFrame(),_onlineCheckout.isCheckoutCCChanged=!0),_onlineCheckout.AuthoriseListData=[],_onlineCheckout.AuthorisePaymnetCount=0,FailedCapture3DSecurePopup()},_onlineCheckout.AffirmSuccessCheckout=function(e){void 0!==e&&null!=e&&(_onlineCheckout.AuthoriseListData[0].PSPReferenceNo=e.PaymentIntentResponse.PSPReferenceNo,_onlineCheckout.ValidateCartData())},_onlineCheckout.AffirmFailCheckout=function(e){_onlineCheckout.SetCheckoutAuthResult("fail","",e&&e.paymentGateway?e.paymentGateway:null,e&&e.subResponseCode?e.subResponseCode:"",e&&e.Message?e.Message:"Affirm/VPL authorization failed"),_onlineCheckout.FireOnlineCheckoutCompleted(),String.isNullOrUndefineOrBlank(e)||String.isNullOrUndefineOrBlank(e.PaymentIntentResponse)||String.isNullOrUndefineOrBlank(e.PaymentIntentResponse.PSPReferenceNo)||"FAIL"!=e.PaymentIntentResponse.PSPReferenceNo?(_shopdetail.ResetVPLPaymentMethod(!0,!0),_onlineCheckout.AuthorisePaymnetCount=0,_onlineCheckout.AuthoriseListData=[],FailedCapture3DSecurePopup()):(_onlineCheckout.AuthorisePaymnetCount=0,_onlineCheckout.AuthoriseListData=[])},_onlineCheckout.AuthoriseAffirmPayment=function(){var e={};e.CountryID=countryIdBusDetail,e.PaymentIntentURL=_onlineCheckout.AuthoriseListData[0].NextActionUrl,e.SuccessCallBack=SuccessCallBack=_onlineCheckout.AffirmSuccessCheckout,e.FailedCallback=_onlineCheckout.AffirmFailCheckout,e.IsAffirm=!0,_cardIntendent.LoadCardCaptureIntendentInfo(e)},_onlineCheckout.ChekoutResponse=function(t){ShowLoader(!0),_onlineCheckout.CaptureCheckoutAuthResult(t);var i=!1;if(null==t)return _onlineCheckout.FireOnlineCheckoutCompleted(),void swal({html:!0,title:"Something went wrong. Please search again."});if(_onlineCheckout.AuthorisePaymnetCount=0,_onlineCheckout.CreateAuthoriseList(t),_onlineCheckout.AuthoriseListData.length>0)void 0!==_onlineCheckout.AuthoriseListData[0].IsVPLTransaction&&1==_onlineCheckout.AuthoriseListData[0].IsVPLTransaction?_onlineCheckout.AuthoriseAffirmPayment():_onlineCheckout.AuthorisePayment();else{if(_onlineCheckout.FireOnlineCheckoutCompleted(),null!=t.checkoutResponse&&null!=t.checkoutResponse.resultType&&9==t.checkoutResponse.resultType&&null!=t.checkoutResponse.resultMessage)return void CallbackforMobileApp(0,0,"","",0,"36|~|"+t.checkoutResponse.resultMessage);if(null!=t.checkoutResponse&&null!=t.checkoutResponse.resultType&&10==t.checkoutResponse.resultType&&null!=t.checkoutResponse.resultMessage){var n;return n=location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")+"/ReleaseToPublicPending.aspx",void(location.href=n)}1==isCheckInApp&&centerModal("#divClassValidationpopupchk");var o=!1,a=!1,s=!1,r="",l="";if(onlineShoppingCartmainSuccess=e.extend(!0,{},onlineShoppingCartmain),t.OnlineCheckoutType==x||t.OnlineCheckoutType==F){var d=t.classCheckoutResponse;if(null!=d&&d.length>0){var u=t.classCheckoutResponse[0].response;if(void 0!==u&&null!=u&&void 0!==u.subResponseCode&&null!=u.subResponseCode&&"58-43-1"==u.subResponseCode&&(ShowLoader(!1),CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed)),4==d[0].type){if(ClassCartInvoiceNum=null,0==isCheckInApp&&(bkEvent.timeSlotsCache={}),t.OnlineCheckoutType==x){if("true"==IsClassReschedule.toLowerCase()){IsClassReschedule="false";var p=!1;e(".cartremoverdtl").each(function(t,i){void 0!==e(i).attr("data-isWorkShop")&&"true"==e(i).attr("data-isWorkShop").toLowerCase()&&(p=!0)});var h=_shopdetail.GetRescheduleDetail();if(p&&null!=h&&void 0!==h.EventSessionAttendeesId){var m={eventSsnAtIds:h.EventSessionAttendeesId,userId:onlineShoppingCart.loginUserId,status:12,device:"Deleted",denyComments:"",isCancelledByCustomer:!1,isSendMail:!1,isWorkshop:!0};_onlineCheckout.removeEventSessionAttendies(m,function(e){},function(e){})}}1==_onlineCheckout.IsCCDetailEnable()?(1==isCheckInApp&&navigator.userAgent.toLowerCase().indexOf("ipad")>-1&&e("#txtfocusbox").blur(),i=!0,_onlineCheckout.CheckoutMSG(!1,isCheckInApp,onlineShoppingCartmain.Events)):(i=!0,_onlineCheckout.CheckoutMSG(!0,isCheckInApp,onlineShoppingCartmain.Events)),ShowLoader(!1),onlineShoppingCart.Events=[],onlineShoppingCartmain.Events=[],(N=[]).push(4);var g=new vagaro.ajax;(R={}).businessID=onlineShoppingCart.BusinessID,R.loginUserID=UserID,R.itemType=N,R.ischeckinApp=isCheckInApp,R.isFromInvoice=_onlineCheckout.isFromInvoice,R.IsLiveStream=_onlineCheckout.IsCalledFromLiveStream(),g.datamodel.Token=ApiURLEnumOnlineCheckout.removecheckoutitem,g.datamodel.IsNewVagaroAPI=!0,g.datamodel.callback=function(t){0==i?e("#shoppingcartfirst").show():e("#shoppingcartfirst").hide(),e("#shoppingcartsecond").hide(),e("#shoppingcartfirst .divnoitem").removeAttr("style"),e("#shoppingcartfirst .divcartdetail").attr("style","display:none;"),e("#shoppingcartfirst .divheadertext").html("There are no items in the cart."),_onlineCheckout.GetCartItemCount(0)},g.datamodel.data=R,g.datamodel.Error=function(e){vagaro.alert("error")},g.Post()}else o=!0;ShowLoader(!1)}else if(6==d[0].type){if(0==isCheckInApp&&(bkEvent.timeSlotsCache={}),r="",""!=d[0].successSPlist)for(var v=d[0].successSPlist.split(","),f=0;f<=v.length-1;f++)v.length>1&&f==v.length-2?r+=_vgClassSessionSelection.findSPnameByspid(parseInt(v[f]))+" and ":r+=_vgClassSessionSelection.findSPnameByspid(parseInt(v[f]))+",";if(null!=d[0].failSPlistAndReason&&d[0].failSPlistAndReason.length>0){var C=d[0].failSPlistAndReason,S=[];l="";for(f=0;f<=C.length-1;f++)e.grep(C[f].spID,function(e){var t={};t.spID=parseInt(e),t.spName=_vgClassSessionSelection.findSPnameByspid(parseInt(e)),t.failReason=C[f].failReason,S.push(t)}),C.length>1&&f==C.length-2?null!=C[f].spID&&C[f].spID.length>0&&(l+=_vgClassSessionSelection.findSPnameByspid(parseInt(C[f].spID[0]))+" and "):null!=C[f].spID&&C[f].spID.length>0&&(l+=_vgClassSessionSelection.findSPnameByspid(parseInt(C[f].spID[0]))+",");if(""!=d[0].successSPlist&&""!=r){var y=onlineShoppingCartmain.Events;if(y.length>0)for(var b=0;b<=y.length-1;b++){var k=[];for(f=0;f<=S.length-1;f++){var _=e.grep(y[b].eventEnrollment,function(e){return e.sPID==S[f].spID});_.length>0&&(k=k.concat(_))}k.length>0?y[b].eventEnrollment=k:y.splice(b,1)}y.length>0&&(onlineShoppingCartmain.Events=y,_vgClassSessionSelection.SetIntoSessionStorage(_vgClassSessionSelection.model.EventStorage,y))}}if(""!=d[0].successSPlist&&""!=r)r=r.escapeHtml().slice(0,-1),""!=l&&(l=l.escapeHtml().slice(0,-1)),t.OnlineCheckoutType==x?(swal({html:!0,title:"Please note: Due to some error, your enrollment(s) went through with "+r+" and it didn't go through with "+l+"."}),setTimeout(function(){_onlineCheckout.getUserGCDetail()},2e3)):a=!0;else if(t.OnlineCheckoutType==x)if(void 0!==u.paymentGateway&&null!=u.paymentGateway&&void 0!==u.subResponseCode&&null!=u.subResponseCode){var D="Message:"+u.Message+"<br/>Error Code:"+u.paymentGateway+"-"+u.subResponseCode;swal({html:!0,title:D})}else{D="Message:"+u.Message;swal({html:!0,title:D})}else s=!0}else if(1==d[0].type)e.each(d,function(e,t){clsObj=_vgClassSessionSelection.findClassObjByAppId(t.appointmentId),t.className=clsObj.className,t.sessionTime=clsObj.startTime,t.spName=clsObj.sPName,t.eventDate=_vgClassSessionSelection.FormatDate(clsObj.eventDate),t.isVacancyFull=t.vacancy<=0}),e("#tBodyClassValidationTemp").html(""),e("#classValidationCheckoutTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"),e("#validationpopupcls").html(e("#divClassValidationTemp").html()),e("#divClassValidationpopupchk").modal("show");else if(2==d[0].type)e.each(d,function(e,t){if(clsObj=_vgClassSessionSelection.findClassObjByAppId(t.appointmentId),t.className=clsObj.className,t.sessionTime=clsObj.startTime,t.spName=clsObj.sPName,t.eventDate=_vgClassSessionSelection.FormatDate(clsObj.eventDate),""!=t.userDataXml){var i=t.userDataXml.split(" ")[0],n="";void 0!==t.userDataXml.split(" ")[1]&&(n=t.userDataXml.split(" ")[1]),t.username=""!=n?_vgClassSessionSelection.GetUserShortDetail(i,n):i+"."}else t.username=""}),e("#tBodyClassValidationTemp").html(""),e("#UserAlreadyEnrolledTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"),e("#validationpopupcls").html(e("#divClassValidationTemp").html()),e("#divClassValidationpopupchk").modal("show"),ShowLoader(!1);else if(7==d[0].type)e.each(d,function(e,t){clsObj=_vgClassSessionSelection.findClassObjByAppId(t.appointmentId),t.className=clsObj.className,t.sessionTime=clsObj.startTime,t.spName=clsObj.sPName,t.eventDate=_vgClassSessionSelection.FormatDate(clsObj.eventDate)}),e("#tBodyClassValidationTemp").html(""),e("#ClassDeleteTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"),e("#validationpopupcls").html(e("#divClassValidationTemp").html()),e("#divClassValidationpopupchk").modal("show");else if(8==d[0].type)swal({html:!0,title:"Your order is not free of cost. It requires credit card information. Please go back and search again."});else if(9==d[0].type||10==d[0].type||11==d[0].type||12==d[0].type||13==d[0].type){_vgClassSessionSelection.GetGCorPackage();e.each(d,function(e,t){if(1==t.isCustomPackage)var i=_vgClassSessionSelection.findClassObjByGcIdAndEventId(t.gcId,t.eventId);else i=_vgClassSessionSelection.findClassObjByGcId(t.gcId);i.length>0&&(t.className=i[0].className,t.username=_vgClassSessionSelection.GetUserShortDetail(i[0].cFirstName,i[0].cLastName),1==i[0].isPackage?t.giftcertificate="package":0==i[0].isPackage?t.giftcertificate="gift card":t.giftcertificate="")}),e("#tBodyClassValidationTemp").html(""),9==d[0].type?e("#GCNotAvalableTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"):10==d[0].type?e("#GCExpiredTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"):11==d[0].type?e("#GCVoidedTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"):12==d[0].type?e("#GCNotServiceBalTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"):13==d[0].type&&e("#GCNotPriceBalTemplate").tmpl(d).appendTo("#tBodyClassValidationTemp"),e("#validationpopupcls").html(e("#divClassValidationTemp").html()),e("#divClassValidationpopupchk").modal("show"),_onlineCheckout.getUserGCDetail()}else if(5==d[0].type)swal({html:!0,title:"Something went wrong. Please search again."});else if(14==d[0].type)swal({html:!0,title:"User point redeem exceed point balance limit."});else if(15==d[0].type)swal({html:!0,title:"Membership DeActivated / Membership Discount Not Match."});else if(16==d[0].type){var I="";e.grep(d,function(e){I+=e.userDataXml+", "}),d[0].userDataXml=I.trimRight().slice(0,-1);var w=[];w.push(d[0]),e("#tBodyClassValidationTemp").html(""),e("#ClassOnlineBookBlockTemplate").tmpl(w).appendTo("#tBodyClassValidationTemp"),e("#validationpopupcls").html(e("#divClassValidationTemp").html()),e("#divClassValidationpopupchk").modal("show")}}_common.GooglePostCall(onlineShoppingCart.BusinessID)}if(t.OnlineCheckoutType==T||t.OnlineCheckoutType==F){var P=t.checkoutResponse;if(null!=P&&null!==P.resultType){if(P.resultType===_onlineCheckout.FinalResponseType.OldVersion||P.resultType===_onlineCheckout.FinalResponseType.ConfigurationMismatch)1==o?(swal({html:!0,title:"Please note: Your enrollment(s) for classes went through but for other item(s) "+_onlineCheckout.SomeErrorMessage}),_onlineCheckout.RemoveClassOnly()):1==a?(""!=r&&""!=l?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes with "+r+" went through. Your enrollment(s) with "+l+" and transacion for other item(s) didnot go through."}):swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes didn't go through with "+l+" and the transacion for other item(s) didnot go through."}),setTimeout(function(){_onlineCheckout.getUserGCDetail()},2e3)):swal({html:!0,title:_onlineCheckout.SomeErrorMessage});else if(P.resultType===_onlineCheckout.FinalResponseType.TokenMissMatch){var A="Our system indicates that there is some network related error. Your transaction might be completed. It's recommended to verify Transaction List Report to avoid duplicate Transactions.";1==o?(swal({html:!0,title:"Please note: Your enrollment(s) for classes went through but for other item(s) "+A}),_onlineCheckout.RemoveClassOnly()):1==a?(""!=r&&""!=l?swal({html:!0,title:"Your enrollment(s) went through with "+r+",enrollment didn't go through with "+l+" and for other item(s) "+A}):swal({html:!0,title:"Your enrollment(s) didn't go through with "+l+" and for other item(s) "+A}),setTimeout(function(){_onlineCheckout.getUserGCDetail()},2e3)):swal({html:!0,title:A})}else if(P.resultType===_onlineCheckout.FinalResponseType.ServiceMismatch)swal({html:!0,title:P.resultMessage+" Or contact the shop owner."});else if(P.resultType===_onlineCheckout.FinalResponseType.Fail)if(null!=P.gatewayResponse&&void 0!==P.gatewayResponse.subResponseCode&&null!=P.gatewayResponse.subResponseCode&&"58-43-1"==P.gatewayResponse.subResponseCode&&CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed),1==o)swal({html:!0,title:"Please note: Your enrollment(s) for classes went through but the transaction for other item(s) didnot go through."}),_onlineCheckout.RemoveClassOnly();else if(1==a)""!=r&&""!=l?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes with "+r+" went through. Your enrollment(s) with "+l+" and transacion for other item(s) didnot go through."}):swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes didn't go through with "+l+" and the transacion for other item(s) didnot go through."}),setTimeout(function(){_onlineCheckout.getUserGCDetail()},2e3);else{if((D=P.resultMessage.replace("Something went wrong. Please try again.","")).includes("Certegy")){e(".customeb-body p").html("");var $=P.resultMessage.split("|~|");e("#vpl-payment-fail-popup").modal("show");var O=$[0],M=$[1];return e(".customeb-body p").html(O),e(".customeb-body-last #certegydate").html(String.format("{0}",(new Date).format("MMMM dd, yyyy hh:mm"))),e(".customeb-body-last #certegyref").text(M),ShowLoader(!1),e(".modal:visible").each(function(e,t){centerModal(t)}),!1}swal({html:!0,title:D},function(e){_shopdetail.ResetVPLPaymentMethod(!0,!0),L(P)})}else if(P.resultType===_onlineCheckout.FinalResponseType.AuthorizationFail){var B=parseFloat(P.resultMessage);isNaN(B)&&(B=0);A="didnot go through.";1==o?(swal({html:!0,title:"Please note: Your enrollment(s) for classes went through but the transaction for other item(s) didnot go through."}),_onlineCheckout.RemoveClassOnly()):1==a?(""!=r&&""!=l?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes with "+r+" went through. Your enrollment(s) with "+l+" and transacion for other item(s) didnot go through."}):swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes didn't go through with "+l+" and the transacion for other item(s) didnot go through."}),setTimeout(function(){_onlineCheckout.getUserGCDetail()},2e3)):swal({html:!0,title:"Something went wrong. Please try again."})}else if(P.resultType===_onlineCheckout.FinalResponseType.PartialSuccess){var E=!1;e.each(P.partiallyFailed,function(e,t){t.recordType==c&&0==E&&(E=!0)});var N=[];if(1==E)onlineShoppingCart.GiftCertificates=[],onlineShoppingCartmain.GiftCertificates=[],onlineShoppingCart.Memberships=[],onlineShoppingCartmain.Memberships=[],onlineShoppingCart.Packages=[],onlineShoppingCartmain.Packages=[],N.push(2),N.push(3),N.push(5),1==o?(onlineShoppingCart.Events=[],onlineShoppingCartmain.Events=[],N.push(4),swal({html:!0,title:"Your enrollment(s) for classes went through but the transaction for product(s) didnot go through."})):1==a?""!=r&&""!=l?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes with "+r+" went through. Your enrollment(s) with "+l+" and transacion for product(s) didnot go through."}):swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes didn't go through with "+l+" and the transacion for product(s) didnot go through."}):1==s?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes and transaction for Product(s) didnot go through."}):swal({html:!0,title:"Product(s) checkout didnot go through."});else{var U="";null!=onlineShoppingCart.GiftCertificates&&GiftCertificates.length>0&&(U+="GiftCertificate(s),"),null!=onlineShoppingCart.Memberships&&Memberships.length>0&&(U+="Membership(s),"),null!=onlineShoppingCart.Packages&&Packages.length>0&&(U+="Package(s),"),U=U.escapeHtml().slice(0,-1),1==o?(onlineShoppingCart.Events=[],onlineShoppingCartmain.Events=[],N.push(4),swal({html:!0,title:"Your enrollment(s) for classes went through but the transaction for "+U+" didnot go through."})):1==a?""!=r&&""!=l?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes with "+r+" went through. Your enrollment(s) with "+l+" and transacion for "+U+" didnot go through."}):swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes didn't go through with "+l+" and the transacion for "+U+" didnot go through."}):1==s?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes and transaction for "+U+" didnot go through."}):swal({html:!0,title:U+" checkout didnot go through."}),onlineShoppingCart.Inventories=[],onlineShoppingCartmain.Inventories=[],N.push(1)}g=new vagaro.ajax;(R={}).businessID=onlineShoppingCart.BusinessID,R.loginUserID=UserID,R.itemType=N,R.ischeckinApp=isCheckInApp,R.isFromInvoice=_onlineCheckout.isFromInvoice,R.IsLiveStream=_onlineCheckout.IsCalledFromLiveStream(),g.datamodel.Token=ApiURLEnumOnlineCheckout.removecheckoutitem,g.datamodel.IsNewVagaroAPI=!0,g.datamodel.callback=function(e){_onlineCheckout.getUserGCDetail()},g.datamodel.data=R,g.datamodel.Error=function(e){vagaro.alert("error")},g.Post()}else if(P.resultType===_onlineCheckout.FinalResponseType.Success){N=[];CartInvoiceNum=null,1==o?(N.push(4),i=!0,_onlineCheckout.CheckoutMSG(!1,isCheckInApp,onlineShoppingCartmain.Events)):1==a?""!=r&&""!=l?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes with "+r+" went through. Your enrollment(s) with "+l+"  didnot go through and transacion for other item(s) item(s) did go through."}):swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes didn't go through with "+l+" and transacion for other item(s) item(s) did go through."}):1==s?swal({html:!0,title:"Please note: Due to some error, your enrollment(s) for classes didn't go through but the transaction for other item(s) did go through."}):(i=!0,_onlineCheckout.CheckoutMSG(!1,isCheckInApp,onlineShoppingCartmain.Events)),onlineShoppingCart.Events=[],onlineShoppingCartmain.Events=[],onlineShoppingCart.GiftCertificates=[],onlineShoppingCartmain.GiftCertificates=[],onlineShoppingCart.Memberships=[],onlineShoppingCartmain.Memberships=[],onlineShoppingCart.Packages=[],onlineShoppingCartmain.Packages=[],onlineShoppingCart.Inventories=[],onlineShoppingCartmain.Inventories=[],N.push(1),N.push(2),N.push(3),N.push(5);var R;g=new vagaro.ajax;(R={}).businessID=onlineShoppingCart.BusinessID,R.loginUserID=UserID,R.itemType=N,R.ischeckinApp=isCheckInApp,R.isFromInvoice=_onlineCheckout.isFromInvoice,R.IsLiveStream=_onlineCheckout.IsCalledFromLiveStream(),g.datamodel.Token=ApiURLEnumOnlineCheckout.removecheckoutitem,g.datamodel.IsNewVagaroAPI=!0,g.datamodel.callback=function(t){1==a||1==s?_onlineCheckout.getUserGCDetail():(0==i&&e("#shoppingcartfirst").show(),e("#shoppingcartsecond").hide(),e("#shoppingcartfirst .divnoitem").removeAttr("style"),e("#shoppingcartfirst .divcartdetail").attr("style","display:none;"),e("#shoppingcartfirst .divheadertext").html("There are no items in the cart."),_onlineCheckout.GetCartItemCount(0))},g.datamodel.data=R,g.datamodel.Error=function(e){vagaro.alert("error")},g.Post()}if(null!==P.printObjects&&P.printObjects.length>0){var W="",G="",V=!1;if(e.each(P.printObjects,function(e,t){t.printType===_onlineCheckout.PrintType.Receipt||t.printType===_onlineCheckout.PrintType.GC&&(ShowLoader(!1),W=_onlineCheckout.getParameterFromUrl(t.printData,"BussURl"),G=G+","+_onlineCheckout.getParameterFromUrl(t.printData,"img"),V=!0)}),1==V)if(W.includes("https://")||(W="https://"+W),"undefined"!=typeof vgAppicationType&&1==vgAppicationType){G=","==(G=","==G.charAt(0)?G.substr(1):G).charAt(G.length-1)?G.substr(0,G.length-1):G,CallbackforMobileApp(0,0,"","","0","9|~|"+('{\\"vagarourl\\":\\"'+(W+("/"!=W.charAt(W.length-1)?"/":"")+("undefined"!=typeof GCTextOnImageAkamai&&""!=GCTextOnImageAkamai?GCTextOnImageAkamai:""))+'\\", \\"imagename\\":\\"'+G+'\\"}')),HideDynamicPopup("divPrintGC")}else{var H="/ShopOwner/PrintMultipleGC.aspx?BussID="+onlineShoppingCart.BusinessID+"&img="+G;ShowDynamicPopupForShopOwner(H,510,970,"divPrintGC","Print GC")}}else ShowLoader(!1)}}}},_onlineCheckout.SuccessCheckinAPP=function(){null!=glbMembershipData.membershipID&&1==onlineShoppingCart.ChekoutType?null!=glbMembershipData.membershipCardNo?CallbackforMobileScreen(null):"function"==typeof InsertCheckInLog&&(glbDataCheckIn.requiredMembershipStatus=2,InsertCheckInLog()):"function"==typeof CheckInSuccessRedirection&&(glbDataCheckIn.requiredMembershipStatus=2,CheckInSuccessRedirection())},_onlineCheckout.ShowSweetConfirmCheckInLogEntry=function(e,t,i,n){swal({title:e,text:"",type:"success",showCancelButton:n,confirmButtonClass:"btn-danger",confirmButtonText:"OK",cancelButtonText:"",closeOnConfirm:!1,closeOnCancel:!1,customClass:"swal-white-greenbtn"},function(e){return swal.close(),1==e&&(null!=glbMembershipData.membershipID&&1==onlineShoppingCart.ChekoutType?null!=glbMembershipData.membershipCardNo?CallbackforMobileScreen(null):"function"==typeof InsertCheckInLog&&InsertCheckInLog():"function"==typeof CheckInSuccessRedirection&&CheckInSuccessRedirection(),!0)})},_onlineCheckout.ApplyPointsONClass=function(){e.each(onlineShoppingCart.Events,function(t,i){i.PointRedeem>0&&e.each(i.eventEnrollment,function(t,n){var o=e.grep(onlineShoppingCart.UsersPoints,function(e){return e.userId==n.customerID&&e.userId>0||e.emailId==n.cUserEmail&&""!=e.emailId});if(null!=(o=o[0])&&null!=o&&o.pointsBalance>0){var a=1*i.PointRedeem;a>0&&o.pointsBalance>=a&&(n.isPointApply=!0,n.PointRedeem=a,n.pointGained=0,o.pointsBalance=parseInt(o.pointsBalance-a),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(n.PointRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(n.PointRedeem))}1!=n.isPointApply&&(n.PointRedeem=0)})})};var $=0,O=0,M=!0;_onlineCheckout.GetPackageSessionWisePrice=function(e,t,i){$=0,O=0;var n=[],o=e;if(1==i){for(var a=0;a<=o.length-1;a++){if(!(parseInt(t)>=parseInt(o[a].split("-")[1]))){_onlineCheckout.GetPackageSessionWisePrice(e,t+1,1),M=!1;break}if(t==parseInt(o[a].split("-")[1])){$=parseInt(o[a].split("-")[1]),O=parseFloat(o[a].split("-")[2]),M=!1;break}M=!0}M&&_onlineCheckout.GetPackageSessionWisePrice(e,t-1,1)}else{for(a=o.length-1;a>=0;a--){if(!(parseInt(t)<=parseInt(o[a].split("-")[1]))){_onlineCheckout.GetPackageSessionWisePrice(e,t-1,0),M=!1;break}if(t==parseInt(o[a].split("-")[1])){$=parseInt(o[a].split("-")[1]),O=parseFloat(o[a].split("-")[2]),M=!1;break}M=!0}M&&(1!=t?_onlineCheckout.GetPackageSessionWisePrice(e,t+1,0):$=o[0].split("-")[1])}return n[0]=$,n[1]=O,n},_onlineCheckout.GetClassSessionWisePrice=function(e,t,i){for(var n=0,o=0,a=e.split(","),s=0;s<=a.length-1&&parseInt(t)>=parseInt(a[s].split("-")[1]);s++)n=parseInt(a[s].split("-")[1]),o=parseFloat(a[s].split("-")[2]);return(parseInt(t)*o/n*parseInt(i)).toFixed(2)},_onlineCheckout.errorMessage=function(){e(".checkoutvalerror").remove(),String.isNullOrUndefineOrBlank(onlineShoppingCartmain)||_onlineCheckout.isValidForCheckoutInvoice()||(String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Inventories)||e.each(onlineShoppingCartmain.Inventories,function(t,i){!String.isNullOrUndefineOrBlank(i.errors)&&i.errors.length>0&&e.each(i.errors,function(t,n){e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId.toString()+'"]').find("div.div-block-42").append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+n.Message+"</div>")})}),String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Memberships)||e.each(onlineShoppingCartmain.Memberships,function(e,t){!String.isNullOrUndefineOrBlank(t.errors)&&t.errors.length}),String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Packages)||e.each(onlineShoppingCartmain.Packages,function(t,i){!String.isNullOrUndefineOrBlank(i.errors)&&i.errors.length>0&&e.each(i.errors,function(t,n){e('div [data-type="servicepackage"][data-rid="'+i.ServiceId+'"][data-autoid="'+i.autoId+'"]').find("div.div-block-47 > div").append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+n.Message+"</div>")})}),String.isNullOrUndefineOrBlank(onlineShoppingCartmain.GiftCertificates)||e.each(onlineShoppingCartmain.GiftCertificates,function(t,i){!String.isNullOrUndefineOrBlank(i.errors)&&i.errors.length>0&&e.each(i.errors,function(t,n){e('div [data-type="gc"][data-rid="'+i.GiftCertificatePhotoID.toString()+'"][data-autoid="'+i.autoId+'"]').find(".div-block-42").append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+n.Message+"</div>")})}),String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Events)||e.each(onlineShoppingCartmain.Events,function(t,i){!String.isNullOrUndefineOrBlank(i.eventEnrollment)&&i.eventEnrollment.length>0&&e.each(i.eventEnrollment,function(t,i){!String.isNullOrUndefineOrBlank(i.errors)&&i.errors.length>0&&e.each(i.errors,function(t,n){e('div [data-type="classes"][data-rid="'+i.eventID.toString()+'"][data-autoid="'+i.autoID.toString()+'"] > div').append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+n.Message+"</div>")})})}))},_onlineCheckout.setShippingAddressObject=function(){if(onlineShoppingCart.IsPickupInStore=e("#btnInStorePickup").hasClass("w--current"),onlineShoppingCart.IsAddressOnFile=e("#aOldUserAddress").hasClass("w--current"),0==onlineShoppingCart.IsPickupInStore)if(1==onlineShoppingCart.IsAddressOnFile)onlineShoppingCart.Address={},onlineShoppingCart.Address.fullName=e("#aOldUserAddress").attr("data-fullname"),onlineShoppingCart.Address.street=e("#aOldUserAddress").attr("data-street"),onlineShoppingCart.Address.streetNo=e("#aOldUserAddress").attr("data-streetno"),onlineShoppingCart.Address.stateName=e("#aOldUserAddress").attr("data-statename"),onlineShoppingCart.Address.countryID=e("#aOldUserAddress").attr("data-countryid"),onlineShoppingCart.Address.city=e("#aOldUserAddress").attr("data-City"),onlineShoppingCart.Address.zip=e("#aOldUserAddress").attr("data-zip"),onlineShoppingCart.Address.dayPhone=e("#aOldUserAddress").attr("data-dayphone"),onlineShoppingCart.Address.stateID=e("#aOldUserAddress").attr("data-stateid"),onlineShoppingCart.Address.isSaveAddressinfo=!1;else{onlineShoppingCart.Address={},onlineShoppingCart.Address.fullName=e("#txtNewShipFirstName").val()+" "+e("#txtNewShipLastName").val(),onlineShoppingCart.Address.dayPhone=e("#txtNewShipPhone").val();var t;t=newShippingAddress.getAddressData(),onlineShoppingCart.Address.street=t.address,onlineShoppingCart.Address.streetNo=e("#txtNewShippingAptSuite").val(),onlineShoppingCart.Address.stateName=t.state,onlineShoppingCart.Address.countryID=t.country,onlineShoppingCart.Address.city=t.city,onlineShoppingCart.Address.zip=t.zip,onlineShoppingCart.Address.stateID=t.stateId,onlineShoppingCart.Address.isSaveAddressinfo=e("#saveaddressinfo").prop("checked")}else onlineShoppingCart.Address=null;try{onlineShoppingCart.PickupDate=moment(getdatepickervalue("#txtPickupDateTime"))._d}catch(e){}_onlineCheckout.displayFinalCalculatedPrice()},_onlineCheckout.ValidateCheckOutForm=function(){_onlineCheckout.setShippingAddressObject(),_onlineCheckout.ClearCheckOutValidationMessage();var t=!0;if(!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&!_onlineCheckout.isValidForCheckoutInvoice())if(onlineShoppingCart.IsPickupInStore=e("#btnInStorePickup").hasClass("w--current"),onlineShoppingCart.IsPickupInStore){try{onlineShoppingCart.PickupDate=moment(getdatepickervalue("#txtPickupDateTime"))._d}catch(e){onlineShoppingCart.PickupDate=moment(new Date)._d}var n=onlineShoppingCart.PickupDate.getDay()+1;0==(null!=_onlineCheckout.businessWorkinghour.filter(function(e){return e.DayID===n})[0])&&(e("#divPickupDateError").show(),e("#divPickupDateError").html(""),e("#divPickupDateError").html("Business is closed on pickup date. Please select another pickup date"),e("#txtPickupDateTime").addClass("errorInput"),t=!1);var o,a="";for(i=1;i<=7;i++){switch(i){case 1:o="Sunday";break;case 2:o="Monday";break;case 3:o="Tuesday";break;case 4:o="Wednesday";break;case 5:o="Thursday";break;case 6:o="Friday";break;case 7:o="Saturday"}var s=e.grep(_onlineCheckout.businessWorkinghour,function(e){return e.DayID===i});a+="<div class='openingHours' itemprop='openingHours' datetime='Su 06:05-13:05'><div class='clsdays'>"+o+"</div> <div class='clstime'>  "+(null!=s[0]&&""!=s[0]?s[0].FromTime.replace("AM"," AM").replace("PM"," PM")+" - "+s[0].ToTime.replace("AM"," AM").replace("PM"," PM"):"Closed")+"</div></div>"}var r,l=moment(onlineShoppingCart.PickupDate).format("hh:mm a");for(i=0;i<_onlineCheckout.businessWorkinghour.length;i++)if(_onlineCheckout.businessWorkinghour[i].DayID==n){openingtime=_onlineCheckout.businessWorkinghour[i].FromTime,closingtime=_onlineCheckout.businessWorkinghour[i].ToTime;break}if("undefined"!=typeof openingtime&&"undefined"!=typeof closingtime)openingtime=openingtime.toLowerCase().replace("am"," am"),openingtime=openingtime.toLowerCase().replace("pm"," pm"),closingtime=closingtime.toLowerCase().replace("am"," am"),closingtime=closingtime.toLowerCase().replace("pm"," pm"),r='<div id="divWorkingHours1" style="" class="paddingbottom20"> <p style=padding-top:5px>You are allowed to select any time from the range given below. </p><div><div id="ulBusinessWorkingHours" class="list-inline salontime ulBusinessWorkingHours">'+a+"</div></div></div>",(Date.parse("01/01/2010 "+l)<Date.parse("01/01/2010 "+openingtime)||Date.parse("01/01/2010 "+l)>Date.parse("01/01/2010 "+closingtime))&&(e("#divPickupDateError").show(),e("#divPickupDateError").html(""),e("#divPickupDateError").html("The time that you have selected is outside of salon working hours.</br>"+r),e("#txtPickupDateTime").addClass("errorInput"),t=!1);new Date(onlineShoppingCart.PickupDate).toDateString()==salonDate.toDateString()&&Date.parse("01/01/2010 "+l)<Date.parse("01/01/2010 "+salonTime)&&(e("#divPickupDateError").show(),e("#divPickupDateError").html(""),e("#divPickupDateError").html("Selected time has already passed. Please select later time."),e("#txtPickupDateTime").addClass("errorInput"),t=!1)}else if(onlineShoppingCart.IsAddressOnFile=e("#aOldUserAddress").hasClass("w--current"),0==onlineShoppingCart.IsAddressOnFile&&(e("#userNewAddressValidate").valid()&&newShippingAddress.validateAddressData()||(vagaro.alert("Please enter valid address"),t=!1)),String.isNullOrUndefineOrBlank(onlineShoppingCart.SelectedShippingMethod)){var c="Please select shipping method";String.isNullOrUndefineOrBlank(onlineShoppingCart.shippingOptions)&&(c="Please calculate shipping cost"),0==_onlineCheckout.hideShippingMethodsForFlatRateShippingProducts().allFlatRateShippingProducts?(e("#divShippingerrorTab").show(),e("#divShippingerrorTab").html(""),_onlineCheckout.ShippingMethodPopUp(c),t=!1):1==onlineShoppingCart.IsAddressOnFile&&(String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-statename"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-countryid"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-City"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-zip"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-stateid")))&&(swal("Please enter valid shipping address"),t=!1)}if(0==e("#tabVagaroPayLater").hasClass("w--current")){var d=_onlineCheckout.getFinalCCAmount();!(parseFloat(onlineShoppingCart.ccAmt)>0-parseFloat(onlineShoppingCart.FeeDepositsRemaining)>0||1==_onlineCheckout.IsCCDetailEnable()&&parseFloat(onlineShoppingCart.classFinalTotal-parseFloat(onlineShoppingCart.DepositsRemaining))>0||null!=onlineShoppingCart.SelectedShippingMethod&&null!=onlineShoppingCart.SelectedShippingMethod&&onlineShoppingCart.SelectedShippingMethod.Rate>0||1==_onlineCheckout.IsLoadCCIframForMemrship()||parseFloat(d)>0)||null!=_onlineCheckout.zenSwipeCardDetails&&null!=_onlineCheckout.zenSwipeCardDetails.card_token||1!=_onlineCheckout.isCheckoutCCChanged||(ShowLoader(!0),vui.frame.zenswipe.submit(),t=!1)}return t},_onlineCheckout.IsLoadCCIframForMemrship=function(){if("undefined"!=typeof onlineShoppingCartmain&&!String.isNullOrUndefineOrBlank(onlineShoppingCartmain)){if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Memberships)){var t=0;if(e.grep(onlineShoppingCartmain.Memberships,function(e){e.IsRecurring&&(t=_onlineCheckout.parseTodecimal(t+e.Price,2))}),onlineShoppingCartmain.Memberships.length>0&&t>0)return!0}if(!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Packages)){var i=0,n=e.grep(onlineShoppingCartmain.Packages,function(e){if(void 0!==e.IsRecurring&&1==e.IsRecurring)return i=_onlineCheckout.parseTodecimal(i+e.Price,2),!0});if(onlineShoppingCartmain.Packages.length>0&&n.length>0&&i>0)return!0}if("true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove)&&("false"==IsClassReschedule.toLowerCase()||"true"==IsClassReschedule.toLowerCase()&&("undefined"==typeof IsPaid||"false"==IsPaid.toString().toLowerCase())))return!0;if("true"==isCCRequiredForOnlineClass.toLowerCase()&&parseFloat(onlineShoppingCart.classFinalTotal-parseFloat(onlineShoppingCart.DepositsRemaining)-parseFloat(onlineShoppingCart.PartialPrice))>0)return!0}return!1},_onlineCheckout.ClearCheckOutValidationMessage=function(){e("#divPickupDateError").hide(),e("#divPickupDateError").html(""),e("#divShippingerrorTab").hide(),e("#divShippingerrorTab").html("")},_onlineCheckout.getAppliedPresetDiscount=function(){var t=[];return null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&(objDIsc={},objDIsc.DiscountID=e.DiscountID,objDIsc.ItemTypeID=2,objDIsc.ServiceID=e.InventoryId,t.push(objDIsc))}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&(objDIsc={},objDIsc.DiscountID=e.DiscountID,objDIsc.ItemTypeID=3,objDIsc.ServiceID=e.ServiceId,t.push(objDIsc))}),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&(objDIsc={},objDIsc.DiscountID=e.DiscountID,objDIsc.ItemTypeID=7,objDIsc.ServiceID=e.MembershipId,t.push(objDIsc))}),null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"==isCCRequiredForOnlineClass.toLowerCase()&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&(objDIsc={},objDIsc.DiscountID=e.DiscountID,objDIsc.ItemTypeID=8,objDIsc.ServiceID=e.appointmentID,t.push(objDIsc))})}),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&e.grep(onlineShoppingCart.GiftCertificates,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&(objDIsc={},objDIsc.DiscountID=e.DiscountID,objDIsc.ItemTypeID=5,objDIsc.Price=e.TotalPrice,t.push(objDIsc))}),t},_onlineCheckout.ValidProductData=function(){if(onlineShoppingCart.IsPickupInStore=e("#btnInStorePickup").hasClass("w--current"),onlineShoppingCart.IsPickupInStore){try{onlineShoppingCart.PickupDate=moment(getdatepickervalue("#txtPickupDateTime"))._d}catch(e){onlineShoppingCart.PickupDate=moment(new Date)._d}var t=onlineShoppingCart.PickupDate.getDay()+1;if(0==(null!=_onlineCheckout.businessWorkinghour.filter(function(e){return e.DayID===t})[0]))return e("#divPickupDateError").show(),e("#divPickupDateError").html(""),e("#divPickupDateError").html("Business is closed on pickup date. Please select another pickup date"),e("#txtPickupDateTime").addClass("errorInput"),isValid=!1,!1;var n,o="";for(i=1;i<=7;i++){switch(i){case 1:n="Sunday";break;case 2:n="Monday";break;case 3:n="Tuesday";break;case 4:n="Wednesday";break;case 5:n="Thursday";break;case 6:n="Friday";break;case 7:n="Saturday"}var a=e.grep(_onlineCheckout.businessWorkinghour,function(e){return e.DayID===i});o+="<div class='openingHours' itemprop='openingHours' datetime='Su 06:05-13:05'><div class='clsdays'>"+n+"</div> <div class='clstime'>  "+(null!=a[0]&&""!=a[0]?a[0].FromTime.replace("AM"," AM").replace("PM"," PM")+" - "+a[0].ToTime.replace("AM"," AM").replace("PM"," PM"):"Closed")+"</div></div>"}var s,r=moment(onlineShoppingCart.PickupDate).format("hh:mm a");for(i=0;i<_onlineCheckout.businessWorkinghour.length;i++)if(_onlineCheckout.businessWorkinghour[i].DayID==t){openingtime=_onlineCheckout.businessWorkinghour[i].FromTime,closingtime=_onlineCheckout.businessWorkinghour[i].ToTime;break}if("undefined"!=typeof openingtime&&"undefined"!=typeof closingtime)if(openingtime=openingtime.toLowerCase().replace("am"," am"),openingtime=openingtime.toLowerCase().replace("pm"," pm"),closingtime=closingtime.toLowerCase().replace("am"," am"),closingtime=closingtime.toLowerCase().replace("pm"," pm"),s='<div id="divWorkingHours1" style="" class="paddingbottom20"> <p style=padding-top:5px>You are allowed to select any time from the range given below. </p><div><div id="ulBusinessWorkingHours" class="list-inline salontime ulBusinessWorkingHours">'+o+"</div></div></div>",Date.parse("01/01/2010 "+r)<Date.parse("01/01/2010 "+openingtime)||Date.parse("01/01/2010 "+r)>Date.parse("01/01/2010 "+closingtime))return e("#divPickupDateError").show(),e("#divPickupDateError").html(""),e("#divPickupDateError").html("The time that you have selected is outside of salon working hours.</br>"+s),e("#txtPickupDateTime").addClass("errorInput"),isValid=!1,!1;if(new Date(onlineShoppingCart.PickupDate).toDateString()==salonDate.toDateString()&&Date.parse("01/01/2010 "+r)<Date.parse("01/01/2010 "+salonTime))return e("#divPickupDateError").show(),e("#divPickupDateError").html(""),e("#divPickupDateError").html("Selected time has already passed. Please select later time."),e("#txtPickupDateTime").addClass("errorInput"),isValid=!1,!1}else{if(onlineShoppingCart.IsAddressOnFile=e("#aOldUserAddress").hasClass("w--current"),0==onlineShoppingCart.IsAddressOnFile){if(!e("#userNewAddressValidate").valid())return vagaro.alert("Please enter valid address"),isValid=!1,!1;if(!newShippingAddress.validateAddressData())return vagaro.alert("Please enter valid address"),isValid=!1,!1}if(String.isNullOrUndefineOrBlank(onlineShoppingCart.SelectedShippingMethod)){var l="Please select shipping method";if(String.isNullOrUndefineOrBlank(onlineShoppingCart.shippingOptions)&&(l="Please calculate shipping cost"),0==_onlineCheckout.hideShippingMethodsForFlatRateShippingProducts().allFlatRateShippingProducts)return e("#divShippingerrorTab").show(),e("#divShippingerrorTab").html(""),e("#divShippingerrorTab").html(l),isValid=!1,!1;if(1==onlineShoppingCart.IsAddressOnFile&&(String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-statename"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-countryid"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-City"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-zip"))||String.isNullOrUndefineOrBlank(e("#aOldUserAddress").attr("data-stateid"))))return swal("Please enter valid shipping address"),isValid=!1,!1}}return!0},_onlineCheckout.ValidateCartData=function(){if(1==isCheckInApp&&navigator.userAgent.toLowerCase().indexOf("ipad")>-1&&1==_onlineCheckout.isFormsDirectClass&&e("#txtfocusbox").focus(),!_onlineCheckout.ValidateFirstTimeCustomerSelectionCart())return!1;if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&0==_onlineCheckout.isValidForCheckoutInvoice()&&0==onlineShoppingCart.IsAddressOnFile){if(""==e("#txtNewShipFirstName").val().trim()||""==e("#txtNewShipLastName").val().trim())return void vagaro.alert("Please enter valid name.");if(""==e("#txtNewShipPhone").val().trim())return void vagaro.alert("Please enter valid contact number.")}if(_vgClassSessionSelection.VisibleControlLength("#divreturnpolicy")>0&&_vgClassSessionSelection.VisibleControlLength("#shoppingcartsecond")>0&&_onlineCheckout.VisibleControlLength("#lblreturnpolicy")>0){if(0==e("#chkreturnpolicy").prop("checked"))return _onlineCheckout.CancelPolicyPopup(),!1;e("#lblreturnpolicy").removeClass("label-error").css("color","")}if(e("#tabVagaroPayLater").hasClass("w--current")){if(!_onlineCheckout.UpdateAffirmUserData())return!1;if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&String.isNullOrUndefineOrBlank(onlineShoppingCart.SelectedShippingMethod)&&!onlineShoppingCart.IsPickupInStore)if(null==onlineShoppingCart.invoiceDetails)if(0==_onlineCheckout.ValidProductData())return isValid=!1,!1;if(0==_onlineCheckout.AffirmVPLCapture(!0))return isvalid=!1,!1}if(0==isCheckInApp&&_vgClassSessionSelection.VisibleControlLength("#divreturnpolicyPayInvoice")>0){if(0==e("#chkinvoicereturnpolicy").prop("checked"))return e("#lblinvoicereturnpolicy").addClass("label-error").css("color","#FF0000"),e("#chkinvoicereturnpolicy").focus(),!1;e("#lblinvoicereturnpolicy").removeClass("label-error").css("color","")}if(1!=_onlineCheckout.isValidCardNotPresent())if(1==isCheckInApp&&(UserID=glbDataCheckIn.scanUserID),"false"==IsClassReschedule.toLowerCase()){ShowLoader(!0);var t=_onlineCheckout.getAppliedPresetDiscount(),i=new vagaro.ajax;i.datamodel.Token=ApiURLEnumOnlineCheckout.validateshoppingcartdata,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(t){if(ShowLoader(!1),null!=t){if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&null==t.Inventories)return vagaro.alert("All the items in the cart are already checked out, Keep shopping."),void setTimeout(function(){window.location.href=window.location.href},3e3);if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&null==t.Memberships)return vagaro.alert("All the items in the cart are already checked out, Keep shopping."),void setTimeout(function(){window.location.href=window.location.href},3e3);if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&null==t.Packages)return vagaro.alert("All the items in the cart are already checked out, Keep shopping."),void setTimeout(function(){window.location.href=window.location.href},3e3);if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){if(null==t.Events)return vagaro.alert("All the items in the cart are already checked out, Keep shopping."),void setTimeout(function(){window.location.href=window.location.href},3e3);try{e.grep(onlineShoppingCart.Events,function(t){var i="",n=e("#ancBuyNow").text();console.log(n),i="Request"!=n;var o={};o.PageName=0==i?"Request":"Book",o.Category="Book",o.Action=o.PageName+" Class",o.BusinessName=_shopdetail.businessName;var a=0;null!=e("#hdnSiteBuilderBusinessID")&&null!=e("#hdnSiteBuilderBusinessID").val()&&(a=parseInt(e("#hdnSiteBuilderBusinessID").val())),o.BusinessID=a,o.ClassName=t.eventName,o.ClassPrice=currencysymbol+t.eventEnrollment[0].price.format("#.##"),o.EmpName=t.eventEnrollment[0].sPName,o.ClassTime=t.eventEnrollment[0].startTime,formattedDate=new Date(t.eventEnrollment[0].eventDate),o.ClassDate=formattedDate.toISOString().split("T")[0],o.isAppointmentBooked=i,_vgLogEvent.LogData(o)})}catch(e){}}if(null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&null==t.GiftCertificates)return vagaro.alert("All the items in the cart are already checked out, Keep shopping."),void setTimeout(function(){window.location.href=window.location.href},3e3);_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(onlineShoppingCart)?(onlineShoppingCart.loginUserId=t.loginUserId,1==_onlineCheckout.isCheckoutVPLChanged&&0==_siteBuilderDetail.isAffirmEnable?_onlineCheckout.VPLCheckoutValidation():_onlineCheckout.SaveOnlineCheckout()):1==_onlineCheckout.isCheckoutVPLChanged?(ShowLoader(!0),0==_siteBuilderDetail.isAffirmEnable?_onlineCheckout.VPLCheckoutValidation():_onlineCheckout.SaveOnlineCheckout()):1==t.IsValidCartData?_onlineCheckout.SaveOnlineCheckout():(onlineShoppingCartmain=t,_onlineCheckout.ValidateErrorMessage(t,!0))}};var n={businessID:businessID,loginUserID:UserID,IsCheckInApp:isCheckInApp,AppliedPromo:t,IsFromInvoice:_onlineCheckout.isFromInvoice,InvoiceID:_onlineCheckout.InvoiceID,IsLiveStream:_onlineCheckout.IsCalledFromLiveStream()};i.datamodel.data=n,i.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},i.Post(),setTimeout(function(){e("#dvCheckoutSuccessMSG").attr("tabindex",-1).attr("role","banner").focus()},5e3)}else _onlineCheckout.SaveOnlineCheckout(),setTimeout(function(){e("#dvCheckoutSuccessMSG").attr("tabindex",-1).attr("role","banner").focus()},5e3);else vagaro.alert(_onlineCheckout.CardNotPresentMessage)},_onlineCheckout.CancelPolicyPopup=function(){swal({title:"",text:"By selecting “Agree & Continue,” you acknowledge and accept the Cancellation Policy and Terms & Conditions of this business.",html:!0,showCancelButton:!0,confirmButtonText:"Agree & Proceed",cancelButtonText:"Disagree",customClass:"sweet-alert-model"},function(t){t?(e("#chkreturnpolicy").prop("checked",!0),e("#lblreturnpolicy").removeClass("label-error").css("color",""),e("#ancBuyNow").is(":visible")&&e("#ancBuyNow").click()):(e("#lblreturnpolicy").addClass("label-error").css("color","#FF0000"),e("#chkreturnpolicy").focus(),swal.close())})},_onlineCheckout.ShippingMethodPopUp=function(t){swal({title:"",text:t,html:!0,showCancelButton:!0,confirmButtonText:"Ok",cancelButtonText:"Cancel",customClass:"sweet-alert-model"},function(i){var n;i?(n=document.querySelector(".shippingMethodsHideShow"))&&(e("#divShippingerrorTab").html(t),n.scrollIntoView({behavior:"smooth",block:"start"})):((n=document.querySelector(".shippingMethodsHideShow"))&&(e("#divShippingerrorTab").html(t),n.scrollIntoView({behavior:"smooth",block:"start"})),swal.close())})},_onlineCheckout.VPLFinalSubmit=function(t){if(1==t){if(0==_onlineCheckout.AffirmVPLCapture(!0))return ShowLoader(!1),!1;_onlineCheckout.isValidForCheckoutInvoice()?_onlineCheckout.PayInvoice():_onlineCheckout.ValidateCartData()}else ShowLoader(!0),e("#finalCheckout").val(1),_onlineCheckout.SaveOnlineCheckout()},_onlineCheckout.AffirmVPLCapture=function(t){var i=JSON.parse(e("#hdnUserDetails").val());if(1==t)return!String.isNullOrUndefineOrBlank(i.EmailId)||!String.isNullOrUndefineOrBlank(e("#txtAffirmEmailId").data("EmailId"))||(_onlineCheckout.DisplayAffirmEmailValidation(),!1);var n="";return n=2==i.CountryID?"UK":3==i.CountryID?"CA":4==i.CountryID?"AU":"US",{ShopperName:{FirstName:i.FirstName,LastName:i.LastName},ShopperAddress:{City:String.isNullOrUndefineOrBlank(i.City)?"":i.City,Country:n,HouseNumberOrName:String.isNullOrUndefineOrBlank(i.StreetNo)?"":i.StreetNo,PostalCode:String.isNullOrUndefineOrBlank(i.Zip)?"":i.Zip,StateOrProvince:String.isNullOrUndefineOrBlank(i.StateCode)?"":i.StateCode,Street:String.isNullOrUndefineOrBlank(i.Street)?"":i.Street},ShopperEmail:String.isNullOrUndefineOrBlank(i.EmailId)?e("#txtAffirmEmailId").data("EmailId"):i.EmailId,ShopperPhoneNumber:String.isNullOrUndefineOrBlank(i.Cell)?"":i.Cell}},_onlineCheckout.DisplayVPLCetegeyOrAffirm=function(t){1==_siteBuilderDetail.isAffirmEnable?1==t&&(e("#tabVagaroPayLaterCertegy").hide(),e("#tabVagaroPayLaterAffirm").show()):1==t&&(e("#tabVagaroPayLaterCertegy").show(),e("#tabVagaroPayLaterAffirm").hide())},_onlineCheckout.VPLCheckoutValidation=function(){if(null!=typeof _onlineCheckout.VPLUserBankDetails||null!=_onlineCheckout.VPLUserBankDetails.length){if(0==_siteBuilderDetail.isAffirmEnable&&(null==typeof e('input[type="radio"][name="vpl-bank"]:checked').val()||null==e('input[type="radio"][name="vpl-bank"]:checked').val()))return vagaro.alert("Please add bank account to pay with Vagaro Pay Later."),void ShowLoader(!1);_onlineCheckout.VplSelectedBank={},SelectedBank=e.grep(_onlineCheckout.VPLUserBankDetails,function(t){return t.Id==e('input[type="radio"][name="vpl-bank"]:checked').val()}),_onlineCheckout.VplSelectedBank=SelectedBank,NewUser=e.grep(onlineShoppingCartmain.UsersPoints,function(e){return e.userId==UserID}),null!=e("#divServicesTotalPrice")[0]&&null!=e("#divServicesTotalPrice")[0]&&(FinalCCAmount=e("#divServicesTotalPrice")[0].innerHTML.replace("$","")),e("#divVplCheckoutScreen").show(),e(".mulvplbook").hide(),e("#divVplTracking").hide(),e("#subtotalCheckoutScreen").text("Subtotal: "+currencySymbol+_onlineCheckout.ConvertDecimalWithFixed(FinalCCAmount,!0,2)),ShowLoader(!1)}else vagaro.alert("Add bank for vagaro pay later.")},_onlineCheckout.SavecheckoutVPL=function(e){onlineShoppingCart.ccAmt=0,_onlineCheckout.VPLCheckoutData.vplAmt=_onlineCheckout.ConvertDecimalWithFixed(onlineShoppingCart.FinalCCAmount,!1,2),_onlineCheckout.VPLCheckoutData.businessID=businessID,_onlineCheckout.VPLCheckoutData.loggedInUserId=_onlineCheckout.VplSelectedBank[0].UserID,_onlineCheckout.VPLCheckoutData.BankAccountId=_onlineCheckout.VplSelectedBank[0].BankId,_onlineCheckout.VPLCheckoutData.AccountNumber=_onlineCheckout.VplSelectedBank[0].AccountNumber,_onlineCheckout.VPLCheckoutData.VplBankMasterId=_onlineCheckout.VplSelectedBank[0].Id,_onlineCheckout.VPLCheckoutData.ConsumerId=_onlineCheckout.VplSelectedBank[0].CertegyConsumerTokenID,_onlineCheckout.VPLCheckoutData.TransactionIntentId=e.intentId,_onlineCheckout.SaveOnlineCheckout()},_onlineCheckout.AddEventLogInFirebaseForClass=function(){try{e.grep(onlineShoppingCart.Events,function(t){var i=[],n=[];e.grep(t.eventEnrollment,function(o){if(0==o.IsWorkShop&&-1==i.indexOf(o.appointmentID)||-1==(o.IsWorkShop&&n.indexOf(o.customerID))){i.push(o.appointmentID),o.IsWorkShop&&n.push(o.customerID);var a="",s=e("#ancBuyNow").text();console.log(s);var r="";r=0==(a="Request"!=s)?"Request":"Book";var l={};l.Category="Request"==r?"Book_Class_Request":"Book_Class_Confirmation_Page",l.Action=r+" Class",l.PageName=r;var c=0;c=null!=e("#hdnSiteBuilderBusinessID")&&null!=e("#hdnSiteBuilderBusinessID").val()?parseInt(e("#hdnSiteBuilderBusinessID").val()):businessID,l.BusinessID=c,l.BusinessName=_shopdetail.businessName,l.EmpName=t.eventEnrollment[0].sPName,formattedDate=new Date(t.eventEnrollment[0].eventDate),l.ClassDate=formattedDate.toISOString().split("T")[0],l.ClassTime=t.eventEnrollment[0].startTime,l.ClassName=t.eventName,l.ClassPrice=currencysymbol+t.eventEnrollment[0].price.format("#.##"),l.isAppointmentBooked=a,_vgLogEvent.LogEventData(l)}})})}catch(e){}},_onlineCheckout.ValidateErrorMessage=function(t,n){e(".checkoutvalerror").remove();var o=[],a=[],s=!0;if(!String.isNullOrUndefineOrBlank(t)&&!_onlineCheckout.isValidForCheckoutInvoice()){if(String.isNullOrUndefineOrBlank(t.Inventories)||e.each(t.Inventories,function(t,i){!String.isNullOrUndefineOrBlank(i.errors)&&i.errors.length>0&&e.each(i.errors,function(t,n){(1!=n.IsWarning||i.Quantity>i.TotalQty)&&(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId.toString()+'"]').find("div.div-block-42").append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+n.Message+"</div>"),s=!1),o.push(n)})}),!String.isNullOrUndefineOrBlank(t.Memberships)){_onlineCheckout.IsAnyDailyDealInCart(t);e.each(t.Memberships,function(i,a){var r=_onlineCheckout.IsItemFmbEligible(a.PromotionID,t),l=Math.max(0,(Number(a.Price)||0)-(Number(a.productDisc)||0)),c=_onlineCheckout.GetEffectiveIsForNewCustomer();r&&!0===c?(a.dailydealFee=l*dailyDealFeeValue/100,a.FMBPercentage=dailyDealFeeValue):r&&!1===c?(a.dailydealFee=l*dailyDealFeeValue_ExistingUser/100,a.FMBPercentage=dailyDealFeeValue_ExistingUser):(a.dailydealFee=0,a.FMBPercentage=0),!String.isNullOrUndefineOrBlank(a.errors)&&a.errors.length>0&&e.each(a.errors,function(t,i){e('div [data-type="membership"][data-rid="'+a.MembershipId.toString()+'"]').find("div.div-block-47 > div").append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+i.Message+"</div>"),(1!=i.IsWarning||1==n)&&(s=!1),o.push(i)})})}if(!String.isNullOrUndefineOrBlank(t.Packages)){_onlineCheckout.IsAnyDailyDealInCart(t);e.each(t.Packages,function(i,a){var r=_onlineCheckout.IsItemFmbEligible(a.PromotionID,t),l=Math.max(0,(Number(a.TotalPrice)||0)-(Number(a.discount)||0)),c=_onlineCheckout.GetEffectiveIsForNewCustomer();r&&!0===c?(a.dailydealFee=l*dailyDealFeeValue/100,a.FMBPercentage=dailyDealFeeValue):r&&!1===c?(a.dailydealFee=l*dailyDealFeeValue_ExistingUser/100,a.FMBPercentage=dailyDealFeeValue_ExistingUser):(a.dailydealFee=0,a.FMBPercentage=0),!String.isNullOrUndefineOrBlank(a.errors)&&a.errors.length>0&&e.each(a.errors,function(t,i){e('div [data-type="servicepackage"][data-rid="'+a.ServiceId+'"]').find(".div-block-42").append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+i.Message+"</div>"),1==i.IsWarning&&1!=n||(s=!1),o.push(i)})})}String.isNullOrUndefineOrBlank(t.GiftCertificates)||e.each(t.GiftCertificates,function(t,i){i.dailydealFee=0,!String.isNullOrUndefineOrBlank(i.errors)&&i.errors.length>0&&e.each(i.errors,function(t,a){e('div [data-type="gc"][data-rid="'+i.GiftCertificatePhotoID.toString()+'"][data-autoid="'+i.autoId+'"]').find(".div-block-42").append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+a.Message+"</div>"),1==a.IsWarning&&1!=n||(s=!1),o.push(a)})}),String.isNullOrUndefineOrBlank(t.Events)||e.each(t.Events,function(t,i){!String.isNullOrUndefineOrBlank(i.eventEnrollment)&&i.eventEnrollment.length>0&&e.each(i.eventEnrollment,function(t,i){!String.isNullOrUndefineOrBlank(i.errors)&&i.errors.length>0&&e.each(i.errors,function(t,r){e('div [data-type="classes"][data-rid="'+i.eventID.toString()+'"][data-autoid="'+i.autoID.toString()+'"] > div').append('<div class="checkoutvalerror web-caption-text-error" style="color: red;font-size: 12px;padding-top: 10px;">'+r.Message+"</div>"),1==r.IsWarning&&1!=n||(s=!1),o.push(r),r.Message.indexOf("This business does not allow you to book more than")>-1&&a.push(r)})})})}if(onlineShoppingCartmain.IsValidCartData=s,o.length>0&&(0==s||1==n)){var r="";if(1==o.length)e.each(o,function(e,t){r=t.Message});else{for(i=0;i<o.length;i++)o[i].Message.indexOf("This business does not allow you to book more than")>-1&&(o.splice(i,1),i--);a.length>0&&o.push(a[0]),1==o.length?e.each(o,function(e,t){r=t.Message}):(r="<ul>",e.each(o,function(e,t){r=r+'<li style="text-align: left;">'+t.Message+"</li>"}))}return swal({html:!0,title:r,text:"",type:"",showCancelButton:!1,confirmButtonText:"OK",cancelButtonText:"No",closeOnCancel:!0},function(e){1==n&&(_onlineCheckout.checkoutGotoNextStep(!0),_onlineCheckout.loadPage())}),setTimeout(function(){e(".gencutom-title").html("Booking Unavailable")},100),!1}return!0},_onlineCheckout.clickOnPolicy=function(t){1==isCheckInApp&&centerModal("#AppcheckoutModal"),e("#AppcheckoutModal").find("#divpolicyforclass").hide(),e("#AppcheckoutModal").find("#divpolicyforProduct").hide(),_onlineCheckout.isShowClassPolicePopup=!0,_onlineCheckout.isShowProductPolicePopup=!0,_onlineCheckout.isShowServicePolicePopup=!0,e("#mainTCPoliceHeader").html("Terms and Conditions For Classes"),e("#divTCforClassHeader").hide(),e("#divTCforServiceInvoice").hide(),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&(_onlineCheckout.isShowClassPolicePopup=!1,_onlineCheckout.ViewClassCancellationPolicy()),(!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0||!String.isNullOrUndefineOrBlank(onlineShoppingCart.GiftCertificates)&&onlineShoppingCart.GiftCertificates.length>0||!String.isNullOrUndefineOrBlank(onlineShoppingCart.Packages)&&onlineShoppingCart.Packages.length>0||!String.isNullOrUndefineOrBlank(onlineShoppingCart.Memberships)&&onlineShoppingCart.Memberships.length>0)&&(e("#mainTCPoliceHeader").html("Refund Policy"),e("#divTCforClassHeader").show(),e("#divpolicyforclass").addClass("policy-border"),_onlineCheckout.isShowProductPolicePopup=!1,_onlineCheckout.ViewReturnPolicy()),_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&(_onlineCheckout.isShowServicePolicePopup=!1,0==_onlineCheckout.isShowClassPolicePopup&&1==_onlineCheckout.isShowProductPolicePopup&&e("#divpolicyforclass").removeClass("policy-border"),1==_onlineCheckout.isShowClassPolicePopup&&1==_onlineCheckout.isShowProductPolicePopup?(e("#mainTCPoliceHeader").html("Terms and Conditions For Appointments"),e("#divTCforServiceInvoice").hide()):e("#divTCforServiceInvoice").show(),_onlineCheckout.ViewAppointmentCancellationPolicy())},_onlineCheckout.ViewClassCancellationPolicy=function(){ShowLoader(!0);var t=new vagaro.ajax;return t.datamodel.Token=ApiURLEnumOnlineCheckout.getclasscancellationpolicy,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.callback=function(t){ShowLoader(!1),_onlineCheckout.isShowClassPolicePopup=!0,String.isNullOrUndefineOrBlank(t)?(e("#AppcheckoutModal").find("#divpolicyforclass").show(),e("#AppcheckoutModal").find("#divpolicyforclass .divclasspolicycontent").html(""),e("#AppcheckoutModal").find("#divpolicyforclass .divclasspolicycontent").html("No Class Cancellation Policy")):(e("#AppcheckoutModal").find("#divpolicyforclass").show(),e("#AppcheckoutModal").find("#divpolicyforclass .divclasspolicycontent").html(""),e("#AppcheckoutModal").find("#divpolicyforclass .divclasspolicycontent").html(t)),1==_onlineCheckout.isShowClassPolicePopup&&1==_onlineCheckout.isShowProductPolicePopup&&e("#AppcheckoutModal").modal("show"),e("#mainTCPoliceHeader").focus(),e("#AppcheckoutModal").find(".btn.btn-primary").attr("id","btn_ClosePoPAppCancelPolicy"),e("#btn_ClosePoPAppCancelPolicy").off().on("click",function(){e("#AppcheckoutModal").modal("hide")})},t.datamodel.data={businessID:businessID},t.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},t.Post(),!1},_onlineCheckout.ViewReturnPolicy=function(){ShowLoader(!0);var t=new vagaro.ajax;t.datamodel.Token=ApiURLEnumOnlineCheckout.getreturnpolicy,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.callback=function(t){ShowLoader(!1),_onlineCheckout.isShowProductPolicePopup=!0,String.isNullOrUndefineOrBlank(t)?(e("#AppcheckoutModal").find("#divpolicyforProduct").show(),e("#AppcheckoutModal").find("#divpolicyforProduct .divproductpolicycontent").html(""),e("#AppcheckoutModal").find("#divpolicyforProduct .divproductpolicycontent").html(""),e("#AppcheckoutModal").modal("show")):(e("#AppcheckoutModal").find("#divpolicyforProduct").show(),e("#AppcheckoutModal").find("#divpolicyforProduct .divproductpolicycontent").html(""),e("#AppcheckoutModal").find("#divpolicyforProduct .divproductpolicycontent").html(t)),1==_onlineCheckout.isShowClassPolicePopup&&1==_onlineCheckout.isShowProductPolicePopup&&e("#AppcheckoutModal").modal("show"),e("#mainTCPoliceHeader").focus(),e("#AppcheckoutModal").find(".btn.btn-primary").attr("id","btn_ClosePoPAppCancelPolicy"),e("#btn_ClosePoPAppCancelPolicy").off().on("click",function(){e("#AppcheckoutModal").modal("hide")})},t.datamodel.data={businessID:businessID},t.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},t.Post()},_onlineCheckout.ViewAppointmentCancellationPolicy=function(){ShowLoader(!0);var t=new vagaro.ajax;t.datamodel.Token=ApiURLEnumOnlineCheckout.getappointmentcancellationpolicy,t.datamodel.IsNewVagaroAPI=!0;var i={businessID:businessID};t.datamodel.callback=function(t){ShowLoader(!1),_onlineCheckout.isShowServicePolicePopup=!0,String.isNullOrUndefineOrBlank(t)?(e("#AppcheckoutModal").find("#divpolicyforServiceInvoice").show(),e("#AppcheckoutModal").find("#divpolicyforServiceInvoice .divServiceInvoicepolicycontent").html(""),e("#AppcheckoutModal").find("#divpolicyforServiceInvoice .divServiceInvoicepolicycontent").html(""),e("#AppcheckoutModal").modal("show")):(e("#AppcheckoutModal").find("#divpolicyforServiceInvoice").show(),e("#AppcheckoutModal").find("#divpolicyforServiceInvoice .divServiceInvoicepolicycontent").html(""),e("#AppcheckoutModal").find("#divpolicyforServiceInvoice .divServiceInvoicepolicycontent").html(t)),(_onlineCheckout.isShowServicePolicePopup=1==_onlineCheckout.isShowClassPolicePopup&&1==_onlineCheckout.isShowProductPolicePopup)&&e("#AppcheckoutModal").modal("show"),e("#mainTCPoliceHeader").focus(),e("#AppcheckoutModal").find(".btn.btn-primary").attr("id","btn_ClosePoPAppCancelPolicy"),e("#btn_ClosePoPAppCancelPolicy").off().on("click",function(){e("#AppcheckoutModal").modal("hide")})},t.datamodel.data=i,t.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},t.Post()},_onlineCheckout.ChangeBuyBottonText=function(t){var i=!0,n="";if(String.isNullOrUndefineOrBlank(t)||(1!=i||String.isNullOrUndefineOrBlank(t.Inventories)||t.Inventories.length>0&&(i=!1),1!=i||String.isNullOrUndefineOrBlank(t.Memberships)||t.Memberships.length>0&&(i=!1),1!=i||String.isNullOrUndefineOrBlank(t.Packages)||t.Packages.length>0&&(i=!1),1!=i||String.isNullOrUndefineOrBlank(t.GiftCertificates)||t.GiftCertificates.length>0&&(i=!1)),1==_onlineCheckout.IsCalledFromLiveStream()&&(e("#btnBuyNowBack").text("Back"),e("#mobileCart").hide()),_onlineCheckout.isValidForCheckoutInvoice())e("#ancBuyNow").text("Pay Invoice"),e("#btnBuyNowBack").hide();else if(1==i){if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsConfimationReq){if(t.Events.length>0){for(var o="Book",a=0;a<t.Events.length;a++)if("Request"==t.Events[a].ClassBookText){o="Request";break}e("#ancBuyNow").text(o),n=o}}else e("#ancBuyNow").text(checkoutClassBookText),n=checkoutClassBookText;void 0!==n&&null!=n&&"Book"==n?e("#lblreturnpolicy span").contents().first().replaceWith('By clicking "Book" I agree to '):e("#lblreturnpolicy span").contents().first().replaceWith('By clicking "Request" I agree to ')}else e("#ancBuyNow").text("Buy Now"),1==i&&"true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove)&&e("#ancBuyNow").text(checkoutClassBookText)},_onlineCheckout.hasPromotionApplied=function(e){function t(e,t,i){if(!e||0===e.length)return!1;for(var n=0;n<e.length;n++){var o=e[n];if(o.PromotionID&&Number(o.PromotionID)>0)return!0;if(t&&o.eventEnrollment&&o.eventEnrollment.length>0)for(var a=0;a<o.eventEnrollment.length;a++){var s=o.eventEnrollment[a];if(s.PromotionID&&Number(s.PromotionID)>0)return!0;if(i&&s.lstAddonService&&s.lstAddonService.length>0)for(var r=0;r<s.lstAddonService.length;r++)if(s.lstAddonService[r].PromotionID&&Number(s.lstAddonService[r].PromotionID)>0)return!0}}return!1}return t(e.Events,!0,!0)||t(e.Packages,!1,!1)||t(e.Memberships,!1,!1)||t(e.GiftCertificates,!1,!1)},_onlineCheckout.IsClassBookingOnly=function(t){if(isPromotionApplied=_onlineCheckout.hasPromotionApplied(onlineShoppingCart),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.IsMemPkgReqToBook){var i=0,n=0;String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Memberships)||(i=e.grep(onlineShoppingCartmain.Memberships,function(e){return 1==e.IsFromClass}).length),String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Packages)||(n=e.grep(onlineShoppingCartmain.Packages,function(e){return 1==e.IsFromClass}).length),(i>0||n>0)&&(e("#divSuggestUpsell").css("display","none"),e("#removeMemLink").css("display","none"),e("#removePackLink").css("display","none"))}var o=!0;return String.isNullOrUndefineOrBlank(onlineShoppingCartmain)||(1!=o||String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Inventories)?1!=o||String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Memberships)?1!=o||String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Packages)?1!=o||String.isNullOrUndefineOrBlank(onlineShoppingCartmain.GiftCertificates)||onlineShoppingCartmain.GiftCertificates.length>0&&(o=!1):onlineShoppingCartmain.Packages.length>0&&(o=!1):onlineShoppingCartmain.Memberships.length>0&&(o=!1):onlineShoppingCartmain.Inventories.length>0&&(o=!1)),t?o:(e("#btnContShoppingCheckout").text("Proceed to Checkout"),1==o&&0==_onlineCheckout.IsCCDetailEnable()?("true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove)&&("false"==IsClassReschedule.toLowerCase()||"true"==IsClassReschedule.toLowerCase()&&("undefined"==typeof IsPaid||"false"==IsPaid.toString().toLowerCase()))||void 0!==_onlineCheckout.IsMemPackageUpSell&&1==_onlineCheckout.IsMemPackageUpSell?(e("#btnContShoppingCheckoutForClass").hide(),e("#btnContShoppingCheckout").show(),e("#btnContShoppingCheckout").text("Continue")):(1==_onlineCheckout.CheckLiveStreamClass()?e("#btnContShoppingCheckoutForClass").text("Continue"):e("#btnContShoppingCheckoutForClass").text(checkoutClassBookText),e("#btnContShoppingCheckoutForClass").show(),e("#btnContShoppingCheckout").hide(),isPromotionApplied&&(e("#btnContShoppingCheckoutForClass").hide(),e("#btnContShoppingCheckout").show())),_onlineCheckout.isClassCheckout=o,!0):(1==o&&e("#btnContShoppingCheckout").text("Continue"),e("#btnContShoppingCheckoutForClass").hide(),e("#btnContShoppingCheckout").show(),_onlineCheckout.isClassCheckout=o,!1))},_onlineCheckout.CheckLiveStreamClass=function(){var t=!1;return 0==String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Events)&&onlineShoppingCartmain.Events.length>0&&e.each(onlineShoppingCartmain.Events,function(i,n){!String.isNullOrUndefineOrBlank(n.eventEnrollment)&&n.eventEnrollment.length>0&&e.each(n.eventEnrollment,function(e,i){String.isNullOrUndefineOrBlank(i.StreamingStatus)||1!=i.StreamingStatus||(t=!0)})}),t},_onlineCheckout.ClassCheckout=function(t){if(1!=t&&(_onlineCheckout.ValidateErrorMessage(onlineShoppingCartmain),0==onlineShoppingCartmain.IsValidCartData))return!1;if(e("#hdnIsFromPage").length>0&&e("#hdnIsFromPage").val(""),1!=t){var i=!(!String.isNullOrUndefineOrBlank(getCookie("loginTypeValue"))&&8==getCookie("loginTypeValue"));_onlineCheckout.isConsiderForms=i,_onlineCheckout.getUserGCDetail(!0)}},_onlineCheckout.DirectClassCheckout=function(){onlineShoppingCart=e.extend(!0,{},onlineShoppingCartmain),onlineShoppingCart.FinalCCAmount=0,onlineShoppingCart.ccAmt=0,onlineShoppingCart.amtPaid=0,onlineShoppingCart.tax=0,onlineShoppingCart.Rtax=0,onlineShoppingCart.taxdifference=0,onlineShoppingCart.gcAmt=0,onlineShoppingCart.RedeemedByGCtemp=[],onlineShoppingCart.RedeemedByGC=[],onlineShoppingCart.shippingSurcharge=0,onlineShoppingCart.classSubTotal=0,onlineShoppingCart.classTax=0,onlineShoppingCart.classGCUsed=0,onlineShoppingCart.classPackageUsed=0,onlineShoppingCart.classFinalTotal=0,_onlineCheckout.ShoppingCartStep=1,onlineShoppingCart.PartialPrice=0,e.grep(onlineShoppingCart.UsersPoints,function(e){e.userId==onlineShoppingCart.loginUserId&&e.userId>0&&(onlineShoppingCart.loginUserEmail=e.emailId)}),null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(_onlineCheckout.ValidateOnePerUserDealForDirectClassCheckout(),onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events),_onlineCheckout.ValidateCartData())},_onlineCheckout.IsAnyDailyDealInCart=function(e){if(!_shopdetail.EnableFMBFee())return!1;if(e=e||onlineShoppingCart,String.isNullOrUndefineOrBlank(e))return!1;if("function"==typeof _shopdetail.IsUKBusiness&&_shopdetail.IsUKBusiness()){var t=!1;return!("function"!=typeof _shopdetail.IsEligibleFMBForUK||!_shopdetail.IsEligibleFMBForUK())&&(t=!0,(void 0===ischkFirstTimeCustomerCart||!1!==ischkFirstTimeCustomerCart||1!=t||0!=_onlineCheckout.isDailyDealExistsInItems(e))&&t)}return _onlineCheckout.isDailyDealExistsInItems(e)},_onlineCheckout.IsValidateForPromoCode=function(e){return!!_shopdetail.EnableFMBFee()&&(e=e||onlineShoppingCart,!String.isNullOrUndefineOrBlank(e)&&_onlineCheckout.isDailyDealExistsInItems(e))},_onlineCheckout.IsItemFmbEligible=function(e,t){return"undefined"!=typeof _shopdetail&&_shopdetail&&"function"==typeof _shopdetail.IsUKBusiness&&_shopdetail.IsUKBusiness()?_onlineCheckout.IsAnyDailyDealInCart(t):_shopdetail.EnableFMBFee()&&Number(e||0)>0||_onlineCheckout.IsAnyDailyDealInCart(t)},_onlineCheckout.isDailyDealExistsInItems=function(t){var i=function(e){return null!=e&&null!=e.PromotionID&&Number(e.PromotionID)>0};if(t.Events&&t.Events.length>0){var n=!1;if(e.each(t.Events,function(t,o){if(o.eventEnrollment&&o.eventEnrollment.length>0&&e.each(o.eventEnrollment,function(t,o){return i(o)?(n=!0,!1):(o.lstAddonService&&o.lstAddonService.length>0&&e.each(o.lstAddonService,function(e,t){if(i(t))return n=!0,!1}),!n&&void 0)}),n)return!1}),n)return!0}if(t.Packages&&t.Packages.length>0){var o=!1;if(e.each(t.Packages,function(e,t){if(i(t))return o=!0,!1}),o)return!0}if(t.Memberships&&t.Memberships.length>0){var a=!1;if(e.each(t.Memberships,function(e,t){if(i(t))return a=!0,!1}),a)return!0}return!1},_onlineCheckout.GetFMBFeeTypeCart=function(e){e=e||("undefined"!=typeof onlineShoppingCart?onlineShoppingCart:null);var t="undefined"!=typeof IsFMBEnableForBusiness&&!0===IsFMBEnableForBusiness,i=!1;try{e&&"function"==typeof _onlineCheckout.isDailyDealExistsInItems&&(i=!0===_onlineCheckout.isDailyDealExistsInItems(e))}catch(e){i=!1}return t&&!i?1:!t&&i?2:t&&i?3:0},_onlineCheckout.GetEffectiveIsForNewCustomer=function(){return void 0===ischkFirstTimeCustomerCart||null==ischkFirstTimeCustomerCart||!0!==ischkFirstTimeCustomerCart&&!1!==ischkFirstTimeCustomerCart?"undefined"!=typeof IsForNewCustomer&&null!=IsForNewCustomer&&IsForNewCustomer||void 0!==IsForVeraNewCustomer&&!0===IsForVeraNewCustomer:ischkFirstTimeCustomerCart},_onlineCheckout.GetDealBookingType=function(e,t){try{if(Number(t||0)>0&&Number(e||0)>0){var i="";try{i="function"==typeof getCookie&&getCookie("VeraSourceType")||""}catch(e){i=""}if("vera-push"==(i=i.toString().toLowerCase()))return 2;if("vera-email"==i)return 1}}catch(e){}return 0},_onlineCheckout.RecomputeDailyDealFeeOnRemaining=function(t,i,n){if(_shopdetail.EnableFMBFee()){var o=_onlineCheckout.GetEffectiveIsForNewCustomer(),a=Number(!0===o?dailyDealFeeValue||0:dailyDealFeeValue_ExistingUser||0),s=_onlineCheckout.IsAnyDailyDealInCart(),r=function(e,t,i){return function(e){return e&&(!0===e.isPackage||!0===e.isPackageApplied)}(e)?0:Number(null!=t&&""!==t?t:i)||0},l=!("undefined"!=typeof _shopdetail&&_shopdetail&&"function"==typeof _shopdetail.IsUKBusiness&&_shopdetail.IsUKBusiness()),c=function(e,t,i){(l&&null!=t&&Number(t)>0||s)&&a>0&&i>0?(e.dailydealFee=i*a/100,e.FMBPercentage=a):(e.dailydealFee=0,e.FMBPercentage=0)};String.isNullOrUndefineOrBlank(t)||e.each(t,function(t,i){if(!i||String.isNullOrUndefineOrBlank(i.eventEnrollment))return!0;e.each(i.eventEnrollment,function(t,i){if(!i)return!0;c(i,i.PromotionID,r(i,i.price,i.actualPrice)),String.isNullOrUndefineOrBlank(i.lstAddonService)||e.each(i.lstAddonService,function(e,t){if(!t)return!0;c(t,t.PromotionID,r(t,t.Price,t.Originalprice))})})}),String.isNullOrUndefineOrBlank(i)||e.each(i,function(e,t){if(!t)return!0;c(t,t.PromotionID,r(t,t.ActualPrice,t.Price))}),String.isNullOrUndefineOrBlank(n)||e.each(n,function(e,t){if(!t)return!0;c(t,t.PromotionID,r(t,t.ActualPrice,t.Price))})}},_onlineCheckout.BindFirstTimeCustomerCheckbox=function(){var t=e("#dvFirstTimeCustomerCart");0!==t.length&&(_shopdetail.EnableFMBFee()&&_onlineCheckout.EnableFirstTimeCustomerToggle()?(t.show(),_onlineCheckout.RefreshFirstTimeCustomerSelectionUI()):t.hide())},_onlineCheckout.RefreshFirstTimeCustomerSelectionUI=function(){var t=ischkFirstTimeCustomerCart;e("#tabFirstTimeYesCart").toggleClass("w--current",!0===t).attr("aria-checked",!0===t?"true":"false"),e("#tabFirstTimeNoCart").toggleClass("w--current",!1===t).attr("aria-checked",!1===t?"true":"false"),!0!==t&&!1!==t||e("#dvFirstTimeCustomerCartError").hide()},_onlineCheckout.SelectFirstTimeCustomerCart=function(e){var t=_onlineCheckout.IsAnyDailyDealInCart(onlineShoppingCartmain);ischkFirstTimeCustomerCart=!0===e,_onlineCheckout.RefreshFirstTimeCustomerSelectionUI(),(t||_onlineCheckout.IsAnyDailyDealInCart(onlineShoppingCartmain))&&(_onlineCheckout._fmbTipRestore="undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart&&onlineShoppingCart.tipValue>0?{tipValue:onlineShoppingCart.tipValue,tipPercent:onlineShoppingCart.tipPercent}:null,_onlineCheckout.ValidateErrorMessage(onlineShoppingCartmain),_onlineCheckout.getUserGCDetail())},_onlineCheckout.ValidateFirstTimeCustomerSelectionCart=function(){if(e("#dvFirstTimeCustomerCart").is(":visible")&&(void 0===ischkFirstTimeCustomerCart||null==ischkFirstTimeCustomerCart)){e("#dvFirstTimeCustomerCartError").show();try{e("html, body").animate({scrollTop:e("#dvFirstTimeCustomerCart").offset().top-120},300),e("#tabFirstTimeYesCart").focus()}catch(e){}return!1}return!0},_onlineCheckout.GetFirstVisitFlagCart=function(){return!0!==e("#dvFirstTimeCustomerCart").is(":visible")?0:!0===ischkFirstTimeCustomerCart?1:!1===ischkFirstTimeCustomerCart?2:0},_onlineCheckout.EnableFirstTimeCustomerToggle=function(){return("undefined"!=typeof IsForNewCustomer&&!0===IsForNewCustomer||void 0!==IsForVeraNewCustomer&&!0===IsForVeraNewCustomer)&&!_onlineCheckout.isValidForCheckoutInvoice()},_onlineCheckout.AmplitudeStep={OnlineCheckoutPageVisited:121,OnlineCheckoutCompleted:122},_onlineCheckout.FormatFmbAmount=function(e,t){try{if(null==e||""===String(e))return"";var i=void 0!==currencysymbol&&currencysymbol?currencysymbol:"$";return!0===t||1===Number(t)?i+e:e+"%"}catch(e){return""}},_onlineCheckout.GetPrimaryCheckoutItem=function(e){var t={name:"",date:"",time:"",type:"",providerName:"",providerId:"",dealAmount:"",depositAmount:"",isDepositRequired:!1};try{if(null==e)return t;if(e.ServiceInvoice&&e.ServiceInvoice.length>0){var i=e.ServiceInvoice[0];return t.name=i.servicename||"",t.type="Service",t.date=i.appointmentDate||"",t.time=i.appointmentTime||i.startTime||"",t.providerName=i.serviceProviderName||"",t.providerId=null!=i.serviceProviderID?String(i.serviceProviderID):"",t.dealAmount=null!=i.dailydealFee?String(i.dailydealFee):"",t.depositAmount=null!=i.deposit?String(i.deposit):"",t.isDepositRequired=Number(i.depositsPercentage)>0||Number(i.deposit)>0,t}if(e.Events&&e.Events.length>0){var n=e.Events[0];t.name=n.eventName||"",t.type="Class";var o=n.eventEnrollment&&n.eventEnrollment.length>0?n.eventEnrollment[0]:null;return o&&(t.date=o.eventDate||"",t.time=o.startTime||"",t.providerName=o.sPName||"",t.providerId=null!=o.sPID?String(o.sPID):"",t.dealAmount=null!=o.dailydealFee?String(o.dailydealFee):"",t.depositAmount=null!=o.deposit?String(o.deposit):"",t.isDepositRequired=Number(o.deposit)>0),t}if(e.Packages&&e.Packages.length>0){var a=e.Packages[0];return t.name=a.servicename||"",t.type="Package",t.dealAmount=null!=a.dailydealFee?String(a.dailydealFee):"",t}if(e.Memberships&&e.Memberships.length>0)return t.name=e.Memberships[0].membershipName||e.Memberships[0].servicename||"",t.type="Membership",t;if(e.Inventories&&e.Inventories.length>0)return t.name=e.Inventories[0].productName||e.Inventories[0].itemName||"",t.type="Product",t}catch(e){}return t},_onlineCheckout.AmplitudeMultiSep="|~|",_onlineCheckout.FormatItemDealFee=function(e){try{var t=Number(e);return isNaN(t)||t<=0?"$0.00":"$"+t.toFixed(2)}catch(e){return"$0.00"}},_onlineCheckout.GetCheckoutItemsAggregate=function(e){var t=_onlineCheckout.AmplitudeMultiSep,i={name:"",date:"",time:"",type:"",providerName:"",providerId:"",dealAmount:"",depositAmount:"",isDepositRequired:!1,dealComputed:!1};try{if(null==e)return i;var n,o=[],a=[],s=[],r=[],l=[],c=[],d=[],u=[],p=!1,h=!1,m=function(e){null!=e&&(h=!0);var t=null!=e?Number(e):0;return _onlineCheckout.FormatItemDealFee(isNaN(t)?0:t)},g=function(e){return e&&(e.ServiceTitle||e.ServiceName||e.servicename)||""};if(e.ServiceInvoice&&e.ServiceInvoice.length>0){var v=[],f={},C=[];for(n=0;n<e.ServiceInvoice.length;n++){var S=e.ServiceInvoice[n];if(S)if(19===Number(S.recordType)){var y=null!=S.parentAppointmentID?String(S.parentAppointmentID):null;null!=y?(f[y]=f[y]||[]).push(S):C.push(S)}else v.push(S)}var b=function(e,t){var i=t||{};o.push(e.servicename||g(e)),r.push("Add-on"),a.push(e.appointmentDate||i.appointmentDate||""),s.push(e.appointmentTime||e.startTime||i.appointmentTime||i.startTime||""),l.push(e.serviceProviderName||i.serviceProviderName||""),c.push(null!=e.serviceProviderID?String(e.serviceProviderID):null!=i.serviceProviderID?String(i.serviceProviderID):""),d.push(m(null!=e.dailydealFee?e.dailydealFee:null)),u.push(null!=e.deposit?String(e.deposit):""),(Number(e.depositsPercentage)>0||Number(e.deposit)>0)&&(p=!0)};for(n=0;n<v.length;n++){var k=v[n];o.push(k.servicename||""),r.push("Service"),a.push(k.appointmentDate||""),s.push(k.appointmentTime||k.startTime||""),l.push(k.serviceProviderName||""),c.push(null!=k.serviceProviderID?String(k.serviceProviderID):""),d.push(m(null!=k.dailydealFee?k.dailydealFee:null)),u.push(null!=k.deposit?String(k.deposit):""),(Number(k.depositsPercentage)>0||Number(k.deposit)>0)&&(p=!0);var _=null!=k.appointmentID?String(k.appointmentID):null;if(null!=_&&f[_]){for(var D=0;D<f[_].length;D++)b(f[_][D],k);delete f[_]}}for(var I in f)if(f.hasOwnProperty(I))for(var w=0;w<f[I].length;w++)b(f[I][w],null);for(var P=0;P<C.length;P++)b(C[P],null)}else if(e.Events&&e.Events.length>0)for(n=0;n<e.Events.length;n++)for(var A=e.Events[n],T=A.eventEnrollment&&A.eventEnrollment.length>0?A.eventEnrollment:[null],x=0;x<T.length;x++){var F=T[x];o.push(A.eventName||""),r.push("Class"),a.push(F&&F.eventDate||""),s.push(F&&F.startTime||""),l.push(F&&F.sPName||""),c.push(F&&null!=F.sPID?String(F.sPID):""),d.push(m(F&&null!=F.dailydealFee?F.dailydealFee:null)),u.push(F&&null!=F.deposit?String(F.deposit):""),F&&Number(F.deposit)>0&&(p=!0);for(var $=F&&F.lstAddonService&&F.lstAddonService.length?F.lstAddonService:[],O=0;O<$.length;O++){var M=$[O];o.push(g(M)),r.push("Add-on"),a.push(F&&F.eventDate||""),s.push(F&&F.startTime||""),l.push(F&&F.sPName||""),c.push(F&&null!=F.sPID?String(F.sPID):""),d.push(m(M&&null!=M.dailydealFee?M.dailydealFee:null)),u.push("")}}else if(e.Packages&&e.Packages.length>0)for(n=0;n<e.Packages.length;n++){var B=e.Packages[n];o.push(B.servicename||""),r.push("Package"),a.push(""),s.push(""),l.push(""),c.push(""),d.push(m(null!=B.dailydealFee?B.dailydealFee:null)),u.push("");for(var E=B.lstAddonService&&B.lstAddonService.length?B.lstAddonService:[],L=0;L<E.length;L++){var N=E[L];o.push(g(N)),r.push("Add-on"),a.push(""),s.push(""),l.push(""),c.push(""),d.push(m(N&&null!=N.dailydealFee?N.dailydealFee:null)),u.push("")}}else if(e.Memberships&&e.Memberships.length>0)for(n=0;n<e.Memberships.length;n++){var U=e.Memberships[n];o.push(U.membershipName||U.servicename||""),r.push("Membership"),a.push(""),s.push(""),l.push(""),c.push(""),d.push(m(null!=U.dailydealFee?U.dailydealFee:null)),u.push("")}else if(e.Inventories&&e.Inventories.length>0)for(n=0;n<e.Inventories.length;n++){var R=e.Inventories[n];o.push(R.productName||R.itemName||""),r.push("Product"),a.push(""),s.push(""),l.push(""),c.push(""),d.push(m(null!=R.dailydealFee?R.dailydealFee:null)),u.push("")}i.name=o.join(t),i.date=a.join(t),i.time=s.join(t),i.type=r.join(t),i.providerName=l.join(t),i.providerId=c.join(t),i.dealAmount=d.join(t),i.depositAmount=u.join(t),i.isDepositRequired=p,i.dealComputed=h}catch(e){}return i},_onlineCheckout.GetVagaroProVersion=function(){try{var e=navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"";if(e.indexOf("com.vagaro")>-1)return e.indexOf("androidpro")>-1?"Android Pro App":e.indexOf("iospro")>-1?"iPhone Pro App":e.indexOf("android")>-1?"Android App":e.indexOf("iphone")>-1||e.indexOf("ipad")>-1?"iPhone App":"Vagaro App";var t=_onlineCheckout.GetBrowserNameAndVersion(e),i=t?" - "+t:"";return e.indexOf("android")>-1?"Android Web Browser"+i:e.indexOf("iphone")>-1||e.indexOf("ipad")>-1?"iPhone Web Browser"+i:"Desktop Web Browser"+i}catch(e){return"Desktop Web Browser"}},_onlineCheckout.GetBrowserNameAndVersion=function(e){try{return e?e.indexOf("edg/")>-1?(t=e.match(/edg\/([0-9]+)/))?"Edge "+t[1]:"Edge":e.indexOf("opr/")>-1||e.indexOf("opera")>-1?(t=e.match(/(?:opr|opera)\/([0-9]+)/))?"Opera "+t[1]:"Opera":e.indexOf("chrome/")>-1?(t=e.match(/chrome\/([0-9]+)/))?"Chrome "+t[1]:"Chrome":e.indexOf("firefox/")>-1?(t=e.match(/firefox\/([0-9]+)/))?"Firefox "+t[1]:"Firefox":e.indexOf("safari")>-1&&e.indexOf("version/")>-1?(t=e.match(/version\/([0-9]+)/))?"Safari "+t[1]:"Safari":"":"";var t}catch(e){return""}},_onlineCheckout.GetAmplitudeDeviceId=function(){try{if("undefined"!=typeof amplitude&&amplitude&&amplitude.getInstance){var e=amplitude.getInstance().getDeviceId();if(!String.isNullOrUndefineOrBlank(e))return e}}catch(e){}try{var t="vg_amp_fallback_device_id",i=window.localStorage?window.localStorage.getItem(t):null;return String.isNullOrUndefineOrBlank(i)&&(i="vgfb-"+(new Date).getTime().toString(36)+"-"+Math.random().toString(36).slice(2,12),window.localStorage&&window.localStorage.setItem(t,i)),i}catch(e){return""}},_onlineCheckout.BuildOnlineCheckoutAmplitudeData=function(t){var i={};try{var n="undefined"!=typeof onlineShoppingCartmain&&null!=onlineShoppingCartmain&&(onlineShoppingCartmain.ServiceInvoice||onlineShoppingCartmain.Events||onlineShoppingCartmain.Packages)?onlineShoppingCartmain:"undefined"!=typeof onlineShoppingCart?onlineShoppingCart:null;i.Step=t,i.PageURL=window.location.href,i.UserAgent=navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i.AmplitudeDeviceId=_onlineCheckout.GetAmplitudeDeviceId(),i.BusinessID=n&&n.BusinessID?n.BusinessID:e("#hdnBusinessID").val()?e("#hdnBusinessID").val():0,i.UserID=n&&n.loginUserId?n.loginUserId:"undefined"!=typeof UserID?UserID:0,i.BusinessName="undefined"!=typeof _shopdetail&&_shopdetail&&_shopdetail.businessName?_shopdetail.businessName:"",i.Email="undefined"!=typeof UserEmail?UserEmail:"";var o=_onlineCheckout.GetCheckoutItemsAggregate(n);i.ServiceName=o.name,i.ServiceDate=o.date,i.ServiceTime=o.time,i.ServiceType=o.type,i.ServiceProviderName=o.providerName,i.ServiceProviderId=o.providerId;var a="undefined"!=typeof onlineShoppingCartmain&&null!=onlineShoppingCartmain?onlineShoppingCartmain:n||{};if(i.DepositAmount=_onlineCheckout.FormatFmbAmount(a.DepositsPer,a.DepositAmtType),t===_onlineCheckout.AmplitudeStep.OnlineCheckoutPageVisited){var s="function"==typeof _onlineCheckout.GetEffectiveIsForNewCustomer&&_onlineCheckout.GetEffectiveIsForNewCustomer(),r=Number(s?dailyDealFeeValue||0:dailyDealFeeValue_ExistingUser||0),l="function"==typeof _onlineCheckout.IsAnyDailyDealInCart&&!!_onlineCheckout.IsAnyDailyDealInCart(n);if(!l&&n&&n.ServiceInvoice&&n.ServiceInvoice.length&&"undefined"!=typeof _shopdetail&&_shopdetail&&"function"==typeof _shopdetail.EnableFMBFee&&_shopdetail.EnableFMBFee())for(var c=0;c<n.ServiceInvoice.length;c++){var d=n.ServiceInvoice[c],u=d?null!=d.PromotionID?d.PromotionID:d.PromotionId:null;if(null!=u&&Number(u)>0){l=!0;break}}i.DealAmount=l&&r>0?_onlineCheckout.FormatFmbAmount(r,dailyDealFeeType):""}else i.DealAmount=o.dealComputed?o.dealAmount:void 0!==dailyDealFeeValue&&null!=dailyDealFeeValue&&Number(dailyDealFeeValue)>0?dailyDealFeeValue+"%":"";i.IsDepositRequired=o.isDepositRequired;var p="undefined"!=typeof IsFMBEnableForBusiness&&IsFMBEnableForBusiness;i.IsFillMyBooksEnabled=p,i.IsDailyDealEnabled="function"==typeof _onlineCheckout.IsAnyDailyDealInCart&&!!_onlineCheckout.IsAnyDailyDealInCart(n),i.Is_Forms_Enabled="True"==e("#hdnIsFormsEnable").val(),i.IsCreditCardRequired="function"==typeof _onlineCheckout.IsCCDetailEnable&&!!_onlineCheckout.IsCCDetailEnable(),i.IsFirstBusinessVisit="function"==typeof _onlineCheckout.GetFirstVisitFlagCart&&1===_onlineCheckout.GetFirstVisitFlagCart();var h="";try{h="function"==typeof getCookie&&getCookie("VeraSourceType")||""}catch(e){h=""}if(h=h.toString().toLowerCase(),i.IsFromPush="vera-push"==h,i.IsFromEmail="vera-email"==h,i.VagaroProVersion=_onlineCheckout.GetVagaroProVersion(),i.DeviceModel=i.UserAgent,t===_onlineCheckout.AmplitudeStep.OnlineCheckoutCompleted){var m=_onlineCheckout._checkoutAuthResult||{};i.AuthStatus=m.AuthStatus||"",i.TransactionId=m.TransactionId||"",i.AuthFailCode=m.AuthFailCode||"",i.AuthFailReason=m.AuthFailReason||""}}catch(e){}return i},_onlineCheckout.SetCheckoutAuthResult=function(e,t,i,n,o){try{var a="";if("fail"===e){var s=null!=n?String(n):"";a=null!=i&&""!==String(i)?String(i)+"-"+s:s}_onlineCheckout._checkoutAuthResult={AuthStatus:e||"",TransactionId:null!=t?String(t):"",AuthFailCode:a,AuthFailReason:"fail"===e&&null!=o?String(o):""}}catch(e){}},_onlineCheckout.ApplyAuthResultFromResponse=function(e){try{if(null!=e&&null!=e.data){var t=null!=e.data.data&&null!=e.data.data.TransactionId?e.data.data.TransactionId:"";if(1e3==e.data.custom_code)_onlineCheckout.SetCheckoutAuthResult("success",t,null,"","");else{var i=e.data.Message||e.data.subResponseMessage||"Payment authorization failed";_onlineCheckout.SetCheckoutAuthResult("fail",t,e.data.paymentGateway,e.data.subResponseCode,i)}}else _onlineCheckout.SetCheckoutAuthResult("fail","",null,"","Payment authorization failed")}catch(e){}},_onlineCheckout.ExtractTransactionId=function(e){try{if(!e)return"";if(e.data){if(e.data.transactionID)return e.data.transactionID;if(e.data.TransactionId)return e.data.TransactionId;if(e.data.TransactionID)return e.data.TransactionID}return e.transactionID||e.transactionId||e.TransactionId||""}catch(e){return""}},_onlineCheckout.FirstTxnFromDistribution=function(e){try{if(e&&e.length)for(var t=0;t<e.length;t++){var i=e[t];if(i&&(i.transactionID||i.VPLTransactionID))return i.transactionID||i.VPLTransactionID}}catch(e){}return""},_onlineCheckout.AllTxnFromDistribution=function(e){try{if(e&&e.length){for(var t=[],i=0;i<e.length;i++){var n=e[i],o=n?n.transactionID||n.VPLTransactionID:"";o&&-1===t.indexOf(String(o))&&t.push(String(o))}if(t.length)return t.join(_onlineCheckout.AmplitudeMultiSep)}}catch(e){}return""},_onlineCheckout.CaptureCheckoutAuthResult=function(e){try{if(null==e)return void _onlineCheckout.SetCheckoutAuthResult("fail","",null,"","No checkout response");if(null!=e.classCheckoutResponse&&e.classCheckoutResponse.length>0){var t=e.classCheckoutResponse[0],i=t?t.response:null;if(t&&4==t.type){var n=_onlineCheckout.ExtractTransactionId(i);if(!n&&e.checkoutResponse){var o=e.checkoutResponse;n=_onlineCheckout.AllTxnFromDistribution(o.ccDistribution)||_onlineCheckout.ExtractTransactionId(o.gatewayResponse)||o.EventTransactionId||""}_onlineCheckout.SetCheckoutAuthResult("success",n,null,"","")}else if(t&&(5==t.type||6==t.type)){var a=e.checkoutResponse,s=i&&(i.paymentGateway||i.subResponseCode||i.Message)?i:a&&a.gatewayResponse?a.gatewayResponse:null,r=s&&s.Message?s.Message:s&&s.subResponseMessage?s.subResponseMessage:a&&a.resultMessage?a.resultMessage:"Payment failed";_onlineCheckout.SetCheckoutAuthResult("fail","",s?s.paymentGateway:null,s?s.subResponseCode:"",r)}return}var l=e.checkoutResponse;if(null!=l&&void 0!==l.resultType&&null!=l.resultType){var c=l.resultType;if(c===_onlineCheckout.FinalResponseType.Success||c===_onlineCheckout.FinalResponseType.PartialSuccess||c===_onlineCheckout.FinalResponseType.Distrubution){var d=_onlineCheckout.AllTxnFromDistribution(l.ccDistribution)||_onlineCheckout.ExtractTransactionId(l.gatewayResponse)||l.EventTransactionId||"";_onlineCheckout.SetCheckoutAuthResult("success",d,null,"","")}else if(c===_onlineCheckout.FinalResponseType.Fail||c===_onlineCheckout.FinalResponseType.AuthorizationFail){var u=l.gatewayResponse,p=l.resultMessage||(u&&u.Message?u.Message:"Checkout failed");_onlineCheckout.SetCheckoutAuthResult("fail","",u?u.paymentGateway:null,u?u.subResponseCode:"",p)}}}catch(e){}},_onlineCheckout.FireOnlineCheckoutAmplitude=function(e,t){try{var i=t||_onlineCheckout.BuildOnlineCheckoutAmplitudeData(e);i&&(i.Step=e);var n={};if(n.AddLogInAmplitude=i,_shopdetail.AjaxOld("AddLogInAmplitudeV2",n,function(){},function(){}),e==_onlineCheckout.AmplitudeStep.OnlineCheckoutCompleted&&i&&"success"==(i.AuthStatus||"").toString().toLowerCase()&&"function"==typeof clearCookie)try{clearCookie("VeraSourceType")}catch(e){}}catch(e){}},_onlineCheckout.FireOnlineCheckoutPageVisited=function(){try{_onlineCheckout._checkoutAuthResult=null,_onlineCheckout.FireOnlineCheckoutAmplitude(_onlineCheckout.AmplitudeStep.OnlineCheckoutPageVisited)}catch(e){}},_onlineCheckout.FireOnlineCheckoutCompleted=function(){try{_onlineCheckout.FireOnlineCheckoutAmplitude(_onlineCheckout.AmplitudeStep.OnlineCheckoutCompleted)}catch(e){}},_onlineCheckout.getTotalDailyDealFeeOfAllCartItems=function(t){if(_shopdetail.EnableFMBFee())return _onlineCheckout.RecomputeDailyDealFeeOnRemaining(t?t.Events:null,t?t.Packages:null,t?t.Memberships:null),totalDailyDealFeeOfAllCart_PMGCA=0,t.Events&&t.Events.length>0&&e.each(t.Events,function(t,i){i.eventEnrollment&&i.eventEnrollment.length>0&&e.each(i.eventEnrollment,function(t,i){totalDailyDealFeeOfAllCart_PMGCA+=Number(i.dailydealFee||0),i.lstAddonService&&i.lstAddonService.length>0&&e.each(i.lstAddonService,function(e,t){totalDailyDealFeeOfAllCart_PMGCA+=Number(t.dailydealFee||0)})})}),t.Packages&&t.Packages.length>0&&e.each(t.Packages,function(e,t){totalDailyDealFeeOfAllCart_PMGCA+=Number(t.dailydealFee||0)}),t.Memberships&&t.Memberships.length>0&&e.each(t.Memberships,function(e,t){totalDailyDealFeeOfAllCart_PMGCA+=Number(t.dailydealFee||0)}),totalDailyDealFeeOfAllCart_PMGCA},_onlineCheckout.displayFinalCalculatedPrice=function(){if(totalDailyDealFeeOfAllCart_PMGCA=_onlineCheckout.getTotalDailyDealFeeOfAllCartItems(onlineShoppingCart),_onlineCheckout.ChangeBuyBottonText(onlineShoppingCartmain),!String.isNullOrUndefineOrBlank(onlineShoppingCart)){var t=_onlineCheckout.hideShippingMethodsForFlatRateShippingProducts();_onlineCheckout.DisplayBusinessTaxes(),onlineShoppingCart.totalFeeAmount=0,onlineShoppingCart.totalFeeTax=0,onlineShoppingCart.businessFeesFinalTotal=0,String.isNullOrUndefineOrBlank(_onlineCheckout.IsVCFRequire)||1!=_onlineCheckout.IsVCFRequire?_onlineCheckout.ApplyMultipleFeesonAllItems(0):(_onlineCheckout.ApplyMultipleFeesonAllItems(2),_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.BusinessFee,null,f),_onlineCheckout.IsVCFRequire=!1),_onlineCheckout.DisplayBusinessFees(),onlineShoppingCart.businessFeesFinalTotal=_onlineCheckout.parseTodecimal(onlineShoppingCart.totalFeeAmount+onlineShoppingCart.totalFeeTax,2),e("#divdepositsdescription").hide(),e("#divCCDescription").hide(),e("#divcartsubtotal").hide(),e("#divfinalTotalPrice").html("");var i=parseFloat(0),n=parseFloat(0);i=parseFloat(onlineShoppingCart.ccAmt);var a=!1,s=onlineShoppingCart.tax,r=onlineShoppingCart.amtPaid-s,l=onlineShoppingCart.gcAmt,c=onlineShoppingCart.classPackageUsed,d=onlineShoppingCart.discount;if(i+=parseFloat(onlineShoppingCart.classFinalTotal),s+=onlineShoppingCart.classTax,r=r+parseFloat(onlineShoppingCart.classSubTotal)-parseFloat(onlineShoppingCart.classdiscount)-parseFloat(onlineShoppingCart.totalFeeAmount),parseFloat(onlineShoppingCart.depositTotal)>0&&(r+=onlineShoppingCart.depositTotal),l+=onlineShoppingCart.classGCUsed,d=_onlineCheckout.parseTodecimal(d+onlineShoppingCart.classdiscount,2),parseFloat(onlineShoppingCart.tipValue)>0&&(i+=parseFloat(onlineShoppingCart.tipValue)),0==onlineShoppingCart.IsPickupInStore){null!=onlineShoppingCart.shippingSurcharge&&null!=onlineShoppingCart.shippingSurcharge&&onlineShoppingCart.shippingSurcharge>0&&(i+=parseFloat(onlineShoppingCart.shippingSurcharge));var u=0;if(1==IsChargeMostExpensive&&t.Inventories.length>0){var p=0,h=0;e.grep(t.Inventories,function(e,t){(e.FlatRateShippingPrice>p||e.FlatRateShippingPrice==p&&e.AdditionShippingPrice>h)&&(p=e.FlatRateShippingPrice,h=e.AdditionShippingPrice,u=e.InventoryId)})}e.grep(t.Inventories,function(e,t){1==IsChargeMostExpensive?e.InventoryId==u?(n+=e.FlatRateShippingPrice,n+=(e.Quantity-1)*e.AdditionShippingPrice):n+=e.Quantity*e.AdditionShippingPrice:(n+=e.FlatRateShippingPrice,e.Quantity>1&&(n+=(e.Quantity-1)*e.AdditionShippingPrice))}),!_onlineCheckout.isValidForCheckoutInvoice()&&n>0&&(i+=n),null!=onlineShoppingCart.SelectedShippingMethod&&null!=onlineShoppingCart.SelectedShippingMethod&&null!=onlineShoppingCart.SelectedShippingMethod.Rate&&null!=onlineShoppingCart.SelectedShippingMethod.Rate&&onlineShoppingCart.SelectedShippingMethod.Rate>0&&(i+=parseFloat(onlineShoppingCart.SelectedShippingMethod.Rate),e.grep(onlineShoppingCart.Inventories,function(t,i){var n=t.InventoryId.toString();t.MasterInventoryId>0&&(n=t.InventoryId.toString()+""+t.MasterInventoryId.toString());var o=e.grep(onlineShoppingCart.shippingOptionsInd,function(e,t){return e.CombineId==n&&e.Code==onlineShoppingCart.SelectedShippingMethod.Code});o.length>0&&(t.shippingAmount=o[0].Rate)}))}if(!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"!=isCCRequiredForOnlineClass.toLowerCase()?(1==_onlineCheckout.IsClassBookingOnly(!0)?e(".divfinalclassamountless").hide():IsDailyDealFeeCCOFF&&totalDailyDealFeeOfAllCart_PMGCA>0||(i-=parseFloat(onlineShoppingCart.classFinalTotal),e("#divfinalclassamountless").html(""),e("#divfinalclassamountless").html("("+currencysymbol+parseFloat(parseFloat(onlineShoppingCart.classFinalTotal)+parseFloat(onlineShoppingCart.FeeDepositsRemaining)).format("#.##")+")"),e(".divfinalclassamountless").show()),a=!0):e(".divfinalclassamountless").hide(),"undefined"!=typeof IsEnableMerchantAccount&&"false"==IsEnableMerchantAccount.toLowerCase()&&1==_onlineCheckout.IsCalledFromLiveStream()&&(e(".divfinalclassamountless").hide(),a=!1),e("#divmobilefinalTotalPrice").html(""),1==_onlineCheckout.IsCalculateAndDisplayFeeOnline(!0)&&(i-=parseFloat(onlineShoppingCart.FeeDepositsRemaining)),e("#divfinalTotalPrice").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i)),_onlineCheckout.isCheckoutVPLPromocode=!0,_onlineCheckout.totalfinalAmount=i,e("#divmobilefinalTotalPrice").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i)),onlineShoppingCart.FinalCCAmount=i,_onlineCheckout.ValidateVPl(!1),_onlineCheckout.VPLmessagedeposit(i),e("#VPLtotaldeposit").show(),e("#vpltotalmessage").hide(),parseFloat(onlineShoppingCart.depositTotal)>0?(e(".divfinalcheckoutdeposit").show(),e("#divFinalCheckoutDeposit").html(""),e("#divFinalCheckoutDeposit").html("("+currencysymbol+onlineShoppingCart.depositTotal.format("#.##")+")"),a=!0):e(".divfinalcheckoutdeposit").hide(),parseFloat(s)>0?(e(".divfinalcheckouttex").hide(),e("#divFinalCheckoutTex").html(""),e("#divFinalCheckoutTex").html(currencysymbol+s.format("#.##")),a=!0):e(".divfinalcheckouttex").hide(),e("#divFinalCheckoutSubtotal").html(""),e("#divFinalCheckoutSubtotal").html(currencysymbol+r.format("#.##")),e("#divFinalCheckoutSubtotalDisplay").hide(),r>0&&e("#divFinalCheckoutSubtotalDisplay").show(),parseFloat(c)>0||_onlineCheckout.isValidForCheckoutInvoice()&&parseFloat(onlineShoppingCart.PackageAmount)>0){var m=c;e(".divfinalcheckoutpkgamount").show(),e("#divFinalCheckoutPkgAmount").html(""),_onlineCheckout.isValidForCheckoutInvoice()&&parseFloat(onlineShoppingCart.PackageAmount)>0&&(m=parseFloat(m)+parseFloat(onlineShoppingCart.PackageAmount)),e("#divFinalCheckoutPkgAmount").html("("+currencysymbol+m.format("#.##")+")"),a=!0}else e(".divfinalcheckoutpkgamount").hide();if(onlineShoppingCart.tipValue>0){var g=_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue,2);e("#divfinalCheckoutTipAmount").html(currencysymbol+g.format("#.##")),a=!0}else if(onlineShoppingCartmain.IsFullDeposit)a=!0;else if(_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(isAllowTipForInvoice)&&"true"==isAllowTipForInvoice.toLowerCase().trim())if(a=!0,null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0||null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){var v=null;null!=onlineShoppingCart.ServiceInvoice&&(v=e.grep(onlineShoppingCart.ServiceInvoice,function(e){return 0==e.isPaid&&e.depositsPercentage>0})),(null==v||null!=v&&0==v.length)&&_onlineCheckout.setTipOption()}else e(".divfinalCheckoutTip").hide();else e(".divfinalCheckoutTip").hide();0!=onlineShoppingCart.IsPickupInStore||String.isNullOrUndefineOrBlank(onlineShoppingCart.SelectedShippingMethod)||String.isNullOrUndefineOrBlank(onlineShoppingCart.SelectedShippingMethod.Rate)&&null==o?e(".divfinalcheckoutshipping").hide():(e(".divfinalcheckoutshipping").show(),e("#divFinalCheckoutShipping").html(""),e("#divFinalCheckoutShipping").html(currencysymbol+onlineShoppingCart.SelectedShippingMethod.Rate.format("#.##")),a=!0),!_onlineCheckout.isValidForCheckoutInvoice()&&n>0?(e(".divfinalflatrateshipping").show(),e("#divFinalFlatRateShipping").html(""),e("#divFinalFlatRateShipping").html(currencysymbol+n.format("#.##")),a=!0):e(".divfinalflatrateshipping").hide(),0!=onlineShoppingCart.IsPickupInStore||String.isNullOrUndefineOrBlank(onlineShoppingCart.shippingSurcharge)?e(".divfinalcheckoutsurcharge").hide():(e(".divfinalcheckoutsurcharge").show(),e("#divFinalCheckoutsurcharge").html(""),e("#divFinalCheckoutsurcharge").html(currencysymbol+onlineShoppingCart.shippingSurcharge.format("#.##")),a=!0),parseFloat(i)>0&&1==_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.invoiceDetails&&(a=!0,(0==_onlineCheckout.IsCCSupportedCountry()||1==_onlineCheckout.IsCCSupportedCountry()&&"false"==IsEnableMerchantAccount.toLowerCase())&&(e("#ancBuyNow").hide(),e("#divreturnpolicyPayInvoice").hide())),1==onlineShoppingCart.IsPickupInStore&&0==i&&0==_onlineCheckout.IsLoadCCIframForMemrship()?(e("#creditcardiframe_checkoutcart").html(""),e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide(),e("#divVplTracking").hide()):0==onlineShoppingCart.IsPickupInStore&&!_onlineCheckout.isValidForCheckoutInvoice()&&1==t.allFlatRateShippingProducts&&i>0&&_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout"),onlineShoppingCart.businessFeesFinalTotal>0&&(a=!0),a&&e("#divcartsubtotal").show(),e("#divcartdepositsblock").hide(),e("#divcartdepositprice_mobile").hide();var C=0;if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&("true"==isCCRequiredForOnlineClass.toLowerCase()||_onlineCheckout.isValidForCheckoutInvoice())&&("false"==IsClassReschedule.toLowerCase()||"true"==IsClassReschedule.toLowerCase()&&("undefined"==typeof IsPaid||"false"==IsPaid.toString().toLowerCase()))||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0){e("#divcartdepositsper").hide();var S=0,y=0,b=0,k=0;if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(t){b+=1,t.IsPartialDeposits=void 0!==t.IsPartialDeposits&&t.IsPartialDeposits,t.IsPartialPoint=void 0!==t.IsPartialPoint&&t.IsPartialPoint,t.paidType==_onlineCheckout.arrpaidType.DepositsClass?(S+=1,t.IsPartialPoint&&t.IsPartialDeposits&&(C+=t.PartialPrice),t.IsPartialPoint&&!t.IsDepositsOver?k+=t.depositsPaid+t.PartialPrice:k+=t.depositsPaid):t.paidType==_onlineCheckout.arrpaidType.PartiallyPaidClass?1:t.paidType==_onlineCheckout.arrpaidType.PaidClass&&(y+=1),null!=t.lstAddonService&&null!=t.lstAddonService&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){e.IsPartialDeposits=void 0!==e.IsPartialDeposits&&e.IsPartialDeposits,e.IsPartialPoint=void 0!==e.IsPartialPoint&&e.IsPartialPoint,b+=1,e.paidType==_onlineCheckout.arrpaidType.DepositsClass?(S+=1,e.IsPartialPoint&&e.IsPartialDeposits&&(C+=e.PartialPrice),e.IsPartialPoint&&!e.IsDepositsOver?k+=e.depositsPaid+e.PartialPrice:k+=e.depositsPaid):e.paidType==_onlineCheckout.arrpaidType.PartiallyPaidClass?1:e.paidType==_onlineCheckout.arrpaidType.PaidClass&&(y+=1)})})}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){b+=1,e.paidType==_onlineCheckout.arrpaidType.OfflineDeposit?(S+=1,k+=e.depositsPaid):e.paidType==_onlineCheckout.arrpaidType.Paid&&(y+=1)}),!(y>0&&b==y)){e("#divfinalTotalPrice").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,parseFloat(i+l))),e("#divcartdepositsblock").show(),e("#divcartdepositprice_mobile").show(),S>0&&(e("#divcartdepositsper").show(),e("#divcartdepositsper").html(currencysymbol+k.format("#.##")+" Deposit"),1==_onlineCheckout.IsClassBookingOnly(!0)&&(e("#divcheckoutSelectPaymentMethodTitle").html(_onlineCheckout.arrPaymentTitleType.Deposits),e("#divdepositsdescription").show())),i=_onlineCheckout.ConvertDecimalWithFixed(i-parseFloat(onlineShoppingCart.DepositsRemaining),!1,2)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining)-parseFloat(onlineShoppingCart.FeeDepositsRemaining)-parseFloat(C),onlineShoppingCart.FinalCCAmount=i,onlineShoppingCart.PartialPrice=C,e("#divcartdepositprice").html(currencysymbol+i.format("#.##")),e("#divcartdepositprice_mobile").html(currencysymbol+i.format("#.##")+" due now"),e("#divcarttotalduepriceatbusiness").html(currencysymbol+(onlineShoppingCart.DepositsRemaining+parseFloat(onlineShoppingCart.InvoiceDepositsRemaining)+parseFloat(onlineShoppingCart.FeeDepositsRemaining)).format("#.##"));var _=(onlineShoppingCart.DepositsRemaining+parseFloat(onlineShoppingCart.InvoiceDepositsRemaining)+parseFloat(onlineShoppingCart.FeeDepositsRemaining)).format("#.##");_>0&&(e("#VPLtotaldeposit").hide(),e("#vpltotalmessage").show(),_onlineCheckout.VPLmessagedeposit(_)),0==i&&0==_onlineCheckout.IsLoadCCIframForMemrship()&&(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide(),e("#divVplTracking").hide())}}else!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&1==_onlineCheckout.IsClassBookingOnly(!0)&&(e("#divcheckoutSelectPaymentMethodTitle").html(_onlineCheckout.arrPaymentTitleType.HoldOnCard),e("#divCCDescription").show(),"undefined"!=typeof GetCCRequiredToSecureAppointmentDescription&&e("#divCCDescription").html(GetCCRequiredToSecureAppointmentDescription("classes")));if(1==_onlineCheckout.Model.IsPaymentOption&&e("#dvCheckoutBookingPaymentMethod").show(),e("#divcartdepositsduelabelwithgc").hide(),e("#divCartGCLabelNew").hide(),e("#divcartdepositsperlabel").html("Total Due Now"),"undefined"!=typeof _shopdetail&&null!=_shopdetail?(e(_shopdetail.tabAddGiftCards).removeClass("w--current"),e(_shopdetail.divAddGiftCards).attr("style","display: none")):(e("#tabAddGiftCards").removeClass("w--current"),e("#divAddGiftCards").attr("style","display: none")),parseFloat(l)>0){var D=_onlineCheckout.createGiftCertificatesCartsubTotal();"none"==e("#divcartdepositsblock").css("display")?(e("#divCartGCLabelNew").show(),e("#divCartPrepayGClist").html(""),e("#tmplgclstCartSubtotal").tmpl(D).appendTo("#divCartPrepayGClist"),e("#divCartPrepaypricewithoutGC").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i)),e("#divfinalTotalPrice").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i+l)),1==_onlineCheckout.IsClassBookingOnly(!0)&&e("#divcheckoutSelectPaymentMethodTitle").html(_onlineCheckout.arrPaymentTitleType.Default)):(e("#divcartdepositsperlabel").html(""),e("#divcartdepositsduelabelwithgc").show(),e("#divcartdepositsgclist").html(""),e("#tmplgclstCartSubtotal").tmpl(D).appendTo("#divcartdepositsgclist"),"none"==e("#divcartdepositsper").css("display")?e("#divcartdepositpricewithoutgc").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i)):e("#divcartdepositpricewithoutgc").html(currencysymbol+i.format("#.##")),e("#divcartdepositprice").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i+l)))}e("#divfinalTotalDisplay").show(),e("#divcartsubtotal").removeClass("total-master").addClass("subtotal-master"),0==i&&1==e("#divfinalclassamountless").is(":visible")&&0==parseFloat(l)&&(e("#divfinalTotalDisplay").hide(),e("#divcartsubtotal").removeClass("subtotal-master").addClass("total-master")),0==_onlineCheckout.isValidForCheckoutInvoice()&&e(".divfinalCheckoutTipSuboption").hide();var I=null,w=null;null!=e("#divcartdepositprice")[0]&&null!=e("#divcartdepositprice")[0].innerHTML&&(w=e("#divcartdepositprice")[0].innerHTML.replace(currencysymbol,"")),null!=e("#lblGCRedeemAmt")[0]&&(I=(I=e("#lblGCRedeemAmt")[0].innerHTML.replace("$(","")).replace(")","")),null!=w&&null!=w&&0!=w?(totalDueAmt=e("#divfinalTotalPrice")[0].innerHTML.replace(currencysymbol,"")-w,FinalCCAmount=totalDueAmt):null!=I&&null!=I&&0!=I?(totalDueAmt=e("#divfinalTotalPrice")[0].innerHTML.replace(currencysymbol,"")-onlineShoppingCart.gcAmt,FinalCCAmount=totalDueAmt):FinalCCAmount=e("#divfinalTotalPrice")[0].innerHTML.replace(currencysymbol,""),!String.isNullOrUndefineOrBlank(BusinessDetail)&&FinalCCAmount<=BusinessDetail.MaximumAmount&&FinalCCAmount>=BusinessDetail.MinimumAmount&&"Free"==e("#divfinalTotalPrice")[0].innerHTML&&e("#divVplTracking").hide(),1==e("#tabVagaroPayLater").hasClass("w--current")&&FinalCCAmount>0&&_vgVPLOnline.PaymentSchedule(FinalCCAmount,_onlineCheckout.PaymentSchduleSuccess,_onlineCheckout.PaymentSchdulefail);var P=0,A=0;if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0){for(var T=0;T<onlineShoppingCart.Events.length;T++)if(null!=onlineShoppingCart.Events[T].eventEnrollment&&onlineShoppingCart.Events[T].eventEnrollment.length>0)for(var x=0;x<onlineShoppingCart.Events[T].eventEnrollment.length;x++){if(null!=onlineShoppingCart.Events[T].eventEnrollment[x].gcId&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].gcId&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax&&""!=onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].giftCertificateNo&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].giftCertificateNo)for(var F=onlineShoppingCart.Events[T].eventEnrollment[x].giftCertificateNo.substr(onlineShoppingCart.Events[T].eventEnrollment[x].giftCertificateNo.length-4),$=0;$<onlineShoppingCart.lstGCPkgData.length;$++)if(0==onlineShoppingCart.lstGCPkgData[$].isPackage&&onlineShoppingCart.lstGCPkgData[$].giftCertificateNo.substr(onlineShoppingCart.lstGCPkgData[$].giftCertificateNo.length-4).toLowerCase()==F.toLowerCase()&&null!=onlineShoppingCart.lstGCPkgData[$].Taxes)for(var O=0;O<onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax.length;O++)if(e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax[O].BusinessTaxID).length>0){var M=e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax[O].BusinessTaxID)[0].innerHTML;M=ConvertTodecimalMorePrecious(parseFloat(M.replace(/\$/g,"").replace(/£/g,"")),!0,2),M=ConvertTodecimalMorePrecious(M-onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax[O].CalculatedTax,!0,2),e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax[O].BusinessTaxID)[0].innerHTML=_shopdetail.currencySymbol+M,P+=onlineShoppingCart.Events[T].eventEnrollment[x].BusinessTax[O].CalculatedTax}if(null!=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService&&onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService.length>0)for(var B=0;B<onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService.length;B++)if(null!=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].gcId&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].gcId&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax&&""!=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].giftCertificateNo&&null!=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].giftCertificateNo)for(var E=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].giftCertificateNo.substr(onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].giftCertificateNo.length-4),L=0;L<onlineShoppingCart.lstGCPkgData.length;L++)if(0==onlineShoppingCart.lstGCPkgData[L].isPackage&&onlineShoppingCart.lstGCPkgData[L].giftCertificateNo.substr(onlineShoppingCart.lstGCPkgData[L].giftCertificateNo.length-4).toLowerCase()==E.toLowerCase()&&null!=onlineShoppingCart.lstGCPkgData[L].Taxes)for(var N=0;N<onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax.length;N++)if(e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax[N].BusinessTaxID).length>0){var U=e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax[N].BusinessTaxID)[0].innerHTML;U=ConvertTodecimalMorePrecious(parseFloat(U.replace(/\$/g,"").replace(/£/g,"")),!0,2),U=ConvertTodecimalMorePrecious(U-onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax[N].CalculatedTax,!0,2),e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax[N].BusinessTaxID)[0].innerHTML=_shopdetail.currencySymbol+U,A+=onlineShoppingCart.Events[T].eventEnrollment[x].lstAddonService[B].BusinessTax[N].CalculatedTax}}e("#divTotalDuePrice").find("#divfinalTotalPrice")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divTotalDuePrice").find("#divfinalTotalPrice")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")-(parseFloat(ConvertTodecimalMorePrecious(P,!0,2))+parseFloat(ConvertTodecimalMorePrecious(A,!0,2))),!0,2),e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")>=P+A?e("#divCartPrepaypricewithoutGC")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")-ConvertTodecimalMorePrecious(parseFloat(ConvertTodecimalMorePrecious(P,!0,2))+parseFloat(ConvertTodecimalMorePrecious(A,!0,2)),!0,2),!0,2):e("#divCartPrepaypricewithoutGC")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")-parseFloat(e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")),!0,2),e("#divmobilefinalTotalPrice")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")>=P+A?e("#divmobilefinalTotalPrice")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divmobilefinalTotalPrice")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")-ConvertTodecimalMorePrecious(parseFloat(ConvertTodecimalMorePrecious(P,!0,2))+parseFloat(ConvertTodecimalMorePrecious(A,!0,2)),!0,2),!0,2):e("#divmobilefinalTotalPrice")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divmobilefinalTotalPrice")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")-parseFloat(e("#divmobilefinalTotalPrice")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")),!0,2)}if(null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&null!=onlineShoppingCart.RedeemedByGC&&onlineShoppingCart.RedeemedByGC.length>0){var R=0,W=[];for(T=0;T<onlineShoppingCart.ServiceInvoice.length;T++)for(x=0;x<onlineShoppingCart.RedeemedByGC.length;x++)onlineShoppingCart.ServiceInvoice[T].serviceid==onlineShoppingCart.RedeemedByGC[x].serviceId&&W.push(onlineShoppingCart.ServiceInvoice[T]);for($=0;$<W.length;$++)for(O=0;O<onlineShoppingCart.lstGCPkgData.length;O++)if(W[$].serviceid==onlineShoppingCart.lstGCPkgData[O].serviceID&&null!=onlineShoppingCart.lstGCPkgData[O].Taxes&&null!=W[$].BusinessTax&&W[$].BusinessTax.length>0)for(B=0;B<W[$].BusinessTax.length;B++)if(e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+W[$].BusinessTax[B].BusinessTaxID).length>0){M=e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+W[$].BusinessTax[B].BusinessTaxID)[0].innerHTML;M=ConvertTodecimalMorePrecious(parseFloat(M.replace(/\$/g,"").replace(/£/g,"")),!0,2),M=ConvertTodecimalMorePrecious(M-W[$].BusinessTax[B].CalculatedTax,!0,2),e("#divfinalcheckoutMultipletaxes").find("#divMultipleTaxValue_"+W[$].BusinessTax[B].BusinessTaxID)[0].innerHTML=_shopdetail.currencySymbol+M,R+=W[$].BusinessTax[B].CalculatedTax}e("#divTotalDuePrice").find("#divfinalTotalPrice")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divTotalDuePrice").find("#divfinalTotalPrice")[0].innerHTML.replace(/\$/g,"").replace(/£/g,""),!0,2),e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")>=R?e("#divCartPrepaypricewithoutGC")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,""),!0,2):e("#divCartPrepaypricewithoutGC")[0].innerHTML=_shopdetail.currencySymbol+ConvertTodecimalMorePrecious(e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")-parseFloat(e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace(/\$/g,"").replace(/£/g,"")),!0,2)}}_onlineCheckout.BindFirstTimeCustomerCheckbox()},_onlineCheckout.CheckGCPromoCodeLimt=function(t){if(_shopdetail.EnableFMBFee()&&_onlineCheckout.IsAnyDailyDealInCart()){var i=_onlineCheckout.IsValidateForPromoCode();if("function"!=typeof _shopdetail.IsUKBusiness||!_shopdetail.IsUKBusiness()||0!=i)return}ShowLoader(!0);try{if(void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication||"undefined"!=typeof isWidget&&null!=isWidget&&"true"==isWidget.toLowerCase()){var n=(new Date).getTime();if(1===t)var o=e("#txtGCRedeemGCNo").val(),a={timestamp:n,eventName:"GiftCardApplied",data:{customerId:"undefined"!=typeof staticEncryptUserID&&null!=staticEncryptUserID?staticEncryptUserID:"",giftCardNumber:o}};else{var s=e("#txtPromoCode").val();a={timestamp:n,eventName:"PromoCodeApplied",data:{customerId:"undefined"!=typeof staticEncryptUserID&&null!=staticEncryptUserID?staticEncryptUserID:"",promoCode:s}}}"undefined"!=typeof wbc&&void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication?wbc._postMessage('{"eventType": "MysiteSendEventMessage","message": '+JSON.stringify(a)+"}"):"undefined"!=typeof $Interframe&&$Interframe.sendEventMessage(a)}}catch(e){}if(t==_onlineCheckout.PromoCodeType.GCCode){if(null==(o=e("#txtGCRedeemGCNo").val())||String.isNullOrUndefineOrBlank(o.trim()))return e("#txtGCRedeemGCNo").val(""),e("#txtGCRedeemGCNo").addClass("errorInput"),e("#txtGCRedeemGCNo").focus(),void ShowLoader(!1);var r=onlineShoppingCart.loginUserId,l=UserType,c="CheckGCNumber";_onlineCheckout.GetGCPromoCodeLimt(r,l,c),ShowLoader(!1)}else if(t==_onlineCheckout.PromoCodeType.PromoCode){if(null==(s=e("#txtPromoCode").val())||String.isNullOrUndefineOrBlank(s.trim()))return e("#txtPromoCode").val(""),e("#txtPromoCode").addClass("errorInput"),e("#txtPromoCode").focus(),void ShowLoader(!1);r=onlineShoppingCart.loginUserId,l=UserType,c="CheckPromoNumber";_onlineCheckout.GetGCPromoCodeLimt(r,l,c),ShowLoader(!1)}},_onlineCheckout.GetGCPromoCodeLimt=function(e,t,i){var n={};n.UserID=parseInt(e),n.UserType=null==t||""==t||void 0===t||0==t?parseInt(1):parseInt(t),n.MethodName=i;var o=new vagaro.ajax;o.datamodel.async=!1,o.datamodel.Token=_onlineCheckout.GetCoreAPIURLWithToken(ApiURLEnumOnlineCheckout.getgcpromocodelimt,groupID),o.datamodel.data=n,o.datamodel.IsNewVagaroAPI=!0,o.datamodel.callback=_onlineCheckout.GetGCPromoCodeLimtSuccess,o.datamodel.Error=_onlineCheckout.GetState_Failure,o.Post()},_onlineCheckout.GetGCPromoCodeLimtSuccess=function(t){if(1e3==t.ResponseCode&&null!=t.Data){var i=t.Data.split("|");if(i.length<=2&&i[1]==_onlineCheckout.CodeType.GCCode){var n=e("#txtGCRedeemGCNo").val();if("True"!=i[0])return _onlineCheckout.CreateGCCodeDiv(n.trim().toUpperCase(),n.trim().toUpperCase(),"You have exceeded the number of attempts.",!1),e("#txtGCRedeemGCNo").val(""),void ShowLoader(!1);_onlineCheckout.CheckValidGCNoInGCRedeem(),ShowLoader(!1)}else if(i.length<=2&&i[1]==_onlineCheckout.CodeType.PromoCode){var o=e("#txtPromoCode").val();if("True"!=i[0])return _onlineCheckout.CreatePromoCodeDiv(o.toUpperCase(),o.toUpperCase(),"You have exceeded the number of attempts.",!1),e("#txtPromoCode").val(""),void ShowLoader(!1);_onlineCheckout.ValidatePromoCode(),ShowLoader(!1)}}},_onlineCheckout.GCPromoCodeLimt=function(e,t,i,n){var o={};o.UserID=parseInt(e),o.UserType=null==t||""==t||void 0===t||0==t?parseInt(1):parseInt(t),o.GCPromoCodeNo=i,o.MethodName=n;var a=new vagaro.ajax;a.datamodel.async=!1,a.datamodel.Token=_onlineCheckout.GetCoreAPIURLWithToken(ApiURLEnumOnlineCheckout.gcpromocodelimt,groupID),a.datamodel.data=o,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.callback=_onlineCheckout.GCPromoCodeLimtSuccess,a.datamodel.Error=_onlineCheckout.GetState_Failure,a.Post()},_onlineCheckout.GCPromoCodeLimtSuccess=function(t){if(1e3==t.CustomCode&&null!=t.Data)if(null!=t.Data.RateLimitMethods&&t.Data.RateLimitMethods.MethodName==_onlineCheckout.CodeType.GCCode){var i=e("#txtGCRedeemGCNo").val();if(null!=t.Data.RateLimitMethodDetails)return _onlineCheckout.CreateGCCodeDiv(i.trim().toUpperCase(),i.trim().toUpperCase(),"The gift card number you entered is incorrect.",!1),e("#txtGCRedeemGCNo").val(""),void ShowLoader(!1)}else if(null!=t.Data.RateLimitMethods&&t.Data.RateLimitMethods.MethodName==_onlineCheckout.CodeType.PromoCode){var n=e("#txtPromoCode").val();if(null!=t.Data.RateLimitMethodDetails)return _onlineCheckout.CreatePromoCodeDiv(n.toUpperCase(),n.toUpperCase(),"The promo code you entered is incorrect.",!1),e("#txtPromoCode").val(""),void ShowLoader(!1)}};var B=!1;_onlineCheckout.CheckValidGCNoInGCRedeem=function(){e("#divApplyGCcode").empty();var t,i=e("#txtGCRedeemGCNo").val();if(null==i||String.isNullOrUndefineOrBlank(i.trim()))e("#txtGCRedeemGCNo").val(""),e("#txtGCRedeemGCNo").addClass("errorInput"),e("#txtGCRedeemGCNo").focus();else{if(0!==(t=e.grep(onlineShoppingCart.lstGCPkgData,function(t){return!String.isNullOrUndefineOrBlank(t.giftCertificateNo)&&t.giftCertificateNo.toLowerCase()==e("#txtGCRedeemGCNo").val().toLowerCase().trim()||!String.isNullOrUndefineOrBlank(t.giftCertificateNo)&&t.giftCertificateNo.toLowerCase().substr(0,t.giftCertificateNo.lastIndexOf("-")).trim()==e("#txtGCRedeemGCNo").val().toLowerCase().trim()})).length)return _onlineCheckout.CreateGCCodeDiv(i.trim().toUpperCase(),i.trim().toUpperCase(),"This Gift Card already exist.",!1),e("#txtGCRedeemGCNo").val(""),void ShowLoader(!1);if(B=!0,0===t.length){ShowLoader(!0);var n={};n.businessID=onlineShoppingCart.BusinessID,n.userID=onlineShoppingCart.loginUserId,n.gCNo=e("#txtGCRedeemGCNo").val().trim(),n.isConsiderOwnBusiness="1"===e("#hdnIsFromSwipe").val(),n.lLoggedInID=onlineShoppingCart.loginUserId;var o=new vagaro.ajax;o.datamodel.Token="CheckGCNo",o.datamodel.data=n,o.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},o.datamodel.callback=_onlineCheckout.CheckValidGCNoInGCRedeem_Success,o.Post()}}},_onlineCheckout.DateDifference=function(e,t){var i=t.getTime()-e.getTime();return Math.ceil(i/1e3/60/60/24)},_onlineCheckout.GetTerikSupportedDate=function(e){return new Date(e.replace(/-/g,","))},_onlineCheckout.SetGCPackageList=function(e){var t={AdvanceLimitDate:null};return t.SharedUserIDs=onlineShoppingCart.loginUserId.toString(),t.TotalPKGUnlimitedCount=e.TotalPKGUnlimitedCount,t.ValidUpto=e.ValidUpto,t.assignTo=e.AssignTo,t.assignedToName=e.AssignedToName,t.businessID=e.BusinessID,t.businessName=e.BusinessName,t.currentBalance=e.CurrentBalance,t.emailId="",t.eventType=e.EventType,t.expiresOn=e.ExpiresOn,t.giftCertificateAmt=e.GiftCertificateAmt,t.giftCertificateID=e.GiftCertificateID,t.giftCertificateNo=e.GiftCertificateNo,t.groupID=e.GroupId,t.initialQuantity=e.InitialQuantity,t.isCustomPackage=e.IsCustomPackage,t.isPackage=e.IsPackage,t.pkgName="",t.quantity=e.Quantity,t.senderName=e.SenderName,t.serviceID=0==e.ServiceID?null:e.ServiceID,t.serviceName=e.ServiceName,t.strAdvanceLimitDate=e.AdvanceLimitDate,t.strValidUpto=e.strValidUpto,t.voidDate=e.VoidDate,t.voidReason=e.VoidReason,onlineShoppingCart.lstGCPkgData.push(t),t},_onlineCheckout.CheckValidGCNoInGCRedeem_Success=function(t){ShowLoader(!1);var i=e("#txtGCRedeemGCNo").val();if(null!==t&&t.length>0){var n=_onlineCheckout.Empty,o=e.grep(t,function(e){return String.isNullOrUndefineOrBlank(e.VoidDate)&&(String.isNullOrUndefineOrBlank(e.strExpiresOn)||!String.isNullOrUndefineOrBlank(e.strExpiresOn)&&_onlineCheckout.DateDifference(_onlineCheckout.GetTerikSupportedDate(BusinessDate),new Date(e.strExpiresOn))>0)&&(null===e.ServiceID||null!==e.ServiceID&&e.Quantity>0)&&null!==e.CurrentBalance&&e.CurrentBalance>0});if(o.length>0&&(t[0]=o[0]),String.isNullOrUndefineOrBlank(t[0].VoidDate)?!String.isNullOrUndefineOrBlank(t[0].strExpiresOn)&&_onlineCheckout.DateDifference(_onlineCheckout.GetTerikSupportedDate(BusinessDate),new Date(t[0].strExpiresOn))<0?n=_onlineCheckout.GCExpMsg:null!==t[0].CurrentBalance&&t[0].CurrentBalance<=0?n=_onlineCheckout.GCBalMsg:null!==t[0].ServiceID&&t[0].Quantity<=0&&(n=_onlineCheckout.GCQuantityMsg):n=_onlineCheckout.GCVoidMsg,!String.isNullOrUndefineOrBlank(n))return _onlineCheckout.CreateGCCodeDiv(i.trim().toUpperCase(),i.trim().toUpperCase(),n,!1),!1;if(0==o.length&&1==B){var a=UserType,s="CheckGCNumber";return _onlineCheckout.GCPromoCodeLimt(onlineShoppingCart.loginUserId,a,i.trim().toUpperCase(),s),!1}e("#divApplyGCcode").empty(),e("#txtGCRedeemGCNo").val("");var r=_onlineCheckout.SetGCPackageList(t[0]);null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(t){1!=t.isPointApply&&1!=t.isPackage&&(t.gcId=null,t.GCDetail=[],t.isPriceBaseGCApply=!1,t.isGCApply=!1,t.isDecisionTaken=null,t.redeemAmt=0,t.redeemTax=0,t.isServiceBaseGC=!1),!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){1!=e.isPointApply&&1!=e.isPackage&&(e.gcId=null,e.GCDetail=[],e.isPriceBaseGCApply=!1,e.isGCApply=!1,e.isDecisionTaken=null,e.redeemAmt=0,e.redeemTax=0,e.isServiceBaseGC=!1)})})}),onlineShoppingCart.RedeemedByGCtemp=[]),_onlineCheckout.ApplyDiscounts(onlineShoppingCart.lstGCPkgData,null,onlineShoppingCart.lstMembership,onlineShoppingCart.IsPromotionEnable,r),e("#txtGCRedeemGCNo").val(_onlineCheckout.Empty)}else{a=UserType,s="CheckGCNumber";_onlineCheckout.GCPromoCodeLimt(onlineShoppingCart.loginUserId,a,i.trim().toUpperCase(),s)}},_onlineCheckout.VPLmessagedeposit=function(t){if("undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CheckinApp&&_siteBuilderDetail.isAffirmEnable)return e("#dvVPLdeposit").hide(),e("#VPLImageaftrdeposit").css("display","none"),e("#VPLImageBfrdeposit").css("display","none"),e("#dvVPLTotal").hide(),e("#VPLImageaftr").css("display","none"),void e("#VPLImageBfr").css("display","none");var i=t,n=e("#hdnMaximumAmount").val(),o=e("#hdnMinimumAmount").val(),a=e("#hdnIsVPLEnable").val(),s=parseInt(JSON.parse(n)),r=parseInt(JSON.parse(o)),l=JSON.parse(a);if(_siteBuilderDetail.isAffirmEnable){const t="https://vagaro.azureedge.net/static/assets/new_affirm_logo2.png";e("#VPLImageBfrdeposit img, #VPLImageaftrdeposit img, #VPLImageBfr img, #VPLImageaftr img").attr("src",t).addClass("AffirmImageLogo")}if(2==l&&0==_onlineCheckout.IsVplChanged&&"false"==IsClassReschedule.toLowerCase()){if("undefined"!=typeof IsEnableMerchantAccount&&"false"==IsEnableMerchantAccount.toLowerCase())e("#dvVPLdeposit").hide(),e("#VPLImageaftrdeposit").css("display","none"),e("#VPLImageBfrdeposit").css("display","none"),e("#dvVPLTotal").hide(),e("#VPLImageaftr").css("display","none"),e("#VPLImageBfr").css("display","none");else if(1==_onlineCheckout.IsRecurringPkg||1==_onlineCheckout.IsRecurringMembership)e("#VPLImageBfrdeposit").css("display","block"),e("#dvVPLdeposit").css("display","block"),e("#dvVPLdeposit")[0].innerText=" is not available for recurring memberships and packages.",e("#VPLImageaftrdeposit").css("display","none"),e("#VPLImageBfr").css("display","inline"),e("#dvVPLTotal").css("display","inline"),e("#dvVPLTotal")[0].innerText=" is not available for recurring memberships and packages.",e("#VPLImageaftr").css("display","none");else if(0==i||i<r&&(0==_onlineCheckout.IsRecurringPkg||0==_onlineCheckout.IsRecurringMembership))e("#dvVPLdeposit").css("display","inline"),e("#dvVPLdeposit")[0].innerText="Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with ",e("#VPLImageaftrdeposit").css("display","inline"),e("#VPLImageBfrdeposit").css("display","none"),e("#VPLImageaftrdeposit").attr("aria-label"," Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with"),e("#dvVPLTotal").css("display","inline"),e("#dvVPLTotal")[0].innerText="Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with ",e("#VPLImageaftr").css("display","inline"),e("#VPLImageBfr").css("display","none"),e("#VPLImageaftr").attr("aria-label"," Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with");else if(i>s&&(0==_onlineCheckout.IsRecurringPkg||0==_onlineCheckout.IsRecurringMembership))e("#VPLImageaftrdeposit").css("display","none"),e("#VPLImageBfrdeposit").css("display","inline"),e("#dvVPLdeposit").css("display","inline"),e("#dvVPLdeposit")[0].innerText=" is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+".",e("#VPLImageBfrdeposit").attr("aria-label"," is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"."),e("#VPLImageBfr").css("display","inline"),e("#VPLImageaftr").css("display","none"),e("#dvVPLTotal").css("display","inline"),e("#dvVPLTotal")[0].innerText=" is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+".",e("#VPLImageBfr").attr("aria-label"," is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+".");else if(i<s&&i>r&&0==_onlineCheckout.isCheckoutVPLChanged||0==_onlineCheckout.IsVplChanged){var c=i/4;c=c.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,"),e("#dvVPLdeposit").css("display","inline"),e("#dvVPLdeposit")[0].innerText=" or 4 payments of "+_shopdetail.currencySymbol+c+" with ",e("#VPLImageaftrdeposit").css("display","inline"),e("#VPLImageBfrdeposit").css("display","none"),e("#VPLImageaftrdeposit").attr("aria-label"," or 4 payments of "+_shopdetail.currencySymbol+c+" with vagaro pay later"),_siteBuilderDetail.isAffirmEnable&&(e("#dvVPLdeposit")[0].innerText="Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with",e("#dvVPLdeposit").addClass("affirm-as-low-as"),e("#dvVPLdeposit").attr("data-page-type","product"),e("#dvVPLdeposit").attr("data-amount",(100*i).toFixed(2)),e("#VPLImageaftrdeposit").css("display","none"),"undefined"!=typeof affirm&&affirm.ui&&"function"==typeof affirm.ui.refresh?affirm.ui.refresh():e("#VPLImageaftrdeposit").css("display","inline")),e("#dvVPLTotal").css("display","inline"),e("#dvVPLTotal")[0].innerText=" or 4 payments of "+_shopdetail.currencySymbol+c+" with ",e("#VPLImageaftr").css("display","inline"),e("#VPLImageBfr").css("display","none"),e("#VPLImageaftr").attr("aria-label"," or 4 payments of "+_shopdetail.currencySymbol+c+" with vagaro pay later"),_siteBuilderDetail.isAffirmEnable&&(e("#dvVPLTotal")[0].innerText="Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with ",e("#dvVPLTotal").addClass("affirm-as-low-as"),e("#dvVPLTotal").attr("data-page-type","product"),e("#dvVPLTotal").attr("data-amount",(100*i).toFixed(2)),e("#VPLImageaftr").css("display","none"),"undefined"!=typeof affirm&&affirm.ui&&"function"==typeof affirm.ui.refresh?affirm.ui.refresh():e("#VPLImageaftr").css("display","inline")),e("#AffirmPaybutton").attr("data-amount",(100*i).toFixed(2)),"undefined"!=typeof affirm&&affirm.ui&&"function"==typeof affirm.ui.refresh&&affirm.ui.refresh(),_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.ShowNoOfPayment==ShowVPLNoOfPayment.Hide&&i<_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MinimumAmount&&(e("#dvVPLdeposit").css("display","none"),e("#VPLImageaftrdeposit").css("display","none"),e("#dvVPLTotal").css("display","none"),e("#VPLImageaftr").css("display","none"))}}else 1==l?(e("#VPLImageBfrdeposit").css("display","block"),e("#dvVPLdeposit").css("display","block"),e("#dvVPLdeposit")[0].innerText="is not available for this service Provider.",e("#VPLImageBfr").css("display","block"),e("#dvVPLTotal").css("display","block"),e("#dvVPLTotal")[0].innerText="is not available for this service Provider."):(e("#dvVPLdeposit").hide(),e("#VPLImageaftrdeposit").css("display","none"),e("#VPLImageBfrdeposit").css("display","none"))},_onlineCheckout.Affirmmessagedeposit=function(t){var i=t,n=e("#hdnMaximumAmount").val(),o=e("#hdnMinimumAmount").val(),a=e("#hdnIsVPLEnable").val(),s=parseInt(JSON.parse(n)),r=parseInt(JSON.parse(o)),l=JSON.parse(a);2==l&&0==_onlineCheckout.IsVplChanged&&"false"==IsClassReschedule.toLowerCase()?"undefined"!=typeof IsEnableMerchantAccount&&"false"==IsEnableMerchantAccount.toLowerCase()?(e("#dvAffirmdeposit").hide(),e("#AffirmImageaftrdeposit").css("display","none"),e("#AffirmImageBfrdeposit").css("display","none"),e("#dvAffirmTotal").hide(),e("#AffirmImageaftr").css("display","none"),e("#AffirmImageBfr").css("display","none")):1==_onlineCheckout.IsRecurringPkg||1==_onlineCheckout.IsRecurringMembership?(e("#AffirmImageBfrdeposit").css("display","block"),e("#dvAffirmdeposit").css("display","block"),e("#dvAffirmdeposit")[0].innerText=" is not available for recurring memberships and packages.",e("#AffirmImageaftrdeposit").css("display","none"),e("#AffirmImageBfr").css("display","inline"),e("#dvAffirmTotal").css("display","inline"),e("#dvAffirmTotal")[0].innerText=" is not available for recurring memberships and packages.",e("#AffirmImageaftr").css("display","none")):0==i||i<r&&(0==_onlineCheckout.IsRecurringPkg||0==_onlineCheckout.IsRecurringMembership)?(e("#dvAffirmdeposit").css("display","inline"),e("#dvAffirmdeposit")[0].innerText="Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with",e("#AffirmImageaftrdeposit").css("display","inline"),e("#AffirmImageBfrdeposit").css("display","inline"),e("#AffirmImageaftrdeposit").attr("aria-label"," Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with"),e("#dvAffirmTotal").css("display","inline"),e("#dvAffirmTotal")[0].innerText="Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with",e("#AffirmImageaftr").css("display","inline"),e("#AffirmImageBfr").css("display","inline"),e("#AffirmImageaftr").attr("aria-label"," Pay over time for orders of $"+r.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"+ with")):i>s&&(0==_onlineCheckout.IsRecurringPkg||0==_onlineCheckout.IsRecurringMembership)?(e("#AffirmImageaftrdeposit").css("display","none"),e("#AffirmImageBfrdeposit").css("display","inline"),e("#dvAffirmdeposit").css("display","inline"),e("#dvAffirmdeposit")[0].innerText=" is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+".",e("#AffirmImageBfrdeposit").attr("aria-label"," is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+"."),e("#AffirmImageBfr").css("display","inline"),e("#AffirmImageaftr").css("display","none"),e("#dvAffirmTotal").css("display","inline"),e("#dvAffirmTotal")[0].innerText=" is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+".",e("#AffirmImageBfr").attr("aria-label"," is only available for order under $"+s.toFixed(2).replace(/\d(?=(\d{3})+\.)/g,"$&,")+".")):(i<s&&i>r&&0==_onlineCheckout.isCheckoutVPLChanged||0==_onlineCheckout.IsVplChanged)&&(e("#dvAffirmdeposit").css("display","none"),e("#AffirmImageaftrdeposit").css("display","block"),e("#AffirmImageBfrdeposit").css("display","none"),e("#AffirmImageaftrdeposit").attr("data-amount",(100*i).toFixed(2)),"undefined"!=typeof affirm&&affirm.ui&&"function"==typeof affirm.ui.refresh&&affirm.ui.refresh(),e("#dvAffirmTotal").css("display","none"),e("#AffirmImageaftr").css("display","block"),e("#AffirmImageBfr").css("display","none"),e("#AffirmImageaftr").attr("data-amount",(100*i).toFixed(2)),"undefined"!=typeof affirm&&affirm.ui&&"function"==typeof affirm.ui.refresh&&affirm.ui.refresh(),_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.ShowNoOfPayment==ShowVPLNoOfPayment.Hide&&i<_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MinimumAmount&&(e("#dvAffirmdeposit").css("display","none"),e("#AffirmImageaftrdeposit").css("display","none"),e("#dvAffirmTotal").css("display","none"),e("#AffirmImageaftr").css("display","none"))):1==l?(e("#AffirmImageBfrdeposit").css("display","block"),e("#dvAffirmdeposit").css("display","block"),e("#dvAffirmdeposit")[0].innerText="is not available for this service Provider.",e("#AffirmImageBfr").css("display","block"),e("#dvAffirmTotal").css("display","block"),e("#dvAffirmTotal")[0].innerText="is not available for this service Provider."):(e("#dvAffirmdeposit").hide(),e("#AffirmImageaftrdeposit").css("display","none"),e("#AffirmImageBfrdeposit").css("display","none"))},_onlineCheckout.hideShippingMethodsForFlatRateShippingProducts=function(){var t={Inventories:[],allFlatRateShippingProducts:!1};if("undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart.Inventories&&void 0!==onlineShoppingCart.Inventories){var i=0,n=0,o=!1;parseFloat(0);e.grep(onlineShoppingCart.Inventories,function(e){0==e.MasterInventoryId&&(n++,0==e.IsFreeShipping&&1==e.IsFlatRateShipping&&(i++,t.Inventories.push({InventoryId:e.InventoryId,IsFreeShipping:e.IsFreeShipping,FlatRateShippingPrice:e.FlatRateShippingPrice,Quantity:e.Quantity,AdditionShippingPrice:e.AdditionShippingPrice})),1==e.IsFreeShipping&&0)}),n==i&&(o=!0,e(".shippingMethodsHideShow").hide()),t.allFlatRateShippingProducts=o}return t};var E=null;function L(t){isCCChanged=!1,null!=t&&void 0!==t&&null!=t.gatewayResponse&&void 0!==t.gatewayResponse&&1080==t.gatewayResponse.custom_code||(null==t||void 0===t||1071!=t.custom_code?e("#hdnIsFromPage").length>0&&"shopdetail"==e("#hdnIsFromPage").val()?(isCCChanged=!0,LoadCCFrame()):(e("#tabCheckoutBooking2").siblings(".w-tab-link").removeClass("w--current"),e("#tabCheckoutBooking2").addClass("w--current"),_onlineCheckout.isCheckoutCCChanged=!0,_onlineCheckout.LoadBalnkCCFrame()):CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed))}_onlineCheckout.CheckUserhasCreditcardOrNot=function(t){if((1!=e("#dvCheckoutBookingPaymentMethod").is(":visible")||1!=e(_onlineCheckout.Controls.DvcheckoutBookingTabs).is(":visible")||1!=_onlineCheckout.loadNewCCandShip)&&"1"!=_onlineCheckout.isFillCCDetailsForms){if(ShowLoader(!0),1==isCheckInApp&&(UserID=glbDataCheckIn.scanUserID),_onlineCheckout.zenSwipeCardDetails=null,1==isCheckInApp?void 0!==glbDataCheckIn.sGroup&&null!=glbDataCheckIn.sGroup?glbDataCheckIn.sGroup:"":void 0!==_siteBuilderDetail.ComponentResponse.lstUserInfo&&null!=_siteBuilderDetail.ComponentResponse.lstUserInfo?_siteBuilderDetail.ComponentResponse.lstUserInfo.GroupID:"","undefined"!=typeof onlineShoppingCartmain){var i=!1;if(void 0!==onlineShoppingCartmain.Packages&&null!=onlineShoppingCartmain.Packages&&onlineShoppingCartmain.Packages.length>0&&e.grep(onlineShoppingCartmain.Packages,function(e){void 0!==e.RecGiftCertificateId&&e.RecGiftCertificateId>0&&(i=!0)}),void 0!==onlineShoppingCartmain.Memberships&&null!=onlineShoppingCartmain.Memberships&&onlineShoppingCartmain.Memberships.length>0&&e.grep(onlineShoppingCartmain.Memberships,function(e){void 0!==e.UserBusinessMembershipId&&null!=e.UserBusinessMembershipId&&""!=e.UserBusinessMembershipId&&(i=!0)}),1==i)return void _onlineCheckout.LoadCCSectionForCheckout([])}var n=new vagaro.ajax;n.datamodel.Token=ApiURLEnumOnlineCheckout.getuserccdetailsbyonlyuserid,n.datamodel.IsNewVagaroAPI=!0,n.datamodel.callback=_onlineCheckout.LoadCCSectionForCheckout;var o={lUserID:UserID,lBusinessID:businessID,isAmaxSupport:"False"!==AcceptAmex,LoginUserGroup:"",EncryptUserId:glbEncryptUserId};n.datamodel.data=o,n.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},n.Post()}},_onlineCheckout.LoadCCSectionForCheckout=function(t){var i,n,o;ShowLoader(!1),void 0!==t&&null!=t&&(i=e.grep(t,function(e){return 1==e.isselfcard}),n=e.grep(t,function(e){return 0==e.isselfcard&&0==e.isOtherCard}),o=e.grep(t,function(e){return 1==e.isOtherCard})),void 0===i||0==i.length?i=null:(i=i[0],_onlineCheckout.BusSavedCard=e.extend(!0,{},i),E=1),e("#dvCheckoutCCConfirmtion").modal("hide"),void 0===i||null==i?void 0!==o&&o.length>0?_onlineCheckout.ccCardOnFile=o[0]:void 0!==n&&n.length>0?_onlineCheckout.ccCardOnFile=n[0]:_onlineCheckout.ccCardOnFile=null:_onlineCheckout.ccCardOnFile=i,_onlineCheckout.zenSwipeCardDetails=i,_onlineCheckout.BindCCDetailForBooking(i,n,o)},_onlineCheckout.IsValidateMembershipPackageRecurring=function(){if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0){var t=e.grep(onlineShoppingCart.Memberships,function(e){return 1==e.IsRecurring});null!=t&&t.length>0?_onlineCheckout.IsRecurringMembership=!0:_onlineCheckout.IsRecurringMembership=!1}else _onlineCheckout.IsRecurringMembership=!1;if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){var i=e.grep(onlineShoppingCart.Packages,function(e){return 1==e.IsRecurring});null!=i&&i.length>0?_onlineCheckout.IsRecurringPkg=!0:_onlineCheckout.IsRecurringPkg=!1}else _onlineCheckout.IsRecurringPkg=!1},_onlineCheckout.ValidateVPl=function(t,i){if("undefined"!=typeof BusinessDetail&&null!=BusinessDetail&&2==BusinessDetail.VPLStatus){_onlineCheckout.IsValidateMembershipPackageRecurring(),_shopdetail.DisplayVPLCetegeyOrAffirm(1);var n=onlineShoppingCart.FinalCCAmount;if("undefined"==typeof CCDetail&&1==_onlineCheckout.Model.IsPaymentOption&&(void 0===onlineShoppingCart.FinalCCAmount||onlineShoppingCart.FinalCCAmount<=0)&&e("#dvcheckoutBookingTabs").hide(),1==_onlineCheckout.isCheckoutVPLPromocode&&null!=_onlineCheckout.totalfinalAmount&&(n=_onlineCheckout.totalfinalAmount),"undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CheckinApp)_onlineCheckout.IsVplChanged=!1,e("#tabVagaroPayLater").hide(),e(_onlineCheckout.Controls.tabGooglePay).is(":visible")&&e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")||e(_onlineCheckout.Controls.tabApplePay).is(":visible")&&e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")||e("#tabCheckoutBooking1").addClass("w--current"),e("#tabVagaroPayLater").removeClass("w--current"),e("#vpltotalmessage").hide(),e("#divVplTracking").hide();else if(null!=e("#divcartdepositprice")[0]&&null!=e("#divcartdepositprice")[0].innerHTML&&(depositeAmount=e("#divcartdepositprice")[0].innerHTML.replace(currencysymbol,""),null!=depositeAmount&&null!=depositeAmount&&0!=depositeAmount&&(1==e("#divcartdepositpricewithoutgc").is(":visible")&&null!=e("#divcartdepositpricewithoutgc")[0]&&null!=e("#divcartdepositpricewithoutgc")[0].innerHTML&&(depositeAmount=e("#divcartdepositpricewithoutgc")[0].innerHTML.replace(currencysymbol,"")),n=depositeAmount,e("#tabVagaroPayLater").hide())),t)n>=BusinessDetail.MinimumAmount&&n<=BusinessDetail.MaximumAmount?1==_onlineCheckout.IsRecurringMembership||1==_onlineCheckout.IsRecurringPkg?(_onlineCheckout.IsVplChanged=!1,e("#tabVagaroPayLater").hide(),e("#vpltotalmessage").show(),e("#VPLtotaldeposit").show()):(_onlineCheckout.IsVplChanged=!0,e("#tabVagaroPayLater").show(),e("#vpltotalmessage").hide(),e("#VPLtotaldeposit").hide()):(_onlineCheckout.IsVplChanged=!1,e("#tabVagaroPayLater").hide(),e("#divVplTracking").hide(),e(_onlineCheckout.Controls.tabGooglePay).is(":visible")&&e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")||e(_onlineCheckout.Controls.tabApplePay).is(":visible")&&e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")||e("#tabCheckoutBooking1").addClass("w--current"),e("#tabVagaroPayLater").removeClass("w--current"));else if(n<=BusinessDetail.MaximumAmount&&n>=BusinessDetail.MinimumAmount)if(1==_onlineCheckout.IsRecurringMembership||1==_onlineCheckout.IsRecurringPkg)_onlineCheckout.IsVplChanged=!1,e("#tabVagaroPayLater").hide();else{if(void 0!==_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage)[0]){var o=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage)[0].eventEnrollment.uniqueObjects(["customerID","cUserEmail"])[0].customerID;if(void 0!==o&&UserID!=o)return _onlineCheckout.IsVplChanged=!1,e("#tabVagaroPayLater").hide(),void e("#divVplTracking").hide()}_onlineCheckout.IsVplChanged=!0,void 0!==E&&1==E&&(e("#tabVagaroPayLater").removeClass("first-tab"),e("#tabVagaroPayLater").addClass("mid-tab")),"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0?1==onlineVPLCheckout?1==_onlineCheckout.IsRecurringMembership||1==_onlineCheckout.IsRecurringPkg?(e("#tabVagaroPayLater").hide(),e("#vpltotalmessage").show(),e("#divVplTracking").hide()):(e("#tabVagaroPayLater").show(),e("#vpltotalmessage").hide(),e("#divVplTracking").hide()):(_onlineCheckout.IsVplChanged=!1,e("#tabVagaroPayLater").hide(),e("#divVplTracking").hide(),e("#dvVPLdeposit").hide(),e("#VPLImageaftrdeposit").css("display","none"),e("#VPLImageBfrdeposit").css("display","none")):1==_onlineCheckout.IsRecurringMembership||1==_onlineCheckout.IsRecurringPkg?(e("#tabVagaroPayLater").hide(),e("#vpltotalmessage").show(),e("#divVplTracking").hide()):(e("#tabVagaroPayLater").show(),e("#vpltotalmessage").hide(),e("#divVplTracking").hide())}else(n<BusinessDetail.MinimumAmount||n>BusinessDetail.MaximumAmount)&&(_onlineCheckout.IsVplChanged=!1,e("#tabVagaroPayLater").hide(),e(_onlineCheckout.Controls.tabGooglePay).is(":visible")&&e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")||e(_onlineCheckout.Controls.tabApplePay).is(":visible")&&e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")||e("#tabCheckoutBooking1").addClass("w--current"),e("#tabVagaroPayLater").removeClass("w--current"))}},_onlineCheckout.UpdateCCSelection=function(t){e(t).siblings(".w-tab-link").removeClass("w--current"),e(t).addClass("w--current"),"tabCheckoutBooking2"!=t.id&&t.id!=_onlineCheckout.Controls.keyApplePay&&t.id!=_onlineCheckout.Controls.keyGooglePay&&void 0!==t.dataset&&null!=t.dataset&&(_onlineCheckout.ccCardOnFile.CCFirstName=t.dataset.ccfirstname,_onlineCheckout.ccCardOnFile.CCLastName=t.dataset.cclastname,_onlineCheckout.ccCardOnFile.CCMiddleName=t.dataset.ccmiddlename,_onlineCheckout.ccCardOnFile.CardTokenId=t.dataset.cardtokenid,_onlineCheckout.ccCardOnFile.CreditCardNumber=t.dataset.creditcardnumber,_onlineCheckout.ccCardOnFile.CreditCardType=t.dataset.creditcardtype,_onlineCheckout.ccCardOnFile.ExpMonth=t.dataset.expmonth,_onlineCheckout.ccCardOnFile.ExpYear=t.dataset.expyear,_onlineCheckout.ccCardOnFile.FullName=t.dataset.fullname,_onlineCheckout.ccCardOnFile.SecurityCode=t.dataset.securitycode,e("#hdnCCTokenID").val(t.dataset.cardtokenid)),e("#divVplAddBankDetails").hide(),e("#divVplCheckoutScreen").hide(),e(".mulvplbook").show(),_onlineCheckout.IsVCFEnable()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.CCSelection))},_onlineCheckout.ShowBankAndEmi=function(t){if(e("#VplAmount").text(currencysymbol+_onlineCheckout.ConvertDecimalWithFixed(onlineShoppingCart.FinalCCAmount,!0,2)),e(t).siblings(".w-tab-link").removeClass("w--current"),e(t).addClass("w--current"),e(".vpl-add-bank").html(""),0==_siteBuilderDetail.isAffirmEnable&&void 0!==_onlineCheckout.VPLUserBankDetails&&null!=_onlineCheckout.VPLUserBankDetails){var i=_onlineCheckout.VPLUserBankDetails[0].Id;e("#tmplUserBankListtmplUserBankList").tmpl(_onlineCheckout.VPLUserBankDetails).appendTo(".vpl-add-bank"),e("#addBankList #rb_"+i).attr("checked","checked"),e("#addBankAccount").length>0&&e("#dvVPLSubPart").hide()}1==e("#tabVagaroPayLater").hasClass("w--current")&&onlineShoppingCart.FinalCCAmount>0&&_vgVPLOnline.PaymentSchedule(onlineShoppingCart.FinalCCAmount,_onlineCheckout.PaymentSchduleSuccess,_onlineCheckout.PaymentSchdulefail);var n=onlineShoppingCart.FinalCCAmount;if(1==_onlineCheckout.isCheckoutVPLPromocode&&null!=_onlineCheckout.totalfinalAmount&&(n=_onlineCheckout.totalfinalAmount),null!=e("#divcartdepositprice")[0]&&null!=e("#divcartdepositprice")[0].innerHTML){var o=e("#divcartdepositprice")[0].innerHTML.replace(currencysymbol,"");null!=o&&null!=o&&0!=o&&(n=o)}n>=_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MinimumAmount&&n<=_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MaximumAmount&&"Free"!=e("#divfinalTotalPrice")[0].innerHTML&&(1==_siteBuilderDetail.isAffirmEnable?(e("#divVplTracking").hide(),_onlineCheckout.addbankclick()):e("#divVplTracking").show(),e("#VplAmountInterestFreeTxt").text("vagaro pay later. "+e("#VplAmountInterestFree").text())),_onlineCheckout.totalfinalAmount<=_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MaximumAmount&&_onlineCheckout.totalfinalAmount>=_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MinimumAmount&&"Free"==e("#divfinalTotalPrice")[0].innerHTML&&e("#divVplTracking").hide(),e("#VplAmount").length>0&&(e("#VplAmount")[0].innerHTML=currencysymbol+_onlineCheckout.ConvertDecimalWithFixed(_onlineCheckout.totalfinalAmount,!0,2)),1==onlineShoppingCartmain.IsEnableVCFFee&&_onlineCheckout.IsVCFFeeExists()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.displayFinalCalculatedPrice())},_onlineCheckout.OpenVPLTCDialog=function(){var t=JSON.parse(e("#hdnUserDetails").val());String.isNullOrUndefineOrBlank(t.Cell)?_common.PassiveAlertwarning("Please enter moblie phone in my profile."):String.isNullOrUndefineOrBlank(t.EmailId)?_common.PassiveAlertwarning("Please enter email id"):String.isNullOrUndefineOrBlank(t.BirthDate)?_common.PassiveAlertwarning("Please enter birthdate in my profile."):String.isNullOrUndefineOrBlank(t.Street)?_common.PassiveAlertwarning("Please enter full address in my profile."):(e("#lblterms").removeClass("termsConditionText"),e("#divActiveDialog").modal("show"),e("#chkDialogAggree").attr("checked",!1))},_onlineCheckout.ActiveButtonClick=function(t){"btnSaveVplTerms"!=t||e("#chkDialogAggree").is(":checked")?("#btnCancel"!=t&&"#btnClose"!=t||(e("#divActiveDialog").modal("hide"),e("#lblterms").removeClass("termsConditionText")),e("#chkDialogAggree").attr("checked",!1)):e("#lblterms").addClass("termsConditionText")},_onlineCheckout.EnrollUser=function(t){e("#chkDialogAggree").is(":checked")||"btnSaveVplTerms"!=t?(e("#divActiveDialog").modal("hide"),ShowLoader(!0),_onlineCheckout.Addnewbank(),e("#chkDialogAggree").attr("checked",!1)):e("#lblterms").addClass("termsConditionText")},_onlineCheckout.Addnewbank=function(){_onlineCheckout.VPLBankDetailsBind;var t=JSON.parse(e("#hdnUserDetails").val());null==t.CountryName&&(t.CountryName=""),null==t.StateCode&&(t.StateCode=""),_onlineCheckout.customerEnroll.submerchant_id=128789,_onlineCheckout.customerEnroll.UserID=t.UserID,_onlineCheckout.customerEnroll.billing_address={city_locality:t.City,postal_code:t.Zip,line_1:t.Street,line_2:t.StreetNo,country_code:t.CountryName,state_province:t.StateCode},_onlineCheckout.customerEnroll.company_name="",null!=t.BirthDate&&""!=t.BirthDate?(_onlineCheckout.customerEnroll.date_of_birth=moment(t.BirthDate)._d.format("yyyy-mm-dd"),"1-01-01"==_onlineCheckout.customerEnroll.date_of_birth&&(_onlineCheckout.customerEnroll.date_of_birth="1900-01-01")):_onlineCheckout.customerEnroll.date_of_birth="1900-01-01",_onlineCheckout.customerEnroll.email_address=t.EmailId,_onlineCheckout.customerEnroll.email_address_is_verified=!0,_onlineCheckout.customerEnroll.external_customer_id="101",_onlineCheckout.customerEnroll.first_name=t.FirstName,_onlineCheckout.customerEnroll.last_name=t.LastName,_onlineCheckout.customerEnroll.phone_number=t.Cell,_onlineCheckout.customerEnroll.phone_number_is_verified=!0,_onlineCheckout.customerEnroll.merchant_token_id=_shopdetail.MerchantTokenID,null!=ObjBankDetail&&ObjBankDetail.length>0&&!String.isNullOrUndefineOrBlank(ObjBankDetail[0].CertegyTokenID)?_onlineCheckout.customerEnroll.consumer=ObjBankDetail[0].CertegyTokenID:_onlineCheckout.customerEnroll.consumer="",_onlineCheckout.customerEnroll.ClientIP=e("#hdnIPAddress").val(),_vgVPLOnline.EnrollNewUser(_onlineCheckout.customerEnroll)},_onlineCheckout.PaymentSchedule=function(){_vgVPLOnline.PaymentSchedule(onlineShoppingCart.FinalCCAmount,_onlineCheckout.PaymentSchduleSuccess,_onlineCheckout.PaymentSchdulefail)},_onlineCheckout.PaymentSchduleSuccess=function(t){if(void 0!==t&&null!=t){var i=[],n=0;e.grep(t.InstallmentDetails,function(t){var o={};o.Index=n,o.Amount=currencysymbol+_onlineCheckout.ConvertDecimalWithFixed(t.amount,!0,2),o.Date=countryDateFormat(moment(t.date),VagaroCountryDateFormat.SmallDate),i.push(o),0==n&&(e("#VplAmount")[0].innerHTML=o.Amount,e(".duetodayCheckoutScreen").text("Due Today: "+o.Amount),e("#dvCheckoutVplAmt").text(o.Amount)),n++}),e(".timeline-text-div").html(""),e("#tmplPaymentScheduleList").tmpl(i).appendTo(".timeline-text-div")}"0"==e("#finalCheckout").val()?ShowLoader(!1):e("#finalCheckout").val("0")},_onlineCheckout.PaymentSchdulefail=function(e){},_onlineCheckout.isValidCardNotPresent=function(){return!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.IsCardNotPresent)&&1==onlineShoppingCartmain.IsCardNotPresent&&(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0||null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0)&&onlineShoppingCart.ccAmt>0},_onlineCheckout.ConvertDecimalWithFixed=function(e,t,i){return isNaN(parseFloat(e))&&(e=0),t?parseFloat(e).toFixed(i):parseFloat(parseFloat(e).toFixed(i))},_onlineCheckout.BindCCDetailForBooking=function(t,i,n){if(ShowLoader(!1),1!=_onlineCheckout.isValidCardNotPresent()){if(e("#dvCheckoutBookingPaymentMethod").show(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).show(),1==_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.invoiceDetails&&(0==_onlineCheckout.IsCCSupportedCountry()||1==_onlineCheckout.IsCCSupportedCountry()&&"false"==IsEnableMerchantAccount.toLowerCase())&&(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide(),e("#divVplTracking").hide()),0==e("#divdepositsdescription").is(":visible")&&0==e("#divCCDescription").is(":visible")&&e("#divcheckoutSelectPaymentMethodTitle").html(_onlineCheckout.arrPaymentTitleType.Select),_onlineCheckout.PromoBox(),null!=t&&null!=t.CreditCardNumber&&("AmericanExpress"!=t.CreditCardType||"False"!=AcceptAmex&&"AmericanExpress"==t.CreditCardType)){e("#dvcheckoutBookingTabs").show(),_onlineCheckout.isCheckoutCCChanged=!1;var o=t.CreditCardNumber;o.length>0||(o=""),e("#dvcheckoutCustomerCCDetail").html(t.CreditCardType+" ending in "+o),e("#tabCheckoutBooking1").attr({"data-ccfirstname":t.CCFirstName,"data-cclastname":t.CCLastName,"data-ccmiddlename":t.CCMiddleName,"data-cardtokenid":t.CardTokenId,"data-creditcardnumber":t.CreditCardNumber,"data-creditcardtype":t.CreditCardType,"data-expmonth":t.ExpMonth,"data-expyear":t.ExpYear,"data-fullname":t.FullName,"data-securitycode":t.SecurityCode}),e("#tabCheckoutBooking1").click(),e("#tabCheckoutBooking1").show(),e("#hdnCheckoutCCTokenID").val(t.CardTokenId)}else e("#tabCheckoutBooking1").hide(),null!=i&&void 0!==i&&0!=i.length||null!=n&&void 0!==n&&0!=n.length||(e("#tabCheckoutBooking2").click(),e("#dvcheckoutBookingTabs").hide(),0==e("#divdepositsdescription").is(":visible")&&0==e("#divCCDescription").is(":visible")&&e("#divcheckoutSelectPaymentMethodTitle").html(_onlineCheckout.arrPaymentTitleType.Default));1==_onlineCheckout.Model.IsPaymentOption&&(void 0===onlineShoppingCart.FinalCCAmount||onlineShoppingCart.FinalCCAmount<=0)&&e("#dvcheckoutBookingTabs").hide();var a=0;e(".ffccdetail").remove(),null!=i&&void 0!==i&&i.length>0&&(e("#familyfriendsCCdetailCheckoutTemplate").tmpl(i).insertAfter("#tabCheckoutBooking1"),a=i.length,null!=t&&void 0!==t||void 0!==n&&null!=n&&0!=n.length||(e("#tabCheckoutBooking3").addClass("first-tab vg-filter-mobile-tab vg-switch-tab-first"),e("#tabCheckoutBooking3").removeClass("mid-tab"),e("#tabCheckoutBooking3").click())),null!=n&&void 0!==n&&n.length>0&&(e.each(n,function(e,t){t.index=a,a++}),e("#familyfriendsCCdetailCheckoutTemplate").tmpl(n).insertAfter("#tabCheckoutBooking1"),void 0!==t&&null!=t||void 0!==i&&null!=i&&0!=i.length||(e("#tabCheckoutBooking3").addClass("first-tab vg-filter-mobile-tab vg-switch-tab-first"),e("#tabCheckoutBooking3").removeClass("mid-tab"),e("#tabCheckoutBooking3").click())),e(_onlineCheckout.Controls.tabGooglePay).hide();try{paymentCheckAvailability("gpay",function(t){1==_shopdetail.IsGooglepayPayment(!0,t)&&e(_onlineCheckout.Controls.tabGooglePay).show()})}catch(t){e(_onlineCheckout.Controls.tabGooglePay).hide()}e(_onlineCheckout.Controls.tabApplePay).hide();try{paymentCheckAvailability("applepay",function(t){1==_shopdetail.IsApplepayPayment(!0,t)&&e(_onlineCheckout.Controls.tabApplePay).show()})}catch(t){e(_onlineCheckout.Controls.tabApplePay).hide()}}else vagaro.alert(_onlineCheckout.CardNotPresentMessage)},_onlineCheckout.SelectedAffirmPaymentMethodDefault=function(){1==_siteBuilderDetail.isAffirmEnable&&1==e("#tabVagaroPayLater").is(":visible")&&0==e("#tabVagaroPayLater").hasClass("w--current")&&e("#tabVagaroPayLater").click()},_onlineCheckout.SaveCardForUser=function(){ShowLoader(!0);var e=new vagaro.ajax;e.datamodel.Token=ApiURLEnumOnlineCheckout.saveuserccdetails,e.datamodel.IsNewVagaroAPI=!0,e.datamodel.callback=function(e){if(ShowLoader(!1),null!=e&&null!=_onlineCheckout.zenSwipeCardDetails&&null!=_onlineCheckout.zenSwipeCardDetails&&(_onlineCheckout.zenSwipeCardDetails.BusinessID=businessID,_onlineCheckout.zenSwipeCardDetails.IsSaveCard=!0),Array.isArray(_onlineCheckout.zenSwipeCardDetails))_onlineCheckout.LoadCCSectionForCheckout(_onlineCheckout.zenSwipeCardDetails);else{var t=[];t.push(_onlineCheckout.zenSwipeCardDetails),_onlineCheckout.LoadCCSectionForCheckout(t)}};var t=null,i=null;void 0!==_onlineCheckout.zenSwipeCardDetails.ExpMonth&&null!=_onlineCheckout.zenSwipeCardDetails.ExpMonth&&""!=_onlineCheckout.zenSwipeCardDetails.ExpMonth&&(t=_onlineCheckout.zenSwipeCardDetails.ExpMonth),void 0!==_onlineCheckout.zenSwipeCardDetails.ExpYear&&null!=_onlineCheckout.zenSwipeCardDetails.ExpYear&&""!=_onlineCheckout.zenSwipeCardDetails.ExpYear&&(i=_onlineCheckout.zenSwipeCardDetails.ExpYear);var n={businessID:businessID,loginUserID:UserID,CCNo:_onlineCheckout.zenSwipeCardDetails.CreditCardNumber,CardType:_onlineCheckout.zenSwipeCardDetails.CreditCardType,CCCode:_onlineCheckout.zenSwipeCardDetails.SecurityCode,LoggedInID:0,CardTokenID:_onlineCheckout.zenSwipeCardDetails.CardTokenId,UCCFirstName:_onlineCheckout.zenSwipeCardDetails.CCFirstName,UCCMiddleName:_onlineCheckout.zenSwipeCardDetails.CCMiddleName,UCCLastName:_onlineCheckout.zenSwipeCardDetails.CCLastName,ExpMonth:t,ExpYear:i,IsCheckUserExists:!0,IsSaveCard:!1};e.datamodel.data=n,e.datamodel.Error=function(e){ShowLoader(!1),_onlineCheckout.LoadCCSectionForCheckout(_onlineCheckout.zenSwipeCardDetails)},e.Post()},_onlineCheckout.GPayApplePaySuccessResponse=function(t){console.log(t);var i={},n={};n.PaymentToken=1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")?""+t:btoa(JSON.stringify(t.token.paymentData)),n.PaymentMethodType=1==e(_onlineCheckout.Controls.tabGooglePay).hasClass("w--current")?PaymentMethod.GooglePay:PaymentMethod.ApplePay,n.LoginUserId=UserID.toString(),_onlineCheckout.isValidForCheckoutInvoice()&&onlineShoppingCart?.invoiceDetails?.InvoiceGridObject?.PayeeId>0&&(n.LoginUserId=onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId),n.MerchantToken=MerchantTokenID,n.SaveCard=!0,n.Device="Online Checkout",i.paymentInfo=[n],i.successCallback=_onlineCheckout.SuccessGoogleAppleTokenInfo,i.FailCallback=_onlineCheckout.FailGoogleAppleTokenInfo,_shopdetail.SaveGoogleAppleToken(i)},_onlineCheckout.SuccessGoogleAppleTokenInfo=function(e){null!=e?(console.log(e),1!=e.IsSuccess||String.isNullOrUndefineOrBlank(e.card_token)?_onlineCheckout.FailGoogleAppleTokenInfo(e):(_onlineCheckout.SetGoogleApplePayCardInfo(e,!0),_onlineCheckout.isValidForCheckoutInvoice()?_onlineCheckout.PayInvoice():_onlineCheckout.ValidateCartData())):_onlineCheckout.FailGoogleAppleTokenInfo()},_onlineCheckout.FailGoogleAppleTokenInfo=function(e){let t="Payment could not be completed.";if(e){if(5006===e.custom_code)t="The card entered is invalid or got declined, Please contact business or try another card.";else if(6001===e.custom_code)t=e.subResponseCode+" - "+e.subResponseMessage;else if(e.message&&""!==e.message.trim()){let i="";e.subResponseCode&&""!==e.subResponseCode.trim()&&(i="<br/>Error Code: "+e.paymentGateway+"-"+e.subResponseCode),t=e.message+i}}else t="Some error occured, Please try again!.";_siteBuilderDetail.PaymentErrorHandler(t)},_onlineCheckout.SetGoogleApplePayCardInfo=function(t,i){void 0!==_onlineCheckout.ccCardOnFile&&null!=_onlineCheckout.ccCardOnFile||(_onlineCheckout.ccCardOnFile={}),t&&"string"!=typeof t||(t={});var n=_shopdetail.getFirstMiddleLastName(t);_onlineCheckout.ccCardOnFile.CCFirstName=n.first_name,_onlineCheckout.ccCardOnFile.CCLastName=n.last_name,_onlineCheckout.ccCardOnFile.CCMiddleName=n.middle_name,_onlineCheckout.ccCardOnFile.CardTokenId=_onlineCheckout.safeValue(t.card_token),_onlineCheckout.ccCardOnFile.CreditCardNumber=_onlineCheckout.safeValue(t.cc_no),_onlineCheckout.ccCardOnFile.CreditCardType=_onlineCheckout.safeValue(t.cc_type),_onlineCheckout.ccCardOnFile.ExpMonth=_onlineCheckout.safeValue(t.expire_month),_onlineCheckout.ccCardOnFile.ExpYear=_onlineCheckout.safeValue(t.expire_year),_onlineCheckout.ccCardOnFile.FullName=n.full_name,_onlineCheckout.ccCardOnFile.SecurityCode="",_onlineCheckout.ccCardOnFile.IsTokenGenerated=i,e("#hdnCCTokenID").val(_onlineCheckout.ccCardOnFile.CardTokenId),_onlineCheckout.ccCardOnFile.IsSaveCard=!0,_onlineCheckout.isCheckoutCCChanged=!1},_onlineCheckout.safeValue=function(e){return null==e||"string"==typeof e&&""===e.trim()?"":e},_onlineCheckout.BookTabClick=function(t){e("#hdnCheckCCAdressISExist").val("true"),e("#creditcardiframe_checkoutccaddress").html(""),_onlineCheckout.isCheckoutVPLChanged=!1;var i="undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail?countryIdBusDetail:"1";if(6==t||7==t)e("#creditcardiframe_checkoutcart").html(""),_onlineCheckout.SetGoogleApplePayCardInfo(null,!1);else if(2==t)_onlineCheckout.LoadBalnkCCFrame(),_onlineCheckout.isCheckoutCCChanged=!0,_onlineCheckout.VPLmessagedeposit(_onlineCheckout.totalfinalAmount),e("#divVplTracking").hide();else if(0==t)_onlineCheckout.isCheckoutVPLChanged=!0,e("#dvVPLdeposit").hide(),e("#VPLImageaftrdeposit").css("display","none"),e("#VPLImageBfrdeposit").css("display","none"),e("#dvVPLTotal").hide(),e("#VPLImageaftr").css("display","none"),e("#VPLImageBfr").css("display","none"),e("#VPLImageBfr1").css("display","none"),e("#VPLImageaftr1").css("display","none"),e("#creditcardiframe_checkoutcart").html("");else if(2==t||void 0===_onlineCheckout.ccCardOnFile||null==_onlineCheckout.ccCardOnFile||String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId)||"2"==i)_onlineCheckout.isCheckoutCCChanged=!1,_onlineCheckout.VPLmessagedeposit(_onlineCheckout.totalfinalAmount),e("#divVplTracking").hide();else{_onlineCheckout.isCheckoutCCChanged=!1,ShowLoader(!0);var n={CardTokenId:_onlineCheckout.ccCardOnFile.CardTokenId};n.UserID=UserID;var o=new vagaro.ajax;o.datamodel.Token="CheckCCAdressISExist",o.datamodel.data=n,o.datamodel.Error=function(e){ShowLoader(!1)},o.datamodel.callback=function(t){ShowLoader(!1),null!=t&&1e3==t.custom_code&&0==t.data?(_onlineCheckout.isCheckoutCCChanged=!0,e("#hdnCheckCCAdressISExist").val(t.data),_onlineCheckout.LoadBalnkCCFrame()):null!=t&&1e3==t.custom_code&&1==t.data&&(e("#creditcardiframe_checkoutcart").html(""),e("#creditcardiframe_checkoutccaddress").html(""))},o.Post()}},_onlineCheckout.LoadBalnkCCFrame=function(){"true"==isWidget.toLowerCase()||"true"==isFacebook.toLowerCase()?backGroundColor=WidgetTabBackgroundColor:"true"==isCustomWebsite.toLowerCase()||"true"==isWidget.toLowerCase()||"true"==isFacebook.toLowerCase()?backGroundColor=TabBackgroundColor:"undefined"!=typeof isPromotionUI&&"true"==isPromotionUI.toLowerCase()&&(backGroundColor=PatternColor),e("#creditcardiframe_checkoutcart").html(""),e("#creditcardiframe_checkoutccaddress").html(""),vui.loader=ShowLoader,vui.ccCountryId="undefined"!=typeof countryIdBusDetail?countryIdBusDetail:"1";var t=void 0!==e("#hdnIsNewCCIframe").val()&&""!=e("#hdnIsNewCCIframe").val()&&JSON.parse(e("#hdnIsNewCCIframe").val()),i=!(void 0!==e("#hdnCheckCCAdressISExist").val()&&!String.isNullOrUndefineOrBlank(e("#hdnCheckCCAdressISExist").val()))||JSON.parse(e("#hdnCheckCCAdressISExist").val()),n=void 0===_onlineCheckout.ccCardOnFile||null==_onlineCheckout.ccCardOnFile||String.isNullOrUndefineOrBlank(_onlineCheckout.ccCardOnFile.CardTokenId)?"":_onlineCheckout.ccCardOnFile.CardTokenId;if(i||String.isNullOrUndefineOrBlank(n)){var o="undefined"!=typeof GetTrackData?GetTrackData():"";1==_onlineCheckout.IsLoadCCIframForMemrship()?vui.getTypeWithoutButton("creditcardiframe_checkoutcart",1==t?260:160,MerchantTokenID,"","",1,"online checkout",!0,"",o,void 0,!0):vui.getTypeWithoutButtonAndAuthorization("creditcardiframe_checkoutcart",1==t?260:160,MerchantTokenID,"100%","",1,"online checkout",!1,"",o,!0)}else vui.getTypeFrameForCCAddress("creditcardiframe_checkoutccaddress",1==t?260:160,MerchantTokenID,"","",1,"online checkout",!0,"",!0,n,!0)},_onlineCheckout.SetClassSuccessDetails=function(t,i){try{var n=[],o=0,a="",s="",r="",l=!1,c=_onlineCheckout.getServiceProviderForBusiness();e.grep(i,function(t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&e.grep(t.eventEnrollment,function(i){var d=new Date(i.eventDate).format(_onlineCheckout.DateFormatdddMMM_ddYYYY),u=new Date(i.eventDate).format(_onlineCheckout.DateFormatdddMMM_ddYYYY),p=i.startTime.replace(/^0+/,""),h="";String.isNullOrUndefineOrBlank(i.CustomerTimeZone)||(d=moment(i.CustomerStartTime).format(_onlineCheckout.DateFormatdddMMMDDYYYY),u=moment(i.CustomerStartTime).format(_onlineCheckout.DateFormatdddMMMDDYYYY),p=moment(i.CustomerStartTime).format("h:mm A"),h=" ("+i.CustomerTimeZone+")");var m={};if(m.autoId=o,m.date=d,m.dateLable=u,m.time=p+h,m.image=i.SpPhoto,m.servicename=t.eventName,void 0!==c&&null!=c&&""!=c&&c.length>0)var g=e.grep(c,function(e){if(e.UserID==i.sPID)return e.FirstName+" "+e.LastName});if(void 0!==g&&null!=g&&""!=g&&g.length>0?m.spname=g[0].FullName:m.spname=i.sPName,m.ZoomURL=i.ZoomURL,m.IsFromHomePage=!1,m.cFirstName=i.cFirstName,m.cLastName=i.cLastName,m.UserId=i.customerID,m.appointmentID=i.appointmentID,String.isNullOrUndefineOrBlank(i.IsFromHomePage)||1!=i.IsFromHomePage||(m.IsFromHomePage=!0),void 0!==g&&null!=g&&""!=g&&g.length>0&&null!=g[0].Photo&&""!=g[0].Photo&&(m.image=g[0].CDNUrl+"155x155/"+g[0].Photo),m.spinit=FindInitials(i.sPName,"SP"),1==i.StreamingStatus?m.LiveStreamingStatus=!0:m.LiveStreamingStatus=!1,m.ShowLiveStream=!1,m.lstAddonService=[],null!=i.lstAddonService&&null!=i.lstAddonService&&i.lstAddonService.length>0)for(var v=0;v<i.lstAddonService.length;v++)m.lstAddonService.push({AddonName:i.lstAddonService[v].ServiceTitle});n.push(m),""==s?(s=m.date,l=!1):m.date!=s&&(l=!0),a=moment(i.eventDate),""==r&&(r=moment(t.eventEnrollment[0].eventDate)),String.isNullOrUndefineOrBlank(i.CustomerTimeZone)||(a=moment(i.CustomerStartTime),r=moment(i.CustomerStartTime)),o++})}),"true"==isWidget&&w_type==(_siteBuilderDetail.WidgetTypeEnum.Embedded||_siteBuilderDetail.WidgetTypeEnum.Popup)&&e("#btnviewBusiness").hide();var d=e("#divClassBookSuccess");e("#classDateBox").hide(),0==l?(e("#classDateBox").show(),d.find(".booked-month").html(a.format("MMM").toUpperCase()).attr("aria-hidden",!0),d.find("#classDateBox").attr("aria-label",a.format("MMMM").toUpperCase()+","+a.format("D")).attr("role","banner"),d.find("#divDatemonth").attr("aria-label",a.format("MMMM")+","+a.format("D")).attr("role","banner"),d.find(".booked-date").html(a.format("D")).attr("aria-hidden",!0),d.find("#divstatusicon").attr("class","green-circle-div").attr("aria-hidden",!0).html("&#xf00c;")):void 0!==r&&null!=r&&""!=r&&(e("#classDateBox").show(),d.find(".booked-month").html(r.format("MMM").toUpperCase()).attr("aria-hidden",!0),d.find(".booked-date").html(r.format("D")).attr("aria-hidden",!0),d.find("#classDateBox").attr("aria-label",r.format("MMMM").toUpperCase()+","+r.format("D")).attr("role","banner"),d.find("#divstatusicon").attr("class","green-circle-div").attr("aria-hidden",!0).html("&#xf00c;"));var u=[],p=[],h=[],m="You've booked classes for ";e.grep(n,function(e){return h.push(e.UserId)}),e.grep(n,function(t){var i=e.grep(p,function(e){if(e==t.UserId)return e}),n=e.grep(u,function(e){if(e==t.cFirstName+" "+t.cLastName)return e});if(parseInt(UserID)!=t.UserId&&0==i.length&&0==n.length)return p.push(t.UserId),u.push(t.cFirstName+" "+t.cLastName)});var g="";e.grep(u,function(e,t){0==t?g+=e:t==u.length-1?g+=" and "+e:g+=" , "+e}),m+=g+".",t?o>1?void 0!==u&&null!=u&&""!=u&&u.length>0?_onlineCheckout.hideShowClassSuccessMessage(m,!0,"signed up",!1,n):_onlineCheckout.hideShowClassSuccessMessage(m,!1,"signed up",!0,n):parseInt(UserID)!=n[0].UserId?_onlineCheckout.hideShowClassSuccessMessage(m,!1,"signed up",!1,n):_onlineCheckout.hideShowClassSuccessMessage(m,!1,"signed up",!0,n):o>1?void 0!==u&&null!=u&&""!=u&&u.length>0?_onlineCheckout.hideShowClassSuccessMessage(m,!0,"checkout",!1,n):_onlineCheckout.hideShowClassSuccessMessage(m,!1,"checkout",!0,n):parseInt(UserID)!=n[0].UserId?_onlineCheckout.hideShowClassSuccessMessage(m,!1,"checkout",!1,n):_onlineCheckout.hideShowClassSuccessMessage(m,!1,"checkout",!0,n),d.find("#divapptparagraphtext").html("You're all set with "+businessName+"."),e("#divclassbooking").html(""),e("#divtempclassbooking").tmpl(n).appendTo("#divclassbooking"),e(".apptproviderimg").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload"),e("#divClassBookSuccess").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;");var v=e.grep(n,function(e){return 1==e.LiveStreamingStatus});void 0!==v&&null!=v&&""!=v&&v.length>0?e(".booknow-live-box").show():e(".booknow-live-box").hide(),"undefined"!=typeof vgAppicationType&&vgAppicationType,"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&void 0!==_siteBuilderDetail.UserLocationInfo.RedirectAfterBooking&&null!=_siteBuilderDetail.UserLocationInfo.RedirectAfterBooking&&""!=_siteBuilderDetail.UserLocationInfo.RedirectAfterBooking&&1==("true"==isWidget&&w_type==(_siteBuilderDetail.WidgetTypeEnum.Embedded||_siteBuilderDetail.WidgetTypeEnum.Popup))&&_onlineCheckout.continueShoping()}catch(i){t?(e("#dvCheckoutSuccess").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;"),e("#dvCheckoutSuccessMSG").html("Successful Enrollment."),e("#dvCheckoutSuccessMSG1").hide()):(e("#dvCheckoutSuccess").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;"),e("#dvCheckoutSuccessMSG").html("Successful Checkout"),1==_onlineCheckout.isCheckoutVPLChanged?1==_siteBuilderDetail.isAffirmEnable?(e("#dvCheckoutSuccessMSG1").show(),e("#dvCheckoutVplAmt").hide(),e("#dvCheckoutVplPart").hide(),e("#dvCheckoutVplMsg").hide()):(e("#dvCheckoutSuccessMSG1").hide(),e("#dvCheckoutVplAmt").show(),e("#dvCheckoutVplPart").show(),e("#dvCheckoutVplMsg").show()):e("#dvCheckoutSuccessMSG1").show().css("display","flex"))}},_onlineCheckout.getServiceProviderForBusiness=function(){var e=[],t={};t.businessId=_shopdetail.businessID,t.userType=5,t.isAdmin=!1,t.viewHisOwnReports=!1,t.viewOtherReports=!1;var i=new vagaro.ajax;return i.datamodel.Token="GetServiceProviders",i.datamodel.data=t,i.datamodel.ErrorMessage="",i.datamodel.async=!1,i.datamodel.callback=function(t){e=t},i.datamodel.Error=function(e){},i.Post(),e},_onlineCheckout.hideShowClassSuccessMessage=function(t,i,n,o,a){"checkout"==n&&(n="Checked Out.");var s="You're "+n,r=e("#divClassBookSuccess"),l="divClassSuccessMessageForFriend";o?(r.find("#"+l).hide(),r.find("#divappttitletext").html(s)):0==i&&0==o?(r.find("#divappttitletext").html(a[0].cFirstName+" is "+n+" for the class."),r.find("#"+l).show(),r.find("#"+l).html("You booked class for "+a[0].cFirstName+" "+a[0].cLastName+".")):i&&(r.find("#divappttitletext").html(s),r.find("#"+l).show(),r.find("#"+l).html(t))},onZSDownCallback=function(t){var i="";if(_onlineCheckout.ApplyAuthResultFromResponse(t),void 0!==t&&void 0!==t.data&&null!=t.data&&void 0!==t.data.Message&&""!==t.data.Message&&"5006"==t.data.custom_code)i="The card entered is invalid or got declined, Please contact business or try another card.";else if(void 0!==t&&void 0!==t.data&&null!=t.data&&void 0!==t.data.Message&&""!==t.data.Message){var n="";null!=t.data.subResponseCode&&""!=t.data.subResponseCode&&(n="<br/>Error Code:"+t.data.paymentGateway+"-"+t.data.subResponseCode),i=t.data.Message+n}else i=void 0!==t&&void 0!==t.Message&&null!=t.Message&&""!==t.Message?t.Message:void 0!==t&&null!=t&&6001==t.custom_code?t.subResponseCode+" - "+t.subResponseMessage:"Some error occured, Please try again!.";var o="";o=e("#hdnIsFromPage").length>0&&"shopdetail"==e("#hdnIsFromPage").val()?"Book247CCDetails":"creditcardiframe_checkoutcart",e("#"+o).html("");var a=GetHTMLDummyFrame();e("#"+o).html(a),e("#"+o).show(),ShowLoader(!1),swal({title:"",text:i,showCancelButton:!1,html:!0},function(e){L(t)})},onGetTokenCallback=function(t){if(ShowLoader(!1),_onlineCheckout.ApplyAuthResultFromResponse(t),1e3==t.data.custom_code){var i=!(void 0!==e("#hdnCheckCCAdressISExist").val()&&!String.isNullOrUndefineOrBlank(e("#hdnCheckCCAdressISExist").val()))||JSON.parse(e("#hdnCheckCCAdressISExist").val());e("#hdnIsFromPage").length>0&&"shopdetail"==e("#hdnIsFromPage").val()?(i||void 0===t.data.data||1!=t.data.data?ZenSwipeCardDetails=t.data.data:(isCCChanged=!1,e("#hdnCheckCCAdressISExist").val("true")),_shopdetail.ValidateBookingDataWithCC()):e("#hdnIsFromPage").length>0&&"cancelfromcheckinapp"==e("#hdnIsFromPage").val()?(ZenSwipeCardDetails=t.data.data,validateCCCaptureCancellation()):(i||void 0===t.data.data||1!=t.data.data?_onlineCheckout.zenSwipeCardDetails=t.data.data:(_onlineCheckout.isCheckoutCCChanged=!1,e("#hdnCheckCCAdressISExist").val("true")),_onlineCheckout.SaveOnlineCheckout())}else onZSDownCallback(t)},onOpenedCallback=function(t){if(e("#hdnIsFromPage").length>0&&"shopdetail"==e("#hdnIsFromPage").val()){var i=_IsPrepay?_shopdetail.BookingDetail.Prepay.ccAmt+_shopdetail.BookingDetail.TipAmount:0;"0"!=parseFloat(i)||!_IsPrepay||"false"!=e("#hdnIsCCCapturedAllowed").val().toLowerCase()||"undefine"!=typeof _IsPaymentOption&&0!=_IsPaymentOption?e("#dvBookingPaymentMethod").show():e("#dvBookingPaymentMethod").hide()}else e("#hdnIsFromPage").length>0&&("cancelappointment"==e("#hdnIsFromPage").val()||"cancelfromcheckinapp"==e("#hdnIsFromPage").val())?(e("#divCancelCCCaptureAppoitmentModalBody").animate({scrollTop:e("#divCancelCCCaptureAppoitmentModalBody").prop("scrollHeight")},100),e("#dvPaymentFailedSaveCCCheckbox").show(),e("#dvPaymentFailedSecuredVagaro").show()):(e("#dvCheckoutBookingPaymentMethod").show(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).show(),1==_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.invoiceDetails&&(0==_onlineCheckout.IsCCSupportedCountry()||1==_onlineCheckout.IsCCSupportedCountry()&&"false"==IsEnableMerchantAccount.toLowerCase())&&(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide(),e("#divVplTracking").hide()),void 0===_onlineCheckout.Model||String.isNullOrUndefineOrBlank(_onlineCheckout.Model)||1==_onlineCheckout.Model.IsPaymentOption&&(void 0===onlineShoppingCart.FinalCCAmount||onlineShoppingCart.FinalCCAmount<=0)&&(e("#dvcheckoutBookingTabs").hide(),e("#creditcardiframe_checkoutcart").html("")),_onlineCheckout.PromoBox());"undefined"!=typeof AcceptAmex&&"false"==AcceptAmex.toLowerCase()&&vui.frame.zenswipe.removeCardOption("amex"),ShowLoader(!1)},_onlineCheckout.ValidateCCforCheckout=function(){return null!=_onlineCheckout.zenSwipeCardDetails&&null!=_onlineCheckout.zenSwipeCardDetails.card_token||1!=_onlineCheckout.isCheckoutCCChanged||(ShowLoader(!0),vui.frame.zenswipe.submit()),!1},_onlineCheckout.PrintPopup=function(e,t){var i=window.open(e,"","left=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0,resizable=1");!i||i.closed||void 0===i||void 0===i.closed?vagaro.alert(t):i&&navigator&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&(i.onload=function(){setTimeout(function(){_onlineCheckout.CheckChromePopup(i,t)},40)})},_onlineCheckout.getParameterFromUrl=function(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},_onlineCheckout.CheckChromePopup=function(e,t){0===e.screenX&&(vagaro.alert(t),e.close())},_onlineCheckout.CustomPackageAddToCart=function(t,i,n){var o=e(t).closest(".srvdtls");o.attr("data-noofvisit",i),o.attr("data-iscustompackage",!0),_onlineCheckout.ServiceAddToCart(t,n)},_onlineCheckout.rebindCartDataAfterPartialCheckOut=function(){String.isNullOrUndefineOrBlank(onlineShoppingCartmain)||((String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Inventories)||!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Inventories)&&0==onlineShoppingCartmain.Inventories.length)&&e('.cartremoverdtl[data-type="inventory"]').hide(),(String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Packages)||!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Packages)&&0==onlineShoppingCartmain.Packages.length)&&e('.cartremoverdtl[data-type="servicepackage"]').hide(),(String.isNullOrUndefineOrBlank(onlineShoppingCartmain.GiftCertificates)||!String.isNullOrUndefineOrBlank(onlineShoppingCartmain.GiftCertificates)&&0==onlineShoppingCartmain.GiftCertificates.length)&&e('.cartremoverdtl[data-type="gc"]').hide(),(String.isNullOrUndefineOrBlank(onlineShoppingCart.Memberships)||!String.isNullOrUndefineOrBlank(onlineShoppingCart.Memberships)&&0==onlineShoppingCart.Memberships.length)&&e('.cartremoverdtl[data-type="membership"]').hide(),(String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)||!String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&0==onlineShoppingCart.Events.length)&&e("#newCartSummaryDectail123").hide(),_onlineCheckout.loadPage())},_onlineCheckout.appendMembership=function(e){return-1==e.toLowerCase().indexOf("membership")&&(e+=" Membership"),e},_onlineCheckout.RemovePromoCode=function(t){e("#txtPromoCode").val("");var i=e.grep(onlineShoppingCart.lstPromotionData,function(e){return e.PromotionID==t});if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0){var n=e.grep(i,function(e){return 2==e.ItemTypeID});n.length>0&&(_onlineCheckout.RemovePresetDiscountOnProducts(onlineShoppingCart.Inventories,n,t),_onlineCheckout.ApplyRemovePromoCodeOnBundle())}if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){var o=e.grep(i,function(e){return 3==e.ItemTypeID||1==e.ItemTypeID||19==e.ItemTypeID});o.length>0&&_onlineCheckout.RemovePresetDiscountOnPackages(onlineShoppingCart.Packages,o,t)}if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0){var a=e.grep(i,function(e){return 7==e.ItemTypeID});a.length>0&&_onlineCheckout.RemovePresetDiscountOnMemberships(onlineShoppingCart.Memberships,a,t)}if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"==isCCRequiredForOnlineClass.toLowerCase()){var s=e.grep(i,function(e){return 8==e.ItemTypeID||e.ItemTypeID==v});s.length>0&&_onlineCheckout.RemovePresetDiscountOnEvents(onlineShoppingCart.Events,s,t)}if(null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0){var r=e.grep(i,function(e){return 5==e.ItemTypeID});r.length>0&&_onlineCheckout.RemovePresetDiscountOnGC(onlineShoppingCart.GiftCertificates,r,t)}var l=e.grep(onlineShoppingCart.lstPromotionData,function(e){return e.PromotionID!=t}),c=e.grep(onlineShoppingCart.lstPromoDetails,function(e){return e.PromotionID!=t});onlineShoppingCart.lstPromotionData=l,onlineShoppingCart.lstPromoDetails=c,_onlineCheckout.RemovePromoCodeDiv(t),_onlineCheckout.RecalcGCONAllItemsAfterPreset(),1==onlineShoppingCartmain.IsEnableVCFFee&&_onlineCheckout.IsVCFFeeExists()?(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.ReApplyDiscounts(!0),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.RemovePromoCode)):_onlineCheckout.ReApplyDiscounts(!0)},_onlineCheckout.txtPromoCodeClick=function(){e(".divPromoCode_0").hide()},_onlineCheckout.txtPromoCodeKeypress=function(t){13==t.which?(t.preventDefault(),_onlineCheckout.ValidatePromoCode()):e("#txtPromoCode").removeClass("errorInput")},_onlineCheckout.ValidatePromoCode=function(){var t=e("#txtPromoCode").val();if(""==t.trim())return e("#txtPromoCode").val(""),void e("#txtPromoCode").addClass("errorInput");ShowLoader(!0);var i={};i.PromotionCode=t,i.businessID=businessID,i.loginUserID=UserID,i.CartAmount=_onlineCheckout.ShoppingCartAmount(),i.IsNewCustomer=_onlineCheckout.IsThisNewCustomer,i.ServiceIDs=_onlineCheckout.ShoppingCartItemIds(!0,1);var n=new vagaro.ajax;n.datamodel.Token=ApiURLEnumOnlineCheckout.validatepromocodeandgetdetails,n.datamodel.IsNewVagaroAPI=!0,n.datamodel.callback=function(i){if(ShowLoader(!1),void 0!==i&&null!=i){if(200==i.ResponseID)if(null!=i.PromotionDataList&&i.PromotionDataList.length>0){if(e.grep(onlineShoppingCart.lstPromotionData,function(e){return e.PromotionID==i.PromotionDataList[0].PromotionID}).length>0)return _onlineCheckout.CreatePromoCodeDiv("twise",t.toUpperCase(),"This discount has already been applied.",!1),void e("#txtPromoCode").val("");_onlineCheckout.ApplyPromoCodeOnCart(i.PromotionDataList,!0,t,i.PromotionDesc,i.PerTransactionOne,!0)}else _onlineCheckout.CreatePromoCodeDiv("0",t.toUpperCase(),"Discount cannot be used for any items in this cart.",!1);else{var n=UserType;_onlineCheckout.GCPromoCodeLimt(onlineShoppingCart.loginUserId,n,t.toUpperCase(),"CheckPromoNumber")}e("#txtPromoCode").val(""),_onlineCheckout.IsVCFEnable()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.ApplyPromoCode))}},n.datamodel.data=i,n.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},n.Post()},_onlineCheckout.ApplyPromoCodeOnCart=function(t,i,n,o,a,s){if(1!=_onlineCheckout.IsValidateForPromoCode()&&null!=t){var r=!1,l=null;if(1==a&&(l=_onlineCheckout.GetApplicableItemForOnePerUser(t)),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0){var c=e.grep(t,function(e){return 2==e.ItemTypeID});c.length>0&&1==_onlineCheckout.ApplyPresetDiscountOnProducts(onlineShoppingCart.Inventories,c,l)&&(r=!0,_onlineCheckout.ApplyRemovePromoCodeOnBundle())}if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){var d=e.grep(t,function(e){return 3==e.ItemTypeID||1==e.ItemTypeID||19==e.ItemTypeID});d.length>0&&1==_onlineCheckout.ApplyPresetDiscountOnPackages(onlineShoppingCart.Packages,d,l)&&(r=!0)}if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0){var u=e.grep(t,function(e){return 7==e.ItemTypeID});u.length>0&&1==_onlineCheckout.ApplyPresetDiscountOnMemberships(onlineShoppingCart.Memberships,u,l)&&(r=!0)}if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"==isCCRequiredForOnlineClass.toLowerCase()){var p=e.grep(t,function(e){return 8==e.ItemTypeID||e.ItemTypeID==v});p.length>0&&1==_onlineCheckout.ApplyPresetDiscountOnEvents(onlineShoppingCart.Events,p,i,l)&&(r=!0)}if(null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0){var h=e.grep(t,function(e){return 5==e.ItemTypeID});h.length>0&&1==_onlineCheckout.ApplyPresetDiscountOnGC(onlineShoppingCart.GiftCertificates,h,l)&&(r=!0)}if(1==i||1==s)if(0==r)_onlineCheckout.CreatePromoCodeDiv(t[0].PromotionID,n.toUpperCase(),"Discount cannot be used for any items in this cart.",!1);else{onlineShoppingCart.lstPromotionData=onlineShoppingCart.lstPromotionData.concat(t),_onlineCheckout.CreatePromoCodeDiv(t[0].PromotionID,n.toUpperCase(),o,!0),_onlineCheckout.RemoveUnusedPromocode(t[0].PromotionID);var m={};m.PromotionID=t[0].PromotionID,m.PromoCodeStr=n.toUpperCase(),m.msg=o,m.PeruserOne=a,m.PerTransactionOne=a,onlineShoppingCart.lstPromoDetails.push(m)}_onlineCheckout.RecalcGCONAllItemsAfterPreset(),_onlineCheckout.ReApplyDiscounts(!0)}},_onlineCheckout.ApplyRemovePromoCodeOnBundle=function(){e.each(onlineShoppingCart.Inventories,function(t,i){if(!String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)){var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==i.InventoryId});i.OriginalPrice=0,i.Price=0,i.isPresetApply=!1,e.each(n,function(e,t){i.OriginalPrice+=t.OriginalPrice,i.Price+=t.Price,i.isPresetApply=1==i.isPresetApply||t.isPresetApply})}})},_onlineCheckout.GetApplicableItemForOnePerUser=function(t){var n=!1,o={},a=0;return null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(i){var s=e.grep(t,function(e){return e.ServiceID==i.InventoryId&&2==e.ItemTypeID}),r=e.grep(onlineShoppingCartmain.Inventories,function(e){return e.autoId==i.autoId});if(null!=s&&s.length>0){s=s[0];var l=r[0].Price,c=0;1!=i.isPointApply&&(0==s.IsAmount?c=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(l/i.Quantity*s.DiscountValue/100,2),2):(c=_onlineCheckout.parseTodecimal(s.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(c=parseFloat(ConvertTodecimalMorePrecious(parseFloat(c)/(1+i.Tax/100),!0,4)))),l/i.Quantity<c&&(c=l)),c>a&&(a=c,o.autoId=i.autoId,o.EnrollAutoID=0,n=!0)}}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(i){var s=e.grep(t,function(e){return e.ServiceID==i.ServiceId&&3==e.ItemTypeID&&4==i.eventType||e.ServiceID==i.ServiceId&&1==e.ItemTypeID&&1==i.eventType}),r=e.grep(onlineShoppingCartmain.Packages,function(e){return e.autoId==i.autoId});if(null!=s&&s.length>0){s=s[0];var l=r[0].Price,c=0;0==s.IsAmount?c=_onlineCheckout.parseTodecimal(l*s.DiscountValue/100,2):(c=_onlineCheckout.parseTodecimal(s.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(c=parseFloat(ConvertTodecimalMorePrecious(parseFloat(c)/(1+i.Tax/100),!0,4))));i.NoOfVisit;i.SellPackageServiceID>0&&1,l-c<0&&(c=l),c>a&&(a=c,o.autoId=i.autoId,o.EnrollAutoID=0,n=!0)}}),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(i){var s=e.grep(t,function(e){return e.ServiceID==i.MembershipId&&7==e.ItemTypeID}),r=e.grep(onlineShoppingCartmain.Memberships,function(e){return e.autoId==i.autoId});if(null!=s&&s.length>0){s=s[0];var l=r[0].Price,c=0;0==s.IsAmount?c=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(l*s.DiscountValue/100,2),2):(c=_onlineCheckout.parseTodecimal(s.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(c=parseFloat(ConvertTodecimalMorePrecious(parseFloat(c)/(1+i.Tax/100),!0,4)))),l<c&&(c=l),c>a&&(a=c,o.autoId=i.autoId,o.EnrollAutoID=0,n=!0)}}),null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"==isCCRequiredForOnlineClass.toLowerCase()&&e.grep(onlineShoppingCart.Events,function(s){var r=e.grep(t,function(e){return e.ServiceID==s.eventID&&8==e.ItemTypeID}),l=e.grep(onlineShoppingCartmain.Events,function(e){return e.autoId==s.autoId});if(null!=r&&r.length>0){r=r[0];e.grep(s.eventEnrollment,function(t){var c=e.grep(l[0].eventEnrollment,function(e){return e.autoID==t.autoID})[0].actualPrice,d=0,u=r.ServiceProviderIDs,p=t.sPID;for(i=0;i<u.split(",").length;i++)p==u.split(",")[i]&&!0;var h=moment(t.workshopActualDate),m=moment(r.StartDate.replace("A"," A").replace("P"," P")),g=moment(r.EndDate.replace("A"," A").replace("P"," P"));m.diff(h,"min"),""!=r.EndDate&&g.diff(h,"min"),1!=t.isPointApply&&1!=t.isPackage&&(0==r.IsAmount?d=_onlineCheckout.parseTodecimal(c*r.DiscountValue/100,2):(d=_onlineCheckout.parseTodecimal(r.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(d=parseFloat(ConvertTodecimalMorePrecious(parseFloat(d)/(1+s.tax/100),!0,4)))),c<d&&(d=c),d>a&&(a=d,o.autoId=s.autoId,o.EnrollAutoID=t.autoID,n=!0))})}}),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&e.grep(onlineShoppingCart.GiftCertificates,function(i){var s=e.grep(t,function(e){return e.Price==i.TotalPrice&&5==e.ItemTypeID}),r=e.grep(onlineShoppingCartmain.GiftCertificates,function(e){return e.autoId==i.autoId});if(null!=s&&s.length>0){s=s[0];var l=r[0].Price,c=0;0==s.IsAmount?c=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(l*s.DiscountValue/100,2),2):(c=_onlineCheckout.parseTodecimal(s.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(c=parseFloat(ConvertTodecimalMorePrecious(parseFloat(c)/(1+i.Tax/100),!0,4)))),l<c&&(c=l),c>a&&(a=c,o.autoId=i.autoId,o.EnrollAutoID=0,n=!0)}}),n||(o=null),o},_onlineCheckout.ShowPromoCodeErrorMessage=function(e,t){},_onlineCheckout.ApplyPresetDiscountOnProducts=function(t,i,n){var o=!1;return e.grep(t,function(t){if(null!=n&&t.autoId+"0"==n.autoId.toString()+n.EnrollAutoID.toString()||null==n){var a=e.grep(i,function(e){return e.ServiceID==t.InventoryId&&2==e.ItemTypeID}),s=e.grep(onlineShoppingCartmain.Inventories,function(e){return e.autoId==t.autoId});if(null!=a&&a.length>0){a=a[0];var r=s[0].Price,l=0;if(void 0!==t.isPresetApply&&t.isPresetApply,1!=t.isPointApply){if(1==t.isMembershipApply){var d=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==t.MembershipID&&3==e.ItemType&&e.MembershipItemId==t.InventoryId});null!=d&&d.length>0&&1==d[0].IsAllowPreSetDiscount?l=_onlineCheckout.parseTodecimal(r*d[0].Discount/100,2):_onlineCheckout.RemoveDicount(c,4,t.autoId)}if(0==a.IsAmount)if(null!=n){var u=0,p=_onlineCheckout.parseTodecimal(r/t.Quantity*a.DiscountValue/100,2);l/t.Quantity+p>r/t.Quantity&&(u=l/t.Quantity+p-r/t.Quantity),l=_onlineCheckout.parseTodecimal(l+_onlineCheckout.parseTodecimal(r/t.Quantity*a.DiscountValue/100,2),2),l-=u}else l=_onlineCheckout.parseTodecimal(l+_onlineCheckout.parseTodecimal(r*a.DiscountValue/100,2),2);else{if(null!=n){u=0,p=_onlineCheckout.parseTodecimal(a.DiscountValue,2);l/t.Quantity+p>r/t.Quantity&&(u=l/t.Quantity+p-r/t.Quantity),l=_onlineCheckout.parseTodecimal(l+a.DiscountValue,2),l-=u}else l=_onlineCheckout.parseTodecimal(l+a.DiscountValue*t.Quantity,2);"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(l=parseFloat(ConvertTodecimalMorePrecious(parseFloat(l)/(1+t.Tax/100),!0,4)))}r<l&&(l=r),t.discount=l,t.Price=_onlineCheckout.parseTodecimal(r-t.discount,2),t.ActualPrice=t.Price,t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),t.isPresetApply=!0,t.isPointApply=!1,t.DiscountID=a.PromotionID,t.IsAmount=a.IsAmount,t.AmountValue=a.DiscountValue,o=!0}}}}),o},_onlineCheckout.ApplyPresetDiscountOnPackages=function(t,i,n){var o=!1;return e.grep(t,function(t){if(null!=n&&t.autoId+"0"==n.autoId.toString()+n.EnrollAutoID.toString()||null==n){var a=e.grep(i,function(e){return e.ServiceID==t.ServiceId&&3==e.ItemTypeID&&4==t.eventType||e.ServiceID==t.ServiceId&&1==e.ItemTypeID&&1==t.eventType}),s=e.grep(onlineShoppingCartmain.Packages,function(e){return e.autoId==t.autoId});if(null!=a&&a.length>0){a=a[0];var r=s[0].Price,l=0;0!=t.PromotionID&&(t.PromotionID=0),0==a.IsAmount?l=_onlineCheckout.parseTodecimal(l+r*a.DiscountValue/100,2):(l=_onlineCheckout.parseTodecimal(l+a.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(l=parseFloat(ConvertTodecimalMorePrecious(parseFloat(l)/(1+t.Tax/100),!0,4))));var c=t.NoOfVisit;t.SellPackageServiceID>0&&(c=1),r-l<0&&(l=r),t.discount=null!=n?l:l*c,t.Price=_onlineCheckout.parseTodecimal(r*c-t.discount,2),t.ActualPrice=t.Price,t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),t.isPresetApply=!0,t.DiscountID=a.PromotionID,t.IsAmount=a.IsAmount,t.AmountValue=a.DiscountValue,1==t.IsRecurring&&(t.BillingCycle=a.BillingCycle,t.IsInitialDiscount=!1,t.InitialDiscount=0,t.IsAmountForInitialDiscount=!1),o=!0}}if(!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0){var d=_onlineCheckout.ApplyPresetDiscountOnAddOnPackages(t,t.lstAddonService,i,n);o=d||o}}),o},_onlineCheckout.ApplyPresetDiscountOnMemberships=function(t,i,n){var o=!1;return e.grep(t,function(t){if(null!=n&&t.autoId+"0"==n.autoId.toString()+n.EnrollAutoID.toString()||null==n){var a=e.grep(i,function(e){return e.ServiceID==t.MembershipId&&7==e.ItemTypeID}),s=e.grep(onlineShoppingCartmain.Memberships,function(e){return e.autoId==t.autoId});if(null!=a&&a.length>0){a=a[0];var r=s[0].Price,l=0;0!=t.PromotionID&&(t.PromotionID=0),0==a.IsAmount?l=_onlineCheckout.parseTodecimal(l+_onlineCheckout.parseTodecimal(r*a.DiscountValue/100,2),2):(l=_onlineCheckout.parseTodecimal(l+a.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(l=parseFloat(ConvertTodecimalMorePrecious(parseFloat(l)/(1+t.Tax/100),!0,4)))),r<l&&(l=r),t.productDisc=l,t.Price=r,t.ActualPrice=_onlineCheckout.parseTodecimal(r-t.productDisc,2),t.calculatedTax=_onlineCheckout.parseTodecimal(t.ActualPrice*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.ActualPrice,t),t.isPresetApply=!0,t.DiscountID=a.PromotionID,t.IsAmount=a.IsAmount,t.AmountValue=a.DiscountValue,o=!0,1==t.IsRecurring&&(t.BillingCycle=a.BillingCycle,t.IsInitialDiscount=!1,t.InitialDiscount=0,t.IsAmountForInitialDiscount=!1),1==t.isGCApply&&0==t.Price&&_onlineCheckout.RemoveDicount(u,1,t.autoId)}}}),o},_onlineCheckout.ApplyPresetDiscountOnEvents=function(t,n,o,a){var s=!1,r=0,l=0,c=0;onlineShoppingCart.classdiscount=0,e.grep(t,function(t){var d=e.extend(!0,[],n),u=e.grep(d,function(e){return e.ServiceID==t.eventID&&8==e.ItemTypeID});t.calssdiscountprice=0,t.addonCalssdiscountprice=0;var h=e.grep(onlineShoppingCartmain.Events,function(e){return e.autoId==t.autoId});if(null!=u&&u.length>0){u=u[0];e.grep(t.eventEnrollment,function(n){if(void 0!==a&&(null!=a&&t.autoId.toString()+n.autoID.toString()==a.autoId.toString()+a.EnrollAutoID.toString()||null==a)){var d=e.grep(h[0].eventEnrollment,function(e){return e.autoID==n.autoID})[0].actualPrice,m=0,g=u.ServiceProviderIDs,v=n.sPID,f=!1;for(i=0;i<g.split(",").length;i++)v==g.split(",")[i]&&(f=!0);var C=moment(n.workshopActualDate),S=moment(u.StartDate.replace("A"," A").replace("P"," P")),y=moment(u.EndDate.replace("A"," A").replace("P"," P"));if(S.diff(C,"min")>0&&(f=!1),""!=u.EndDate&&y.diff(C,"min")<0&&(f=!1),0==o&&(void 0!==n.isPresetApply&&0==n.isPresetApply&&n.DiscountID!=u.PromotionID||void 0===n.isPresetApply||void 0!==n.isPresetApply&&1==n.isPresetApply&&n.DiscountID!=u.PromotionID)&&(f=!1),1==n.isPointApply||null!=n.gcId&&1==n.isPackage||0==f){if(1!=n.isPointApply){if(n.gcId>0&&(d=n.actualPrice),1==n.isMembershipApply){var b=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==n.MembershipID&&2==e.ItemType&&e.MembershipItemId==n.MembershipItemId});m=_onlineCheckout.parseTodecimal(d*b[0].Discount/100,2)}if(void 0!==n.isPresetApply&&1==n.isPresetApply&&(0==n.IsAmount?m=_onlineCheckout.parseTodecimal(m+d*n.AmountValue/100,2):(m=n.actualPrice<m+n.AmountValue?d:_onlineCheckout.parseTodecimal(m+n.AmountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(m=parseFloat(ConvertTodecimalMorePrecious(parseFloat(m)/(1+t.tax/100),!0,4))))),(null==n.gcId||0==n.gcId||n.gcId>0&&0==n.isPackage)&&0!=n.PromotionID){var k=0;1==n.IsAmount?(k=n.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(k=parseFloat(ConvertTodecimalMorePrecious(parseFloat(k)/(1+t.tax/100),!0,4)))):k=d*n.AmountValue/100,m+=k}n.actualPrice<m&&(m=d),n.discount=m,n.price=_onlineCheckout.parseTodecimal(d-n.discount,2),n.actualPrice=n.price,(n.gcId<0||n.gcId>0)&&1==n.isPackage?n.actualTaxprice=0:n.actualTaxprice=_onlineCheckout.parseTodecimal(n.price*t.tax/100,3),t.calssdiscountprice=_onlineCheckout.parseTodecimal(t.calssdiscountprice+n.discount,2),n.taxprice=n.actualTaxprice,null!=n.gcId&&0==n.isPackage&&(0==n.price&&(n.gcId=null,_onlineCheckout.RemoveDicount(p,1,n.eventID,n.autoID)),n.redeemTax=n.actualTaxprice,n.redeemAmt=n.actualPrice),n.BusinessTax=_onlineCheckout.ApplyMultipleTax(n.price,n),r=_onlineCheckout.parseTodecimal(r+n.price,2),l=_onlineCheckout.parseTodecimal(l+n.actualTaxprice,2),n.gcId>0&&0==n.isPackage&&(c=_onlineCheckout.parseTodecimal(c+n.price,2))}}else{if(0!=n.PromotionID&&(n.PromotionID=0),1==n.isMembershipApply)null!=(b=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==n.MembershipID&&2==e.ItemType&&e.MembershipItemId==n.MembershipItemId}))&&b.length>0&&1==b[0].IsAllowPreSetDiscount?m=_onlineCheckout.parseTodecimal(d*b[0].Discount/100,2):_onlineCheckout.RemoveDicount(p,4,n.eventID,n.autoID);(void 0===n.isPresetApply||void 0!==n.isPresetApply&&1==n.isPresetApply||o)&&(0==u.IsAmount?m=_onlineCheckout.parseTodecimal(m+d*u.DiscountValue/100,2):(m=_onlineCheckout.parseTodecimal(m+u.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(m=parseFloat(ConvertTodecimalMorePrecious(parseFloat(m)/(1+t.tax/100),!0,4)))),n.isPresetApply=!0,n.DiscountID=u.PromotionID,n.IsAmount=u.IsAmount,n.AmountValue=u.DiscountValue,s=!0),d<m&&(m=d),n.discount=m,n.price=_onlineCheckout.parseTodecimal(d-n.discount,2),n.actualPrice=n.price,n.actualTaxprice=_onlineCheckout.parseTodecimal(n.price*t.tax/100,3),t.calssdiscountprice=_onlineCheckout.parseTodecimal(t.calssdiscountprice+n.discount,2),n.isPointApply=!1,n.isPackage=!1,n.taxprice=n.actualTaxprice,null!=n.gcId&&0==n.isPackage&&(0==n.price&&(n.gcId=null,_onlineCheckout.RemoveDicount(p,1,n.eventID,n.autoID)),n.redeemTax=n.actualTaxprice,n.redeemAmt=n.actualPrice),n.BusinessTax=_onlineCheckout.ApplyMultipleTax(n.price,n),r=_onlineCheckout.parseTodecimal(r+n.price,2),l=_onlineCheckout.parseTodecimal(l+n.taxprice,2),n.gcId>0&&0==n.isPackage&&(c=_onlineCheckout.parseTodecimal(c+n.price,2))}}})}else e.grep(t.eventEnrollment,function(i){if(1!=i.isPointApply){var n=e.grep(h[0].eventEnrollment,function(e){return e.autoID==i.autoID})[0].actualPrice;i.gcId>0&&(n=i.actualPrice);var o=0;if(1==i.isMembershipApply){var a=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==i.MembershipID&&2==e.ItemType&&e.MembershipItemId==i.MembershipItemId});o=_onlineCheckout.parseTodecimal(n*a[0].Discount/100,2)}if(void 0!==i.isPresetApply&&1==i.isPresetApply&&(0==i.IsAmount?o=_onlineCheckout.parseTodecimal(o+n*i.AmountValue/100,2):(o=i.actualPrice<o+i.AmountValue?n:_onlineCheckout.parseTodecimal(o+i.AmountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(o=parseFloat(ConvertTodecimalMorePrecious(parseFloat(o)/(1+t.tax/100),!0,4))))),(null==i.gcId||0==i.gcId||i.gcId>0&&0==i.isPackage)&&0!=i.PromotionID){var s=0;1==i.IsAmount?(s=i.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(s=parseFloat(ConvertTodecimalMorePrecious(parseFloat(s)/(1+t.tax/100),!0,4)))):s=n*i.AmountValue/100,o+=s}i.actualPrice<o&&(o=n),i.discount=o,i.price=_onlineCheckout.parseTodecimal(n-i.discount,2),i.actualPrice=i.price,(i.gcId<0||i.gcId>0)&&1==i.isPackage?i.actualTaxprice=0:i.actualTaxprice=_onlineCheckout.parseTodecimal(i.price*t.tax/100,3),t.calssdiscountprice=_onlineCheckout.parseTodecimal(t.calssdiscountprice+i.discount,2),i.taxprice=i.actualTaxprice,null!=i.gcId&&0==i.isPackage&&(0==i.price&&(i.gcId=null,_onlineCheckout.RemoveDicount(p,1,i.eventID,i.autoID)),i.redeemTax=i.actualTaxprice,i.redeemAmt=i.actualPrice),i.BusinessTax=_onlineCheckout.ApplyMultipleTax(i.price,i),r=_onlineCheckout.parseTodecimal(r+i.price,2),l=_onlineCheckout.parseTodecimal(l+i.actualTaxprice,2),i.gcId>0&&0==i.isPackage&&(c=_onlineCheckout.parseTodecimal(c+i.price,2))}});t.displayroundedPrice<t.calssdiscountprice&&(t.calssdiscountprice=t.displayroundedPrice);var m=_onlineCheckout.ApplyPresetDiscountOnEventsAddon(t.eventEnrollment,n,o,a);r+=m.addonTotalPrice,l+=m.addonTotalTaxPrice,c+=m.addonTotalGCUsed,m.PromoApplied&&(s=m.PromoApplied),t.addonCalssdiscountprice=m.addonDiscountprice,onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+t.calssdiscountprice+t.addonCalssdiscountprice,2)});var d=parseFloat((r+l-(c+onlineShoppingCart.classPackageUsed)).toFixed(2));return onlineShoppingCart.classTax=parseFloat(l.toFixed(2)),onlineShoppingCart.classGCUsed=c,onlineShoppingCart.classFinalTotal=d,s},_onlineCheckout.ApplyPresetDiscountOnGC=function(t,i,n){var o=!1;return e.grep(t,function(t){if(0==t.ServiceId&&(null!=n&&t.autoId+"0"==n.autoId.toString()+n.EnrollAutoID.toString()||null==n)){var a=e.grep(i,function(e){return e.Price==t.TotalPrice&&5==e.ItemTypeID}),s=e.grep(onlineShoppingCartmain.GiftCertificates,function(e){return e.autoId==t.autoId});if(null!=a&&a.length>0){a=a[0];var r=s[0].Price,l=0;0!=t.PromotionID&&(t.PromotionID=0),0==a.IsAmount?l=_onlineCheckout.parseTodecimal(l+r*a.DiscountValue/100,2):(l=_onlineCheckout.parseTodecimal(l+a.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(l=parseFloat(ConvertTodecimalMorePrecious(parseFloat(l)/(1+t.Tax/100),!0,4)))),r-l<0&&(l=r),t.discount=l,t.Price=_onlineCheckout.parseTodecimal(r-t.discount,2),t.ActualPrice=t.Price,t.isPresetApply=!0,t.DiscountID=a.PromotionID,t.IsAmount=a.IsAmount,t.AmountValue=a.DiscountValue,o=!0,"undefined"!=typeof PromotionAppointmentID&&null!=PromotionAppointmentID&&""!=PromotionAppointmentID&&PromotionAppointmentID>0&&t.DiscountID>0&&(PromotionAppointmentID="")}}}),o},_onlineCheckout.CreatePromoCodeDiv=function(t,i,n,o){1==o?e("#divApplyPromocode").prepend("<div id='divPromoCode_"+t+"' class='promo-summercode'> <div class='promo-summercode-bg'><a class='font-awesome-light grid-close-icon promo-close-icon ' onclick ='_onlineCheckout.RemovePromoCode("+t+");'>&#xf00d;</a><span class='font-awesome-normal vg-green-text sign-icon' aria-hidden='true'>&#xf058;</span> <span class='vg-green-text'>"+i+"</span><p class='text web-body-font web-builder-font-color'>"+n+"</p></div></div>"):e("#divApplyPromocode").prepend("<div id='divPromoCode_0' class='promo-summercode divPromoCode_0'> <div class='promo-summercode-error-bg' ><a class='font-awesome-light grid-close-icon promo-close-icon ' onclick ='_onlineCheckout.RemovePromoCodeError(this);'>&#xf00d;</a><span class='font-awesome-normal vg-red-text sign-icon' aria-hidden='true'>&#xf057;</span> <span class='vg-red-text'>"+i+"</span><p class='text web-body-font web-builder-font-color'>"+n+"</p></div></div>")},_onlineCheckout.CreateGCCodeDiv=function(t,i,n,o){1==o?e("#divApplyGCcode").prepend("<div id='divGCCode_"+t+"' class='promo-summercode'> <div class='promo-summercode-bg'><a class='font-awesome-light grid-close-icon promo-close-icon ' onclick ='_onlineCheckout.RemovePromoCode("+t+");'>&#xf00d;</a><span class='font-awesome-normal vg-green-text sign-icon' aria-hidden='true'>&#xf058;</span> <span class='vg-green-text'>"+i+"</span><p class='text web-body-font web-builder-font-color'>"+n+"</p></div></div>"):e("#divApplyGCcode").prepend("<div id='divGCCode_0' class='promo-summercode divGCCode_0'> <div class='promo-summercode-error-bg' ><a class='font-awesome-light grid-close-icon promo-close-icon ' onclick ='_onlineCheckout.RemoveGCCodeError(this);'>&#xf00d;</a><span class='font-awesome-normal vg-red-text sign-icon' aria-hidden='true'>&#xf057;</span> <span class='vg-red-text'>"+i+"</span><p class='text web-body-font web-builder-font-color'>"+n+"</p></div></div>")},_onlineCheckout.GCCodeClick=function(){e(".divGCCode_0").hide()},_onlineCheckout.GCCodeCodeKeypress=function(t){13==t.which?(t.preventDefault(),_onlineCheckout.ValidateGCCode()):e("#txtGCRedeemGCNo").removeClass("errorInput")},_onlineCheckout.ValidateGCCode=function(){if(""==e("#txtGCRedeemGCNo").val().trim())return e("#txtGCRedeemGCNo").val(""),void e("#txtGCRedeemGCNo").addClass("errorInput")},_onlineCheckout.RemoveGCCodeError=function(t){e(t).parent().parent().hide()},_onlineCheckout.RemovePromoCodeDiv=function(t){e(e("#divPromoCode_"+t)[0].firstElementChild.firstElementChild).empty(),e("#divPromoCode_"+t).hide(),e("#divPromoCode_"+t).attr("id","0")},_onlineCheckout.RemovePromoCodeError=function(t){e(t).parent().parent().hide()},_onlineCheckout.RemoveUnusedPromocode=function(t){var i=onlineShoppingCart.lstPromotionData.uniqueObjects(["PromotionID"]);e.grep(i,function(t){var i=!1;null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&e.DiscountID==t.PromotionID&&(i=!0)}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(n){void 0!==n.isPresetApply&&1==n.isPresetApply&&n.DiscountID==t.PromotionID&&(i=!0),!String.isNullOrUndefineOrBlank(n.lstAddonService)&&n.lstAddonService.length>0&&e.grep(n.lstAddonService,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&e.DiscountID==t.PromotionID&&(i=!0)})}),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&e.DiscountID==t.PromotionID&&(i=!0)}),null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"==isCCRequiredForOnlineClass.toLowerCase()&&e.grep(onlineShoppingCart.Events,function(n){e.grep(n.eventEnrollment,function(n){void 0!==n.isPresetApply&&1==n.isPresetApply&&n.DiscountID==t.PromotionID&&(i=!0),null!=n.lstAddonService&&n.lstAddonService.length>0&&e.grep(n.lstAddonService,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&e.DiscountID==t.PromotionID&&(i=!0)})})}),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&e.grep(onlineShoppingCart.GiftCertificates,function(e){void 0!==e.isPresetApply&&1==e.isPresetApply&&e.DiscountID==t.PromotionID&&(i=!0)}),0==i&&_onlineCheckout.RemovePromoCode(t.PromotionID)})},_onlineCheckout.RemovePresetDiscountOnProducts=function(t,i,n){e.grep(t,function(t){var o=e.grep(i,function(e){return e.ServiceID==t.InventoryId&&2==e.ItemTypeID}),a=e.grep(onlineShoppingCartmain.Inventories,function(e){return e.autoId==t.autoId});if(null!=o&&o.length>0){o=o[0];var s=a[0].Price,r=0;if(void 0!==t.isPresetApply&&1==t.isPresetApply&&t.DiscountID==n){if(1==t.isMembershipApply){var l=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==t.MembershipID&&3==e.ItemType&&e.MembershipItemId==t.InventoryId});null!=l&&l.length>0&&1==l[0].IsAllowPreSetDiscount&&(r=_onlineCheckout.parseTodecimal(s*l[0].Discount/100,2))}t.discount=r,t.Price=_onlineCheckout.parseTodecimal(s-r,2),t.ActualPrice=t.Price,t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),t.isPresetApply=!1,t.isPointApply=!1,t.DiscountID=0,t.IsAmount=!1,t.AmountValue=0}}})},_onlineCheckout.RemovePresetDiscountOnPackages=function(t,i,n){e.grep(t,function(t){var o=e.grep(i,function(e){return e.ServiceID==t.ServiceId&&3==e.ItemTypeID&&4==t.eventType||e.ServiceID==t.ServiceId&&1==e.ItemTypeID&&1==t.eventType}),a=e.grep(onlineShoppingCartmain.Packages,function(e){return e.autoId==t.autoId});if(null!=o&&o.length>0){o=o[0];var s=a[0].Price;if(void 0!==t.isPresetApply&&1==t.isPresetApply&&t.DiscountID==n){s-(0==o.IsAmount?_onlineCheckout.parseTodecimal(s*o.DiscountValue/100,2):_onlineCheckout.parseTodecimal(o.DiscountValue,2))<0&&s;var r=t.NoOfVisit;t.SellPackageServiceID>0&&(r=1),t.discount=0,t.Price=s*r,t.ActualPrice=t.Price,t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),t.isPresetApply=!1,t.DiscountID=0,t.IsAmount=!1,t.AmountValue=0,t.BillingCycle=0}}!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(o){var a=e.grep(i,function(e){return e.ServiceID==t.ServiceId&&3==e.ItemTypeID&&4==t.eventType||e.ServiceID==o.ServiceId&&19==e.ItemTypeID}),s=e.grep(onlineShoppingCartmain.Packages,function(e){return e.autoId==t.autoId}),r=e.grep(s[0].lstAddonService,function(e){return e.ServiceId==o.ServiceId});if(null!=a&&a.length>0){a=a[0];var l=r[0].Price;if(void 0!==o.isPresetApply&&1==o.isPresetApply&&o.DiscountID==n){l-(0==a.IsAmount?_onlineCheckout.parseTodecimal(l*a.DiscountValue/100,2):_onlineCheckout.parseTodecimal(a.DiscountValue,2))<0&&l;var c=t.NoOfVisit;o.SellPackageServiceID>0&&(c=1),o.discount=0,o.Price=l*c,o.ActualPrice=o.Price,o.calculatedTax=_onlineCheckout.parseTodecimal(o.Price*o.tax/100,3),o.ActualTax=o.calculatedTax,o.BusinessTax=_onlineCheckout.ApplyMultipleTax(o.Price,t),o.isPresetApply=!1,o.DiscountID=0,o.IsAmount=!1,o.AmountValue=0,o.BillingCycle=0}}})})},_onlineCheckout.RemovePresetDiscountOnMemberships=function(t,i,n){e.grep(t,function(t){var o=e.grep(i,function(e){return e.ServiceID==t.MembershipId&&7==e.ItemTypeID}),a=e.grep(onlineShoppingCartmain.Memberships,function(e){return e.autoId==t.autoId});if(null!=o&&o.length>0){o=o[0];var s=a[0].Price;void 0!==t.isPresetApply&&1==t.isPresetApply&&t.DiscountID==n&&(t.productDisc=0,t.ActualPrice=_onlineCheckout.parseTodecimal(s,2),t.calculatedTax=_onlineCheckout.parseTodecimal(t.ActualPrice*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.ActualPrice,t),t.isPresetApply=!1,t.DiscountID=0,t.IsAmount=!1,t.AmountValue=0,t.BillingCycle=0)}})},_onlineCheckout.RemovePresetDiscountOnEvents=function(t,i,n){var o=0,a=0,s=0;onlineShoppingCart.classdiscount=0,e.grep(t,function(t){var r=e.grep(i,function(e){return e.ServiceID==t.eventID&&8==e.ItemTypeID});t.calssdiscountprice=0,t.addonCalssdiscountprice=0;var l=e.grep(onlineShoppingCartmain.Events,function(e){return e.autoId==t.autoId});if(null!=r&&r.length>0){r=r[0];e.grep(t.eventEnrollment,function(i){var c=e.grep(l[0].eventEnrollment,function(e){return e.autoID==i.autoID})[0].actualPrice,d=0;if(void 0!==i.isPresetApply&&1==i.isPresetApply&&i.DiscountID==n)d=0==r.IsAmount?_onlineCheckout.parseTodecimal(c*r.DiscountValue/100,2):i.actualPrice<r.DiscountValue?c:_onlineCheckout.parseTodecimal(r.DiscountValue,2),i.discount=i.discount-d,i.price=_onlineCheckout.parseTodecimal(i.price+i.discount,2),i.actualPrice=i.price,(i.gcId<0||i.gcId>0)&&1==i.isPackage?i.actualTaxprice=0:i.actualTaxprice=_onlineCheckout.parseTodecimal(i.price*t.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+i.discount,2),t.calssdiscountprice=_onlineCheckout.parseTodecimal(t.calssdiscountprice+i.discount,2),i.isPresetApply=!1,i.isPointApply=!1,i.isPackage,i.DiscountID=0,i.IsAmount=!1,i.AmountValue=0,i.taxprice=i.actualTaxprice,null!=i.gcId&&0==i.isPackage&&(i.redeemTax=i.actualTaxprice,i.redeemAmt=i.actualPrice,onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed+d);else{if(1==i.isMembershipApply){var u=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==i.MembershipID&&2==e.ItemType&&e.MembershipItemId==i.MembershipItemId});d=_onlineCheckout.parseTodecimal(c*u[0].Discount/100,2)}i.discount=d,i.price=i.price,i.actualPrice=i.price,(i.gcId<0||i.gcId>0)&&1==i.isPackage?i.actualTaxprice=0:i.actualTaxprice=_onlineCheckout.parseTodecimal(i.price*t.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+i.discount,2),t.calssdiscountprice=_onlineCheckout.parseTodecimal(t.calssdiscountprice+i.discount,2),i.taxprice=i.actualTaxprice,null!=i.gcId&&0==i.isPackage&&(0==i.price?_onlineCheckout.RemoveDicount(p,1,i.eventID,i.autoID):onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed-i.discount,i.redeemTax=i.actualTaxprice,i.redeemAmt=i.actualPrice)}o=_onlineCheckout.parseTodecimal(o+i.price,2),a=_onlineCheckout.parseTodecimal(a+i.actualTaxprice,2),i.gcId>0&&0==i.isPackage&&(s=_onlineCheckout.parseTodecimal(s+i.price,2))})}else e.grep(t.eventEnrollment,function(i){var n=i.actualPrice,r=0;if(1==i.isMembershipApply){var l=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==i.MembershipID&&2==e.ItemType&&e.MembershipItemId==i.MembershipItemId});r=_onlineCheckout.parseTodecimal(n*l[0].Discount/100,2)}i.discount=r,i.price=i.price,i.actualPrice=i.price,(i.gcId<0||i.gcId>0)&&1==i.isPackage?i.actualTaxprice=0:i.actualTaxprice=_onlineCheckout.parseTodecimal(i.price*t.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+i.discount,2),t.calssdiscountprice=_onlineCheckout.parseTodecimal(t.calssdiscountprice+i.discount,2),i.taxprice=i.actualTaxprice,null!=i.gcId&&0==i.isPackage&&(0==i.price?_onlineCheckout.RemoveDicount(p,1,i.eventID,i.autoID):onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed-i.discount,i.redeemTax=i.actualTaxprice,i.redeemAmt=i.actualPrice),o=_onlineCheckout.parseTodecimal(o+i.price,2),a=_onlineCheckout.parseTodecimal(a+i.actualTaxprice,2),i.gcId>0&&0==i.isPackage&&(s=_onlineCheckout.parseTodecimal(s+i.price,2))});var c=_onlineCheckout.RemovePresetDiscountOnEventsAddon(t.eventEnrollment,i,n);o+=c.addonTotalPrice,a+=c.addonTotalTaxPrice,s+=c.addonTotalGCUsed,t.addonCalssdiscountprice=c.addonDiscountprice});var r=parseFloat((o+a-(s+onlineShoppingCart.classPackageUsed)).toFixed(2));onlineShoppingCart.classTax=parseFloat(a.toFixed(2)),onlineShoppingCart.classGCUsed=s,onlineShoppingCart.classFinalTotal=r},_onlineCheckout.RemovePresetDiscountOnGC=function(t,i,n){e.grep(t,function(t){if(0==t.ServiceId){var o=e.grep(i,function(e){return e.Price==t.TotalPrice&&5==e.ItemTypeID}),a=e.grep(onlineShoppingCartmain.GiftCertificates,function(e){return e.autoId==t.autoId});if(null!=o&&o.length>0){o=o[0];var s=a[0].Price;void 0!==t.isPresetApply&&1==t.isPresetApply&&t.DiscountID==n&&(s-(0==o.IsAmount?_onlineCheckout.parseTodecimal(s*o.DiscountValue/100,2):_onlineCheckout.parseTodecimal(o.DiscountValue,2))<0&&s,t.discount=0,t.Price=s,t.ActualPrice=t.Price,t.isPresetApply=!1,t.DiscountID=0,t.IsAmount=!1,t.AmountValue=0)}}})},_onlineCheckout.PersistGCBalance=function(t,i){null!=t&&null!=onlineShoppingCart.lstGCPkgData&&e.grep(onlineShoppingCart.lstGCPkgData,function(e){e.giftCertificateID==t&&(e.currentBalance=i)})},_onlineCheckout.RecalcGCONAllItemsAfterPreset=function(t){if(void 0!==onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0){onlineShoppingCart.RedeemedByGCtemp=[],onlineShoppingCart.RedeemedByGC=[],e.grep(onlineShoppingCart.lstGCPkgData,function(e){String.isNullOrUndefineOrBlank(e.ResetcurrentBalance)||(e.currentBalance=e.ResetcurrentBalance)});var i=e.grep(e.extend(!0,[],onlineShoppingCart.lstGCPkgData),function(e,t){return(1==e.eventType||7==e.eventType||2==e.eventType)&&0==e.isPackage&&1==e.assignStatus});if(null!=i&&i.length>0){var n={serviceID:"desc",GiftCertificateAmt:"asc"};i.keySort(n)}if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&_onlineCheckout.ApplyGCONAllItemsPreset(onlineShoppingCart.Memberships,i,u,t),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&_onlineCheckout.ApplyGCONAllItemsPreset(onlineShoppingCart.GiftCertificates,i,d,t),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&_onlineCheckout.ApplyGCONAllItemsPreset(onlineShoppingCart.Packages,i,h,t),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&_onlineCheckout.ApplyGCONAllItemsPreset(onlineShoppingCart.Inventories,i,c,t),1==t&&_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&_onlineCheckout.ApplyGCONAllItemsPreset(onlineShoppingCart.ServiceInvoice,i,m,t),null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&_onlineCheckout.ApplyGCONAllItemsPreset(onlineShoppingCart.BusinessFee,i,g,t),onlineShoppingCart.tax>0){var o=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax,2),a=onlineShoppingCart.tax;a!=o&&(onlineShoppingCart.taxdifference=_onlineCheckout.parseTodecimal(a-o,2),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax-onlineShoppingCart.taxdifference,2),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid-onlineShoppingCart.taxdifference,2),onlineShoppingCart.ccAmt>0&&onlineShoppingCart.ccAmt>onlineShoppingCart.taxdifference?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-onlineShoppingCart.taxdifference,2):onlineShoppingCart.gcAmt>0&&onlineShoppingCart.gcAmt>onlineShoppingCart.taxdifference&&(onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt-onlineShoppingCart.taxdifference,3)))}if(onlineShoppingCart.RedeemedByGCtemp.length>0){onlineShoppingCart.RedeemedByGC=[];var s=e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){return 1!=e.IsClass}),r=s.uniqueObjects(["GCId"]);e.grep(r,function(t){objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=0,objGC.redeemAmt=0,objGC.uniqID=0,objGC.AppointmentID=0,objGC.Type="GC",e.grep(s,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.GCAmount,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)})}if(1==t&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){var l=e.grep(e.extend(!0,[],onlineShoppingCart.lstGCPkgData),function(e,t){return(2==e.eventType||8==e.eventType)&&0==e.isPackage&&1==e.assignStatus});if(null!=l&&l.length>0){n={expiresOn:"asc",GiftCertificateAmt:"asc"};l.keySort(n)}l.length>0&&(onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events,!0,l))}}},_onlineCheckout.ApplyGCONAllItemsPreset=function(t,i,n,o){if(null!=i&&i.length>0){let a=!0===i._cycleResetDone;e.grep(t,function(t){String.isNullOrUndefineOrBlank(t.InventoryBundleCartDetails)&&(n==u?(t.Price=parseFloat(t.Price),t.ActualPrice=parseFloat(t.ActualPrice),t.RemainingPrice=parseFloat(t.ActualPrice),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax)):n==d?(t.TotalPrice=parseFloat(t.TotalPrice),t.ServiceId>0?(t.ActualPrice=parseFloat(t.TotalPrice),t.RemainingPrice=parseFloat(t.TotalPrice)):(t.ActualPrice=parseFloat(t.Price),t.RemainingPrice=parseFloat(t.Price)),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax)):n==h?(t.TotalPrice=parseFloat(t.TotalPrice),t.ActualPrice=parseFloat(t.ActualPrice),t.RemainingPrice=parseFloat(t.Price),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax)):n==c?(t.Price=parseFloat(t.Price),t.ActualPrice=parseFloat(1==t.IsPartialPoint?t.ActualPrice:t.Price),t.RemainingPrice=parseFloat(1==t.IsPartialPoint?t.ActualPrice:t.Price),t.RemainingTax=parseFloat(t.calculatedTax),t.ActualTax=parseFloat(t.calculatedTax)):n==m?(t.priceOriginal=parseFloat(t.ServiceOrginalPrice),_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(t.PromotionId)&&t.PromotionId>0&&(t.priceOriginal=parseFloat(t.price)),t.Price=parseFloat(t.price),t.RemainingPrice=parseFloat(t.price),t.RemainingTax=parseFloat(t.calculatedTax),1==t.isPackageApplied||1==t.isPointApply?(t.ActualPrice=parseFloat(t.price),t.ActualTax=parseFloat(0)):(t.ActualPrice=parseFloat(t.price),t.ActualTax=parseFloat(t.calculatedTax)),t.isServiceBaseGC=!1):n==g&&(t.Price=parseFloat(t.CalculatedFees),t.paidType==_onlineCheckout.arrpaidType.Paid?(t.ActualPrice=parseFloat(t.CalculatedFees),t.ActualTax=parseFloat(t.CalculatedTax),t.RemainingPrice=parseFloat(t.Price),t.RemainingTax=parseFloat(t.CalculatedTax)):(t.ActualPrice=parseFloat(t.CalculatedFees),t.ActualTax=parseFloat(t.CalculatedTax),t.RemainingPrice=0,t.RemainingTax=0)),t.redeemAmt=0,t.redeemTax=0,t.GCDetail=[],1!=t.isGCApply&&1!=o||e.grep(i,function(e){!_onlineCheckout.isValidForCheckoutInvoice()||String.isNullOrUndefineOrBlank(e.serviceID)||String.isNullOrUndefineOrBlank(e.serviceName)||n!=m?(!String.isNullOrUndefineOrBlank(e.serviceID)||_onlineCheckout.isValidForCheckoutInvoice()&&n==d||!_onlineCheckout.isValidForCheckoutInvoice()||void 0!==t.isPointApply&&0!=t.isPointApply||void 0!==t.isPackageApplied&&0!=t.isPackageApplied)&&(_onlineCheckout.isValidForCheckoutInvoice()||n==d||!String.isNullOrUndefineOrBlank(e.serviceID))||(!a&&1==t.isGCApply&&String.isNullOrUndefineOrBlank(t.InventoryBundleCartDetails)&&(e.currentBalance=String.isNullOrUndefineOrBlank(e.ResetcurrentBalance)?e.currentBalance:e.ResetcurrentBalance,a=!0,i._cycleResetDone=!0),t.RemainingPrice>0&&e.currentBalance>0&&(_onlineCheckout.isValidForCheckoutInvoice()&&n==m&&t.paidType==_onlineCheckout.arrpaidType.OfflineDeposit&&(t.RemainingPrice=t.depositsPaid,t.RemainingTax=0),e.currentBalance>=t.RemainingPrice?(t.isGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=t.RemainingPrice,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemAmt=_onlineCheckout.parseTodecimal(t.redeemAmt+t.RemainingPrice,2),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-t.RemainingPrice,2),t.RemainingPrice=0,_onlineCheckout.PersistGCBalance(e.giftCertificateID,e.currentBalance)):t.RemainingPrice>e.currentBalance&&e.currentBalance>0&&(t.isGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=e.currentBalance,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemAmt=_onlineCheckout.parseTodecimal(t.redeemAmt+e.currentBalance,2),t.RemainingPrice=_onlineCheckout.parseTodecimal(t.RemainingPrice-e.currentBalance,2),e.currentBalance=0,_onlineCheckout.PersistGCBalance(e.giftCertificateID,0))),t.RemainingTax>0&&e.currentBalance>0&&(t.RemainingTax=_onlineCheckout.parseTodecimal(t.RemainingTax,2),e.currentBalance>=t.RemainingTax?(objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=t.RemainingTax,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemTax=_onlineCheckout.parseTodecimal(t.redeemTax+t.RemainingTax,2),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-t.RemainingTax,2),t.RemainingTax=0,_onlineCheckout.PersistGCBalance(e.giftCertificateID,e.currentBalance)):t.RemainingTax>e.currentBalance&&e.currentBalance>0&&(objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=e.currentBalance,objGC.giftCertificateNo=e.giftCertificateNo,t.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),t.redeemTax=_onlineCheckout.parseTodecimal(t.redeemTax+e.currentBalance,2),t.RemainingTax=_onlineCheckout.parseTodecimal(t.RemainingTax-e.currentBalance,2),e.currentBalance=0,_onlineCheckout.PersistGCBalance(e.giftCertificateID,0)))):void 0!==t.isPointApply&&0!=t.isPointApply||void 0!==t.isPackageApplied&&0!=t.isPackageApplied||void 0!==t.isMembershipApply&&0!=t.isMembershipApply||0!=t.isPaid||e.serviceID==t.serviceid&&e.serviceName.toLowerCase().trim()==t.servicename.toLowerCase().trim()&&e.quantity>0&&t.RemainingPrice>0&&(objGC={},objGC.GCId=e.giftCertificateID,objGC.giftCertificateNo=e.giftCertificateNo,objGC.serviceId=t.serviceid,objGC.redeemAmt=t.price,objGC.uniqID=t.AppSrNo,objGC.AppointmentID=t.appointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.srvcGC,onlineShoppingCart.RedeemedByGCtemp.push(objGC),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-t.price,2),e.quantity=e.quantity-1,t.redeemID=e.giftCertificateID,t.redeemAmt=t.price,t.GCDetail.push(objGC),t.isServiceBaseGC=!0,t.RemainingPrice=0,t.paidType=_onlineCheckout.arrpaidType.Paid,t.depositsPaid=0,null!=e.Taxes&&(t.RemainingTax=0))}),onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(t.ActualPrice+_onlineCheckout.parseTodecimal(t.ActualTax,3))-(t.redeemAmt+t.redeemTax),3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(t.ActualPrice+_onlineCheckout.parseTodecimal(t.ActualTax,3)),3),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax+t.ActualTax,2),onlineShoppingCart.Rtax=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax+t.ActualTax,3),onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt+t.redeemAmt+t.redeemTax,2))})}else e.grep(t,function(e){String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)&&(n==u?(e.Price=parseFloat(e.Price),e.ActualPrice=parseFloat(e.ActualPrice),e.ActualTax=parseFloat(e.calculatedTax)):n==d?(e.TotalPrice=parseFloat(e.TotalPrice),e.ServiceId>0?e.ActualPrice=parseFloat(e.TotalPrice):e.ActualPrice=parseFloat(e.Price),e.ActualTax=0):n==h?(e.TotalPrice=parseFloat(e.TotalPrice),e.ActualPrice=parseFloat(e.ActualPrice),e.ActualTax=parseFloat(e.calculatedTax)):n==c?(String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)||0!=e.InventoryMasterID||(e.Price=0,e.ActualPrice=0,e.calculatedTax=0),e.Price=parseFloat(e.Price),e.ActualPrice=parseFloat(1==e.IsPartialPoint?e.ActualPrice:e.Price),e.ActualTax=parseFloat(e.calculatedTax)):n==m?(_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(e.PromotionId)&&e.PromotionId>0?e.priceOriginal=parseFloat(e.price):e.priceOriginal=parseFloat(e.ServiceOrginalPrice),1==e.isPackageApplied||1==e.isPointApply?(e.ActualPrice=parseFloat(e.price),e.ActualTax=parseFloat(0)):(e.ActualPrice=parseFloat(e.price),e.ActualTax=parseFloat(e.calculatedTax)),e.Price=parseFloat(e.price),e.isServiceBaseGC=!1):n==g&&(e.Price=parseFloat(e.CalculatedFees),e.ActualPrice=parseFloat(e.CalculatedFees),e.ActualTax=parseFloat(e.CalculatedTax)),e.redeemAmt=0,e.redeemTax=0,onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3)),3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(e.ActualPrice+_onlineCheckout.parseTodecimal(e.ActualTax,3)),3),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax+e.ActualTax,2),onlineShoppingCart.Rtax=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax+e.ActualTax,3))})},_onlineCheckout.ApplyDailyDealONEvents=function(){if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){var t=onlineShoppingCart.Events,i=0,n=0,o=0,a=0,s=0,r=0;onlineShoppingCart.classdiscount=0,e.each(t,function(t,l){var c=e.grep(onlineShoppingCartmain.Events,function(e){return e.autoId==l.autoId});l.calssdiscountprice=0,l.addonCalssdiscountprice=0,l.classGCUsed=0,e.each(l.eventEnrollment,function(t,d){var u=e.grep(c[0].eventEnrollment,function(e){return e.autoID==d.autoID}),p=u[0].price;if(_onlineCheckout.isValidForCheckoutInvoice()&&(p=u[0].actualPrice),d.discount=0,(1!=d.isPointApply||d.IsPartialPoint)&&(d.isPointApply&&d.IsPartialPoint?d.IsPartialPoint&&1==_onlineCheckout.isValidForCheckoutInvoice()?void 0!==d.depositsPercentage&&!String.isNullOrUndefineOrBlank(d.depositsPercentage)&&d.depositsPercentage<100?d.price=p:p=d.price:d.IsPartialPoint&&"undefined"!=typeof onlineShoppingCartmain&&void 0!==onlineShoppingCartmain.DepositsPer&&onlineShoppingCartmain.DepositsPer<100?d.price=p:p=d.price:d.price=p,null!=d.gcId&&(d.gcId>0||d.gcId<0&&1==d.isPackage)&&(d.price=d.actualPrice),p>0&&(d.taxprice=_onlineCheckout.parseTodecimal(d.price*d.taxprice/p,2)),!_onlineCheckout.isValidForCheckoutInvoice()||0!=d.isPackage&&null!=d.isPackage||(d.discount=d.originalDiscount,d.price=p-d.discount,d.actualPrice=d.price,d.actualTaxprice=d.taxprice),(null==d.gcId||0==d.gcId||d.gcId>0&&0==d.isPackage)&&void 0!==d.PromotionID&&0!=d.PromotionID&&0==d.isPaid))if(void 0!==d.PromotionID&&0!=d.PromotionID){var h=getCookie("Referral");if(void 0===h||""==h||null==h||null==h)if(null==d.IsDailyDealApply||d.IsDailyDealApply)d.PromotionID=0;else if(d.price>0){var m=0;1==d.IsAmount?(m=d.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(m=parseFloat(ConvertTodecimalMorePrecious(parseFloat(m)/(1+l.tax/100),!0,4)))):m=_onlineCheckout.parseTodecimal(p*d.AmountValue/100,2),d.Originalprice<m&&(m=d.Originalprice),d.discount=m,d.price=p-m,d.taxprice=_onlineCheckout.parseTodecimal(d.price*l.tax/100,3),d.actualPrice=d.price,d.actualTaxprice=d.taxprice}else d.PromotionID=0;else if(d.price>0){m=0;1==d.IsAmount?(m=d.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(m=parseFloat(ConvertTodecimalMorePrecious(parseFloat(m)/(1+l.tax/100),!0,4)))):m=_onlineCheckout.parseTodecimal(p*d.AmountValue/100,2),d.Originalprice<m&&(m=d.Originalprice),d.discount=m,d.price=p-m,d.taxprice=_onlineCheckout.parseTodecimal(d.price*l.tax/100,3),d.actualPrice=d.price,d.actualTaxprice=d.taxprice}else d.PromotionID=0}else if(d.price>0){m=0;m=1==d.IsAmount?d.AmountValue:_onlineCheckout.parseTodecimal(p*d.AmountValue/100,2),d.Originalprice<m&&(m=d.Originalprice),d.discount=m,d.price=p-m,d.taxprice=_onlineCheckout.parseTodecimal(d.price*l.tax/100,3),d.actualPrice=d.price,d.actualTaxprice=d.taxprice}else d.PromotionID=0;onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+d.discount,2),l.calssdiscountprice=_onlineCheckout.parseTodecimal(l.calssdiscountprice+d.discount,2),d.isPointApply||d.IsPartialPoint||(d.BusinessTax=_onlineCheckout.ApplyMultipleTax(d.price,d)),i=_onlineCheckout.parseTodecimal(i+d.price,2),n=_shopdetail.CheckPriceWithTaxSwitch()&&_onlineCheckout.isValidForCheckoutInvoice()&&!isNullOrUndefineOrBlank(d.paidType)&&d.paidType===_onlineCheckout.arrpaidType.Deposits?_vgClassSessionSelection.ConvertTodecimal(i*l.tax/100,2,!0):_onlineCheckout.parseTodecimal(n+d.taxprice,2),d.gcId>0&&0==d.isPackage&&(o=_onlineCheckout.parseTodecimal(o+d.price,2),l.classGCUsed=_onlineCheckout.parseTodecimal(l.classGCUsed+d.price,2)),(d.gcId<0||d.gcId>0)&&1==d.isPackage&&(l.classGCUsed=_onlineCheckout.parseTodecimal(l.classGCUsed+d.price,2));var g=_onlineCheckout.ApplyDailyDealONEventsAddon(d.lstAddonService);a+=g.addonTotalPrice,s+=g.addonTotalTaxPrice,r+=g.addonTotalGCUsed,onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+g.addonDiscountprice,2)})});var l=parseFloat((i+a+n+s-(o+r+onlineShoppingCart.classPackageUsed)).toFixed(2));onlineShoppingCart.classTax=parseFloat((n+s).toFixed(2)),onlineShoppingCart.classGCUsed=o+r,onlineShoppingCart.classFinalTotal=l,onlineShoppingCart.classAddonGCUsed=r,onlineShoppingCart.classAddonTotalTaxPrice=s}},_onlineCheckout.PromotionAppliedOnPKGMS=function(t,i){var n=!0;if(void 0!==t.PerUserOne&&"1"==t.PerUserOne&&void 0!==t.PerTransactionOne&&"1"==t.PerTransactionOne){n=!1;var o={TotalPrice:"desc"},a=[];if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){var s=e.extend(!0,[],onlineShoppingCart.Packages);a=e.grep(s,function(e){return t.PromotionID==e.PromotionID}).keySort(o)}o={Price:"desc"};var r=[];if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0){var l=e.extend(!0,[],onlineShoppingCart.Memberships);r=e.grep(l,function(e){return t.PromotionID==e.PromotionID}).keySort(o)}i==_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg&&a.length>0&&a[0].autoId===t.autoId?(r.length>0&&a[0].TotalPrice>r[0].Price||0==r.length)&&(n=!0):i==_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS&&r.length>0&&r[0].autoId===t.autoId&&(a.length>0&&a[0].TotalPrice<r[0].Price||0==a.length)&&(n=!0)}return n},_onlineCheckout.ApplyDailyDealONPackages=function(){if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){var t=onlineShoppingCart.Packages;e.grep(t,function(t){if(0!=t.PromotionID){if(_onlineCheckout.PromotionAppliedOnPKGMS(t,_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg)){var i=t.NoOfVisit;t.SellPackageServiceID>0&&(i=1),_onlineCheckout.isValidForCheckoutInvoice()?t.TotalPrice=t.TotalPrice:t.TotalPrice=t.Price*i;var n=0;1==t.IsAmount?(n=t.AmountValue*i,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(n=parseFloat(ConvertTodecimalMorePrecious(parseFloat(n)/(1+t.Tax/100),!0,4)))):n=_onlineCheckout.parseTodecimal(t.TotalPrice*t.AmountValue/100,2),void 0!==t.PerUserOne&&"1"==t.PerUserOne&&(n/=i),t.TotalPrice-n<0&&(n=t.TotalPrice),t.discount=n,t.Price=_onlineCheckout.parseTodecimal(t.TotalPrice-n,2),t.ActualPrice=t.Price,t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+t.discount,2)}else t.PromotionID=0;0===t.Price&&0!=t.isGCApply&&(t.isGCApply=!1,e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+t.ServiceId+'"][data-autoid="'+t.autoId+'"]').find("#divPkgGCApply").html(""))}else if(t.IsInitialDiscount){i=t.NoOfVisit;t.SellPackageServiceID>0&&(i=1),_onlineCheckout.isValidForCheckoutInvoice()?t.TotalPrice=t.TotalPrice:t.TotalPrice=t.Price*i;var o=0;o=1==t.IsAmountForInitialDiscount?t.InitialDiscount*i:_onlineCheckout.parseTodecimal(t.TotalPrice*t.InitialDiscount/100,2),t.TotalPrice-o<0&&(o=t.TotalPrice),t.discount=o,t.Price=_onlineCheckout.parseTodecimal(t.TotalPrice-o,2),t.ActualPrice=t.Price,t.calculatedTax=_onlineCheckout.parseTodecimal(t.Price*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+t.discount,2)}})}},_onlineCheckout.ApplyDailyDealONMemberships=function(){if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0){var t=onlineShoppingCart.Memberships;e.grep(t,function(t){if(0!=t.PromotionID){if(_onlineCheckout.PromotionAppliedOnPKGMS(t,_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS)){var i=0;1==t.IsAmount?(i=t.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(i=parseFloat(ConvertTodecimalMorePrecious(parseFloat(i)/(1+t.Tax/100),!0,4)))):i=_onlineCheckout.parseTodecimal(t.Price*t.AmountValue/100,2),t.productDisc=i,t.Price=t.Price,i>t.Price?t.ActualPrice=0:t.ActualPrice=_onlineCheckout.parseTodecimal(t.Price-i,2),t.calculatedTax=_onlineCheckout.parseTodecimal(t.ActualPrice*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.ActualPrice,t),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+t.productDisc,2)}else t.PromotionID=0;0===t.ActualPrice&&0!=t.isGCApply&&(t.isGCApply=!1,e('#shoppingcartfirst [data-type="membership"][data-rid="'+t.MembershipId+'"]').find("#divMembershipGCApply").html(""))}else if(1==t.IsInitialDiscount){var n=0;n=1==t.IsAmountForInitialDiscount?t.InitialDiscount:_onlineCheckout.parseTodecimal(t.Price*t.InitialDiscount/100,2),t.productDisc=n,t.Price=t.Price,n>t.Price?t.ActualPrice=0:t.ActualPrice=_onlineCheckout.parseTodecimal(t.Price-n,2),t.calculatedTax=_onlineCheckout.parseTodecimal(t.ActualPrice*t.Tax/100,3),t.ActualTax=t.calculatedTax,t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.ActualPrice,t),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+t.productDisc,2)}})}},_onlineCheckout.ApplyDailyDealONGC=function(){if(null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0){var t=onlineShoppingCart.GiftCertificates;e.grep(t,function(e){var t=getCookie("Referral");if(void 0!==t&&""!=t&&null!=t&&null!=t||null!=e.IsDailyDealApply&&e.IsDailyDealApply&&(e.Price=e.TotalPrice,e.PromotionID=0),0!=e.PromotionID){var i=0;i=1==e.IsAmount?e.AmountValue:_onlineCheckout.parseTodecimal(e.TotalPrice*e.AmountValue/100,2),e.TotalPrice-i<0&&(i=e.TotalPrice),e.discount=i,e.Price=_onlineCheckout.parseTodecimal(e.TotalPrice-i,2),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.discount,2)}})}},_onlineCheckout.PromoBox=function(){if(e("#divCheckoutBookingPromoCode").hide(),"undefined"!=typeof onlineShoppingCartmain&&onlineShoppingCartmain.IsPromotionEnable){_onlineCheckout.ShoppingCartAmount()>0&&(_onlineCheckout.isValidForCheckoutInvoice()||e("#divCheckoutBookingPromoCode").show())}},_onlineCheckout.ShoppingCartAmount=function(){var t=0;return null!=onlineShoppingCartmain.Inventories&&onlineShoppingCartmain.Inventories.length>0&&e.grep(onlineShoppingCartmain.Inventories,function(e){t+=e.Price}),null!=onlineShoppingCartmain.Packages&&onlineShoppingCartmain.Packages.length>0&&e.grep(onlineShoppingCartmain.Packages,function(e){void 0!==e.SellPackageServiceID&&e.SellPackageServiceID>0?t+=e.Price:t+=e.Price*e.NoOfVisit}),null!=onlineShoppingCartmain.Memberships&&onlineShoppingCartmain.Memberships.length>0&&e.grep(onlineShoppingCartmain.Memberships,function(e){t+=e.Price}),null!=onlineShoppingCartmain.GiftCertificates&&onlineShoppingCartmain.GiftCertificates.length>0&&e.grep(onlineShoppingCartmain.GiftCertificates,function(e){t+=e.Price}),null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0&&"true"==isCCRequiredForOnlineClass.toLowerCase()&&e.grep(onlineShoppingCartmain.Events,function(i){e.grep(i.eventEnrollment,function(i){t+=i.actualPrice,!isNullOrUndefineOrBlank(i.lstAddonService)&&i.lstAddonService.length>0&&e.grep(i.lstAddonService,function(e){t+=e.actualPrice})})}),t},_onlineCheckout.isValidForCheckoutInvoice=function(){return"true"==_onlineCheckout.isFromInvoice.toString().toLowerCase()},_onlineCheckout.setTipOption=function(){if(ShowLoader(!0),businessID>0){var t={};t.businessID=businessID;var i=new vagaro.ajax;i.datamodel.Token=ApiURLEnumOnlineCheckout.getonlinecheckouttipsetting,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(t){var i=t;if(null!=i&&"undefined"!=i)if(""==i.TipOption)e(".divfinalCheckoutTip").hide();else{var n=e(".selectonlineTipCol"),o=i.TipOption.split(",");n.html(""),strTip="<ul>";"0"!=i.TipOption&&e.each(o,function(e,t){strTip+='<li role="link" aria-label="'+t+'%" onclick="_onlineCheckout.SetColorOnSignature(this);_onlineCheckout.setTipValueOnline('+t+');_onlineCheckout.showOtherTipOption(false,0);" > <div class=\'Custome-price-option\'><input type="button" title="'+t+'%" value="'+t+'%" aria-hidden="true" /></div> </li>'}),strTip+='<li role="link" aria-label="Other" id="liotherTipOpt" onclick="_onlineCheckout.SetColorOnSignature(this);_onlineCheckout.showOtherTipOption(true,0);" > <div class=\'Custome-price-option\'><input type="button" title="Other" value="Other" aria-hidden="true" /></div> </li>',strTip+="</ul>",n.append(strTip),e(".divfinalCheckoutTip").show(),e("#divfinalCheckoutTipAmount").html(""),e("#divfinalCheckoutTipAmount").html(currencysymbol+"0.00"),e(".otherTipCol").is(":visible")&&e("#liotherTipOpt").addClass("selected")}ShowLoader(!1)},i.datamodel.data=t,i.datamodel.Error=function(t){e(".divfinalCheckoutTip").hide(),ShowLoader(!1)},i.Post()}},_onlineCheckout.showOtherTipOption=function(t,i,n){void 0!==n&&null!=n&&(e(".tip-tab").removeClass("active"),e(n).addClass("active")),1==i?(e("#txtOnlineCustomerTip").val("0.00"),e(".tipBlock").show(),e("#txtOnlineCustomerTip").show(),e("#txtOnlineCustomerTip").select()):1==t?(e(".otherTipCol").show(),e("#divfinalCheckoutTipAmount").html(""),e("#divfinalCheckoutTipAmount").html(currencysymbol+"0.00"),e("#txtOnlineCustomerTip").select()):e(".otherTipCol").hide()},_onlineCheckout.setFocusinCustomTip=function(){(String.isNullOrUndefineOrBlank(e("#txtOnlineCustomerTip").val())||!String.isNullOrUndefineOrBlank(e("#txtOnlineCustomerTip").val())&&e("#txtOnlineCustomerTip").val()<=0)&&e("#txtOnlineCustomerTip").val("0.00"),e("#txtOnlineCustomerTip").select()},_onlineCheckout.validateCustomTipKeyPress=function(e,t){var i=void 0!==t.charCode&&null!=t.charCode?t.charCode:t.keyCode;if(0==i||8==i)return!0;var n=46==i;if(!n&&!(i>=48&&i<=57))return!1;var o=e.value||"",a="number"==typeof e.selectionStart?e.selectionStart:o.length,s="number"==typeof e.selectionEnd?e.selectionEnd:o.length,r=(o.substring(0,a)+String.fromCharCode(i)+o.substring(s)).replace(/^[^0-9.]*/,"");return!(n&&!/[1-9]/.test(r.split(".")[0]))},_onlineCheckout.enforceCustomTipMinimum=function(e){var t=e.value||"",i=t.replace(/^[^0-9.]*/,""),n=i.replace(/^0+(?=\d)/,""),o=parseFloat(n);o>0&&o<1&&(n="0.00"),n!==i&&(e.value=t.substring(0,t.length-i.length)+n)},_onlineCheckout.GetSumOfProdcutOrService=function(){var t=0;return _onlineCheckout.TotalPaidCount=0,e.each(onlineShoppingCart.ServiceInvoice,function(e,i){_onlineCheckout.TotalPaidCount+=1,!String.isNullOrUndefineOrBlank(i.isPointApply)&&1==i.isPointApply||i.isPackageApplied||i.isMembershipApply?t+=parseFloat(i.ServiceOrginalPrice):i.paidType==_onlineCheckout.arrpaidType.Deposits&&0==parseFloat(i.ActualPrice)?t+=parseFloat(i.ActualPrice):t+=parseFloat(i.ActualPrice)+parseFloat(i.deposit)}),(null==onlineShoppingCart.ServiceInvoice||null!=onlineShoppingCart.ServiceInvoice&&0==onlineShoppingCart.ServiceInvoice.length)&&(null==onlineShoppingCart.Events||null!=onlineShoppingCart.Events&&0==onlineShoppingCart.Events.length)&&e.each(onlineShoppingCart.Inventories,function(e,i){_onlineCheckout.TotalPaidCount+=1,t+=parseFloat(i.ActualPrice)}),e.each(onlineShoppingCart.Events,function(e,i){for(var n=i.eventEnrollment,o=0;o<=n.length-1;o++)_onlineCheckout.TotalPaidCount+=1,!String.isNullOrUndefineOrBlank(n[o].isPointApply)&&1==n[o].isPointApply||n[o].isPackage?t+=parseFloat(n[o].Originalprice):n[o].paidType==_onlineCheckout.arrpaidType.Deposits&&0==parseFloat(n[o].actualPrice)?t+=parseFloat(n[o].actualPrice):t+=parseFloat(n[o].actualPrice)+parseFloat(n[o].deposit)}),t<=0&&null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&e.each(onlineShoppingCart.Inventories,function(e,i){_onlineCheckout.TotalPaidCount+=1,t+=parseFloat(i.ActualPrice)}),t>0?t:0},_onlineCheckout.GetDiscountedPrice=function(e,t){return parseFloat(e*t/100).toFixed(2)},_onlineCheckout.setTipValueOnline=function(t,i){var n=0;t>0&&(e(".tip-tab").removeClass("active"),e(i).addClass("active")),n=onlineShoppingCartmain.IsFullDeposit&&"true"!=_onlineCheckout.isFromInvoice.toString().toLowerCase()?_onlineCheckout.GetTotalCartAmountforTip():_onlineCheckout.GetSumOfProdcutOrService();var o=0;-1==t?(o=e("#txtOnlineCustomerTip").val().replace(currencysymbol,""),e("#txtOnlineCustomerTip").val(o),n>0&&(onlineShoppingCart.tipPercent=_onlineCheckout.parseTodecimal(100*o/n,2))):("dollar"===tipType?(o=parseFloat(t).toFixed(2),n>0&&(onlineShoppingCart.tipPercent=_onlineCheckout.parseTodecimal(100*o/n,2))):(o=_onlineCheckout.GetDiscountedPrice(n,t),onlineShoppingCart.tipPercent=t),e("#txtOnlineCustomerTip").val("0.00")),onlineShoppingCart.tipValue=o,-1!=t&&e(".tipBlock").hide(),e("#divfinalCheckoutTipAmount").show(),e("#divfinalCheckoutTipAmount").html(""),e("#divfinalCheckoutTipAmount").html(currencysymbol+o);var a=null;null!=e("#lblGCRedeemAmt")[0]&&null!=e("#lblGCRedeemAmt")[0]&&(a=e("#lblGCRedeemAmt")[0].innerHTML.replace("$(","")),_onlineCheckout.displayFinalCalculatedPrice(),(0==e("#dvCheckoutBookingPaymentMethod").is(":visible")||0==e(_onlineCheckout.Controls.DvcheckoutBookingTabs).is(":visible"))&&parseFloat(onlineShoppingCart.tipValue)>0&&_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout"),null!=onlineShoppingCart.gcAmt&&null!=onlineShoppingCart.gcAmt&&(totalDueAmt=e("#divCartPrepaypricewithoutGC")[0].innerHTML.replace("$","")-onlineShoppingCart.gcAmt),_onlineCheckout.ConvertDecimalWithFixed(totalDueAmt,!0,2)>_onlineCheckout.ConvertDecimalWithFixed(_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MaximumAmount,!0,2)&&_onlineCheckout.ConvertDecimalWithFixed(totalDueAmt,!0,2)<_onlineCheckout.ConvertDecimalWithFixed(_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.MinimumAmount,!0,2)&&(e("#dvBookingPaymentMethod").hide(),e("#divVplTracking").hide()),_onlineCheckout.ValidateVPl(!0),e("#VplAmount").length>0&&e("#divCartPrepaypricewithoutGC").length>0&&(null!=e("#lblGCRedeemAmt")[0]&&null!=e("#lblGCRedeemAmt")[0]&&(a=a.replace(")","")),null!=a&&null!=a&&0!=a?(vplTipAmount=totalDueAmt,e("#VplAmount")[0].innerHTML=currencysymbol+_onlineCheckout.ConvertDecimalWithFixed(vplTipAmount,!0,2)):(vplTipAmount=e("#VplAmount")[0].innerHTML.replace(currencysymbol,""),e("#VplAmount")[0].innerHTML=e("#divfinalTotalPrice")[0].innerHTML),1==e("#tabVagaroPayLater").hasClass("w--current")&&vplTipAmount>0&&_vgVPLOnline.PaymentSchedule(vplTipAmount,_onlineCheckout.PaymentSchduleSuccess,_onlineCheckout.PaymentSchdulefail)),_onlineCheckout.IsVCFEnable()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.ApplyTip),_onlineCheckout.displayFinalCalculatedPrice())},_onlineCheckout.AddTip=function(t){e("#divfinalCheckoutTipAmount").show(),e(".divfinalCheckoutTipSuboption").show(),t&&onlineShoppingCartmain.IsFullDeposit&&_onlineCheckout.ShowHideTipOptions(!0)},_onlineCheckout.ShowHideTipOptions=function(t){t?_shopdetail.VisibleControlLength("#mobile-check")>0?e("#divCartTipSelectionMobile").show():e("#divCartTipSelection").show():_shopdetail.VisibleControlLength("#mobile-check")>0?e("#divCartTipSelectionMobile").hide():e("#divCartTipSelection").hide()},_onlineCheckout.RemoveTip=function(){onlineShoppingCart.tipValue=0,"true"!=_onlineCheckout.isFromInvoice.toString().toLowerCase()&&_onlineCheckout.ShowHideTipOptions(!1),e("#divfinalCheckoutTipAmount").html(""),e("#divfinalCheckoutTipAmount").html(currencysymbol+"0.00"),e("#divfinalCheckoutTipAmount").hide(),e("#txtOnlineCustomerTip").val("0.00"),_onlineCheckout.showOtherTipOption(!1),_onlineCheckout.displayFinalCalculatedPrice(),parseFloat(onlineShoppingCart.ccAmt)>0||1==_onlineCheckout.IsCCDetailEnable()&&onlineShoppingCart.classFinalTotal>0||parseFloat(onlineShoppingCart.tipValue)>0||1==_onlineCheckout.IsLoadCCIframForMemrship()?_onlineCheckout.CheckUserhasCreditcardOrNot("online-checkout"):(e("#dvCheckoutBookingPaymentMethod").hide(),e(_onlineCheckout.Controls.DvcheckoutBookingTabs).hide(),e("#divVplTracking").hide())},_onlineCheckout.SetColorOnSignature=function(t){e(".selectonlineTipCol").find(".selected").removeClass("selected"),e(t).addClass("selected")},_onlineCheckout.PayInvoice=function(){_onlineCheckout.GetOnlineInvoiceBusinessUserDetailsByInvoiceId(_onlineCheckout.InvoiceID)},_onlineCheckout.GetOnlineInvoiceBusinessUserDetailsByInvoiceId=function(t){if(ShowLoader(!0),businessID>0&&t>0){var i={};i.BusinessID=businessID,i.Id=0,i.CreatedBy=0,i.isFilterByInvoiceID=!0;var n=window.location.href.split("invoice/")[1];n.indexOf("?")>-1&&(n=n.split("?")[0]),i.EncInvoiceID=n;var o=new vagaro.ajax;o.datamodel.Token=ApiURLEnumOnlineCheckout.getonlineinvoicebusinessuserdetailsbyinvoiceid,o.datamodel.IsNewVagaroAPI=!0,o.datamodel.callback=function(e){var t=e;if(null!=t&&void 0!==t&&t.Status!==_onlineCheckout.invoiceStatus.Sent&&t.Status!==_onlineCheckout.invoiceStatus.Overdue)return ShowLoader(!1),void(window.location.href=sInvWarningLink.replace("||~||",t.Status));ShowLoader(!1),_onlineCheckout.ValidateCartData()},o.datamodel.data=i,o.datamodel.Error=function(e){ShowLoader(!1),_onlineCheckout.ValidateCartData()},o.Post()}else ShowLoader(!1),_onlineCheckout.ValidateCartData();setTimeout(function(){e("#divDatemonth").focus()},500)},_onlineCheckout.ShoppingCartItemIds=function(t,i,n){var o="";return null!=onlineShoppingCartmain.Inventories&&onlineShoppingCartmain.Inventories.length>0&&(1==i||3==i)&&e.grep(onlineShoppingCartmain.Inventories,function(e){o+=e.InventoryId+","}),null!=onlineShoppingCartmain.Packages&&onlineShoppingCartmain.Packages.length>0&&1==t&&e.grep(onlineShoppingCartmain.Packages,function(e){o+=e.ServiceId+","}),null!=onlineShoppingCartmain.Memberships&&onlineShoppingCartmain.Memberships.length>0&&1==t&&e.grep(onlineShoppingCartmain.Memberships,function(e){o+=e.MembershipId+","}),!(null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0)||"true"!=isCCRequiredForOnlineClass.toLowerCase()&&1!=n||1!=i&&2!=i||e.grep(onlineShoppingCartmain.Events,function(t){o+=t.eventID+",",e.grep(t.eventEnrollment,function(e){if(null!=e.lstAddonService&&null!=e.lstAddonService&&e.lstAddonService.length>0){var t=_onlineCheckout.GetAllAddonsWithSeparator(e.lstAddonService,",");o+=t.addonids+","}})}),o=o.substring(0,o.length-1)},_onlineCheckout.getUserGCDetail_ShowDiscount=function(t,i){if(String.isNullOrUndefineOrBlank(_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount)&&String.isNullOrUndefineOrBlank(_onlineCheckout.lstUserListForCheckout_ShowDiscount)&&String.isNullOrUndefineOrBlank(_onlineCheckout.lstMembershipForCheckout_ShowDiscount)&&String.isNullOrUndefineOrBlank(_onlineCheckout.IsPromotionEnable_ShowDiscount))if(null!=onlineShoppingCart){1==isCheckInApp&&(onlineShoppingCart.loginUserId=glbDataCheckIn.scanUserID);var n=!1;if("undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget()&&null!=typeof getQueryStringData){String.isNullOrUndefineOrBlank(e("#hdnLoginQueryString").val())||(QueryStringValue=e("#hdnLoginQueryString").val()),String.isNullOrUndefineOrBlank(QueryStringValue)&&(QueryStringValue=""!=window.QueryStringValue?window.QueryStringValue:window.document.URL);var o=getQueryStringData("Type"),a=getQueryStringData("wgVal");"Builder"==o&&null!=a&&""!=a&&(widgetcookievalue=a,n=!0)}if(void 0===onlineShoppingCart.loginUserId&&0==isCheckInApp)return 0==n&&showCommonLoginPopup(),!1;var s=e("<XMLDocument/>");s.append(_vgClassSessionSelection.createXmlElement("UsersDetail"));var r=_vgClassSessionSelection.createXmlElement("User");1==n&&void 0!==onlineShoppingCart.loginUserId||"undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget()&&void 0!==onlineShoppingCart.loginUserId?r.append(_vgClassSessionSelection.createXmlElement("userid",parseInt(onlineShoppingCart.loginUserId))):r.append(_vgClassSessionSelection.createXmlElement("userid",glbEncryptUserIdWithSafeURL)),r.append(_vgClassSessionSelection.createXmlElement("email","")),r.append(_vgClassSessionSelection.createXmlElement("isloginuser",!0)),r.append(_vgClassSessionSelection.createXmlElement("encryptuserid",glbEncryptUserIdWithSafeURL)),s.find("UsersDetail").append(r);for(var l=_vgClassSessionSelection.ManageEventTempAndRealData(!0,!1,!1),c=0;c<=l.length-1;c++){if(parseInt(onlineShoppingCart.loginUserId)!=parseInt(l[c].customerID))(r=_vgClassSessionSelection.createXmlElement("User")).append(_vgClassSessionSelection.createXmlElement("userid",parseInt(l[c].customerID))),r.append(_vgClassSessionSelection.createXmlElement("email",l[c].cUserEmail)),s.find("UsersDetail").append(r)}var d=e("<XMLDocument/>");if(null!=onlineShoppingCartmain.Inventories&&onlineShoppingCartmain.Inventories.length>0){d.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",3)).append(_vgClassSessionSelection.createXmlElement("ns"))));for(c=0;c<onlineShoppingCartmain.Inventories.length;c++){var u=_vgClassSessionSelection.createXmlElement("n",onlineShoppingCartmain.Inventories[c].ProductName,!0);d.find("ns").append(u)}}var p=e("<XMLDocument/>"),h=e("<XMLDocument/>");if(null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0){p.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",2)).append(_vgClassSessionSelection.createXmlElement("ns"))));for(c=0;c<onlineShoppingCartmain.Events.length;c++){var m=_vgClassSessionSelection.createXmlElement("n",onlineShoppingCartmain.Events[c].eventName.trim());p.find("ns").append(m)}var g=!0;for(c=0;c<onlineShoppingCartmain.Events.length;c++)e.each(onlineShoppingCartmain.Events[c].eventEnrollment,function(t,i){null!=i.lstAddonService&&null!=i.lstAddonService&&i.lstAddonService.length>0&&(g&&h.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",8)).append(_vgClassSessionSelection.createXmlElement("ns")))),e.each(i.lstAddonService,function(e,t){g&&(g=!1);var i=_vgClassSessionSelection.createXmlElement("n",t.ServiceTitle.trim());h.find("ns").append(i)}))})}d.find("itms").length>0?(p.find("itms").length>0&&d.find("itms").append(p.find("itms").html()),h.find("itms").length>0&&d.find("itms").append(h.find("itms").html())):p.find("itms").length>0?(d=p,h.find("itms").length>0&&d.find("itms").append(h.find("itms").html())):h.find("itms").length>0&&(d=h);var v={};v.userData=s.html(),v.businessID=onlineShoppingCart.BusinessID,v.productList=d.html(),v.isGetDepositsConfig=!1,"undefined"==typeof PromotionID||String.isNullOrUndefineOrBlank(PromotionID)?v.promotionID=0:v.promotionID=parseInt(PromotionID),v.isWebsiteBuilder=void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication||"undefined"!=typeof vgAppicationType&&1==vgAppicationType;var f=new vagaro.ajax;f.datamodel.async=!1,f.datamodel.Token=ApiURLEnumOnlineCheckout.getgcpackageandpointforonlinecheckout,f.datamodel.IsNewVagaroAPI=!0,f.datamodel.callback=function(n){dailyDealFeeValue=n.depositsClassConfigForCheckout.DailyDealFee,dailyDealFeeValue_ExistingUser=n.depositsClassConfigForCheckout.DailyDealVagaroFee_ExistingUser;var o=n.depositsClassConfigForCheckout;dailyDealFeeType=null!=o.IsClsDailyDealVagaroFeeType?o.IsClsDailyDealVagaroFeeType:null!=o.IsDailyDealVagaroFeeType?o.IsDailyDealVagaroFeeType:null!=o.DailyDealVagaroFeeType&&o.DailyDealVagaroFeeType,IsForVeraNewCustomer=n.depositsClassConfigForCheckout.IsForVeraNewCustomer,IsFMBEnableForBusiness=n.IsFMBEnableForBusiness,onlineShoppingCartmain.UsersPoints=n.lstUserListForCheckout,onlineShoppingCartmain.IsPromotionEnable=n.IsPromotionEnable,onlineShoppingCart.IsPromotionEnable=n.IsPromotionEnable,onlineShoppingCart.IsDailyDealEnable=n.depositsClassConfigForCheckout.IsDailyDealEnable,onlineShoppingCartmain.IsDailyDealEnable=n.depositsClassConfigForCheckout.IsDailyDealEnable;var a=_onlineCheckout.IsAnyDailyDealInCart();a?(n.lstUserListForCheckout?.forEach(e=>{e.pointsBalance=0}),_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount=e.grep(e.extend(!0,[],n.lstGcAndPackagesForCheckout)||[],function(e){return e&&1==e.isPackage}),_onlineCheckout.lstUserListForCheckout_ShowDiscount=e.extend(!0,[],n.lstUserListForCheckout),_onlineCheckout.lstMembershipForCheckout_ShowDiscount=e.extend(!0,[],n.lstMembershipForCheckout)):(_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount=e.extend(!0,[],n.lstGcAndPackagesForCheckout),_onlineCheckout.lstUserListForCheckout_ShowDiscount=e.extend(!0,[],n.lstUserListForCheckout),_onlineCheckout.lstMembershipForCheckout_ShowDiscount=e.extend(!0,[],n.lstMembershipForCheckout)),_onlineCheckout.IsPromotionEnable_ShowDiscount=n.IsPromotionEnable,_onlineCheckout.VPLUserBankDetails=n.lstVPLUserAccount,_onlineCheckout.ApplyDiscounts_ShowDiscount(a?_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount:n.lstGcAndPackagesForCheckout,a?_onlineCheckout.lstUserListForCheckout_ShowDiscount:n.lstUserListForCheckout,a?_onlineCheckout.lstMembershipForCheckout_ShowDiscount:n.lstMembershipForCheckout,n.IsPromotionEnable,i),_onlineCheckout.ValidateOnePerUserDeal(1),_onlineCheckout.ReApplyDiscounts_ShowDiscount(),_onlineCheckout.CalculateSubtotal_ShowDiscount(t),_onlineCheckout.IsSelectGCEmployeeForWidget(),_onlineCheckout.IsMemPackageUpSell=n.depositsClassConfigForCheckout.IsMemPackageUpSell},f.datamodel.data=v,f.datamodel.Error=function(e){},f.Post()}else ShowLoader(!1),vagaro.alert("Some error occured. Please try again.");else null!=onlineShoppingCart?(onlineShoppingCart.IsPromotionEnable=_onlineCheckout.IsPromotionEnable_ShowDiscount,_onlineCheckout.GcAndPackagesForCheckout_ShowDiscount=e.extend(!0,[],_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount),_onlineCheckout.UserListForCheckout_ShowDiscount=e.extend(!0,[],_onlineCheckout.lstUserListForCheckout_ShowDiscount),_onlineCheckout.MembershipForCheckout_ShowDiscount=e.extend(!0,[],_onlineCheckout.lstMembershipForCheckout_ShowDiscount),_onlineCheckout.IsPromotionEnable_ShowDiscount=_onlineCheckout.IsPromotionEnable_ShowDiscount,_onlineCheckout.ApplyDiscounts_ShowDiscount(_onlineCheckout.GcAndPackagesForCheckout_ShowDiscount,_onlineCheckout.UserListForCheckout_ShowDiscount,_onlineCheckout.MembershipForCheckout_ShowDiscount,_onlineCheckout.IsPromotionEnable_ShowDiscount,i),_onlineCheckout.ValidateOnePerUserDeal(1),_onlineCheckout.ReApplyDiscounts_ShowDiscount(),_onlineCheckout.CalculateSubtotal_ShowDiscount(t)):(ShowLoader(!1),vagaro.alert("Some error occured. Please try again."))},_onlineCheckout.CalculateSubtotal_ShowDiscount=function(t){if(!_onlineCheckout.isValidForCheckoutInvoice()&&1==t){e.each(onlineShoppingCart.Events,function(t,i){if(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing){var n=0,o=0;e.each(i.eventEnrollment,function(t,i){if(void 0!==i.isPackage&&null!=i.isPackage&&1==i.isPackage)n=n+i.price+i.taxprice;else if(void 0!==i.isPriceBaseGCApply&&null!=i.isPriceBaseGCApply&&0==i.isPriceBaseGCApply&&void 0!==i.gcId&&null!=i.gcId&&i.gcId>0)n+=i.price;else if(void 0!==i.isPriceBaseGCApply&&null!=i.isPriceBaseGCApply&&1==i.isPriceBaseGCApply)n=n+i.Originalprice+i.Originaltaxprice,o=o+i.price+i.taxprice-(i.redeemAmt+i.redeemTax);else if(n=n+i.Originalprice+i.Originaltaxprice,null!=i.PromotionID&&null!=i.PromotionID&&i.PromotionID>0){var a=getCookie("Referral");(void 0===a||""==a||null==a||null==a)&&(null==i.IsDailyDealApply||i.IsDailyDealApply)?(o=n,i.PromotionID=0,e.each(onlineShoppingCartmain.Events,function(t,n){e.each(n.eventEnrollment,function(e,t){t.eventID==i.eventID&&(t.PromotionID=0)})})):o=o+i.price+i.taxprice}else o=o+i.price+i.taxprice;if(null!=i.lstAddonService&&null!=i.lstAddonService&&i.lstAddonService.length>0)for(t=0;t<i.lstAddonService.length;t++)i.lstAddonService[t].IsIncludeTaxInOnlinePricing=!0,i.lstAddonService[t].displayroundedPriceWithTax=i.lstAddonService[t].Originalprice+i.lstAddonService[t].Originaltaxprice,i.lstAddonService[t].roundedPriceWithTax=i.lstAddonService[t].Price+i.lstAddonService[t].taxprice}),i.IsIncludeTaxInOnlinePricing=!0,i.displayroundedPriceWithTax=n,i.roundedPriceWithTax=o}}),String.isNullOrUndefineOrBlank(onlineShoppingCartmain.Events)||e("#NewEvenetCartDetail123").tmpl(onlineShoppingCart.Events).appendTo("#newCartSummaryDectail123");var i=parseFloat(Math.round(0)/100),n=parseInt(0);e.each(onlineShoppingCart.Inventories,function(t,o){if(String.isNullOrUndefineOrBlank(o.InventoryBundleCartDetails)){var a=0;if(void 0!==o.isPointApply&&0==o.isPointApply){var s=0;if(void 0!==o.isGCApply&&1==o.isGCApply&&o.GCDetail.length>0&&e.each(onlineShoppingCart.Inventories[t].GCDetail,function(e,t){s+=parseFloat(t.GCAmount)}),o.OriginalPrice==o.Price)0==o.MasterInventoryId&&(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(s>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax):""),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.PriceWithTax-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax-s)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(s>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax):"")+", new price is "+(_onlineCheckout.decimalFormate(o.PriceWithTax-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax-s))).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(s>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice):""),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.OriginalPrice-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice-s)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(s>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice):"")+", new price is "+(_onlineCheckout.decimalFormate(o.OriginalPrice-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice-s))).attr("aria-live","polite").attr("role","contentinfo"))),a+=parseFloat(o.OriginalPrice-s);else{if(0==o.MasterInventoryId)if(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing){var r=o.ActualPrice+o.ActualTax-s;e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.PriceWithTax-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,r)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old Price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)+", new Price is "+(_onlineCheckout.decimalFormate(o.PriceWithTax-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,r))).attr("aria-live","polite").attr("role","contentinfo")}else e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.Price-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price-s)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old Price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice)+", new Price is "+(_onlineCheckout.decimalFormate(o.Price-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price-s))).attr("aria-live","polite").attr("role","contentinfo");a+=parseFloat(o.Price-s)}}else void 0!==o.isPointApply&&1==o.isPointApply?(0==o.MasterInventoryId&&(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html("Free"),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)+", new price is Free").attr("aria-live","polite").attr("role","contentinfo")):o.IsPartialPoint?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.ActualPrice)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice)+", new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.ActualPrice)).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html("Free"),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.OriginalPrice)+", new price is Free").attr("aria-live","polite").attr("role","contentinfo"))),o.IsPartialPoint?a+=parseFloat(o.ActualPrice):a+=parseFloat(0)):(0==o.MasterInventoryId&&(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)).attr("aria-live","polite").attr("role","contentinfo"))),a+=parseFloat(o.Price));0==o.MasterInventoryId&&(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProductPromoPointGcApply").html(""),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProdcutMembershipApply").html(""),void 0!==o.isPresetApply&&1==o.isPresetApply&&e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProductPromoPointGcApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Promo Code Applied</span></div></div>'),void 0!==o.isGCApply&&1==o.isGCApply?e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProductPromoPointGcApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Gift Card Applied</span></div></div>'):void 0!==o.isPointApply&&1==o.isPointApply&&("undefined"!=_onlineCheckout.IsPartialPointAllowed&&1==_onlineCheckout.IsPartialPointAllowed?e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProductPromoPointGcApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Points Applied ('+o.pointsRedeem+")</span></div></div>"):e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProductPromoPointGcApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Points Applied</span></div></div>')),void 0!==o.isMembershipApply&&1==o.isMembershipApply&&e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProdcutMembershipApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Membership Applied ('+o.membershipName+")</span></div></div>"),void 0!==o.isPackageApplied&&1==o.isPackageApplied&&e('#shoppingcartfirst [data-type="inventory"][data-rid="'+o.InventoryId+'"]').find("#divProdcutMembershipApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Package Applied ('+o.membershipName+")</span></div></div>")),(isNaN(a)||a<0)&&(a=0),1==onlineShoppingCart.IsIncludeTaxInOnlinePricing&&(a=o.OriginalPrice==o.Price?o.OriginalPrice+o.calculatedTax-s:o.ActualPrice+o.ActualTax-s),i+=a,0==o.MasterInventoryId&&(n+=1)}else n+=1}),e.each(onlineShoppingCart.Inventories,function(t,i){if(!String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)){i.bPrice=0,i.bOriginalPrice=0,i.bgcAmount=0,i.isPresetApply=!1,i.isGCApply=!1,i.isMembershipApply=!1,i.isPointApply=!1,i.isPointApplyPartial=!1,i.membershipName="",i.packageName="",i.bPriceWithTax=0,i.bPriceWithDiscount=0;var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==i.InventoryId}),o=0,a=[],s=[],r=!1,l=!1;if(e.each(n,function(t,c){if(void 0!==c.isPointApply&&0==c.isPointApply){var d=0;void 0!==c.isGCApply&&1==c.isGCApply&&c.GCDetail.length>0&&e.each(n[t].GCDetail,function(e,t){d+=parseFloat(t.GCAmount)}),i.bOriginalPrice+=c.OriginalPrice,i.bPrice+=c.Price,i.bgcAmount+=d,i.bPriceWithTax+=c.PriceWithTax,i.bPriceWithDiscount+=c.ActualPrice+c.ActualTax-d}else o+=1;i.isPresetApply=1==i.isPresetApply||c.isPresetApply,i.isGCApply=1==i.isGCApply||c.isGCApply,i.isMembershipApply=1!=c.isPackageApplied&&(1==i.isMembershipApply||c.isMembershipApply),i.isPackageApplied=1==i.isPackageApplied||c.isPackageApplied,c.isPackageApplied&&(r=!0),c.isMembershipApply&&(l=!0),c.isMembershipApply&&-1==a.indexOf(c.membershipName)&&a.push(c.membershipName),c.isPackageApplied&&-1==s.indexOf(c.membershipName)&&s.push(c.membershipName)}),r&&null!=s&&s.length>0){var c=s.join();i.packageName=c}if(l&&null!=a&&a.length>0){var d=a.join();i.membershipName=d}n.length==o?i.isPointApply=!0:o>0&&(i.isPointApplyPartial=!0);void 0!==i.isPointApply&&0==i.isPointApply?i.bOriginalPrice==i.bPrice?1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(i.bgcAmount>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax):""),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(i.bOriginalPrice-i.bgcAmount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax-i.bgcAmount)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(i.bgcAmount>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax):"")+", new price is "+(_onlineCheckout.decimalFormate(i.bPriceWithTax-i.bgcAmount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax-i.bgcAmount))).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(i.bgcAmount>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bOriginalPrice):""),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(i.bOriginalPrice-i.bgcAmount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bOriginalPrice-i.bgcAmount)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(i.bgcAmount>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bOriginalPrice):"")+", new price is "+(_onlineCheckout.decimalFormate(i.bOriginalPrice-i.bgcAmount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bOriginalPrice-i.bgcAmount))).attr("aria-live","polite").attr("role","contentinfo")):1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(i.bPriceWithDiscount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithDiscount)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax)+", new price is "+(_onlineCheckout.decimalFormate(i.bPriceWithDiscount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithDiscount))).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bOriginalPrice)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(i.bPrice-i.bgcAmount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPrice-i.bgcAmount)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bOriginalPrice)+", new price is "+(_onlineCheckout.decimalFormate(i.bPrice-i.bgcAmount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPrice-i.bgcAmount))).attr("aria-live","polite").attr("role","contentinfo")):void 0!==i.isPointApply&&1==i.isPointApply?(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html("Free"),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax)+", new price is Free").attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.OriginalPrice)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html("Free"),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.OriginalPrice)+", new price is Free").attr("aria-live","polite").attr("role","contentinfo")),parseFloat(0)):1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPriceWithTax)).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPrice)),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,i.bPrice)).attr("aria-live","polite").attr("role","contentinfo")),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find("#divProductPromoPointGcApply").html(""),e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find("#divProdcutMembershipApply").html(""),void 0!==i.isPresetApply&&1==i.isPresetApply&&e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find("#divProductPromoPointGcApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Promo Code Applied</span></div></div>'),void 0!==i.isGCApply&&1==i.isGCApply?e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find("#divProductPromoPointGcApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Gift Card Applied</span></div></div>'):(void 0!==i.isPointApply&&1==i.isPointApply||void 0!==i.isPointApplyPartial&&1==i.isPointApplyPartial)&&e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find("#divProductPromoPointGcApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Points Applied</span></div></div>'),void 0!==i.isMembershipApply&&1==i.isMembershipApply&&e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find("#divProdcutMembershipApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Membership Applied ('+i.membershipName.replace(/^,|,$/g,"")+")</span></div></div>"),void 0!==i.isPackageApplied&&1==i.isPackageApplied&&e('#shoppingcartfirst [data-type="inventory"][data-rid="'+i.InventoryId+'"]').find("#divProdcutPackageApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Package Applied ('+i.packageName.replace(/^,|,$/g,"")+")</span></div></div>")}}),e.each(onlineShoppingCart.Packages,function(t,o){var a=e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"]').find("#txtItemsQuantity").val();4==o.eventType&&(e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"]').find("#txtItemsQuantity").attr("disabled","disabled"),a=1);var s=0,r=0;if(void 0!==o.isGCApply&&1==o.isGCApply&&o.GCDetail.length>0&&e.each(onlineShoppingCart.Packages[t].GCDetail,function(e,t){r+=parseFloat(t.GCAmount)}),o.ActualPrice==o.TotalPrice)1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .item-price-line-through").html(r>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax*a):""),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.ActualPrice-r)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax*a-r)),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(r>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax*a):"")+", new price is "+(_onlineCheckout.decimalFormate(o.PriceWithTax*a-r)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax*a-r))).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .item-price-line-through").html(r>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice):""),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.ActualPrice-r)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.ActualPrice-r)),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(r>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice):"")+", new price is "+(_onlineCheckout.decimalFormate(o.ActualPrice-r)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.ActualPrice-r))).attr("aria-live","polite").attr("role","contentinfo")),s+=parseFloat(o.ActualPrice-r);else{if(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing){var l=o.ActualPrice+o.ActualTax-r;e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax*a)),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.PriceWithTax*a-r-o.discount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,l)),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax*a)+", new price is "+(_onlineCheckout.decimalFormate(o.PriceWithTax*a-r-o.discount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,l))).attr("aria-live","polite").attr("role","contentinfo")}else e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.decimalFormate(o.TotalPrice-r-o.discount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice-r-o.discount)),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)+", new price is "+(_onlineCheckout.decimalFormate(o.TotalPrice-r-o.discount)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice-r-o.discount))).attr("aria-live","polite").attr("role","contentinfo");s+=parseFloat(o.TotalPrice-r-o.discount)}if(void 0!==o.isPresetApply&&o.PromotionID>0){var c="";if(void 0!==o.PromotionTitle&&null!=o.PromotionTitle&&(c=o.PromotionTitle.length>0?"("+o.PromotionTitle+")":""),e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find("#divPkgDDApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Daily Deal Applied '+c+"</span></div></div>"),o.BillingCycle>0)u="<br/>"+(-1==o.BillingCycle?"For unlimited payments ":"After the first "+(o.BillingCycle>1?o.BillingCycle+" payments":"payment"))+", this package price will return to "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)+".",(d=3==o.ChargeFrequency?e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find("#showPackageVisitCompletedMessage"):e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find("#showPackageMessage")).length>0&&d.find(".clsPkgInitialDis").html(u)}else if(o.IsInitialDiscount&&o.BillingCycle>0){var d,u="<br/>"+(-1==o.BillingCycle?"For unlimited payments ":"After the first "+(o.BillingCycle>1?o.BillingCycle+" payments":"payment"))+", this package price will return to "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)+".";(d=3==o.ChargeFrequency?e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find("#showPackageVisitCompletedMessage"):e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find("#showPackageMessage")).length>0&&d.find(".clsPkgInitialDis").html(u)}void 0!==o.isPresetApply&&1==o.isPresetApply&&e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find("#divPkgPromoApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Promo Code Applied</span></div></div>'),void 0!==o.isGCApply&&1==o.isGCApply&&e('#shoppingcartfirst [data-type="servicepackage"][data-rid="'+o.ServiceId+'"][data-autoid="'+o.autoId+'"]').find("#divPkgGCApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Gift Card Applied</span></div></div>'),(isNaN(s)||s<0)&&(s=0),1==onlineShoppingCart.IsIncludeTaxInOnlinePricing&&(s=o.ActualPrice==o.TotalPrice?o.PriceWithTax*a-r:o.ActualPrice+o.ActualTax-r),i+=s,1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?i+=o.TotalAddonServicePrice+parseFloat(void 0===o.TotalAddonServiceTax?0:o.TotalAddonServiceTax):i+=o.TotalAddonServicePrice,n+=1,_onlineCheckout.IsRecurringPkg=o.IsRecurring,_onlineCheckout.IsRecurringPkg&&(_onlineCheckout.IsRecurringPkgCount=1)}),e.each(onlineShoppingCart.GiftCertificates,function(t,o){var a=0;if(o.ServiceId>0)a+=parseFloat(o.TotalPrice),1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)).parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)).attr("aria-live","polite").attr("role","contentinfo"):e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)).parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)).attr("aria-live","polite").attr("role","contentinfo");else{var s=getCookie("Referral");void 0!==s&&""!=s&&null!=s&&null!=s||null!=o.IsDailyDealApply&&o.IsDailyDealApply&&(o.Price=o.TotalPrice,o.PromotionID=0),a+=parseFloat(o.Price),o.Price==o.TotalPrice?1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)).parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)).attr("aria-live","polite").attr("role","contentinfo"):e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)).parent().closest("div").attr("aria-label","new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)).attr("aria-live","polite").attr("role","contentinfo"):(e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)),e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find(".div-block-59 .product-name").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)).parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.TotalPrice)+", new price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)).attr("aria-live","polite").attr("role","contentinfo"));if(o.PromotionID>0){var r="";void 0!==o.PromotionTitle&&null!=o.PromotionTitle&&(r=o.PromotionTitle.length>0?"("+o.PromotionTitle+")":""),e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find("#divGCDDApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Daily Deal Applied '+r+"</span></div></div>")}"0"!=o.Price&&"0.00"!=o.Price||e('#shoppingcartfirst [data-type="gc"][data-rid="'+o.GiftCertificatePhotoID+'"][data-autoid="'+o.autoId+'"]').find("#MYDropDown").css("display","none")}(isNaN(a)||a<0)&&(a=0),1==onlineShoppingCart.IsIncludeTaxInOnlinePricing&&(a=o.PriceWithTax),i+=a,n+=1}),e.each(onlineShoppingCart.Memberships,function(t,o){var a=0,s=0;if(void 0!==o.isGCApply&&1==o.isGCApply&&o.GCDetail.length>0&&e.each(onlineShoppingCart.Memberships[t].GCDetail,function(e,t){s+=parseFloat(t.GCAmount)}),o.ActualPrice==o.Price)1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?(e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .item-price-line-through").html(s>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]:""),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").html((_onlineCheckout.decimalFormate(o.ActualPrice-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax-s))+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(s>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]:"")+", new price is "+(_onlineCheckout.decimalFormate(o.PriceWithTax-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax-s))+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]).attr("aria-live","polite").attr("role","contentinfo")):(e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .item-price-line-through").html(s>0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]:""),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").html((_onlineCheckout.decimalFormate(o.ActualPrice-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.ActualPrice-s))+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label",(s>0?"old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]:"")+", new price is "+(_onlineCheckout.decimalFormate(o.ActualPrice-s)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.ActualPrice-s))+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]).attr("aria-live","polite").attr("role","contentinfo")),a+=parseFloat(o.ActualPrice-s);else{if(1==onlineShoppingCart.IsIncludeTaxInOnlinePricing){var r=o.ActualPrice+o.ActualTax-s;e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").html((_onlineCheckout.decimalFormate(o.Price-s-o.productDisc)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,r))+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.PriceWithTax)+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]+", new price is "+(_onlineCheckout.decimalFormate(o.PriceWithTax-s-o.productDisc)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,r))+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]).attr("aria-live","polite").attr("role","contentinfo")}else e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .item-price-line-through").html(_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").html((_onlineCheckout.decimalFormate(o.Price-s-o.productDisc)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price-s-o.productDisc))+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").parent().closest("div").attr("aria-label","old price is "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]+", new price is "+(_onlineCheckout.decimalFormate(o.Price-s-o.productDisc)<0?_onlineCheckout.DisplayAmountOnCart(currencysymbol,0):_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price-s-o.productDisc))+" per "+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]).attr("aria-live","polite").attr("role","contentinfo");a+=parseFloat(o.Price-s-o.productDisc)}if(void 0!==o.isPresetApply&&o.PromotionID>0){var l="";if(void 0!==o.PromotionTitle&&null!=o.PromotionTitle&&(l=o.PromotionTitle.length>0?"("+o.PromotionTitle+")":""),e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find("#divMembershipDDApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Daily Deal Applied '+l+"</span></div></div>"),o.BillingCycle>0){var c=(-1==o.BillingCycle?"For unlimited payments ":"After the first "+(o.BillingCycle>1?o.BillingCycle+" payments":"payment"))+", this membership price will return to "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]+".";e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find("#divMembershipInitialDiscountApply").html(c)}}else if(o.IsInitialDiscount&&o.BillingCycle>0){c=(-1==o.BillingCycle?"For unlimited payments ":"After the first "+(o.BillingCycle>1?o.BillingCycle+" payments":"payment"))+", this membership price will return to "+_onlineCheckout.DisplayAmountOnCart(currencysymbol,o.Price)+"/"+e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find(".div-block-59 .product-name").text().split("/")[1]+".";e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find("#divMembershipInitialDiscountApply").html(c)}void 0!==o.isPresetApply&&1==o.isPresetApply&&e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find("#divMembershipPromoApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Promo Code Applied</span></div></div>'),void 0!==o.isGCApply&&1==o.isGCApply&&e('#shoppingcartfirst [data-type="membership"][data-rid="'+o.MembershipId+'"]').find("#divMembershipGCApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part thm-textColor badge-button-positive"><div class="sign-icon" aria-hidden="true"></div><span class="green-text">Gift Card Applied</span></div></div>'),(isNaN(a)||a<0)&&(a=0),1==onlineShoppingCart.IsIncludeTaxInOnlinePricing&&(a=o.ActualPrice==o.Price?o.PriceWithTax-s:o.ActualPrice+o.ActualTax-s),i+=a,n+=1,_onlineCheckout.IsRecurringMembership=o.IsRecurring,_onlineCheckout.IsRecurringMembership&&(_onlineCheckout.IsRecurringMembershipCount=1)}),e.each(onlineShoppingCart.Events,function(e,t){var o=0;o=parseFloat(t.displayroundedPrice-t.calssdiscountprice-t.classGCUsed)>0?parseFloat(t.displayroundedPrice-t.calssdiscountprice-t.classGCUsed):0,(isNaN(o)||o<0)&&(o=0),1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?i+=o>0?t.roundedPriceWithTax:o:i+=o,i+=_onlineCheckout.CalculateAddonTotal(t.eventEnrollment),n+=1});var o="";o=1==parseInt(n)?"Subtotal ("+n.toString()+" item)":"Subtotal ("+n.toString()+" items)",1==_onlineCheckout.IsRecurringMembershipCount&&(_onlineCheckout.IsRecurringMembership=!0),1==_onlineCheckout.IsRecurringPkgCount&&(_onlineCheckout.IsRecurringPkg=!0),e("#cartsubtotal .cartsubtotaltitle").text(o),e("#cartsubtotal .cartsubtotal").text(_onlineCheckout.DisplayAmountOnCart(currencysymbol,_onlineCheckout.decimalFormate(i))),_onlineCheckout.VPLmessagedeposit(i),e("#vpltotalmessage").show()}},_onlineCheckout.ApplyMembershipONEvents_ShowDiscount=function(t,i){var n=e.grep(i,function(e){return 2==e.ItemType}),o=0,a=0,s=0,r=0,l=0;if(null!=n&&n.length>0){onlineShoppingCart.classdiscount=0,e.each(t,function(t,c){c.classGCUsed=0,e.each(c.eventEnrollment,function(t,i){void 0===i.IsOutsideBilling&&(i.IsOutsideBilling=!1),void 0===i.IsWaivedApply&&(i.IsWaivedApply=!1);var r=e.grep(n,function(e){return i.customerID>0&&e.UserID>0&&(i.customerID==e.UserID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,i.customerID))||i.customerID<=0&&e.UserID>0&&i.cUserEmail==e.EmailId});e.each(r,function(t,n){if(n.ServiceProductName.toLowerCase().trim()==c.eventName.toLowerCase().trim()&&null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))>new Date(moment(n.strValidUpto).format("YYYY/MM/DD"))&&null!=n.strAdvanceLimitDate&&""!=n.strAdvanceLimitDate&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strAdvanceLimitDate).format("YYYY/MM/DD"))&&0==i.IsOutsideBilling&&0==i.IsWaivedApply&&(i.strAdvanceLimitDate=n.strAdvanceLimitDate,i.IsWaivedApply=!0,i.AppliedName=n.MembershipName),1==i.isMembershipRemove&&n.ServiceProductName.toLowerCase().trim()==c.eventName.toLowerCase().trim()&&n.Discount>0&&(i.customerID>0&&n.UserID>0&&(i.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,i.customerID))||i.customerID<=0&&n.UserID>0&&i.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)){n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining>0?n.VisitRemaining-1:n.VisitRemaining;var o=e.grep(r,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});e.each(o,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)});return 1==i.isPointApply||!(null==i.gcId||0==i.gcId||i.gcId>0&&0==i.isPackage)||0==i.PromotionID&&1!=i.isPresetApply||(i.discount,i.price=i.Originalprice-i.discount,i.taxprice=_onlineCheckout.parseTodecimal(i.price*c.tax/100,3),i.actualPrice=i.price,i.actualTaxprice=i.taxprice),!1}if(i.price>0&&1!=i.isPointApply&&1!=i.isPackage&&(null==i.gcId||0==i.gcId)&&n.ServiceProductName.toLowerCase().trim()==c.eventName.toLowerCase().trim()&&n.Discount>0&&(i.customerID>0&&n.UserID>0&&(i.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,i.customerID))||i.customerID<=0&&n.UserID>0&&i.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)&&(!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&(0!=i.PromotionID&&1==n.isPromotionalDiscount||0==i.PromotionID||void 0===i.PromotionID)&&(null==n.strValidUpto||""==n.strValidUpto||null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strValidUpto).format("YYYY/MM/DD")))){var a=parseFloat(i.Originalprice);i.discount=i.discount+_onlineCheckout.parseTodecimal(i.Originalprice*n.Discount/100,2),a<i.discount&&(i.discount=a),i.price=_onlineCheckout.parseTodecimal(i.Originalprice-i.discount,2),a>0&&(i.taxprice=_onlineCheckout.parseTodecimal(i.price*i.taxprice/a,2)),i.isMembershipApply=!0,i.membershipDiscount=n.Discount,i.membershipuserid=n.UserID,i.membershipUniqueID=n.MembershipUniqueId,n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining-1,i.RedeemBusinessId=n.BusinessID,i.BusinessID=onlineShoppingCart.BusinessID,i.MembershipID=n.MembershipID,i.MembershipItemId=n.MembershipItemId,i.membershipName=n.MembershipName,i.GroupId=n.GroupId,i.VisitRemaining=n.VisitRemaining;var s=e.grep(r,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});return e.each(s,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)}),!1}if(1!=i.isMembershipApply)if(i.discount=0,i.isMembershipApply=!1,i.membershipDiscount=0,i.membershipUniqueID=null,1!=i.isPointApply&&(null==i.gcId||0==i.gcId||i.gcId>0&&0==i.isPackage)&&void 0!==i.PromotionID&&0!=i.PromotionID){var l=0;l=1==i.IsAmount?i.AmountValue:i.Originalprice*i.AmountValue/100,i.discount=l,i.price=i.Originalprice-l,i.taxprice=_onlineCheckout.parseTodecimal(i.price*c.tax/100,3),i.actualPrice=i.price,i.actualTaxprice=i.taxprice}else _onlineCheckout.isValidForCheckoutInvoice()&&1!=i.isPointApply&&(null==i.gcId||0==i.gcId||i.gcId>0&&0==i.isPackage)&&(i.discount=i.originalDiscount,i.price=i.Originalprice-i.discount,i.taxprice=_onlineCheckout.parseTodecimal(i.price*c.tax/100,3),i.actualPrice=i.price,i.actualTaxprice=i.taxprice)}),o=_onlineCheckout.parseTodecimal(o+i.price,2),a=_onlineCheckout.parseTodecimal(a+i.taxprice,2),i.gcId>0&&0==i.isPackage&&(s=_onlineCheckout.parseTodecimal(s+i.price,2),c.classGCUsed=_onlineCheckout.parseTodecimal(c.classGCUsed+i.price,2)),(i.gcId<0||i.gcId>0)&&1==i.isPackage&&(c.classGCUsed=_onlineCheckout.parseTodecimal(c.classGCUsed+i.price,2))}),c.calssdiscountprice=0,c.addonCalssdiscountprice=0,e.each(c.eventEnrollment,function(e,t){c.calssdiscountprice+=t.discount}),c.calssdiscountprice=_onlineCheckout.parseTodecimal(c.calssdiscountprice,2);var d=_onlineCheckout.ApplyMembershipONEventsAddon_ShowDiscount(c.eventEnrollment,i);o+=d.addonTotalPrice,l+=d.addonTotalTaxPrice,r+=d.addonTotalGCUsed,c.addonCalssdiscountprice=c.addonCalssdiscountprice+d.addonDiscountprice,onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+c.calssdiscountprice+c.addonCalssdiscountprice,2)});var c=parseFloat((o+a+l-(s+r+onlineShoppingCart.classPackageUsed)).toFixed(2));onlineShoppingCart.classTax=parseFloat(a.toFixed(2)),onlineShoppingCart.classGCUsed=s+r,onlineShoppingCart.classFinalTotal=c,onlineShoppingCart.classAddonGCUsed=r,onlineShoppingCart.classAddonTotalTaxPrice=l}},_onlineCheckout.ApplyPointsONEvents_ShowDiscount=function(t,i,n){var o=e.extend(!0,[],n);e.grep(t,function(t){t.calssdiscountprice=0;var n={IsDealGCApply:!0,PerUserOneFlag:!1};e.grep(t.eventEnrollment,function(a){var s=0,r=_onlineCheckout.GetPackageList(o,t,a,n);e.grep(i,function(i){if(a.price>0&&(a.customerID>0&&i.userId>0&&a.customerID==i.userId||a.customerID<=0&&i.userId>0&&a.cUserEmail==i.emailId)){s=i.pointsBalance;var l=t.PointRedeem;if(l>0&&s>0&&s>=l&&(!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==r.length)a.isPointApply=!0,a.pointsRedeem=l,i.pointsBalance=parseInt(s-l),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(a.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(a.pointsRedeem),a.Originalprice=parseFloat(a.price),a.price=0,a.Originaltaxprice=parseFloat(a.taxprice),a.taxprice=0,a.actualPrice=0,a.actualTaxprice=0,a.IsPartialPoint=!1;else if(_onlineCheckout.IsPartialPointAllowed&&l>0&&s>0&&(!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==r.length){parseInt(l-s);var c=parseInt(s);a.isPointApply=!0,a.pointsRedeem=c,i.pointsBalance=parseInt(s-c),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(a.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(a.pointsRedeem),a.Originalprice=parseFloat(a.price),a.Originaltaxprice=parseFloat(a.taxprice),a.IsPartialPoint=!0,a.PartialPrice=parseFloat(_onlineCheckout.CalculateApplyPointsClassPrice(a.price,c,t.PointRedeem)),a.price=_onlineCheckout.parseTodecimal(parseFloat(a.price-a.PartialPrice),2),a.taxprice=_onlineCheckout.parseTodecimal(a.price*t.tax/100,3),a.BusinessTax=_onlineCheckout.ApplyMultipleTax(a.price,a)}else a.isPointApply=!1,a.pointsRedeem=0,a.Originalprice=parseFloat(a.price),a.Originaltaxprice=parseFloat(a.taxprice)}null!=a.lstAddonService&&a.lstAddonService.length>0&&e.grep(a.lstAddonService,function(e){var s=0,r=_onlineCheckout.GetPackageList(o,t,e,n);if(e.Price>0&&(a.customerID>0&&i.userId>0&&a.customerID==i.userId||a.customerID<=0&&i.userId>0&&a.cUserEmail==i.emailId)){s=i.pointsBalance;var l=e.PointRedeem;if(l>0&&s>0&&s>=l&&(!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==r.length)e.isPointApply=!0,e.pointsRedeem=l,i.pointsBalance=parseInt(s-l),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(e.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(e.pointsRedeem),e.Originalprice=parseFloat(e.Price),e.Price=0,e.Originaltaxprice=parseFloat(e.taxprice),e.taxprice=0,e.actualPrice=0,e.actualTaxprice=0,e.IsPartialPoint=!1;else if(_onlineCheckout.IsPartialPointAllowed&&l>0&&s>0&&(!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==r.length){parseInt(l-s);var c=parseInt(s);e.isPointApply=!0,i.pointsBalance=parseInt(s-c),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(c):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(c),e.Originalprice=parseFloat(e.Price),e.IsPartialPoint=!0,e.PartialPrice=parseFloat(_onlineCheckout.CalculateApplyAddonPointsClassPrice(e.Price,e.PointRedeem,c)),e.Price=_onlineCheckout.parseTodecimal(parseFloat(e.Price-e.PartialPrice),2),e.Originaltaxprice=parseFloat(e.taxprice),e.taxprice=_onlineCheckout.parseTodecimal(e.Price*e.tax/100,3),e.actualPrice=0,e.actualTaxprice=0,e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.Price,a),e.pointsRedeem=c}else e.isPointApply=!1,e.pointsRedeem=0,e.Originalprice=parseFloat(e.Price),e.Originaltaxprice=parseFloat(e.taxprice)}})})})})},_onlineCheckout.CalculateApplyAddonPointsClassPrice=function(e,t,i){return i*e/t},_onlineCheckout.ApplyDiscounts_ShowDiscount=function(t,i,n,o,a){if(!_onlineCheckout.isValidForCheckoutInvoice()){if(onlineShoppingCart=e.extend(!0,{},onlineShoppingCartmain),onlineShoppingCart.UsersPoints=i,onlineShoppingCart.ccAmt=0,onlineShoppingCart.amtPaid=0,onlineShoppingCart.tax=0,onlineShoppingCart.Rtax=0,onlineShoppingCart.taxdifference=0,onlineShoppingCart.gcAmt=0,onlineShoppingCart.shippingSurcharge=0,onlineShoppingCart.PackageAmount=0,onlineShoppingCart.tipValue=0,onlineShoppingCart.classSubTotal=0,onlineShoppingCart.classTax=0,onlineShoppingCart.classGCUsed=0,onlineShoppingCart.classPackageUsed=0,onlineShoppingCart.classFinalTotal=0,onlineShoppingCart.discount=0,onlineShoppingCart.lstMembership=n,onlineShoppingCart.lstMembershipOld=JSON.parse(JSON.stringify(n)),onlineShoppingCart.classdiscount=0,onlineShoppingCart.IsPromotionEnable=o,onlineShoppingCart.lstPromotionData=[],onlineShoppingCart.lstGCPkgData=JSON.parse(JSON.stringify(t)),onlineShoppingCart.RedeemedByGCtemp=[],onlineShoppingCart.RedeemedByGC=[],0==a&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0){for(var s=0;s<=onlineShoppingCart.Events.length-1;s++){var r=e.grep(onlineShoppingCart.Events[s].eventEnrollment,function(e){return 1!=e.isTempData});if(r.length>0){var l={cFirstName:"asc",cLastName:"asc",eventDate:"asc"};r.keySort(l),onlineShoppingCart.Events[s].eventEnrollment=r}else onlineShoppingCart.Events.splice(s,1)}onlineShoppingCart.Events.keySort({eventName:"asc"})}e.grep(i,function(e){e.userId==onlineShoppingCart.loginUserId&&e.userId>0&&(onlineShoppingCart.loginUserEmail=e.emailId)});var d=e.grep(t,function(e,t){return 1==e.eventType}),p=e.grep(t,function(e,t){return 1==e.eventType||2==e.eventType});if(null!=d&&d.length>0){l={serviceID:"desc",GiftCertificateAmt:"asc"};d.keySort(l)}if(_onlineCheckout.ApplyDailyDealONPackages(),_onlineCheckout.ApplyDailyDealONMemberships(),_onlineCheckout.ApplyDailyDealONGC(),null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&(_onlineCheckout.isValidForCheckoutInvoice()&&_onlineCheckout.AddInvoiceDiscount(onlineShoppingCart.Memberships,u),_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.Memberships,d,u)),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&(_onlineCheckout.isValidForCheckoutInvoice()&&_onlineCheckout.AddInvoiceDiscount(onlineShoppingCart.Packages,h),_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.Packages,d,h)),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0){var m=_onlineCheckout.ApplyPointsONProduct(onlineShoppingCart.Inventories,onlineShoppingCart.UsersPoints),v=e.grep(m,function(e){return 1==String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)});null!=v&&v.length>0&&(_onlineCheckout.ApplyMembershipONProduct(v,n),_onlineCheckout.ApplyGCONAllItems(v,p,c))}if(null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&_onlineCheckout.ApplyGCONAllItems(onlineShoppingCart.BusinessFee,d,g),onlineShoppingCart.tax>0){var f=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax,2),C=onlineShoppingCart.tax;C!=f&&(onlineShoppingCart.taxdifference=_onlineCheckout.parseTodecimal(C-f,2),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax-onlineShoppingCart.taxdifference,2),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid-onlineShoppingCart.taxdifference,2),onlineShoppingCart.ccAmt>0&&onlineShoppingCart.ccAmt>onlineShoppingCart.taxdifference?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-onlineShoppingCart.taxdifference,2):onlineShoppingCart.gcAmt>0&&onlineShoppingCart.gcAmt>onlineShoppingCart.taxdifference&&(onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt-onlineShoppingCart.taxdifference,2)))}if(null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){e.grep(onlineShoppingCart.Events,function(t){t.classGCUsed=0,e.grep(t.eventEnrollment,function(t){t.isPointApply=!1,t.isPresetApply=!1,t.gcId=null,t.isPackage=null,t.isMembershipApply=null,t.isPriceBaseGCApply=!1,null!=t.lstAddonService&&null!=t.lstAddonService&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){e.isPointApply=!1,e.isPresetApply=!1,e.gcId=null,e.isPackage=null,e.isMembershipApply=null,e.isPriceBaseGCApply=!1})})});var S=!1,y=e.grep(t,function(e,t){return(2==e.eventType||8==e.eventType)&&(0==e.isCustomPackage||1==e.isCustomPackage&&null==e.serviceID)&&(1==e.isCustomPackage&&null==e.serviceID&&0==S&&(S=!0),!0)}),b=[];if(y.length>0&&y.length>0&&1==_onlineCheckout.IsCCDetailEnable()){l={isPackage:"desc",expiresOn:"asc",quantity:"asc"};y.keySort(l),1==S?e.grep(y,function(i){b.push(i);var n=e.grep(t,function(e){return(2==e.eventType||8==e.eventType)&&1==e.isPackage&&1==e.isCustomPackage&&i.giftCertificateID==e.giftCertificateID&&null!=e.serviceID});n.length>0&&(b=b.concat(n))}):b=y}_onlineCheckout.ApplyPointsONEvents_ShowDiscount(onlineShoppingCart.Events,onlineShoppingCart.UsersPoints,b),b.length>0?onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events,!0,b):onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events),_onlineCheckout.ApplyDailyDealONEvents(),_onlineCheckout.ApplyMembershipONEvents_ShowDiscount(onlineShoppingCart.Events,n),_onlineCheckout.ApplyPriceBaseGCOnEvents(d,!0)}}},_onlineCheckout.ReApplyDiscounts_ShowDiscount=function(){if(!_onlineCheckout.isValidForCheckoutInvoice()){if(onlineShoppingCart.ccAmt=0,onlineShoppingCart.amtPaid=0,onlineShoppingCart.tax=0,onlineShoppingCart.Rtax=0,onlineShoppingCart.taxdifference=0,onlineShoppingCart.gcAmt=0,onlineShoppingCart.RedeemedByGCtemp=[],onlineShoppingCart.RedeemedByGC=[],onlineShoppingCart.shippingSurcharge=0,onlineShoppingCart.classSubTotal=0,onlineShoppingCart.classTax=0,onlineShoppingCart.classGCUsed=0,onlineShoppingCart.classPackageUsed=0,onlineShoppingCart.classFinalTotal=0,onlineShoppingCart.discount=0,onlineShoppingCart.classdiscount=0,null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.Memberships,u),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.GiftCertificates,d),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.Packages,h),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.Inventories,c),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.ServiceInvoice,m),null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&_onlineCheckout.RecalcGCONAllItems(onlineShoppingCart.BusinessFee,g),onlineShoppingCart.tax>0){var t=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax,2),i=onlineShoppingCart.tax;i!=t&&(onlineShoppingCart.taxdifference=_onlineCheckout.parseTodecimal(i-t,2),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax-onlineShoppingCart.taxdifference,2),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid-onlineShoppingCart.taxdifference,2),onlineShoppingCart.ccAmt>0&&onlineShoppingCart.ccAmt>onlineShoppingCart.taxdifference?onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt-onlineShoppingCart.taxdifference,2):onlineShoppingCart.gcAmt>0&&onlineShoppingCart.gcAmt>onlineShoppingCart.taxdifference&&(onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt-onlineShoppingCart.taxdifference,2)))}var n=e.extend(!0,[],onlineShoppingCart.lstGCPkgData),o=e.grep(n,function(e){return 1==e.eventType&&null==e.quantity&&e.currentBalance>0});if(onlineShoppingCart.RedeemedByGCtemp.length>0){onlineShoppingCart.RedeemedByGC=[];var a=e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){return 1!=e.IsClass}),s=a.uniqueObjects(["GCId"]);e.grep(s,function(t){_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg==t.Type?(objGC={},objGC.giftcertificateId=t.giftcertificateId,objGC.serviceId=t.serviceId,objGC.redeemAmt=t.redeemAmt,objGC.uniqID=t.uniqID,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,e.grep(a,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)):_onlineCheckout.CheckoutBarcodeCodePrepayOnline.srvcGC==t.Type?(objGC={},objGC.giftcertificateId=t.GCId,objGC.serviceId=t.serviceId,objGC.redeemAmt=t.redeemAmt,objGC.uniqID=t.uniqID,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,e.grep(a,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)):(objGC={},objGC.giftcertificateId=t.GCId,objGC.serviceId=0,objGC.redeemAmt=0,objGC.uniqID=0,objGC.AppointmentID=0,objGC.Type="GC",e.grep(a,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.GCAmount,2))}),e.grep(o,function(e){t.GCId==e.giftCertificateID&&(e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-objGC.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC))})}if(null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0){onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events),_onlineCheckout.ApplyDailyDealONEvents();var r=e.extend(!0,[],_onlineCheckout.lstMembershipForCheckout_ShowDiscount);_onlineCheckout.ApplyMembershipONEvents_ShowDiscount(onlineShoppingCart.Events,r),_onlineCheckout.ApplyPriceBaseGCOnEvents(o,!0)}}},_onlineCheckout.Clear_ShowDiscount=function(){_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount=null,_onlineCheckout.lstUserListForCheckout_ShowDiscount=null,_onlineCheckout.lstMembershipForCheckout_ShowDiscount=null,_onlineCheckout.IsPromotionEnable_ShowDiscount=!1,_onlineCheckout.GcAndPackagesForCheckout_ShowDiscount=null,_onlineCheckout.UserListForCheckout_ShowDiscount=null,_onlineCheckout.MembershipForCheckout_ShowDiscount=null,DbCartData=[]},_onlineCheckout.getTotalDailyDealFee=function(t){var i=0;return t&&0!==t.length?(e.each(t,function(t,n){n.eventEnrollment&&n.eventEnrollment.length>0&&e.each(n.eventEnrollment,function(t,n){void 0===n.dailydealFee||isNaN(n.dailydealFee)||(i+=Number(n.dailydealFee)),n.lstAddonService&&n.lstAddonService.length>0&&e.each(n.lstAddonService,function(e,t){void 0===t.dailydealFee||isNaN(t.dailydealFee)||(i+=Number(t.dailydealFee))})})}),i):0},_onlineCheckout.CCOFFDepositPerCalculate=function(e,t){return!e||e<=0?0:t/e*100},_onlineCheckout.getTotalDepositFromCart=function(e){return e*(Number(onlineShoppingCart.DepositsPer)||0)/100},_onlineCheckout.GetTotalCartAmountforDeposits=function(){var t=0;return null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(i){t=1==i.isPackage||1==i.isPointApply?_onlineCheckout.parseTodecimal(t+i.Originalprice,2):_onlineCheckout.parseTodecimal(t+i.price,2),null!=i.lstAddonService&&null!=i.lstAddonService&&i.lstAddonService.length>0&&e.grep(i.lstAddonService,function(e){t=1==e.isPackage||1==e.isPointApply?_onlineCheckout.parseTodecimal(t+e.Originalprice,2):_onlineCheckout.parseTodecimal(t+e.Price,2)})})}),t},_onlineCheckout.calculatedDepositsAmount=function(e){return 1==onlineShoppingCartmain.DepositAmtType?_onlineCheckout.parseTodecimal(100*onlineShoppingCartmain.DepositsPer/e,2):_onlineCheckout.parseTodecimal(e*onlineShoppingCartmain.DepositsPer/100,2)},_onlineCheckout.calculatedDepositsPercent=function(e,t){return 100*t/e},_onlineCheckout.calculateDepositsOnEvents=function(){var t=_onlineCheckout.GetTotalCartAmountforDeposits();if(cartDailyDealFee=_onlineCheckout.getTotalDailyDealFee(onlineShoppingCart.Events),dailydeal_CCOFF_Depositper=_onlineCheckout.CCOFFDepositPerCalculate(t,cartDailyDealFee),totalDepositWhenDepositLessDDFee=_onlineCheckout.getTotalDepositFromCart(t),!onlineShoppingCart.IsFullDeposit&&"false"==isCCRequiredForOnlineClass.toLowerCase()&&cartDailyDealFee>0?(IsDailyDealFeeCCOFF=!0,isCCRequiredForOnlineClass="true",onlineShoppingCart.DepositsPer=dailydeal_CCOFF_Depositper,onlineShoppingCart.DepositsLimit=1,onlineShoppingCartmain.DepositsPer=dailydeal_CCOFF_Depositper):IsDailyDealFeeCCOFF&&cartDailyDealFee<=0&&"function"==typeof _shopdetail.IsUKBusiness&&_shopdetail.IsUKBusiness()&&(IsDailyDealFeeCCOFF=!1,void 0===s||String.isNullOrUndefineOrBlank(s)||(isCCRequiredForOnlineClass=s),onlineShoppingCart.DepositsPer=onlineShoppingCartmain.DepositsPer,onlineShoppingCart.DepositsLimit=onlineShoppingCartmain.DepositsLimit),"true"==isCCRequiredForOnlineClass.toLowerCase()||_onlineCheckout.isValidForCheckoutInvoice()){var i=0;totalDepositWhenDepositLessDDFee<cartDailyDealFee&&t>cartDailyDealFee&&(onlineShoppingCart.DepositsPer=dailydeal_CCOFF_Depositper,onlineShoppingCartmain.DepositsPer=dailydeal_CCOFF_Depositper),e.grep(onlineShoppingCart.Events,function(n){var o=0;void 0===n.tax||n.tax;e.grep(n.eventEnrollment,function(e){var i=void 0!==e.IsPartialPoint&&e.IsPartialPoint;if(e.paidType=_onlineCheckout.arrpaidType.PaidClass,1==e.isPointApply&&!i||1==e.isPackage||0!=e.gcId&&null!=e.gcId||0!=e.price||0!=e.discount||(e.paidType=_onlineCheckout.arrpaidType.Paid),e.depositsTax=0,i||(e.depositsPaid=0),(1!=e.isPointApply||i)&&1!=e.isPackage&&(0==e.gcId||null==e.gcId)){if(_onlineCheckout.isValidForCheckoutInvoice())(e.OriginalpaidType==_onlineCheckout.arrpaidType.DepositsClass||e.OriginalpaidType==_onlineCheckout.arrpaidType.OfflineDeposit)&&void 0!==e.depositsPercentage&&parseFloat(e.depositsPercentage)>0&&(e.depositsPaid=_onlineCheckout.parseTodecimal(e.price*e.depositsPercentage/100,2),e.depositsTax=e.taxprice,e.paidType=_onlineCheckout.arrpaidType.DepositsClass);else if(t>=onlineShoppingCart.DepositsLimit&&!_onlineCheckout.isValidForCheckoutInvoice())if(null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))>=new Date(e.eventDate))e.depositsPaid=0,e.depositsPercentage=0,e.depositsTax=e.taxprice,e.paidType=_onlineCheckout.arrpaidType.UnPaid;else if(0==onlineShoppingCartmain.DepositAmtType&&100!=onlineShoppingCart.DepositsPer&&e.price>0){if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()){var n=e.price+e.taxprice;e.depositsPaid=1==e.IsPartialPoint?e.depositsPaid:_onlineCheckout.calculatedDepositsAmount(n,0),totalDepositWhenDepositLessDDFee<cartDailyDealFee&&e.actualPrice>e.dailydealFee?e.depositsPaid=e.dailydealFee:e.actualPrice<e.dailydealFee&&(e.depositsPaid=e.actualPrice)}else e.depositsPaid=1==e.IsPartialPoint?e.depositsPaid:_onlineCheckout.calculatedDepositsAmount(e.price,0),totalDepositWhenDepositLessDDFee<cartDailyDealFee&&e.actualPrice>e.dailydealFee?e.depositsPaid=e.dailydealFee:e.actualPrice<e.dailydealFee&&(e.depositsPaid=e.actualPrice);e.depositsPercentage=Number(e.dailydealFee)>0?onlineShoppingCartmain.DepositsPer:0,e.depositsTax=e.taxprice,e.paidType=_onlineCheckout.arrpaidType.DepositsClass}else 1==onlineShoppingCartmain.DepositAmtType&&onlineShoppingCart.DepositsPer<e.price&&e.price>0?(e.depositsPaid=1==e.IsPartialPoint?e.depositsPaid:onlineShoppingCartmain.DepositsPer,e.depositsPercentage=_onlineCheckout.calculatedDepositsAmount(e.price,1),e.depositsTax=e.taxprice,e.paidType=100==e.depositsPercentage?_onlineCheckout.arrpaidType.Paid:_onlineCheckout.arrpaidType.DepositsClass):(e.paidType=_onlineCheckout.arrpaidType.PaidClass,e.depositsPaid=0,e.actualPrice<e.dailydealFee&&cartDailyDealFee>0&&(e.dailydealFee=e.actualPrice),0==e.price?1==e.isMembershipApply||e.discount>0?e.paidType=_onlineCheckout.arrpaidType.PaidClass:e.paidType=_onlineCheckout.arrpaidType.UnPaid:1==e.isMembershipApply&&0==onlineShoppingCartmain.DepositAmtType&&onlineShoppingCart.DepositsPer<100&&(e.paidType=_onlineCheckout.arrpaidType.PartiallyPaidClass));else 0!=e.price||1!=e.isMembershipApply&&0!=e.discount?1==e.isMembershipApply?e.paidType=_onlineCheckout.arrpaidType.PartiallyPaidClass:0==e.discount&&(e.paidType=_onlineCheckout.arrpaidType.UnPaid):e.paidType=_onlineCheckout.arrpaidType.PaidClass,e.depositsPaid=0,e.depositsPercentage=0,e.depositsTax=e.taxprice;e.paidType!=_onlineCheckout.arrpaidType.PaidClass&&(e.IsPartialPoint?e.IsDepositsOver?(o=_onlineCheckout.parseTodecimal(o+_onlineCheckout.parseTodecimal(e.price-e.depositsPaid,2)+_onlineCheckout.parseTodecimal(e.depositsTax,2),2),e.depositsRemaining=_onlineCheckout.parseTodecimal(e.price-e.depositsPaid,2)):(o=_onlineCheckout.parseTodecimal(o+_onlineCheckout.parseTodecimal(e.price-e.depositsPaid-e.PartialPrice,2)+_onlineCheckout.parseTodecimal(e.depositsTax,2),2),e.depositsRemaining=_onlineCheckout.parseTodecimal(e.price-e.depositsPaid-e.PartialPrice,2)):(o=_onlineCheckout.parseTodecimal(o+_onlineCheckout.parseTodecimal(e.price-e.depositsPaid,2)+_onlineCheckout.parseTodecimal(e.depositsTax,2),2),e.depositsRemaining=_onlineCheckout.parseTodecimal(e.price-e.depositsPaid,2)))}o+=_onlineCheckout.calculateAddonsDepositsOnEvents(e.lstAddonService,t)}),i=_onlineCheckout.parseTodecimal(i+o,2)}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(e){void 0!==e.BusinessTax&&null!=e.BusinessTax&&""!=e.BusinessTax||(e.BusinessTax=String.isNullOrUndefineOrBlank(e.Taxes)||"[]"==e.Taxes?"[]":JSON.parse(e.Taxes),e.BusinessTax=_onlineCheckout.ApplyMultipleTax(e.price,e))})}),onlineShoppingCart.DepositsRemaining=i}},_onlineCheckout.ApplyPriceBaseGCOnEvents=function(t,i){if(t.length>0){var n=e.grep(t,function(e){return 1==e.eventType&&null==e.quantity&&e.currentBalance>0});if(null!=n&&n.length>0){n.keySort({serviceID:"desc",GiftCertificateAmt:"asc"})}if(n.length>0){var o=onlineShoppingCart.Events,a=0,s=0,r=0,l=0,c=0;if(e.each(o,function(o,d){d.classGCUsed=0,e.each(d.eventEnrollment,function(t,o){if(o.isPriceBaseGCApply=!1,o.paidType==_onlineCheckout.arrpaidType.PaidClass||o.paidType==_onlineCheckout.arrpaidType.DepositsClass||1==i||_onlineCheckout.isValidForCheckoutInvoice()){var l=e.grep(n,function(e){return o.customerID>0&&e.assignTo>=0||o.customerID<=0&&e.assignTo>=0&&(o.cUserEmail==e.emailId||0==e.assignTo)});if((1!=o.isPointApply||1==o.IsPartialPoint)&&1!=o.isPackage&&!(Number(o.dailydealFee)>0)&&(1==i||"true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())){var c=0,u=0;c=parseFloat(o.price),u=parseFloat(o.taxprice),o.paidType==_onlineCheckout.arrpaidType.DepositsClass&&(c=o.depositsPaid,u=0,1==o.IsPartialPoint&&(c=0==o.IsDepositsOver?o.depositsPaid:o.depositsPaid-o.PartialPrice)),o.RemainingPrice=parseFloat(c),o.RemainingTax=parseFloat(u),null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&e.grep(onlineShoppingCart.lstGCPkgData,function(e){e.giftCertificateID==o.gcId&&null!=e.Taxes&&(o.RemainingTax=0)}),o.GCDetail=[],o.redeemAmt=0,o.redeemTax=0,e.grep(l,function(t){if(o.RemainingPrice>0&&o.RemainingPrice>0&&t.currentBalance>0)if(t.currentBalance>=o.RemainingPrice){o.isPriceBaseGCApply=!0,objGC={},objGC.GCId=t.giftCertificateID,objGC.GCAmount=o.RemainingPrice,objGC.giftCertificateNo=t.giftCertificateNo,objGC.IsClass=!0,o.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),o.gcId=t.giftCertificateID,o.redeemAmt=_onlineCheckout.parseTodecimal(o.redeemAmt+o.RemainingPrice,2),t.currentBalance=_onlineCheckout.parseTodecimal(t.currentBalance-o.RemainingPrice,2),o.RemainingPrice=0;var i=onlineShoppingCart.lstGCPkgData.filter(function(e){return e.giftCertificateID==o.gcId});String.isNullOrUndefineOrBlank(i)||(i[0].currentBalance=t.currentBalance),e('[id="'+o.gcId+'"]').addClass("w--current")}else if(o.RemainingPrice>t.currentBalance&&t.currentBalance>0){o.isPriceBaseGCApply=!0,objGC={},objGC.GCId=t.giftCertificateID,objGC.GCAmount=t.currentBalance,objGC.giftCertificateNo=t.giftCertificateNo,objGC.IsClass=!0,o.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),o.gcId=t.giftCertificateID,o.redeemAmt=_onlineCheckout.parseTodecimal(o.redeemAmt+t.currentBalance,2),o.RemainingPrice=_onlineCheckout.parseTodecimal(o.RemainingPrice-t.currentBalance,2),t.currentBalance=0;i=onlineShoppingCart.lstGCPkgData.filter(function(e){return e.giftCertificateID==o.gcId});String.isNullOrUndefineOrBlank(i)||(i[0].currentBalance=0),e('[id="'+o.gcId+'"]').addClass("w--current")}o.RemainingTax>0&&t.currentBalance>0&&(o.RemainingTax=_onlineCheckout.parseTodecimal(o.RemainingTax,3),t.currentBalance>=o.RemainingTax?(o.isPriceBaseGCApply=!0,objGC={},objGC.GCId=t.giftCertificateID,objGC.GCAmount=o.RemainingTax,objGC.giftCertificateNo=t.giftCertificateNo,o.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),objGC.IsClass=!0,o.redeemTax=_onlineCheckout.parseTodecimal(o.redeemTax+o.RemainingTax,2),t.currentBalance=_onlineCheckout.parseTodecimal(t.currentBalance-o.RemainingTax,2),o.RemainingTax=0):o.RemainingTax>t.currentBalance&&t.currentBalance>0&&(o.isPriceBaseGCApply=!0,objGC={},objGC.GCId=t.giftCertificateID,objGC.GCAmount=t.currentBalance,objGC.giftCertificateNo=t.giftCertificateNo,o.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),objGC.IsClass=!0,o.redeemTax=_onlineCheckout.parseTodecimal(o.redeemTax+t.currentBalance,2),o.RemainingTax=_onlineCheckout.parseTodecimal(o.RemainingTax-t.currentBalance,2),t.currentBalance=0))})}}o.BusinessTax=_onlineCheckout.ApplyMultipleTax(o.price,o),a=_onlineCheckout.parseTodecimal(a+o.price,2),s=_onlineCheckout.parseTodecimal(s+o.taxprice,2),o.gcId>0&&0==o.isPackage?(r=_onlineCheckout.parseTodecimal(r+o.price+o.redeemTax,2),d.classGCUsed=_onlineCheckout.parseTodecimal(d.classGCUsed+o.price+o.redeemTax,2)):(o.gcId<0||o.gcId>0)&&1==o.isPackage?d.classGCUsed=_onlineCheckout.parseTodecimal(d.classGCUsed+o.price,2):1==o.isPriceBaseGCApply&&(r=_onlineCheckout.parseTodecimal(r+o.redeemAmt+o.redeemTax,2),d.classGCUsed=_onlineCheckout.parseTodecimal(d.classGCUsed+o.redeemAmt+o.redeemTax,2))});var u=_onlineCheckout.ApplyPriceBaseGCOnEventsAddon(d.eventEnrollment,t,i);a+=u.addonTotalPrice,l+=u.addonTotalTaxPrice,c+=u.addonTotalGCUsed}),_onlineCheckout.isValidForCheckoutInvoice()&&onlineShoppingCart.RedeemedByGCtemp.length>0){onlineShoppingCart.RedeemedByGC=[];var d=onlineShoppingCart.RedeemedByGCtemp.uniqueObjects(["GCId"]);e.grep(d,function(t){_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg==t.Type?(objGC={},objGC.giftcertificateId=t.giftcertificateId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=0,objGC.uniqID=t.uniqID,objGC.RedeemServiceId=t.serviceId,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)):_onlineCheckout.CheckoutBarcodeCodePrepayOnline.srvcGC==t.Type?(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=0,objGC.uniqID=t.uniqID,objGC.RedeemServiceId=t.serviceId,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),objGC.GCredeemAmtForDisc=objGC.redeemAmt,onlineShoppingCart.RedeemedByGC.push(objGC)):(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=0,objGC.redeemAmt=0,objGC.uniqID=0,objGC.AppointmentID=0,objGC.Type="GC",e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.GCAmount,2))}),onlineShoppingCart.RedeemedByGC.push(objGC))})}var u=parseFloat((a+s+l-(r+c+onlineShoppingCart.classPackageUsed)).toFixed(2));onlineShoppingCart.classTax=parseFloat(s.toFixed(2)),onlineShoppingCart.classGCUsed=r+c,onlineShoppingCart.classAddonGCUsed=c,onlineShoppingCart.classAddonTotalTaxPrice=l,onlineShoppingCart.classFinalTotal=u}}},_onlineCheckout.GetPackageList=function(t,i,n,o){var a=!1;return e.grep(t,function(e){return null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))>new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))&&null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))&&e.serviceName.toLowerCase().trim()==i.eventName.toLowerCase().trim()&&(0==n.IsOutsideBilling&&(n.strAdvanceLimitDate=e.strAdvanceLimitDate),n.IsWaivedApply=!0,n.AppliedName=e.pkgName),0==a&&1==e.isPackage&&(n.customerID>0&&e.assignTo==n.customerID||n.customerID<=0&&e.emailId==n.cUserEmail)&&null!=e.serviceID&&(e.serviceID==i.eventID||e.serviceName.toLowerCase().trim()==i.eventName.toLowerCase().trim())&&(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strValidUpto).format("YYYY/MM/DD")))&&(n.discount>0&&n.actualPrice==n.discount&&1!=n.isPointApply&&("1"==n.PerUserOne?0==o.PerUserOneFlag?(o.PerUserOneFlag=!0,o.IsDealGCApply=!1):o.IsDealGCApply=!0:o.IsDealGCApply=!1),-1!=e.quantity&&1==o.IsDealGCApply&&(e.quantity=e.quantity-1),a=!0,!0)})},_onlineCheckout.GetPackageListAddon=function(t,i,n,o){var a=!1;return e.grep(t,function(e){return null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))>new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))&&null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))&&e.serviceName.toLowerCase().trim()==n.ServiceTitle.toLowerCase().trim()&&(0==n.IsOutsideBilling&&(n.strAdvanceLimitDate=e.strAdvanceLimitDate),n.IsWaivedApply=!0,n.AppliedName=e.pkgName),0==a&&1==e.isPackage&&(n.customerID>0&&e.assignTo==n.customerID||n.customerID<=0&&e.emailId==n.cUserEmail)&&null!=e.serviceID&&(e.serviceID==n.ServiceId||e.serviceName.toLowerCase().trim()==n.ServiceTitle.toLowerCase().trim())&&(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strValidUpto).format("YYYY/MM/DD")))&&(n.discount>0&&n.actualPrice==n.discount&&1!=n.isPointApply&&("1"==n.PerUserOne?0==o.PerUserOneFlag?(o.PerUserOneFlag=!0,o.IsDealGCApply=!1):o.IsDealGCApply=!0:o.IsDealGCApply=!1),-1!=e.quantity&&1==o.IsDealGCApply&&(e.quantity=e.quantity-1),a=!0,!0)})},_onlineCheckout.createGiftCertificatesCartsubTotal=function(){e("#divGiftCertificatelistCart > a").removeClass("w--current");var t=[];void 0!==onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(i){if(0==i.isPackage&&i.gcId>0&&1!=i.isPriceBaseGCApply){var n={};n.giftCertificateNo=i.giftCertificateNo,n.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,n.giftcertificateId=i.gcId,n.redeemAmt=i.price,t.push(n)}1==i.isPriceBaseGCApply&&e.grep(i.GCDetail,function(e){var i={};i.giftCertificateNo=e.giftCertificateNo,i.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,i.giftcertificateId=e.GCId,i.redeemAmt=e.GCAmount,t.push(i)}),!String.isNullOrUndefineOrBlank(i.lstAddonService)&&i.lstAddonService.length>0&&e.grep(i.lstAddonService,function(i){if(0==i.isPackage&&i.gcId>0&&1!=i.isPriceBaseGCApply){var n={};n.giftCertificateNo=i.giftCertificateNo,n.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,n.giftcertificateId=i.gcId,n.redeemAmt=i.Price,t.push(n)}1==i.isPriceBaseGCApply&&e.grep(i.GCDetail,function(e){var i={};i.giftCertificateNo=e.giftCertificateNo,i.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,i.giftcertificateId=e.GCId,i.redeemAmt=e.GCAmount,t.push(i)})})})});var i=(t=t.concat(onlineShoppingCart.RedeemedByGC)).uniqueObjects(["giftcertificateId"]),n=[];return e.grep(i,function(i){var o=0;if(i.Type==_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC&&void 0!==i.giftCertificateNo&&null!=i.giftCertificateNo){var a={};a.giftCertificateNoLast=i.giftCertificateNo.substr(i.giftCertificateNo.length-4),a.CurrencySymbol=currencysymbol,e.grep(t,function(e){i.giftcertificateId==e.giftcertificateId&&(o=_onlineCheckout.parseTodecimal(o+e.redeemAmt,3))}),a.redeemAmt=o,n.push(a),e('[id="gcNo_'+i.giftCertificateNo+'"]').addClass("w--current"),_onlineCheckout.SetGCStatus(i.giftcertificateId,N.Add)}}),n},_onlineCheckout.createGiftCertificates=function(t){var i=e.grep(t,function(e,t){return!e.isPackage});i.keySort({serviceID:"desc",GiftCertificateAmt:"asc"});var n=[];"true"==isCCRequiredForOnlineClass.toLowerCase()&&void 0!==onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t,i){n.push(t.eventName.toLowerCase().trim()),e.grep(t.eventEnrollment,function(t,i){!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e,t){n.push(e.ServiceTitle.toLowerCase().trim())})})}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e,t){n.push(e.servicename.toLowerCase().trim())});var o=[];e.grep(i,function(e,t){if(null==e.serviceID||e.serviceID>0&&n.indexOf(e.serviceName.toLowerCase().trim())>-1){var i={};i.giftCertificateNo=e.giftCertificateNo,i.giftCertificateID=e.giftCertificateID,i.giftCertificateNoLast=e.giftCertificateNo.substr(e.giftCertificateNo.length-4),i.currentBalance=e.currentBalance,i.CurrencySymbol=currencysymbol,i.AvailabeVisit="",i.isservicebase=!1,null!=e.serviceID&&(i.isservicebase=!0,i.AvailabeVisit="("+e.quantity+" "+(e.quantity>1?"visits":"visit")+")"),o.push(i)}}),o.length>0?(e("#divGiftCertificateCart").show(),e("#divGiftCertificatelistCart").html(""),e("#tmplGiftCertificatelistCart").tmpl(o).appendTo("#divGiftCertificatelistCart"),1==o.length?e('[id="gcNo_'+o[0].giftCertificateNo+'"]').addClass("only-one"):e('[id="gcNo_'+o[0].giftCertificateNo+'"]').removeClass("only-one"),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&e(_shopdetail.tabAddGiftCards).removeClass("giftcard-shipping-method")):"undefined"!=typeof _shopdetail&&null!=_shopdetail&&e(_shopdetail.tabAddGiftCards).addClass("giftcard-shipping-method")};var N={Default:0,Add:1,Remove:2};_onlineCheckout.SetGCStatus=function(t,i){e.grep(onlineShoppingCart.lstGCPkgData,function(e){(e.giftCertificateID==t||null==t&&i==N.Default)&&(e.assignStatus=i)})},_onlineCheckout.ManageGC=function(t){if(_onlineCheckout.IsBuyGC=!0,null!=t){var i=e('[id="'+t.id+'"]'),n=i.data("gcid"),o=i.data("isservicebase");_onlineCheckout.isCheckoutVPLChanged=!1,e("#divVplTracking").hide(),n=e('[id="'+t.id+'"]').data("gcid"),o=e('[id="'+t.id+'"]').data("isservicebase");var a=!1;e.grep(onlineShoppingCart.lstGCPkgData,function(s){if(s.giftCertificateID==n)if(i.hasClass("w--current")){a=!0,o=!1,s.assignStatus=N.Remove,s.currentBalance=String.isNullOrUndefineOrBlank(s.ResetcurrentBalance)?s.currentBalance:s.ResetcurrentBalance,i.removeClass("w--current"),null!=onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(isGCAppliedForClass=!0,e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(t){1==t.isPointApply&&1!=t.IsPartialPoint||1==t.isPackage||(t.gcId==n&&(s.currentBalance=String.isNullOrUndefineOrBlank(s.ResetcurrentBalance)?s.currentBalance+t.redeemAmt:s.ResetcurrentBalance,null!=s.quantity&&-1!=s.quantity&&(s.quantity+=1)),t.gcId=null,t.GCDetail=[],t.isPriceBaseGCApply=!1,t.isGCApply=!1,t.isDecisionTaken=null,t.redeemAmt=0,t.redeemTax=0,t.isServiceBaseGC=!1,t.isMembershipRemove=!0),!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){1==e.isPointApply&&1!=e.IsPartialPoint||1==e.isPackage||(e.gcId==n&&(s.currentBalance=String.isNullOrUndefineOrBlank(s.ResetcurrentBalance)?s.currentBalance+e.redeemAmt:s.ResetcurrentBalance,null!=s.quantity&&-1!=s.quantity&&(s.quantity+=1)),e.gcId=null,e.GCDetail=[],e.isPriceBaseGCApply=!1,e.isGCApply=!1,e.isDecisionTaken=null,e.redeemAmt=0,e.redeemTax=0,e.isServiceBaseGC=!1,e.isMembershipRemove=!0)})})}),onlineShoppingCart.RedeemedByGCtemp=e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){return e.GCId!=n}));var r=[];null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&(r=onlineShoppingCart.Memberships),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&(r=r.concat(onlineShoppingCart.GiftCertificates)),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&(r=r.concat(onlineShoppingCart.Packages)),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&(r=r.concat(onlineShoppingCart.Inventories)),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&(r=r.concat(onlineShoppingCart.ServiceInvoice)),null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&(r=r.concat(onlineShoppingCart.BusinessFee)),r.length>0&&e.grep(r,function(e){e.redeemAmt=0,e.redeemTax=0,e.GCDetail=[],e.isGCApply=!1,void 0!==e.isServiceBaseGC&&(e.isServiceBaseGC=!1)}),setTimeout(function(){e("#divcheckoutSelectPaymentMethodTitle").attr("tabindex",0).attr("role","heading").focus()},500)}else{var l=parseFloat(onlineShoppingCart.ccAmt)+parseFloat(onlineShoppingCart.classFinalTotal-parseFloat(onlineShoppingCart.DepositsRemaining));_onlineCheckout.isValidForCheckoutInvoice()&&(l=parseFloat(onlineShoppingCart.ccAmt)+parseFloat(onlineShoppingCart.classFinalTotal)-parseFloat(onlineShoppingCart.DepositsRemaining)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining)),!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"!=isCCRequiredForOnlineClass.toLowerCase()&&!IsDailyDealFeeCCOFF&&(l=parseFloat(l-parseFloat(onlineShoppingCart.classFinalTotal))),l>0||s.serviceID>0?(a=!0,s.assignStatus=N.Add,i.addClass("w--current"),void 0!==onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(isGCAppliedForClass=!0,e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(t){1!=t.isPointApply&&1!=t.isPackage&&(t.gcId=null,t.GCDetail=[],t.isPriceBaseGCApply=!1,t.isGCApply=!1,t.isDecisionTaken=null,t.redeemAmt=0,t.redeemTax=0,s.serviceID>0&&(t.isMembershipApply=!1)),!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){1!=e.isPointApply&&1!=e.isPackage&&(e.gcId=null,e.GCDetail=[],e.isPriceBaseGCApply=!1,e.isGCApply=!1,e.isDecisionTaken=null,e.redeemAmt=0,e.redeemTax=0,s.serviceID>0&&(e.isMembershipApply=!1))})})}))):0==l&&onlineShoppingCart.tipValue>0?_common.PassiveAlertWarning("Amount Due could not be Paid with this gift card.",t):_common.PassiveAlertfail("Unable to add another gift card because the amount due is zero.")}}),1==a&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.calculateDepositsOnInvoice(!1),_onlineCheckout.RecalcGCONAllItemsAfterPreset(!0),_onlineCheckout.ReApplyDiscounts(),setTimeout(function(){1==o&&0==i.hasClass("w--current")&&_common.PassiveAlertWarning("Amount Due could not be Paid with this gift card.",t)},200)),_onlineCheckout.IsVCFEnable()&&_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.ApplyGC)}_onlineCheckout.IsBuyGC=!1},_onlineCheckout.LoadShoppingCartExternal=function(){ShowLoader(!0);var t,i={UserControlPath:"~/UserControls/ShopDetail/ucShoppingCartPage.ascx",PageNamePath:"~/detail.aspx",isRemoveFormTag:!0};t={GroupID:groupID,BusinessId:_shopdetail.businessID,VagaroURL:_shopdetail.vagaroUrl,loggedInUserId:_siteBuilderDetail.loginUserId,IsAllowTipForInvoice:IsAllowTipForInvoice,EncryptedInvoiceNo:EncryptedInvoiceNo,IsPopup:IsPopup,IsNewCustomWebsite:IsNewCustomWebsite,IsCustomWebsite:isCustomWebsite,IsLiveStream:_onlineCheckout.IsCalledFromLiveStream(),IsPromotionUI:isPromotionUI,IsWidget:isWidget,IsFacebook:isFacebook,IsNewReDesignWidget:IsNewReDesignWidget},i.Parameters=t;var n=new vagaro.ajax;n.datamodel.Token=ApiURLEnumBooking.LoadUserControl,n.datamodel.IsNewVagaroAPI=!0,n.datamodel.callback=function(t){e(".pagebodycontainer").html(e("#dvCart").html());var i=e("#dvShoppingCart");i.html(""),i.append(t),i.show(),DisplayFullView(!0),e(".cancel-select-service:visible").length>0&&(e(".cancel-select-service:visible").trigger("touchstart"),_common.closeServiceSelection()),e("#pageSection").hide().removeClass("pagesectionFlex"),e("#dvOnlineAppoinmentBooked").hide(),e("#divWriteReview").hide(),1==_onlineCheckout.IsCalledFromLiveStream()&&(e("#shoppingcartfirst").hide(),e("#shoppingcartsecond").show(),e("#btnContShoppingCheckoutForClass").click()),ShowLoader(!1)},n.datamodel.data=i,n.datamodel.Error=CallFail_LoadUserControlWithProxy,n.Post()},_onlineCheckout.IsUserHaveSharedMS=function(e,t){return t=void 0===t||null==t?"":t,(null!=e?e.split(","):"").indexOf(t.toString())>-1},_onlineCheckout.showDiffUserAddress=function(t){"Tab 1"==e(t).data("w-tab")?(e(t).siblings(".w-tab-link").removeClass("w--current"),e("#userNewAddressValidate").removeClass("w--tab-active"),e(t).addClass("w--current"),e("#userNewAddressValidate").siblings(".w-tab-pane").addClass("w--tab-active"),e("#userNewAddressValidate").siblings(".w-tab-pane").css({opacity:1,transition:"opacity 300ms ease 0s"})):(e(t).siblings(".w-tab-link").removeClass("w--current"),e("#userNewAddressValidate").siblings(".w-tab-pane").removeClass("w--tab-active"),e(t).addClass("w--current"),e("#userNewAddressValidate").addClass("w--tab-active"),e("#userNewAddressValidate").css({opacity:1,transition:"opacity 300ms ease 0s"}))};var U={1:"us-f",2:"uk-f",3:"canada-f",4:"aus-f"};_onlineCheckout.txtLiveStreamAddress="#txtLiveStreamAddress",_onlineCheckout.clscountryselectmyacprofile=".countryselectmyacprofile",_onlineCheckout.hdnLiveStreamCountryId="#hdnLiveStreamCountryId",_onlineCheckout.selectCountryDiv="#selectedCountrudiv",_onlineCheckout.divLiveStreamAddressControl="#divLiveStreamAddressControl",_onlineCheckout.SelectLiveStreamCountry=function(t){e(_onlineCheckout.txtLiveStreamAddress).select2("val"," "),e(_onlineCheckout.selectCountryDiv).removeClass().addClass("selectedcountry "+U[t]).attr("aria-label",U[t]+" Selected"),e(_onlineCheckout.hdnLiveStreamCountryId).val(t),e(".countryselectoption").hide(),e(_onlineCheckout.txtLiveStreamAddress).select2("focus")},_onlineCheckout.ShowLiveStreamCountry=function(){return e(_onlineCheckout.clscountryselectmyacprofile).is(":visible")?void e(_onlineCheckout.clscountryselectmyacprofile).hide():void e(_onlineCheckout.clscountryselectmyacprofile).show()},_onlineCheckout.SetLiveStreamAddressControl=function(){var t=e(_onlineCheckout.txtLiveStreamAddress).select2({searchInputPlaceholder:"City or Zip Code",minimumInputLength:1,combobox:!0,dropdownCssClass:"select-location-icons select2-drop-active select-customdropdown",selectOnClick:!0,multiple:!1,closeOnSelect:!0,allowClear:!0,ajax:{type:"POST",contentType:"application/json; charset=utf-8",url:"/WebServices/CommonWebService.asmx/GetLocationOrPlaceDetail",dataType:"json",quietMillis:250,transport:function(t){return t.beforeSend=function(t){try{"function"==typeof EncH&&t.setRequestHeader("H",EncH())}catch(e){}t.setRequestHeader("K",getek()),t.setRequestHeader("I",getei()),t.setRequestHeader("Val",EncIV()),"undefined"!=typeof keepAlive&&t.setRequestHeader("keepAlive",keepAlive),1==e("#hdnToken1").length&&void 0!==e("#hdnToken1").val()&&t.setRequestHeader("token1",e("#hdnToken1").val()),1==e("#hdnToken2").length&&void 0!==e("#hdnToken2").val()&&t.setRequestHeader("token2",e("#hdnToken2").val()),1==e("#hdnToken0").length&&void 0!==e("#hdnToken0").val()&&t.setRequestHeader("token0",e("#hdnToken0").val())},e.ajax(t)},data:function(){return{searchText:e(_onlineCheckout.txtLiveStreamAddress).val(),countryFilter:countryMapping[e(_onlineCheckout.hdnLiveStreamCountryId).val()],Location:(""!=lattitude?parseFloat(lattitude):0)+","+(""!=longitude?parseFloat(longitude):0)}},results:function(e,t){return{results:e}},params:{error:function(e){try{if(403===e.status)return void location.reload(!0)}catch(e){}}},cache:!1},formatNoMatches:function(){return e("#select2-drop").css("display","block"),"No matches found"},formatSearching:function(){return e("#select2-drop").css("display","block"),"Searching"},formatInputTooShort:function(t,i){return e("#select2-drop").css("display","none"),""},initSelection:function(t,i){i({id:e(_onlineCheckout.txtLiveStreamAddress).val(),text:e(_onlineCheckout.txtLiveStreamAddress).val()})},formatResult:function(t){return e("#select2-drop").css("display","block"),'<div data-placeid="'+t.place_id+'"><span class="fullocation">'+t.FormattedAddress+"</span></div>"}});t.on("select2-loaded",function(t){e(".select2-result-unselectable").addClass("select2-result-selectable").removeClass("select2-result-unselectable")}),t.on("select2-blur",function(e){e.preventDefault()}),t.on("selected",function(t){ShowLoader(!0),e(t.currentTarget).select2("val",t.choice.CityState),e(t.currentTarget).attr("data-isselected","true"),e(t.currentTarget).attr("data-preval",t.choice.CityState),e(t.currentTarget).data("selectedid",t.choice.CityState);var i=new vagaro.ajax;i.datamodel.Token=ApiURLEnumOnlineCommon.getlocationsearchbyplaceid,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data={placeID:t.choice.place_id},i.datamodel.callback=function(t){if(ShowLoader(!1),null!=t&&"null"!=t){var i=null!=t&&null==t.city?"":t.city.split(",")[0],n=null==t.state?"":t.state;n=n.trim();var o={};o.street=t.Address,o.city=i,o.state=n,o.zip=t.zipCode,o.countryId=t.countryID,o.countrytext=countryMapping[t.countryID],o.statecode=t.stateCode,o.rowOffSet=t.utcOffset,o.timeZoneOffSet=t.timeZoneOffSet,o.isSupportDayLight=t.IsSupportDayLight,e("#hdnLiveStreamSelectedVal").val(JSON.stringify(o)),_onlineCheckout.ChangeCustomerStartTime(t.timeZoneOffSet,t.countryID,t.IsSupportDayLight)}},i.datamodel.Error=function(e){ShowLoader(!1),console.log(e)},i.Post()}),t.on("select2-close",function(t){e(t.currentTarget).removeAttr("data-isselected")})},_onlineCheckout.InitLiveStreamAddressControl=function(){e(_onlineCheckout.selectCountryDiv).removeClass().addClass("selectedcountry "+U[e(_onlineCheckout.hdnLiveStreamCountryId).val()]),_onlineCheckout.SetLiveStreamAddressControl(),_shopdetail.NewAddressHtml()},_onlineCheckout.CheckLiveStreamAddressVisibleOrNot=function(){if(e(_onlineCheckout.divLiveStreamAddressControl).hide(),0==String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0){var t=!1;e.each(onlineShoppingCartmain.Events,function(i,n){!String.isNullOrUndefineOrBlank(n.eventEnrollment)&&n.eventEnrollment.length>0&&e.each(n.eventEnrollment,function(e,i){(!String.isNullOrUndefineOrBlank(i.IsFromHomePage)&&1==i.IsFromHomePage||1==i.StreamingStatus)&&(t=!0)})}),1==t&&(e(_onlineCheckout.divLiveStreamAddressControl).show(),_onlineCheckout.InitLiveStreamAddressControl())}},_onlineCheckout.SetEventDateFormat=function(e,t,i,n){return String.isNullOrUndefineOrBlank(t)||String.isNullOrUndefineOrBlank(i)?_onlineCheckout.dateformate(e,"MMM DD, YYYY"):1==n?countryDateFormat(moment(t),VagaroCountryDateFormat.LargeDate):countryDateFormat(moment(t),VagaroCountryDateFormat.LargeDateWithTime)+" ("+i+")"},_onlineCheckout.SetEventTimeFormat=function(e,t,i,n,o){if(String.isNullOrUndefineOrBlank(i)||String.isNullOrUndefineOrBlank(o)||String.isNullOrUndefineOrBlank(n))return e.replace(/^0+/,"")+" - "+t.replace(/^0+/,"");var a=moment(n).format("h:mm A");return moment(i).format("h:mm A")+" - "+a+" ("+o+")"},_onlineCheckout.ChangeCustomerStartTime=function(t,i,n){ShowLoader(!0);var o=[];null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){var i={};i.autoId=t.autoId,i.eventID=t.eventID,i.eventName=t.eventName;var n=[];e.grep(t.eventEnrollment,function(e){if(1==e.StreamingStatus){var t={};t.autoID=e.autoID,t.appointmentID=e.appointmentID,t.eventID=e.eventID,t.UtcStartTime=e.UtcStartTime,t.workshopActualDate=e.eventDate,t.startTime=e.startTime,t.endTime=e.endTime,t.DurationValue=e.DurationValue,n.push(t)}}),null!=n&&n.length>0&&(i.eventEnrollment=n,o.push(i))});var a={ShoppingCartEvent:o,TimeZoneOffSet:t,CountryId:i,IsSupportDayLight:n,BusinessID:_shopdetail.businessID},s=new vagaro.ajax;s.datamodel.Token=ApiURLEnumOnlineCheckout.geteventtimezonedate,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.data={objRequest:a},s.datamodel.callback=function(e){ShowLoader(!1),null!=e&&null!=e.ShoppingCartEvent&&e.ShoppingCartEvent.length>0&&_onlineCheckout.SetCustomerStartTimeValue(e.ShoppingCartEvent)},s.datamodel.Error=function(e){ShowLoader(!1)},s.Post()},_onlineCheckout.SetCustomerStartTimeValue=function(t){null!=t&&t.length>0&&e.grep(t,function(t){var i=e.grep(onlineShoppingCart.Events,function(e){return e.autoId==t.autoId&&e.eventID==t.eventID}),n=e.grep(onlineShoppingCartmain.Events,function(e){return e.autoId==t.autoId&&e.eventID==t.eventID});e.grep(t.eventEnrollment,function(t){null!=i&&i.length>0&&e.grep(i,function(i){e.grep(i.eventEnrollment,function(e){e.autoID==t.autoID&&e.appointmentID==t.appointmentID&&(e.CustomerStartTime=t.CustomerStartTime,e.CustomerTimeZone=t.CustomerTimeZone,e.CustomerEndTime=t.CustomerEndTime)})}),null!=n&&n.length>0&&e.grep(n,function(i){e.grep(i.eventEnrollment,function(e){e.autoID==t.autoID&&e.appointmentID==t.appointmentID&&(e.CustomerStartTime=t.CustomerStartTime,e.CustomerTimeZone=t.CustomerTimeZone,e.CustomerEndTime=t.CustomerEndTime)})});var o=t.autoID+""+t.appointmentID;e("#dv"+o).html(_onlineCheckout.SetEventDateFormat(t.workshopActualDate,t.CustomerStartTime,t.CustomerTimeZone,!1)),e("#dvdt"+o).html(_onlineCheckout.SetEventDateFormat(t.workshopActualDate,t.CustomerStartTime,t.CustomerTimeZone,!0)),e("#dvti"+o).html(_onlineCheckout.SetEventTimeFormat(t.startTime,t.endTime,t.CustomerStartTime,t.CustomerEndTime,t.CustomerTimeZone))})})},_onlineCheckout.IsCalledFromLiveStream=function(){return"undefined"!=typeof _shopdetail&&void 0!==_shopdetail.IsCalledFromLiveStream&&null!=_shopdetail.IsCalledFromLiveStream&&_shopdetail.IsCalledFromLiveStream},_onlineCheckout.IsCCSupportedCountry=function(){return null!=typeof IsCCSupportedCountry&&null!=IsCCSupportedCountry&&1==IsCCSupportedCountry},_onlineCheckout.IsSelectGCEmployeeForWidget=function(){if("undefined"!=typeof _common&&(!String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)&&1==_common.IsWidgetForServiceProvider(!0)||_common.isCreateLinkPreserve(!0,!0))&&1==e(".MYDropDown").is(":visible")){var t=0;if(_common.isCreateLinkPreserve(!0,!0)){var i=_common.isCreateLinkPreserve(!1);t=1==i.length&&"-1"!=i[0]?parseInt(i[0]):0}else t=_common.IsWidgetForServiceProvider(!1);t>0&&(e(".SelectEmployee").val(t),e(".SelectEmployee").trigger("change"),e(".SelectEmployee").attr("disabled","disabled"))}},_onlineCheckout.GetCoreAPIURLWithToken=function(e,t){try{var i="",n=VagaroCorePublicAPIURLV2.split("/");if(void 0!==t&&null!=t&&""!=t)n[3]=t,i=n.join("/")+e;else if("undefined"!=typeof myAccountUserGroupID&&null!=myAccountUserGroupID&&""!=myAccountUserGroupID){var o=myAccountUserGroupID.split(",");o.length>0&&(n[3]=o[0],i=n.join("/")+e)}return""==i&&(i=CoreAPIURL+e),i}catch(t){return CoreAPIURL+e}},_onlineCheckout.ChangeCountry=function(t){_onlineCheckout.selectedCountryId=t;var i="";e(".countryflag").removeClass("active"),1==t?(e(".lblZipCode").text("ZIP Code:"),e("#txtNewZip").attr("placeholder","ZIP Code"),e("#lblState").text("State:"),e("#lblCity").text("City:"),e("#txtNewCity").attr("placeholder","City"),i="us-f"):2==t?(e(".lblZipCode").text("Postcode:"),e("#txtNewZip").attr("placeholder","Postcode"),e("#lblState").text("County:"),e("#lblCity").text("City:"),e("#txtNewCity").attr("placeholder","City"),i="uk-f"):3==t?(e(".lblZipCode").text("Postal Code:"),e("#txtNewZip").attr("placeholder","Postal Code"),e("#lblState").text("Province:"),e("#lblCity").text("City:"),e("#txtNewCity").attr("placeholder","City"),i="canada-f"):4==t&&(e(".lblZipCode").text("Postcode:"),e("#txtNewZip").attr("placeholder","Postcode"),e("#lblState").text("State/Territory:"),e("#lblCity").text("Suburb:"),e("#txtNewCity").attr("placeholder","Suburb"),i="aus-f"),0==_onlineCheckout.IsVPLAddress&&_onlineCheckout.BindState(!1),e("#cboCountryshopping").val(t),e(".flag-"+i).addClass("active"),e("#mycountrypopup").removeClass(),e("#mycountrypopup").addClass("selectedcountry "+i),e("#mycountrypopupVPL").removeClass(),e("#mycountrypopupVPL").addClass("selectedcountry "+i),e(".selectoptionpopup").css("display","none"),e(".selectoptionpopup").removeClass("active")},_onlineCheckout.GetState=function(){var e=new vagaro.ajax;e.datamodel.async=!1,e.datamodel.Token=_onlineCheckout.GetCoreAPIURLWithToken(ApiURLEnumOnlineCheckout.getState,groupID),e.datamodel.data={},e.datamodel.IsNewVagaroAPI=!0,e.datamodel.callback=_onlineCheckout.GetState_Success,e.datamodel.Error=_onlineCheckout.GetState_Failure,e.Post()},_onlineCheckout.GetState_Success=function(e){1e3==e.ResponseCode&&(_onlineCheckout.popupStateList=e.Data,_onlineCheckout.BindState(!0))},_onlineCheckout.GetState_Failure=function(e){swal({title:e.get_message(),text:"",timer:4e3,type:"error",showConfirmButton:!1,customClass:"swal-nobutton swal-white-greenbtn"},function(e){swal.close()})},_onlineCheckout.BindState=function(t){e(".ddlState").html(""),e(".ddlState").html('<option value="0">Select</option>'),e.grep(_onlineCheckout.popupStateList,function(t){t.CountryID==_onlineCheckout.selectedCountryId&&e(".ddlState").append(e("<option></option>").val(t.StateID).html(t.DisplayStateCode))}),1!=t||void 0===_onlineCheckout.selectedAddressData.statecode||isNullOrUndefineOrBlank(_onlineCheckout.selectedAddressData.statecode)||e.grep(_onlineCheckout.popupStateList,function(t){t.StateCode==_onlineCheckout.selectedAddressData.statecode&&e(".ddlState").val(t.StateID)})},_onlineCheckout.flagChange=function(t){var i=e("#mycountrypopup");if(1==t)i=e("#mycountrypopupVPL");if(i!==event.target&&!i.has(event.target).length){if("mycountrypopup"==event.target.id||"mycountrypopupselection"==event.target.id||"mycountrypopupVPL"==event.target.id||"mycountrypopupVPL"==event.target.id)return e("#ulcartcountryselectoptionpopup").is(":visible")?void e("#ulcartcountryselectoptionpopup").hide():void e("#ulcartcountryselectoptionpopup").show();e("#ulcartcountryselectoptionpopup").hide()}},_onlineCheckout.CreateAuthoriseList=function(t){_onlineCheckout.AuthoriseListData=[],void 0!==t&&null!=t&&void 0!==t.classCheckoutResponse&&null!=t.classCheckoutResponse&&t.classCheckoutResponse.length>0&&void 0!==t.classCheckoutResponse[0].failSPlistAndReason&&null!=t.classCheckoutResponse[0].failSPlistAndReason&&t.classCheckoutResponse[0].failSPlistAndReason.length>0&&e.grep(t.classCheckoutResponse[0].failSPlistAndReason,function(e){var t={};void 0!==e.NextActionUrl&&null!=e.NextActionUrl&&""!=e.NextActionUrl&&(t.NextActionUrl=e.NextActionUrl,t.MerchantTokenID=e.MerchantTokenID,t.Type=_onlineCheckout.ItemType.Class,t.Isauthorise=!1,e.vplAmount>0?t.IsVPLTransaction=!0:t.IsVPLTransaction=!1,_onlineCheckout.AuthoriseListData.push(t))}),void 0!==t&&null!=t&&void 0!==t.checkoutResponse&&null!=t.checkoutResponse&&void 0!==t.checkoutResponse.ccDistribution&&null!=t.checkoutResponse.ccDistribution&&t.checkoutResponse.ccDistribution.length>0&&e.grep(t.checkoutResponse.ccDistribution,function(e){var t={};void 0!==e.NextActionUrl&&null!=e.NextActionUrl&&""!=e.NextActionUrl&&(t.NextActionUrl=e.NextActionUrl,t.MerchantTokenID=e.MerchantTokenID,t.Type=_onlineCheckout.ItemType.Other,t.Isauthorise=!1,e.vplAmount>0?t.IsVPLTransaction=!0:t.IsVPLTransaction=!1,_onlineCheckout.AuthoriseListData.push(t))})},_onlineCheckout.AuthorisePayment=function(){var e={},t={buttonname:"bookwithcc"};e.CountryID=countryIdBusDetail,e.PaymentIntentURL=_onlineCheckout.AuthoriseListData[_onlineCheckout.AuthorisePaymnetCount].NextActionUrl,e.SuccessCallBackResponse=t,e.SuccessCallBack=SuccessCallBack=_onlineCheckout.threeDSSuccessCheckout,e.FailedCallback=_onlineCheckout.threeDSFailCheckout,e.IsAffirm=!1,_cardIntendent.LoadCardCaptureIntendentInfo(e)},_onlineCheckout.IsVagaroMarketplace=function(){return!String.isNullOrUndefineOrBlank(document.referrer)&&!String.isNullOrUndefineOrBlank(document.location.origin)&&document.referrer.indexOf(document.location.origin)>=0&&document.referrer.indexOf("/CheckInApp/")<=0&&!IsFromCreateLink},_onlineCheckout.VPLBankDetailsBind=function(){ShowLoader(!0);var t=e("<XMLDocument/>");t.append(_vgClassSessionSelection.createXmlElement("UsersDetail")),(o=_vgClassSessionSelection.createXmlElement("User")).append(_vgClassSessionSelection.createXmlElement("userid",parseInt(onlineShoppingCart.loginUserId))),o.append(_vgClassSessionSelection.createXmlElement("email","")),o.append(_vgClassSessionSelection.createXmlElement("isloginuser",!0)),o.append(_vgClassSessionSelection.createXmlElement("encryptUserId",glbEncryptUserIdWithSafeURL)),t.find("UsersDetail").append(o);for(var i=_vgClassSessionSelection.ManageEventTempAndRealData(!0,!1,!1),n=0;n<=i.length-1;n++){var o;if(parseInt(onlineShoppingCart.loginUserId)!=parseInt(i[n].customerID))(o=_vgClassSessionSelection.createXmlElement("User")).append(_vgClassSessionSelection.createXmlElement("userid",parseInt(i[n].customerID))),o.append(_vgClassSessionSelection.createXmlElement("email",i[n].cUserEmail)),t.find("UsersDetail").append(o)}var a=e("<XMLDocument/>");if(null!=onlineShoppingCartmain.Inventories&&onlineShoppingCartmain.Inventories.length>0){a.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",3)).append(_vgClassSessionSelection.createXmlElement("ns"))));for(n=0;n<onlineShoppingCartmain.Inventories.length;n++){var s=_vgClassSessionSelection.createXmlElement("n",onlineShoppingCartmain.Inventories[n].ProductName,!0);a.find("ns").append(s)}}var r=e("<XMLDocument/>");if(null!=onlineShoppingCartmain.Events&&onlineShoppingCartmain.Events.length>0){r.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",2)).append(_vgClassSessionSelection.createXmlElement("ns"))));for(n=0;n<onlineShoppingCartmain.Events.length;n++){var l=_vgClassSessionSelection.createXmlElement("n",onlineShoppingCartmain.Events[n].eventName.trim());r.find("ns").append(l)}}a.find("itms").length>0?r.find("itms").length>0&&a.find("itms").append(r.find("itms").html()):r.find("itms").length>0&&(a=r);var c={};c.userData=t.html(),c.businessID=onlineShoppingCart.BusinessID,c.productList=a.html(),c.isGetDepositsConfig=!1,"undefined"==typeof PromotionID||String.isNullOrUndefineOrBlank(PromotionID)?c.promotionID=0:c.promotionID=parseInt(PromotionID),c.isWebsiteBuilder=void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication||"undefined"!=typeof vgAppicationType&&1==vgAppicationType;var d=new vagaro.ajax;d.datamodel.async=!1,d.datamodel.Token=ApiURLEnumOnlineCheckout.getgcpackageandpointforonlinecheckout,d.datamodel.IsNewVagaroAPI=!0,d.datamodel.callback=function(t){if(onlineShoppingCartmain.UsersPoints=t.lstUserListForCheckout,onlineShoppingCartmain.IsPromotionEnable=t.IsPromotionEnable,onlineShoppingCart.IsPromotionEnable=t.IsPromotionEnable,onlineShoppingCart.IsDailyDealEnable=t.depositsClassConfigForCheckout.IsDailyDealEnable,onlineShoppingCartmain.IsDailyDealEnable=t.depositsClassConfigForCheckout.IsDailyDealEnable,IsFMBEnableForBusiness=t.IsFMBEnableForBusiness,_onlineCheckout.IsAnyDailyDealInCart()?(t.lstUserListForCheckout?.forEach(e=>{e.pointsBalance=0}),_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount=e.grep(e.extend(!0,[],t.lstGcAndPackagesForCheckout)||[],function(e){return e&&1==e.isPackage}),_onlineCheckout.lstUserListForCheckout_ShowDiscount=e.extend(!0,[],t.lstUserListForCheckout),_onlineCheckout.lstMembershipForCheckout_ShowDiscount=e.extend(!0,[],t.lstMembershipForCheckout)):(_onlineCheckout.lstGcAndPackagesForCheckout_ShowDiscount=e.extend(!0,[],t.lstGcAndPackagesForCheckout),_onlineCheckout.lstUserListForCheckout_ShowDiscount=e.extend(!0,[],t.lstUserListForCheckout),_onlineCheckout.lstMembershipForCheckout_ShowDiscount=e.extend(!0,[],t.lstMembershipForCheckout)),_onlineCheckout.IsPromotionEnable_ShowDiscount=t.IsPromotionEnable,_onlineCheckout.VPLUserBankDetails=t.lstVPLUserAccount,_onlineCheckout.ValidateOnePerUserDeal(1),_onlineCheckout.ReApplyDiscounts_ShowDiscount(),_onlineCheckout.IsSelectGCEmployeeForWidget(),e(".vpl-add-bank").html(""),void 0!==_onlineCheckout.VPLUserBankDetails&&null!=_onlineCheckout.VPLUserBankDetails&&(e("#tmplUserBankListtmplUserBankList").tmpl(t.lstVPLUserAccount).appendTo(".vpl-add-bank"),void 0!==_onlineCheckout.VPLUserBankDetails&&null!=_onlineCheckout.VPLUserBankDetails)){var i=_onlineCheckout.VPLUserBankDetails[0].Id;e("#addBankList #rb_"+i).attr("checked","checked")}},d.datamodel.data=c,d.datamodel.Error=function(e){},d.Post(),ShowLoader(!1)},_onlineCheckout.GetCustomerBankAccountDetails_Success=function(t){var i=t.Data;if(null!=i.vplUserAccounts&&i.vplUserAccounts.length>0){vplCustomerBankListCheckout=i.vplUserAccounts;var n=i.vplUserAccounts[i.vplUserAccounts.length-1].ACFourDigit;e("#BankList").html(""),e("#tmplUserBankListtmplUserBankList").tmpl(vplCustomerBankListCheckout).appendTo("#BankList"),e("#rb_"+n).attr("checked","checked")}e("#"+_vgCovidCleanCheckout.model.vplAppliedPopup).hide(),e("#"+_vgCovidCleanCheckout.model.vplAppliedPopup).css("display","none"),e("#"+_vgCovidCleanCheckout.model.divVplCheckoutTip).hide(),e("#"+_vgCovidCleanCheckout.model.divVplCheckoutSlotList).show()},_onlineCheckout.BindVPLBank=function(){ShowLoader(!0);var t={};t.UserID=parseInt(UserID),t.EncryptUserID=glbEncryptUserId;var i=new vagaro.ajax;i.datamodel.async=!1,i.datamodel.Token=_onlineCheckout.GetCoreAPIURLWithToken(ApiURLEnumOnlineCheckout.getuservplaccountdetail,groupID),i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(t){ShowLoader(!1),_onlineCheckout.VPLUserBankDetails=t.Data,"undefined"!=typeof ObjBankDetail&&(ObjBankDetail=t.Data.vplUserAccounts);var i=t.Data;e(".vpl-add-bank").html(""),void 0!==i.vplUserAccounts&&null!=i.vplUserAccounts&&(e("#tmplUserBankListtmplUserBankList").tmpl(i.vplUserAccounts).appendTo(".vpl-add-bank"),e("#addBankList #rb_"+i.vplUserAccounts[0].Id).attr("checked","checked"))},i.datamodel.data=t,i.datamodel.Error=function(e){ShowLoader(!1)},i.Post()},_onlineCheckout.IsVagaroFeaturedMarketplace=function(){var e=getCookie(_shopdetail.businessID);return void 0!==e&&null!=e&&_shopdetail.businessID,!1},_onlineCheckout.ApplyMultipleTax=function(t,i){var n=String.isNullOrUndefineOrBlank(i.BusinessTax)||"[]"==i.BusinessTax?"":i.BusinessTax;return String.isNullOrUndefineOrBlank(n)||e.grep(n,function(e){void 0===i||1!=i.isPackage&&1!=i.isPointApply||1==i.IsPartialPoint?e.CalculatedTax=_onlineCheckout.parseTodecimal(t*e.Tax/100,2):e.CalculatedTax=_onlineCheckout.parseTodecimal(0,2)}),n},_onlineCheckout.ApplyMultipleFees=function(e,t,i,n,o){if(t)if(void 0===n||n!=CartItemTypeEnumOnlineCheckout.Product&&n!=CartItemTypeEnumOnlineCheckout.GC?i.Qty+=1:i.Qty+=o,1==i.AmountType)void 0!==n&&n==CartItemTypeEnumOnlineCheckout.Product?i.CalculatedFees+=i.FeeAmount*o:(i.CalculatedFees+=i.FeeAmount,void 0!==n&&n==CartItemTypeEnumOnlineCheckout.Class&&0==_onlineCheckout.IsPrepayBusinessFee()&&(i.Qty-=1,i.CalculatedFeesForClass+=i.FeeAmount));else if(void 0!==n&&n==CartItemTypeEnumOnlineCheckout.GC)i.CalculatedFees+=_onlineCheckout.parseTodecimal(e*o*i.FeeAmount/100,2);else{var a=_onlineCheckout.parseTodecimal(e*i.FeeAmount/100,2);i.CalculatedFees+=a,void 0!==n&&n==CartItemTypeEnumOnlineCheckout.Class&&0==_onlineCheckout.IsPrepayBusinessFee()&&(i.Qty-=1,i.CalculatedFeesForClass+=a)}else if(i.Qty=1,1==i.AmountType)i.CalculatedFees=i.FeeAmount,void 0!==n&&n==CartItemTypeEnumOnlineCheckout.Class&&0==_onlineCheckout.IsPrepayBusinessFee()&&(i.CalculatedFeesForClass=i.FeeAmount);else{var s=_onlineCheckout.parseTodecimal(e*i.FeeAmount/100,2);i.CalculatedFees+=s,void 0!==n&&n==CartItemTypeEnumOnlineCheckout.Class&&0==_onlineCheckout.IsPrepayBusinessFee()&&(i.CalculatedFeesForClass+=s)}i.paidType=1==_onlineCheckout.IsPrepayBusinessFee()?_onlineCheckout.arrpaidType.Paid:_onlineCheckout.arrpaidType.Deposits},_onlineCheckout.IsPrepayBusinessFee=function(){var t=!0;return void 0!==onlineShoppingCart.Events&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(e){e.paidType!=_onlineCheckout.arrpaidType.PaidClass&&(t=!1)})}),t},_onlineCheckout.UpdateBusinessTaxForBusinessFee=function(){e.grep(onlineShoppingCart.BusinessFee,function(t){null!=t.BusinessTax&&t.BusinessTax.length>0&&e.grep(t.BusinessTax,function(e){void 0!==e.PreviousCalculatedTax&&null!=e.PreviousCalculatedTax||(e.PreviousCalculatedTax=_onlineCheckout.parseTodecimal(e.CalculatedTax,2),e.PreviousCalculatedTaxForClass=_onlineCheckout.parseTodecimal(String.isNullOrUndefineOrBlank(e.CalculatedTaxForClass)?0:e.CalculatedTaxForClass,2)),e.CalculatedTax=_onlineCheckout.parseTodecimal(e.PreviousCalculatedTax,2)-_onlineCheckout.parseTodecimal(e.PreviousCalculatedTaxForClass,2)})})},_onlineCheckout.ApplyMultipleFeesonAllItems=function(t){var i;if(null!=onlineShoppingCart.BusinessFee&&0!=onlineShoppingCart.BusinessFee.length&&(null!=(i=1==t?e.grep(onlineShoppingCart.BusinessFee,function(e){return 1==e.FeeType}):0==t?e.grep(onlineShoppingCart.BusinessFee,function(e){return 0==e.FeeType}):onlineShoppingCart.BusinessFee)&&i.length>0)){var n=0,o=0;e.grep(i,function(i){if(1==_onlineCheckout.isValidForCheckoutInvoice()){var a=String.isNullOrUndefineOrBlank(i.ApplyType)?"":i.ApplyType.split(",");_onlineCheckout.IsVCFFeeExists()&&a.indexOf("99")>-1&&2==t&&_onlineCheckout.ApplyMultipleFees(0,!1,i),o+=i.CalculatedFees,i.BusinessTax=String.isNullOrUndefineOrBlank(i.Taxes)||"[]"==i.Taxes?"":JSON.parse(i.Taxes),i.BusinessTax="[]"==i.BusinessTax?"":i.BusinessTax;var s=0;!String.isNullOrUndefineOrBlank(i.BusinessTax)&&"[]"!=i.Taxes&&i.BusinessTax.length>0&&e.grep(i.BusinessTax,function(e){e.CalculatedTax=_onlineCheckout.parseTodecimal(e.Tax*i.CalculatedFees/100,2),n+=e.CalculatedTax,s+=e.CalculatedTax}),i.CalculatedTax=s,i.CalculatedFeesForClass=0,i.CalculatedTaxForClass=0}else{i.CalculatedFees=0,i.CalculatedTax=0,i.Qty=0,i.CalculatedFeesForClass=0,i.CalculatedTaxForClass=0,i.ActualPrice=0,i.ActualTax=0;a=i.ApplyType.split(",");if(1==i.AutoApplyFees){if(0==i.TransactionType)a.indexOf(CartItemTypeEnumOnlineCheckout.Membership)>-1&&null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.each(onlineShoppingCart.Memberships,function(e,t){_onlineCheckout.ApplyMultipleFees(t.ActualPrice,!0,i)}),a.indexOf(CartItemTypeEnumOnlineCheckout.Package)>-1&&null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.each(onlineShoppingCart.Packages,function(e,t){_onlineCheckout.ApplyMultipleFees(t.ActualPrice,!0,i)}),a.indexOf(CartItemTypeEnumOnlineCheckout.Product)>-1&&null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&e.each(onlineShoppingCart.Inventories,function(e,t){1==t.isPointApply?t.pointsRedeem==t.OriginalPointsRedeem?_onlineCheckout.ApplyMultipleFees(0,!0,i,CartItemTypeEnumOnlineCheckout.Product,t.Quantity):_onlineCheckout.ApplyMultipleFees(t.ActualPrice,!0,i,CartItemTypeEnumOnlineCheckout.Product,t.Quantity):_onlineCheckout.ApplyMultipleFees(t.Price,!0,i,CartItemTypeEnumOnlineCheckout.Product,t.Quantity)}),a.indexOf(CartItemTypeEnumOnlineCheckout.Class)>-1&&1==_onlineCheckout.IsCalculateAndDisplayFeeOnline()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&e.each(onlineShoppingCart.Events,function(t,n){e.each(n.eventEnrollment,function(e,t){_onlineCheckout.ApplyMultipleFees(t.price,!0,i,CartItemTypeEnumOnlineCheckout.Class)})}),a.indexOf(CartItemTypeEnumOnlineCheckout.Service)>-1&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.each(onlineShoppingCart.ServiceInvoice,function(e,t){var n=void 0!==t.isPackageApplied&&t.isPackageApplied?t.price:onlineShoppingCart.ServiceInvoice[0].ServiceOrginalPrice;_onlineCheckout.ApplyMultipleFees(n,!0,i)}),a.indexOf(CartItemTypeEnumOnlineCheckout.GC)>-1&&null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&e.each(onlineShoppingCart.GiftCertificates,function(e,t){_onlineCheckout.ApplyMultipleFees(t.Price,!0,i,CartItemTypeEnumOnlineCheckout.GC,t.NoOfVisit)});else{if(null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&a.indexOf(CartItemTypeEnumOnlineCheckout.ServiceInvoice)>-1){var r=0;e.each(onlineShoppingCart.ServiceInvoice,function(e,t){r+=void 0!==t.isPackageApplied&&t.isPackageApplied?t.price:t.ServiceOrginalPrice}),_onlineCheckout.ApplyMultipleFees(r,!1,i)}if(null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&a.indexOf(CartItemTypeEnumOnlineCheckout.Class)>-1&&1==_onlineCheckout.IsCalculateAndDisplayFeeOnline()){var l=0;e.each(onlineShoppingCart.Events,function(t,i){e.each(i.eventEnrollment,function(e,t){l+=t.price})}),_onlineCheckout.ApplyMultipleFees(l,!1,i,CartItemTypeEnumOnlineCheckout.Class)}if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&a.indexOf(CartItemTypeEnumOnlineCheckout.Product)>-1){var c=0;e.each(onlineShoppingCart.Inventories,function(e,t){t.pointsRedeem==t.OriginalPointsRedeem?c+=t.Price:c+=t.ActualPrice}),_onlineCheckout.ApplyMultipleFees(c,!1,i)}if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&a.indexOf(CartItemTypeEnumOnlineCheckout.Membership)>-1){var d=0;e.each(onlineShoppingCart.Memberships,function(e,t){d+=t.ActualPrice}),_onlineCheckout.ApplyMultipleFees(d,!1,i)}if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&a.indexOf(CartItemTypeEnumOnlineCheckout.Package)>-1){var u=0;e.each(onlineShoppingCart.Packages,function(e,t){u+=t.ActualPrice}),_onlineCheckout.ApplyMultipleFees(u,!1,i)}if(null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&a.indexOf(CartItemTypeEnumOnlineCheckout.GC)>-1){var p=0;e.each(onlineShoppingCart.GiftCertificates,function(e,t){p+=t.Price*t.NoOfVisit}),_onlineCheckout.ApplyMultipleFees(p,!1,i)}_onlineCheckout.IsVCFFeeExists()&&a.indexOf("99")>-1&&2==t&&_onlineCheckout.ApplyMultipleFees(0,!1,i)}o+=i.CalculatedFees,i.ActualPrice+=i.CalculatedFees;s=0;var h=0;null!=i.BusinessTax&&i.BusinessTax.length>0&&e.grep(i.BusinessTax,function(e){e.CalculatedTax=_onlineCheckout.parseTodecimal(e.Tax*i.CalculatedFees/100,2),e.CalculatedTaxForClass=_onlineCheckout.parseTodecimal(e.Tax*i.CalculatedFeesForClass/100,2),n+=e.CalculatedTax,s+=e.CalculatedTax,h+=e.CalculatedTaxForClass}),i.CalculatedTax=s,i.CalculatedTaxForClass=h,i.ActualTax=i.CalculatedTax}}});var a=0,s=0,r=0,l=0;e.grep(onlineShoppingCart.BusinessFee,function(e){e.DisplayCalculatedFees=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(e.CalculatedFees,2)-_onlineCheckout.parseTodecimal(e.CalculatedFeesForClass,2),2),e.DisplayCalculatedTax=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(e.CalculatedTax,2)-_onlineCheckout.parseTodecimal(e.CalculatedTaxForClass,2),2),a=_onlineCheckout.parseTodecimal(a+_onlineCheckout.parseTodecimal(e.CalculatedFeesForClass,2)+_onlineCheckout.parseTodecimal(e.CalculatedTaxForClass,2),2),r+=e.DisplayCalculatedFees,l+=e.DisplayCalculatedTax,s=_onlineCheckout.parseTodecimal(s+_onlineCheckout.parseTodecimal(e.CalculatedTaxForClass,2),2)}),onlineShoppingCart.totalFeeAmount=o,onlineShoppingCart.totalFeeTax=n,onlineShoppingCart.totalFeeAmountPrepay=r,onlineShoppingCart.totalFeeTaxPrepay=l,onlineShoppingCart.FeeDepositsRemaining=a,onlineShoppingCart.FeeTaxDepositsRemaining=s}},_onlineCheckout.DisplayBusinessTaxes=function(){e("#divfinalcheckoutMultipletaxes").hide(),e("#divfinalcheckoutMultipletaxes").html("");var t=[];null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)})}),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&(_onlineCheckout.IsBuyGC?e.grep(onlineShoppingCart.GiftCertificates,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)})}):e.grep(onlineShoppingCart.GiftCertificates,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,n){"True"!=_onlineCheckout.isFromInvoice&&i.NoOfVisit>1&&(n.CalculatedTax=n.CalculatedTax*i.NoOfVisit),t.push(n)})})),null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)})}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)}),null!=i.lstAddonService&&null!=i.lstAddonService&&i.lstAddonService.length>0&&e.grep(i.lstAddonService,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)})})}),null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&(1==_onlineCheckout.IsCalculateAndDisplayFeeOnline()&&0==_onlineCheckout.IsCalculateAndDisplayFeeOnline(!0)||1==onlineShoppingCart.IsIncludeTaxInOnlinePricing)&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)}),null!=i.lstAddonService&&null!=i.lstAddonService&&i.lstAddonService.length>0&&e.grep(i.lstAddonService,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)})})})}),null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&e.grep(onlineShoppingCart.BusinessFee,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)})}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(i){var n=i.BusinessTax;null!=n&&""!=n&&"[]"!=n&&e.each(n,function(e,i){t.push(i)})});var i=[];if(t.reduce(function(e,t){return e[t.TaxName]||(e[t.TaxName]={TaxName:t.TaxName,Tax:0,CalculatedTax:0,BusinessTaxID:t.BusinessTaxID},i.push(e[t.TaxName])),e[t.TaxName].Tax+=t.Tax,e[t.TaxName].CalculatedTax+=parseFloat(t.CalculatedTax),e},{}),null!=i&&i.length>0){for(var n="",o=0;o<i.length;o++){var a=i[o].CalculatedTax;a>0&&(n+='<div class="div-block-26" role="contentinfo" aria-labelledby="divTaxTitle divfinalcheckoutMultipletaxes"><div id="divMultipleTaxTitle_'+i[o].BusinessTaxID+'" aria-hidden="true" class="web-body-font web-builder-font-color">'+i[o].TaxName+'</div><div id="divMultipleTaxValue_'+i[o].BusinessTaxID+'" class="web-body-font web-builder-font-color" aria-hidden="true">'+currencysymbol+a.format("#.##")+"</div></div>")}e("#divfinalcheckoutMultipletaxes").html(n),e("#divfinalcheckoutMultipletaxes").show()}},_onlineCheckout.DisplayBusinessFees=function(){if(e("#divfinalcheckoutMultipleFees").hide(),e("#divfinalcheckoutMultipleFees").html(""),null!=onlineShoppingCart.BusinessFee){e("#divfinalcheckoutMultipleFees").html("");for(var t="",i=0;i<onlineShoppingCart.BusinessFee.length;i++){if(0==onlineShoppingCart.BusinessFee[i].FeeType)(o=onlineShoppingCart.BusinessFee[i].CalculatedFees)>0&&(t+='<div class="div-block-26" role="contentinfo" aria-labelledby="divFeesTitle divfinalcheckoutMultipleFees"><div id="divMultipleFeesTitle_'+onlineShoppingCart.BusinessFee[i].BusinessFeeID+'" aria-hidden="true" class="web-body-font web-builder-font-color">'+onlineShoppingCart.BusinessFee[i].FeeName+'</div><div id="divMultipleFeesValue_'+onlineShoppingCart.BusinessFee[i].BusinessFeeID+'" class="web-body-font web-builder-font-color" aria-hidden="true">'+currencysymbol+o.format("#.##")+"</div></div>")}var n=e.grep(onlineShoppingCart.BusinessFee,function(e){return 1==e.FeeType});if(void 0!==n&&null!=n&&n.length>0){itemFees=n[0];var o=itemFees.CalculatedFees*n.length;if(!String.isNullOrUndefineOrBlank(o)&&0!=o)if(n.length>1){var a=itemFees.FeeName+" ("+currencysymbol+itemFees.CalculatedFees+")";t+='<div class="div-block-26" role="contentinfo" aria-labelledby="divFeesTitle divfinalcheckoutMultipleFees"><div id="divMultipleFeesTitle_'+itemFees.BusinessFeeID+'" aria-hidden="true" class="web-body-font web-builder-font-color">'+a+'</div><div id="divMultipleFeesValue_'+itemFees.BusinessFeeID+'" class="web-body-font web-builder-font-color" aria-hidden="true">'+currencysymbol+o.format("#.##")+"</div></div>"}else t+='<div class="div-block-26" role="contentinfo" aria-labelledby="divFeesTitle divfinalcheckoutMultipleFees"><div id="divMultipleFeesTitle_'+itemFees.BusinessFeeID+'" aria-hidden="true" class="web-body-font web-builder-font-color">'+itemFees.FeeName+'</div><div id="divMultipleFeesValue_'+itemFees.BusinessFeeID+'" class="web-body-font web-builder-font-color" aria-hidden="true">'+currencysymbol+o.format("#.##")+"</div></div>"}e("#divfinalcheckoutMultipleFees").html(t),e("#divfinalcheckoutMultipleFees").show()}},_onlineCheckout.CalculateAddonTotal=function(t){var i=0;return e.each(t,function(e,t){if(null!=t.lstAddonService&&null!=t.lstAddonService&&t.lstAddonService.length>0)for(e=0;e<t.lstAddonService.length;e++)1==onlineShoppingCart.IsIncludeTaxInOnlinePricing?i+=parseFloat(t.lstAddonService[e].roundedPriceWithTax):i+=parseFloat(t.lstAddonService[e].displayroundedPrice-t.lstAddonService[e].discount-t.lstAddonService[e].classAddonGCUsed)}),i},_onlineCheckout.CreateAddonXMl=function(t,i,n,o){var a=onlineShoppingCartmain.UsersPoints;e.each(t,function(t,s){var r=null;r=_vgClassSessionSelection.createXmlElement("appointment");var l;if(l=i.isHandleDuetoException,r.append(_vgClassSessionSelection.createXmlElement("isHandleDuetoException",1==l?"1":"0")),r.append(_vgClassSessionSelection.createXmlElement("appId",i.appointmentID)),r.append(_vgClassSessionSelection.createXmlElement("spid",i.sPID)),r.append(_vgClassSessionSelection.createXmlElement("spname","")),r.append(_vgClassSessionSelection.createXmlElement("isworkshop",i.IsWorkShop)),r.append(_vgClassSessionSelection.createXmlElement("appstarttime",new Date(i.eventDate).format("yyyy-MM-dd")+" "+i.startTime)),n.append(r),r.append(_vgClassSessionSelection.createXmlElement("fname",i.cFirstName)),r.append(_vgClassSessionSelection.createXmlElement("lname",i.cLastName)),r.append(_vgClassSessionSelection.createXmlElement("email",i.cUserEmail)),r.append(_vgClassSessionSelection.createXmlElement("cellno",i.cUserCellNo)),r.append(_vgClassSessionSelection.createXmlElement("paidtype",s.paidType)),r.append(_vgClassSessionSelection.createXmlElement("streamingstatus",i.StreamingStatus)),(s.paidType==_onlineCheckout.arrpaidType.DepositsClass||s.paidType==_onlineCheckout.arrpaidType.PartiallyPaidClass)&&void 0!==s.depositsPaid){if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&s.depositsPercentage<100){var c=parseFloat(_onlineCheckout.ConvertDecimalWithFixed(100*parseFloat(s.depositsPaid)/s.Price,!0,2));s.depositsPercentage=c}r.append(_vgClassSessionSelection.createXmlElement("depositspercentage",s.depositsPercentage)),r.append(_vgClassSessionSelection.createXmlElement("depositspaid",s.depositsPaid)),r.append(_vgClassSessionSelection.createXmlElement("payableamount",s.Price)),r.append(_vgClassSessionSelection.createXmlElement("depositsremaining",_onlineCheckout.parseTodecimal(s.Price-s.depositsPaid,2)))}if(onlineShoppingCart.tipPercent>0&&s.paidType==_onlineCheckout.arrpaidType.PaidClass){_onlineCheckout.TipApplyCounter=++_onlineCheckout.TipApplyCounter;var d=_onlineCheckout.parseTodecimal(s.Price,2);(1==s.isPackage||1==s.isPointApply||s.isMembershipApply||void 0!==s.isPresetApply&&s.isPresetApply||void 0!==s.PromotionID&&null!=s.PromotionID&&s.PromotionID>0)&&(d=_onlineCheckout.parseTodecimal(s.Originalprice,2));var u=0;u=_onlineCheckout.TipApplyCounter==_onlineCheckout.TotalPaidCount?_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-_onlineCheckout.TipAppliedSum,2):_onlineCheckout.parseTodecimal(d*onlineShoppingCart.tipPercent/100,2),r.append(_vgClassSessionSelection.createXmlElement("tipAmount",u)),_onlineCheckout.TipAppliedSum+=u}var p=0;void 0!==s.PromotionID&&s.PromotionID>0&&1!=s.isPointApply&&(null==s.gcId||0==s.gcId||s.gcId>0&&0==s.isPackage)&&(p=s.PromotionID,r.append(_vgClassSessionSelection.createXmlElement("presetdiscountamount",s.discount))),r.append(_vgClassSessionSelection.createXmlElement("promotionid",p)),void 0!==s.isPresetApply&&1==s.isPresetApply&&(r.append(_vgClassSessionSelection.createXmlElement("discountid",s.DiscountID)),r.append(_vgClassSessionSelection.createXmlElement("ispresetapply",s.isPresetApply))),void 0!==s.IsAmount&&r.append(_vgClassSessionSelection.createXmlElement("isamount",s.IsAmount)),void 0!==s.AmountValue&&r.append(_vgClassSessionSelection.createXmlElement("amountvalue",s.AmountValue));var h="";0==i.customerID?(h=v=e.grep(a,function(e){return 0==i.customerID&&e.emailId==i.cUserEmail}),null!=v&&v.length>0?r.append(_vgClassSessionSelection.createXmlElement("userid",v[0].userId)):r.append(_vgClassSessionSelection.createXmlElement("userid",i.customerID))):(h=e.grep(a,function(e){return e.userId==i.customerID}),r.append(_vgClassSessionSelection.createXmlElement("userid",i.customerID)));if(null!=h&&h.length>0&&r.append(_vgClassSessionSelection.createXmlElement("isnewcustomer",h[0].isNewCustomer)),1==o&&(1==s.isPackage||0==s.isPackage)&&(s.gcId>0||s.gcId<0&&1==s.isPackage)||1==s.isPriceBaseGCApply){var m=[],g=[];1==s.isPriceBaseGCApply?(s.isPackage=!1,r.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!0))):r.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!1)),r.append(_vgClassSessionSelection.createXmlElement("ispackage",s.isPackage)),1==s.isPriceBaseGCApply&&e.each(s.GCDetail,function(e,t){m.push(t.GCId),g.push(t.GCAmount)}),r.append(_vgClassSessionSelection.createXmlElement("packageid",s.gcId<0?_onlineCheckout.GetPackageId(s.gcId):0)),r.append(_vgClassSessionSelection.createXmlElement("gcid",void 0===s.gcId||null==s.gcId?0:s.gcId)),r.append(_vgClassSessionSelection.createXmlElement("gcids",0==m.length?0:m.join(","))),r.append(_vgClassSessionSelection.createXmlElement("gcamount",0==g.length?0:g.join(","))),s.RedeemServiceId>0&&r.append(_vgClassSessionSelection.createXmlElement("redeemserviceid",s.RedeemServiceId))}if(1==o&&1==s.isPointApply&&(r.append(_vgClassSessionSelection.createXmlElement("ispointapply",s.isPointApply)),r.append(_vgClassSessionSelection.createXmlElement("pointsredeem",s.pointsRedeem))),1==o&&(r.append(_vgClassSessionSelection.createXmlElement("taxes",s.TaxValue)),r.append(_vgClassSessionSelection.createXmlElement("calculatedTaxTypeWise",String.isNullOrUndefineOrBlank(s.BusinessTax)?"[]":JSON.stringify(s.BusinessTax).toString())),null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&e.grep(onlineShoppingCart.lstGCPkgData,function(t){t.giftCertificateID==s.gcId&&null!=t.Taxes&&(r.append(_vgClassSessionSelection.createXmlElement("taxes","0")),e.grep(s.BusinessTax,function(e){onlineShoppingCart.classFinalTotal=parseFloat(ConvertTodecimalMorePrecious(parseFloat(onlineShoppingCart.classFinalTotal)-e.CalculatedTax,!0,2)),onlineShoppingCart.classTax>0&&(onlineShoppingCart.classTax=parseFloat(ConvertTodecimalMorePrecious(parseFloat(onlineShoppingCart.classTax)-e.CalculatedTax,!0,2))),e.CalculatedTax=0,_onlineCheckout.IsTaxCalculated=!0}))}),r.append(_vgClassSessionSelection.createXmlElement("addontaxation",s.tax))),1==o&&1==s.isMembershipApply&&null!=s.membershipUniqueID&&null!=s.membershipUniqueID&&""!=i.membershipUniqueID){r.append(_vgClassSessionSelection.createXmlElement("ismembershipapply",s.isMembershipApply)),r.append(_vgClassSessionSelection.createXmlElement("membershipdiscountpercentage",s.membershipDiscount)),r.append(_vgClassSessionSelection.createXmlElement("membershipuserid",s.membershipuserid)),r.append(_vgClassSessionSelection.createXmlElement("membershipuniqueid",s.membershipUniqueID));var v,f=null;if((f=_vgClassSessionSelection.createXmlElement("membershipredeemeddetails")).append(_vgClassSessionSelection.createXmlElement("businessid",s.BusinessID)),f.append(_vgClassSessionSelection.createXmlElement("redeembusinessid",s.RedeemBusinessId)),0==i.customerID)null!=(v=e.grep(a,function(e){return 0==i.customerID&&e.emailId==i.cUserEmail}))&&v.length>0?f.append(_vgClassSessionSelection.createXmlElement("userid",v[0].userId)):f.append(_vgClassSessionSelection.createXmlElement("userid",i.customerID));else f.append(_vgClassSessionSelection.createXmlElement("userid",i.customerID));f.append(_vgClassSessionSelection.createXmlElement("membershipuserid",s.membershipuserid)),f.append(_vgClassSessionSelection.createXmlElement("redeemuserid",s.membershipuserid)),f.append(_vgClassSessionSelection.createXmlElement("itemtype",20)),f.append(_vgClassSessionSelection.createXmlElement("type",20)),f.append(_vgClassSessionSelection.createXmlElement("membershipid",s.MembershipID)),f.append(_vgClassSessionSelection.createXmlElement("membershipitemid",s.MembershipItemId)),f.append(_vgClassSessionSelection.createXmlElement("groupid",s.GroupId)),f.append(_vgClassSessionSelection.createXmlElement("isunlimitedvisit",-1==s.VisitRemaining)),f.append(_vgClassSessionSelection.createXmlElement("serviceproductname",s.ServiceTitle.trim())),r.append(f)}if(0==isCheckInApp){var C=!1;e(".cartremoverdtl").each(function(t,i){void 0!==e(i).attr("data-isWorkShop")&&"true"==e(i).attr("data-isWorkShop").toLowerCase()&&(C=!0)});var S=_shopdetail.GetRescheduleDetail();null!=S&&(C||(isReschedule=!0),r.append(_vgClassSessionSelection.createXmlElement("eventsessionattendeeid",S.EventSessionAttendeesId)))}r.append(_vgClassSessionSelection.createXmlElement("isAddon",!0)),r.append(_vgClassSessionSelection.createXmlElement("isupsell",(!String.isNullOrUndefineOrBlank(s.isMembershipApply)&&0!=s.isMembershipApply||!String.isNullOrUndefineOrBlank(s.isPackage)&&0!=s.isPackage)&&_onlineCheckout.IsCheckMemPkgUpsellExists(s.isMembershipApply,s.MembershipID))),r.append(_vgClassSessionSelection.createXmlElement("uniqueAddonID","addon"+i.appointmentID+i.autoID)),r.append(_vgClassSessionSelection.createXmlElement("serviceid",s.ServiceId)),r.append(_vgClassSessionSelection.createXmlElement("addonname",s.ServiceTitle)),r.append(_vgClassSessionSelection.createXmlElement("price",s.Originalprice)),r.append(_vgClassSessionSelection.createXmlElement("ispartialpointapply",void 0!==s.IsPartialPoint&&s.IsPartialPoint)),r.append(_vgClassSessionSelection.createXmlElement("partialserviceprice",s.Price))})},_onlineCheckout.OpenAddonModal=function(t,i){ShowLoader(!0);var n=e.grep(onlineShoppingCart.Events,function(e){return e.eventID==t});e("#eventDescription").html("").removeClass("height80").removeAttr("style"),e("#divEventName").text(n[0].eventName),e("#eventDescription").text(n[0].eventDesc),e("#eventDescription").show(),null!=n[0].eventDesc&&""!=n[0].eventDesc||e("#eventDescription").hide(),null==n[0].smallimage||""==n[0].smallimage||n[0].smallimage.indexOf("no-shop-image-big.")>0?e("#divaddonPopupHeader").addClass("no-image-data"):(e("#divaddonPopupHeader").removeClass("no-image-data"),e("#eventimage").css("background-image","url("+n[0].smallimage+")"),e("#eventimage").show());var o=e.grep(n[0].eventEnrollment,function(e){return e.autoID==i}),a={UserID:onlineShoppingCart.loginUserId,ServiceId:parseInt(t),BusinessID:parseInt(_vgClassSessionSelection.GetCommonBusinessID()),ServiceProviderID:parseInt(o[0].sPID)},s=new vagaro.ajax;s.datamodel.Token="GetListofFamilyFriendtoBook",s.datamodel.data=[a],s.datamodel.callback=function(o){_vgClassSessionSelection.commonProperty.isAddonPopup=!0,_vgClassSessionSelection.SetFamilyFriendListData(o,1,!0);var a=n[0].actualPrice>0?_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(n[0].actualPrice,2).format("#.##"):"FREE";e("#divHdrEventPrice").text(a);var s=e.grep(n[0].eventEnrollment,function(e){return e.autoID==i});if(null!=s&&s.length>0){var r=s[0].customerID;_onlineCheckout.UpdateAttendeeSelectionOnAddonPopup(e("#lstoffamilyandfriends").find('[data-value="'+r+'"]')[0])}_onlineCheckout.BindSelectedAddon(n,i),e("#btnContinue").attr("data-enrollAutoId",i),e("#btnContinue").attr("data-eventID",t),e("#divHdrEventPrice").show(),e("#divUserDetail").show(),e("#mob-addnew").hide(),e("#divclassaddonpopup").modal("show"),_onlineCheckout.LoadEventForAddonClass(),e("#eventDescription")[0].scrollHeight<=80?(e("#divMoreContent").hide(),e("#eventDescription").removeClass("height80")):(e("#eventDescription").addClass("height80"),e("#btnMoreContent").html("More"),e("#btnMoreContent").removeClass("active"),e("#divMoreContent").show()),ShowLoader(!1)},s.datamodel.Error=_vgClassSessionSelection.CallFailed,s.Post()},_onlineCheckout.BindSelectedAddon=function(t,i){var n=e.grep(t[0].eventEnrollment,function(e){return e.autoID==i});null!=n[0].lstAddonService&&null!=n[0].lstAddonService&&n[0].lstAddonService.length>0&&e.each(n[0].lstAddonService,function(t){e("#check_"+n[0].lstAddonService[t].ServiceId).prop("checked",!0),e("#rdo_"+n[0].lstAddonService[t].ServiceId).prop("checked",!0)}),_vgClassSessionSelection.CalculateTotalPrice()},_onlineCheckout.UpdateAddonService=function(){var t=0;e("div.clsaccordion").find(".panel-default").each(function(){void 0===e(this).attr("data-value")&&(t+=1)});var i=_vgClassSessionSelection.AddonValidate();if(0==t&&i){var n=0,o=parseInt(e("#btnContinue").attr("data-enrollAutoId")),a=parseInt(e("#btnContinue").attr("data-eventID")),s=JSON.parse(JSON.stringify(onlineShoppingCartmain.Events)),r=e.grep(s,function(e){return e.eventID==a}),l=e.grep(r[0].eventEnrollment,function(e){return e.autoID==o});if(l.length>0){var c=e("div.clsaccordion").find(".panel-default").attr("data-value"),d=e("div.clsaccordion").find(".panel-default").attr("data-email");if(c!=l[0].customerID&&r.length>0&&_onlineCheckout.CheckUserExistanceWhenAddonUpdate(c,d,r[0],l[0])&&(_vgClassSessionSelection.commonMessageAlert("This user is already exists in cart."),n+=1),0==n){var u="",p="",h="",m=0,g="";_vgClassSessionSelection.model.IsOnline&&e("div.clsaccordion").find(".panel-default").each(function(){m=e(this).attr("data-value"),u=e(this).attr("data-fullname").split(" ")[0],p=void 0!==e(this).attr("data-fullname").split(" ")[1]?e(this).attr("data-fullname").split(" ")[1]:"",h=e(this).attr("data-email"),g=e(this).attr("data-cell")}),l[0].customerID=m,l[0].cFirstName=u,l[0].cLastName=p,l[0].cUserEmail=h,l[0].cUserCellNo=g,_vgClassSessionSelection.commonProperty.isAddonPopup=!1,l[0].lstAddonService=_vgClassSessionSelection.CreateAddonCollection(l[0]),"true"==IsClassReschedule.toLowerCase()?(onlineShoppingCartmain.Events=s,_onlineCheckout.loadPage()):_onlineCheckout.classAddToCart(s,!0),e("#divclassaddonpopup").modal("hide")}}}else 0!=t&&_vgClassSessionSelection.commonMessageAlert("Select All Attendees.")},_onlineCheckout.GetTotalPriceAddonEvent=function(e){var t={TotalAddonPrice:0,TotalAddonTax:0,TotalAddonDeposit:0};if(null!=e.lstAddonService&&null!=e.lstAddonService&&e.lstAddonService.length>0)for(var i=0;i<e.lstAddonService.length;i++)1==e.lstAddonService[i].IsPartialPoint&&"undefined"!=typeof onlineShoppingCartmain&&void 0!==onlineShoppingCartmain.DepositsPer&&onlineShoppingCartmain.DepositsPer<100?t.TotalAddonPrice=_vgClassSessionSelection.ConvertTodecimal(t.TotalAddonPrice+parseFloat(e.lstAddonService[i].Originalprice),2,!0):t.TotalAddonPrice=_vgClassSessionSelection.ConvertTodecimal(t.TotalAddonPrice+parseFloat(e.lstAddonService[i].Price),2,!0),t.TotalAddonTax=_vgClassSessionSelection.ConvertTodecimal(t.TotalAddonTax+parseFloat(e.lstAddonService[i].taxprice),2,!0),parseFloat(e.lstAddonService[i].deposit)>0&&(t.TotalAddonDeposit=_vgClassSessionSelection.ConvertTodecimal(t.TotalAddonDeposit+parseFloat(e.lstAddonService[i].deposit),2,!0));return t},_onlineCheckout.OpenServiceAddonModal=function(t,i){ShowLoader(!0);var n=e.grep(onlineShoppingCart.Packages,function(e){return e.ServiceId==t}),o={ServiceId:parseInt(t),BusinessID:parseInt(_vgClassSessionSelection.GetCommonBusinessID()),ServiceProviderID:0,IsOnline:0,LastMinDealHours:LastMinuteBookingDays},a=new vagaro.ajax;a.datamodel.Token=_shopdetail.GetCoreAPIURLWithToken(ApiURLEnumBooking.GetAddOnService,groupID),a.datamodel.data=o,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.callback=function(o){if(o.Data.length>0&&null!=o.Data[0]){_shopdetail.ShowAddOnService(),e(_shopdetail.Controls.AddOnList).empty(),e(_shopdetail.Controls.ParentService).empty(),null==n[0].DefaultImage||""==n[0].DefaultImage||n[0].DefaultImage.indexOf(".jpg")<0?(e("#divServiceImage").css("display","none"),e(".addon-service-description").addClass("no-image-data")):(e("#divServiceImage").css("display","block"),e("#divServiceImage").css("background-image","url("+n[0].DefaultImage+")"),e(".addon-service-description").removeClass("no-image-data")),e("#divServiceName").text(n[0].ServiceTitle),e("#divServiceDes").text(n[0].ServiceDesc);"$0.00"==n[0].Price||"0.00"==n[0].Price||"0"==n[0].Price?(e("#divFreeServicePrice").css("display","block"),e("#divServicePrice").css("display","none"),e("#divServicePrice").text(_onlineCheckout.parseTodecimal(n[0].Price,2).format("#.##"))):(e("#divFreeServicePrice").css("display","none"),e("#divServicePrice").css("display","block"),e("#divServicePrice").text(_shopdetail.currencySymbol+_onlineCheckout.parseTodecimal(n[0].Price,2).format("#.##"))),e("#hdnServiceId").val(n[0].ServiceId),e("#hdnEventType").val(n[0].eventType),e("#hdnSrNo").val(1),e("#divSuggestedAddon").text("Suggested Add-Ons Available"),e("#hdnServicebundleName").val("");var a=e.grep(o.Data,function(e){return 0==e.ServiceLevel});e.each(a,function(t){var i=e.grep(o.Data,function(e){return e.Price=_onlineCheckout.parseTodecimal(e.Price,2).format("#.##"),e.ParentServiceID==a[t].ServiceId});a[t].MinItem=a[t].MinItem>i.length?i.length:a[t].MinItem,a[t].MaxItem=a[t].MaxItem>i.length?i.length:a[t].MaxItem,i=i.map(function(e){return e.IsRequired=a[t].IsRequired,e.MinItem=a[t].MinItem,e.MaxItem=a[t].MaxItem,e.Photo=e.Photo.indexOf("no-shop-image-big.")>0?"":e.Photo,e.CurrencySymbol=_shopdetail.currencySymbol,e.IsShowPriceOnline=1,e.OnlinePrice=1==e.IsShowPriceOnline?e.Price:"0.00",e.OnlinePricewithtax=1==e.IsShowPriceOnline?e.Price:"0.00",e}),e(_shopdetail.Controls.tmplAddOnCategory).tmpl(a[t]).appendTo(_shopdetail.Controls.AddOnList),e(_shopdetail.Controls.tmplAddOnService).tmpl(i).appendTo("#Service_"+i[0].ParentServiceID),e(".modal:visible").each(function(e,t){centerModal(t)})}),2==o.Data.length?e(".addon-group-row1").css("border-bottom","none"):e(".addon-group-row1").css("border-bottom","solid #E7E7E7 1px"),e("#btnClose").css("display","none"),e("#btnback").css("display","none"),e(".classfooter-btn-row").addClass("backremove"),e("#btnNext").css("display","none"),e("#btnContinue").css("display","block"),_onlineCheckout.BindSelectedServiceAddon(n,i),_shopdetail.CheckboxAddOnService(),e("#btnContinue").attr("data-enrollAutoId",i),e("#btnContinue").attr("data-eventID",t),e("#servicenamepopup #btnContinue").attr("onclick","_onlineCheckout.UpdateAddonsService()"),ShowLoader(!1)}},a.datamodel.Error=_common.CallFailed,a.Post()},_onlineCheckout.BindSelectedServiceAddon=function(t,i){null!=t[0].lstAddonService&&null!=t[0].lstAddonService&&t[0].lstAddonService.length>0&&(e.each(t[0].lstAddonService,function(i){e("#check_"+t[0].lstAddonService[i].ServiceId).prop("checked",!0),e("#rdo_"+t[0].lstAddonService[i].ServiceId).prop("checked",!0)}),_vgClassSessionSelection.CalculateTotalPrice())},_onlineCheckout.UpdateAddonsService=function(){var t=_vgClassSessionSelection.AddonValidate();if(_onlineCheckout.isUpdateAddonsItemQty=!0,t){var i=parseInt(e("#btnContinue").attr("data-enrollAutoId")),n=parseInt(e("#btnContinue").attr("data-eventID")),o=JSON.parse(JSON.stringify(onlineShoppingCartmain.Packages)),a=e.grep(o,function(e){return e.ServiceId==n});if(a.length>0){a[0].lstAddonService=null,a[0].lstAddonService=_shopdetail.CreateAddonCollection();for(var s=0;s<onlineShoppingCartmain.Packages.length;s++)onlineShoppingCartmain.Packages[s].ServiceId==n&&onlineShoppingCartmain.Packages[s].autoId==i&&(onlineShoppingCartmain.Packages[s].lstAddonService=null,onlineShoppingCartmain.Packages[s].lstAddonService=a[0].lstAddonService,onlineShoppingCartmain.Packages[s].TotalAddonServicePrice=_onlineCheckout.CalculateServcieAddonTotal(onlineShoppingCartmain.Packages[s].lstAddonService));_onlineCheckout.UpdateMutipleCartItem(this,!1,!0)}_shopdetail.HideAddOnService()}},_onlineCheckout.CalculateServcieAddonTotal=function(t){var i=0;return null!=t&&t.length>0&&e.each(t,function(e,t){i+=parseFloat(t.Price)}),i},_onlineCheckout.CreateOnlineServiceAddonsCollection=function(t,i){var n=[],o=_onlineCheckout.GetServcieDuration(t,i);if(null!=t&&null!=t&&t.length>0){_onlineCheckout.SetAppointmentIdOfSelectedAddonService(t,i);for(var a="",s=0;s<t.length;s++){(d={}).AppTime=0==s?moment(i.ServiceStartTime,"hh:mm A").add(o,"minutes").format("hh:mm A"):moment(a,"hh:mm A").add(t[s-1].Duration,"minutes").format("hh:mm A"),a=d.AppTime,d.AppointmentID=t[s].AppointmentID;var r=new Date(i.StartTime),l=e.datepicker.formatDate("yy-mm-dd",r);d.Appointmentdate=l,d.DepositAmount=0,d.DepositsPercentage=t[s].depositsPercentage,d.Duration=t[s].Duration,d.OldServiceName="",d.OriginalDuration=0,d.OriginalPointRedeem=t[s].pointredeemOriginal,d.OriginalPrice=t[s].OriginalPrice,d.PaidType=t[s].paidType,d.ParentAppointmentID=t[s].ParentAppointmentID,void 0===t[s].IsPaid||0==t[s].IsPaid?(d.PointGiven=t[s].PointGiven,d.PointRedeem=t[s].PointRedeem):1==t[s].IsPaid&&void 0!==t[s].isPointApply&&1==t[s].isPointApply?(d.PointGiven=0,d.PointRedeem=t[s].PointRedeem):1==t[s].IsPaid&&(d.PointGiven=t[s].PointGiven,d.PointRedeem=0),d.Price=t[s].isPointApply?t[s].priceOriginal:t[s].Price,d.OriginalPrice=t[s].priceOriginal,d.ServiceId=t[s].ServiceId,d.ServiceName=t[s].ServiceTitle,d.Status=11,d.PromotionID=i.lstAddonService[s].PromotionID,d.PayableAmount=t[s].payableAmount,d.DiscountId=0,d.CalculatedTaxTypeWise=JSON.stringify(t[s].BusinessTax),"undefined"!=typeof _IsMemPkgUpSell&&1==_IsMemPkgUpSell&&(d.PaidType=0,d.PayableAmount=0,void 0!==i.lstAddonService&&null!=i.lstAddonService&&""!=i.lstAddonService&&0==i.lstAddonService[s].PromotionID&&(d.Price=t[s].priceOriginal)),n.push(d)}}if(!String.isNullOrUndefineOrBlank(ReschedualAddonService)&&ReschedualAddonService.length>0){var c=e.grep(ReschedualAddonService,function(e){return 12==e.Status});if(c.length>0)for(s=0;s<c.length;s++){var d={};r=new Date(i.StartTime),l=e.datepicker.formatDate("yy-mm-dd",r);d.AppTime=moment(i.ServiceStartTime,"hh:mm A"),d.Appointmentdate=l,d.AppointmentID=c[s].AppointmentID,d.DepositsPercentage=0,d.Duration=0,d.OldServiceName="",d.OriginalDuration=0,d.OriginalPointRedeem=0,d.ParentAppointmentID=1*i.AppointmentID,d.ServiceId=c[s].ServiceId,d.ServiceName=c[s].ServiceTitle,d.Status=12,n.push(d)}}return n},_onlineCheckout.GetServcieDuration=function(e,t){var i=0,n=0;if(null!=e&&null!=e&&e.length>0){for(var o=0;o<e.length;o++)n+=parseInt(e[o].Duration);i=parseInt(t.Duration)-parseInt(t.CleanupTime)-parseInt(n)}return i},_onlineCheckout.setAddonServicePackageCheckoutData=function(t,i,n,o){var a=o;if(null!=i)for(var s=0;s<i.length;s++){checkoutGridrow={},checkoutGridrow.uniqID=a++,checkoutGridrow.userName=t.userName,checkoutGridrow.userID=t.userID,checkoutGridrow.serviceProviderID=t.serviceProviderID,checkoutGridrow.itemID=i[s].ServiceId,checkoutGridrow.itemName=i[s].ServiceTitle,checkoutGridrow.pointsGained=i[s].PointGiven,checkoutGridrow.pointsRedeem=i[s].PointRedeem,checkoutGridrow.recordType=d,checkoutGridrow.barcodeID=I,checkoutGridrow.price=i[s].TotalPrice,checkoutGridrow.giftCertificateChangePrice=i[s].TotalPrice,checkoutGridrow.Relationships=t.Relationships,checkoutGridrow.ChildAge=t.ChildAge,checkoutGridrow.MaxNoFamilyFriends=null!=t.MaxNoFamilyFriends?t.MaxNoFamilyFriends:0,checkoutGridrow.ConstantOriginalServicePrice=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(i[s].ConstantOriginalServicePrice)?i[s].TotalPrice:i[s].ConstantOriginalServicePrice:i[s].TotalPrice,checkoutGridrow.OriginalDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(i[s].OriginalDiscountRights)?0:i[s].OriginalDiscountRights:0,checkoutGridrow.OriginalDiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(i[s].OriginalDiscountType)?1:i[s].OriginalDiscountType:1,checkoutGridrow.ApprovedBy=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(i[s].ApprovedBy)?0:i[s].ApprovedBy:0,checkoutGridrow.IsAskApprovalPopup=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(i[s].IsAskApprovalPopup)?0:i[s].IsAskApprovalPopup:0,checkoutGridrow.IsShowApprovalPriceDiscount=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(i[s].IsShowApprovalPriceDiscount)?0:i[s].IsShowApprovalPriceDiscount:0,null==_onlineCheckout.PackageSharingDetail&&(_onlineCheckout.PackageSharingDetail=[]);var r=e.grep(_onlineCheckout.PackageSharingDetail,function(e){return e.ServiceId==i[s].ServiceId&&e.autoId==t.autoId});null!=r&&r.length>0?checkoutGridrow.SelectedFamilyFriends=r[0].SelectedFamilyFriends:"true"==_onlineCheckout.isFromInvoice.toString().toLowerCase()&&(checkoutGridrow.SelectedFamilyFriends=t.SelectedFamilyFriends),void 0!==i[s].isPresetApply&&1==i[s].isPresetApply||0!=i[s].PromotionID||void 0!==i[s].IsInitialDiscount&&1==i[s].IsInitialDiscount?(checkoutGridrow.discount=i[s].discount,checkoutGridrow.discountedPrice=i[s].TotalPrice-i[s].discount):(checkoutGridrow.discount=_onlineCheckout.isValidForCheckoutInvoice()?i[s].discount:0,checkoutGridrow.discountedPrice=_onlineCheckout.isValidForCheckoutInvoice()?i[s].Price:i[s].TotalPrice),checkoutGridrow.quantity=t.NoOfVisit,checkoutGridrow.packageAssignStatus=0,checkoutGridrow.pointAssignStatus=0,checkoutGridrow.isSendEmailToRecipient=!1,checkoutGridrow.isSendEmailToSender=!0,checkoutGridrow.isPrint=!1,checkoutGridrow.assignTo=t.userID,checkoutGridrow.expiresOn="never",checkoutGridrow.imagePath="",checkoutGridrow.message="",checkoutGridrow.calculatedTax=_onlineCheckout.parseTodecimal(i[s].taxprice,3),checkoutGridrow.calculatedTaxTypeWise="[]",String.isNullOrUndefineOrBlank(i[s].BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(i[s].BusinessTax)?"[]":JSON.stringify(i[0].BusinessTax)),checkoutGridrow.taxes=i[s].TaxValue,checkoutGridrow.GCAssignToName="",checkoutGridrow.GCServiceName="",checkoutGridrow.GCColor="",checkoutGridrow.gCPreviewURL="",checkoutGridrow.isRecurring=t.IsRecurring,checkoutGridrow.isRecurring?(checkoutGridrow.renewalOn=t.ChargeFrequency,checkoutGridrow.RecurringLimit=0==t.RecurringLimit?-1:t.RecurringLimit,checkoutGridrow.isCarryBal=3!=t.ChargeFrequency&&t.IsCarryForwardBal):(checkoutGridrow.renewalOn=0,checkoutGridrow.RecurringLimit=0,checkoutGridrow.isCarryBal=!1),checkoutGridrow.recGiftCertificateID=_onlineCheckout.isValidForCheckoutInvoice()||!String.isNullOrUndefineOrBlank(i[s].RecGiftCertificateId)&&i[s].RecGiftCertificateId>0?i[s].RecGiftCertificateId:0,"true"==isWidget.toLowerCase()?checkoutGridrow.purchasedAt="My Widget":"true"==isCustomWebsite.toLowerCase()?checkoutGridrow.purchasedAt="My Vagaro Website":checkoutGridrow.purchasedAt="My Vagaro Page",checkoutGridrow.PromotionID=i[s].PromotionID,checkoutGridrow.DiscountID=i[s].DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(i[s].DiscountType)?1==i[s].IsAmount?2:1:i[s].DiscountType:1==i[s].IsAmount?2:1,checkoutGridrow.AmountValue=i[s].AmountValue,checkoutGridrow.isInitialDiscount=i[s].IsInitialDiscount,checkoutGridrow.initialDiscount=i[s].InitialDiscount,checkoutGridrow.isAmountInitialDiscount=i[s].IsAmountForInitialDiscount,checkoutGridrow.billingCycle=t.BillingCycle,!String.isNullOrUndefineOrBlank(t.UsedInBiling)&&t.UsedInBiling>0?checkoutGridrow.usedInBiling=t.UsedInBiling:0!=typeof t.BillingCycle&&(checkoutGridrow.usedInBiling=1),"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,n.push(checkoutGridrow)}return a},_onlineCheckout.GetAddonsServiceId=function(e){var t="";if(null!=e&&""!=e&&e.length>0){for(var i=0;i<e.length;i++)t+=e[i].ServiceId+",";t=t.substring(0,t.length-1)}return t},_onlineCheckout.SuggestUpsellMembershipAddToCart=function(e,t,i,n,o,a,s,r,l,c,d){ShowLoader(!0),Data={},Data.businessID=e,Data.membershipID=t,Data.IsOverride=i,Data.checkInUserID=n,Data.ischeckinApp=o,Data.promotiondetail=a,Data.promotiontitle=s,Data.IsInitialDiscount=r,Data.InitialDiscount=l,Data.IsAmount=c,Data.BillingCycle=d;var u=new vagaro.ajax;u.datamodel.Token="websiteapi/homepage/membershipaddtocart",u.datamodel.IsNewVagaroAPI=!0,u.datamodel.callback=function(e){ShowLoader(!1)},u.datamodel.data=Data,u.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},u.Post()},_onlineCheckout.DeleteMembersipPackageCartItems=function(){if(_onlineCheckout.IsUpSellMemPkgAdd=0,1==e("#divSuggestUpsell").find(".vg-filter-mobile-tab.vg-switch-tab-first.w--current").length)return!0;ShowLoader(!0),_onlineCheckout.RemoveMembersipPackageCartItems(onlineShoppingCart.BusinessID,onlineShoppingCart.loginUserId,"MembershipsPackage",1),onlineShoppingCartmain.Memberships=[],null!=onlineShoppingCartmain.Packages&&onlineShoppingCartmain.Packages.length>0&&(onlineShoppingCartmain.Packages=e.grep(onlineShoppingCartmain.Packages,function(e){return 4!=e.eventType}));var t=e.extend(!0,[],onlineShoppingCartmain.objGcPackagePointAndUserTaxDetail);t.lstMembershipForCheckout=e.grep(t.lstMembershipForCheckout,function(e){return"undefined"==e.IsUpsell||null==e.IsUpsell||1!=e.IsUpsell}),_onlineCheckout.ApplyDiscounts(t.lstGcAndPackagesForCheckout,t.lstUserListForCheckout,t.lstMembershipForCheckout,t.IsPromotionEnable),e("#divSuggestUpsell").find(".vg-filter-mobile-tab").removeClass("w--current"),e("#divSuggestUpsell").find(".vg-switch-tab-first").addClass("w--current"),_onlineCheckout.IsVCFEnable()&&(_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.RemoveUpSell)),ShowLoader(!1)},_onlineCheckout.RemoveMembersipPackageCartItems=function(e,t,i,n){var o={businessID:e,referenceId:0,cardItemType:i,userEmail:"",autoId:n,isCheckInApp:!1,isWorkShop:!1,randomForWorkShop:"",loginUserID:t};vagaro.ajaxCall(ApiURLEnumOnlineCheckout.removecartitem,o,function(e){},function(e){vagaro.alert("Some error occured. Please try again.")},!1,!0)},_onlineCheckout.setSuggestUpsellMembershipsData=function(t,i,n){if(_onlineCheckout.ResetPkgMembershipVariable(),null!=t&&t.length>0){for(var o=0;o<1;o++){if(membershipDetails={},membershipDetails.ActiveMembershipID=null,membershipDetails.ActiveMembershipName=null,membershipDetails.ActualPrice=t[0].Price,membershipDetails.AmountValue=t[0].AmountValue,membershipDetails.ApprovedBy=null,membershipDetails.BillingCycle=t[0].BillingCycle,0!=typeof t[0].BillingCycle?membershipDetails.usedInBiling=1:membershipDetails.usedInBiling=0,membershipDetails.ChargeFrequency=t[0].ChargeFrequency,membershipDetails.isAutoRenewalMembership=t[0].IsRecurring,membershipDetails.isCarryBal=1==membershipDetails.isAutoRenewalMembership&&void 0!==t[0].IsCarryForwardBal&&null!=t[0].IsCarryForwardBal&&"true"==t[0].IsCarryForwardBal.toString().toLowerCase(),membershipDetails.recordType=u,membershipDetails.barcodeID=w,membershipDetails.ChildAge=t[0].ChildAge,membershipDetails.ConstantOriginalServicePrice=0,membershipDetails.Discount=0,membershipDetails.DiscountID=null,membershipDetails.DiscountType=null,membershipDetails.InitialDiscount=t[0].InitialDiscount,membershipDetails.IsAmount=t[0].IsAmount,membershipDetails.IsAmountForInitialDiscount=t[0].IsAmountForInitialDiscount,membershipDetails.IsAskApprovalPopup=null,membershipDetails.IsFromCreateLink=!1,membershipDetails.IsInitialDiscount=t[0].IsInitialDiscount,membershipDetails.membershipPaymentToBeTaken=t[0].IsRecurring,membershipDetails.IsRecurring=t[0].IsRecurring,membershipDetails.IsShowApprovalPriceDiscount=null,membershipDetails.MaxNoFamilyFriends=null!=t[0].MaxNoFamilyFriends?t[0].MaxNoFamilyFriends:0,membershipDetails.MembershipId=t[0].MembershipID,membershipDetails.itemID=t[0].MembershipID,membershipDetails.MembershipName=t[0].MembershipName,membershipDetails.OriginalDiscountRights=null,membershipDetails.OriginalDiscountType=null,membershipDetails.PerTransactionOne=null,membershipDetails.PerUserOne=null,membershipDetails.Price=t[0].Price,membershipDetails.PromotionID=t[0].PromotionID,membershipDetails.PromotionTitle=t[0].PromotionTitle,membershipDetails.RecurringLimit=t[0].RecurringLimit,membershipDetails.RedeemGCs=null,membershipDetails.Relationships=t[0].Relationships,membershipDetails.SelectedFamilyFriends=null,membershipDetails.Tax=t[0].Tax,membershipDetails.Taxation=0,membershipDetails.UsedInBiling=t[0].UsedInBiling,membershipDetails.UserBusinessMembershipId=null,membershipDetails.autoId=o+200,membershipDetails.isPresetApply=!1,membershipDetails.message=null,membershipDetails.pointsGained=t[0].pointsGained,membershipDetails.productDisc=0,membershipDetails.redeemAmt=0,membershipDetails.redeemTax=0,membershipDetails.serviceDisc=0,membershipDetails.serviceProviderID=t[0].serviceProviderID,membershipDetails.userID=t[0].userID,membershipDetails.DepositsRemaining=0,membershipDetails.DepositsPaid=0,membershipDetails.BusinessTax=String.isNullOrUndefineOrBlank(t[0].Taxes)||"[]"==t[0].Taxes?"[]":JSON.parse(t[0].Taxes),membershipDetails.BusinessTax=_onlineCheckout.ApplyMultipleTax(t[0].Price,membershipDetails),membershipDetails.calculatedTax=parseFloat(t[0].Price*t[0].Tax/100),membershipDetails.ActualTax=membershipDetails.calculatedTax,membershipDetails.TaxValue=t[0].TaxValue,membershipDetails.MembershipUniqueId=t[0].MembershipID+"~UMD",void 0!==totalDailyDealFeeOfAllCart_PMGCA&&""!=totalDailyDealFeeOfAllCart_PMGCA&&totalDailyDealFeeOfAllCart_PMGCA>0){var a=_onlineCheckout.GetEffectiveIsForNewCustomer();!0===a?(membershipDetails.dailydealFee=membershipDetails.Price*dailyDealFeeValue/100,membershipDetails.FMBPercentage=dailyDealFeeValue):!1===a?(membershipDetails.dailydealFee=membershipDetails.Price*dailyDealFeeValue_ExistingUser/100,membershipDetails.FMBPercentage=dailyDealFeeValue_ExistingUser):(membershipDetails.dailydealFee=0,membershipDetails.FMBPercentage=0)}i.push(membershipDetails)}null!=i&&i.length>0&&(i[0].MaxNoFamilyFriends>0?1==n?(e("#scffsharingMS").html(_shopdetail.createHTMLofMembershipUpsell(i[0].MaxNoFamilyFriends,"MS",2)),_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(4)):2==n&&_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(2):e("#scffsharingMS").hide())}},_onlineCheckout.setSuggestUpsellPackageData=function(t,i,n){if(_onlineCheckout.ResetPkgMembershipVariable(),null!=t&&t.length>0){for(var o=0;o<t.length;o++){if(packageDetails={},packageDetails.ActualPrice=t[o].Price,packageDetails.AmountValue=t[o].AmountValue,packageDetails.ApprovedBy=null,packageDetails.BillingCycle=t[o].BillingCycle,0!=typeof t[o].BillingCycle?packageDetails.usedInBiling=1:packageDetails.usedInBiling=0,packageDetails.ChargeFrequency=t[o].ChargeFrequency,packageDetails.ChildAge=t[o].ChildAge,packageDetails.ConstantOriginalServicePrice=0,packageDetails.DefaultImage=t[o].DefaultImage,packageDetails.DiscountID=t[o].DiscountID,packageDetails.DiscountType=t[o].DiscountType,packageDetails.InitialDiscount=t[o].InitialDiscount,packageDetails.IsAdminPhoto=t[o].IsAdminPhoto,packageDetails.IsAmount=t[o].IsAmount,packageDetails.IsAmountForInitialDiscount=t[o].IsAmountForInitialDiscount,packageDetails.IsAskApprovalPopup=null,packageDetails.IsCarryForwardBal=t[o].IsCarryForwardBal,packageDetails.IsFromCreateLink=!1,packageDetails.IsInitialDiscount=t[o].IsInitialDiscount,packageDetails.RecordType=d,packageDetails.BarcodeID=I,packageDetails.IsRecurring=t[o].IsRecurring,packageDetails.IsRecurring?(packageDetails.renewalOn=t[o].ChargeFrequency,packageDetails.RecurringLimit=0==t[o].RecurringLimit?-1:t[o].RecurringLimit,packageDetails.isCarryBal=3!=t[o].IsRecurring&&t[o].IsCarryForwardBal):(packageDetails.renewalOn=0,packageDetails.RecurringLimit=0,packageDetails.isCarryBal=!1),packageDetails.IsShowApprovalPriceDiscount=null,packageDetails.MaxNoFamilyFriends=null!=t[o].MaxNoFamilyFriends?t[o].MaxNoFamilyFriends:0,packageDetails.NoOfVisit=1,packageDetails.OriginalDiscountRights=null,packageDetails.OriginalDiscountType=null,packageDetails.ParentServiceTitle=t[o].ParentServiceTitle,packageDetails.PerTransactionOne=t[o].PerTransactionOne,packageDetails.PerUserOne=t[o].PerUserOne,packageDetails.Price=t[o].Price,packageDetails.PromotionID=t[o].PromotionID,packageDetails.PromotionTitle=t[o].PromotionTitle,packageDetails.RecGiftCertificateId=t[o].RecGiftCertificateId,packageDetails.Relationships=t[o].Relationships,packageDetails.SelectedFamilyFriends=null,packageDetails.SellPackageServiceID=t[o].SellPackageServiceID,packageDetails.ServiceDesc=t[o].ServiceDesc,packageDetails.ServiceId=t[o].ServiceId,packageDetails.ServiceTitle=t[o].ServiceTitle,packageDetails.Tax=t[o].Tax,packageDetails.TotalAddonServicePrice=0,packageDetails.TotalPrice=t[o].Price,packageDetails.autoId=i.length+(o+500),packageDetails.discount=t[o].discount,packageDetails.eventType=4,packageDetails.isPresetApply=!1,packageDetails.lstAddonService=null,packageDetails.originalDiscount=null,packageDetails.pointsGained=t[o].pointsGained,packageDetails.redeemAmt=0,packageDetails.redeemTax=0,packageDetails.serviceProviderID=t[o].serviceProviderID,packageDetails.sessionDetail=t[o].sessionDetail,packageDetails.userID=t[o].userID,packageDetails.userName=t[o].userName,packageDetails.isSuggestUpsell=1,packageDetails.DepositsRemaining=0,packageDetails.DepositsPaid=0,packageDetails.BusinessTax=String.isNullOrUndefineOrBlank(t[o].Taxes)||"[]"==t[o].Taxes?"[]":JSON.parse(t[o].Taxes),packageDetails.BusinessTax=_onlineCheckout.ApplyMultipleTax(t[o].Price,packageDetails),packageDetails.calculatedTax=parseFloat(t[o].Price*t[o].Tax/100),packageDetails.ActualTax=packageDetails.calculatedTax,packageDetails.TaxValue=t[o].TaxValue,packageDetails.lstPackageForCheckout=String.isNullOrUndefineOrBlank(t[o].PackageJSON)?[]:JSON.parse(t[o].PackageJSON),null!=packageDetails.lstPackageForCheckout&&packageDetails.lstPackageForCheckout.length>0&&(packageDetails.lstPackageForCheckout=e.grep(packageDetails.lstPackageForCheckout,function(e){return 1==e.isPackage&&(e.isPackage=!0),1==e.isCustomPackage&&(e.isCustomPackage=!0),e})),packageDetails.GCUpdatePendingID=!String.isNullOrUndefineOrBlank(packageDetails.lstPackageForCheckout)&&packageDetails.lstPackageForCheckout.length>0?packageDetails.lstPackageForCheckout[0].giftCertificateID:0,void 0!==totalDailyDealFeeOfAllCart_PMGCA&&""!=totalDailyDealFeeOfAllCart_PMGCA&&totalDailyDealFeeOfAllCart_PMGCA>0){var a=_onlineCheckout.GetEffectiveIsForNewCustomer();!0===a?(packageDetails.dailydealFee=packageDetails.Price*dailyDealFeeValue/100,packageDetails.FMBPercentage=dailyDealFeeValue):!1===a?(packageDetails.dailydealFee=packageDetails.Price*dailyDealFeeValue_ExistingUser/100,packageDetails.FMBPercentage=dailyDealFeeValue_ExistingUser):(packageDetails.dailydealFee=0,packageDetails.FMBPercentage=0)}i.push(packageDetails)}null!=i&&i.length>0&&(i[0].MaxNoFamilyFriends>0?1==n?(e("#scffsharingPkg").html(_shopdetail.createHTMLofMembershipUpsell(i[0].MaxNoFamilyFriends,"PKG",5)),_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(5)):2==n&&_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(1):e("#scffsharingPkg").hide())}},_onlineCheckout.SuggestUpsellServiceAddToCart=function(t,i,n,o,a,s,r,l,c,d){if(parseFloat(i)>0){var u=_shopdetail.CreateAddonCollection();ShowLoader(!0);var p=new vagaro.ajax;p.datamodel.Token=ApiURLEnumOnlineCheckout.serviceaddtocart,p.datamodel.IsNewVagaroAPI=!0,p.datamodel.callback=function(e){ShowLoader(!1)},Data={},Data.businessID=t,Data.serviceId=i,Data.noOfVisit=n,Data.isCustomPackage=o,Data.promotionDetail=a,Data.promotionTitle=s,Data.IsInitialDiscount=r,Data.InitialDiscount=l,Data.IsAmount=c,Data.BillingCycle=d,Data.ServiceDesc="",Data.lstAddonService=u,p.datamodel.data=Data;try{var h={Action:"Add to Cart",Category:"Deal",PageName:"Deal"};null!=e("#lblSalonName")&&null!=e("#lblSalonName").text()&&(h.BusinessName=e("#lblSalonName").text()),h.BusinessID=t,h.isDealDetails=!0,h.IsListPage=!0,h.IsMapPage=!1,h.isFiltered=!1,h.DealName=s,_vgLogEvent.LogData(h)}catch(e){}p.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},p.Post()}else vagaro.alert("Some error occured. Please try again.")},_onlineCheckout.CalculateAddonTax=function(t){null!=t&&null!=t&&t.length>0&&e.each(t,function(e,t){_onlineCheckout.isValidForCheckoutInvoice()||1==t.isPointApply||(t.Price=t.Originalprice,t.actualPrice=t.Price,t.actualTaxprice=parseFloat(t.Price)*t.tax/100,t.taxprice=_vgClassSessionSelection.ConvertTodecimal(parseFloat(t.Price)*t.tax/100,2,!0))})},_onlineCheckout.ApplyMultipleAddonTax=function(t){null!=t&&null!=t&&t.length>0&&e.each(t,function(t,i){var n=String.isNullOrUndefineOrBlank(i.BusinessTax)||"[]"==i.BusinessTax?"":i.BusinessTax;String.isNullOrUndefineOrBlank(n)||e.grep(n,function(e){void 0===i||1!=i.isPackage&&1!=i.isPointApply?e.CalculatedTax=_onlineCheckout.parseTodecimal(i.Price*e.Tax/100,2):e.CalculatedTax=_onlineCheckout.parseTodecimal(0,2)})})},_onlineCheckout.calculatAddonDepositsPercent=function(e,t){return 100*t/e},_onlineCheckout.calculateAddonsDepositsOnEvents=function(t,i){var n=0;return null!=t&&null!=t&&t.length>0&&e.grep(t,function(e){var t=void 0!==e.IsPartialPoint&&e.IsPartialPoint;e.paidType=_onlineCheckout.arrpaidType.PaidClass,1==e.isPointApply&&!t||1==e.isPackage||0!=e.gcId&&null!=e.gcId||0!=e.Price||0!=e.discount||(e.paidType=_onlineCheckout.arrpaidType.Paid),e.depositsTax=0,t||(e.depositsPaid=0),1==e.isPointApply&&!t||1==e.isPackage||0!=e.gcId&&null!=e.gcId||(_onlineCheckout.isValidForCheckoutInvoice()?(e.OriginalpaidType==_onlineCheckout.arrpaidType.DepositsClass||e.OriginalpaidType==_onlineCheckout.arrpaidType.OfflineDeposit)&&void 0!==e.depositsPercentage&&parseFloat(e.depositsPercentage)>0&&(e.depositsPaid=_onlineCheckout.parseTodecimal(e.Price*e.depositsPercentage/100,2),e.depositsTax=e.taxprice,e.paidType=_onlineCheckout.arrpaidType.DepositsClass):i>=onlineShoppingCart.DepositsLimit&&!_onlineCheckout.isValidForCheckoutInvoice()?null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))>=new Date(e.eventDate)?(e.depositsPaid=0,e.depositsPercentage=0,e.paidType=_onlineCheckout.arrpaidType.UnPaid):0==onlineShoppingCartmain.DepositAmtType&&100!=onlineShoppingCart.DepositsPer&&e.Price>0?("undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()?(e.depositsPaid=1==e.IsPartialPoint?e.depositsPaid:_onlineCheckout.calculatedDepositsAmount(e.Price+e.taxprice,0),IsDailyDealFeeCCOFF||totalDepositWhenDepositLessDDFee<cartDailyDealFee&&e.actualPrice>e.dailydealFee?e.depositsPaid=e.dailydealFee:e.actualPrice<e.dailydealFee&&(e.depositsPaid=e.actualPrice)):(e.depositsPaid=1==e.IsPartialPoint?e.depositsPaid:_onlineCheckout.calculatedDepositsAmount(e.Price,0),IsDailyDealFeeCCOFF||totalDepositWhenDepositLessDDFee<cartDailyDealFee&&e.actualPrice>e.dailydealFee?e.depositsPaid=e.dailydealFee:e.actualPrice<e.dailydealFee&&(e.depositsPaid=e.actualPrice)),e.depositsPercentage=Number(e.dailydealFee)>0?onlineShoppingCartmain.DepositsPer:0,e.depositsTax=e.taxprice,e.paidType=_onlineCheckout.arrpaidType.DepositsClass):1==onlineShoppingCartmain.DepositAmtType&&onlineShoppingCart.DepositsPer<e.Price&&e.Price>0?(e.depositsPaid=1==e.IsPartialPoint?e.depositsPaid:onlineShoppingCartmain.DepositsPer,IsDailyDealFeeCCOFF||totalDepositWhenDepositLessDDFee<cartDailyDealFee&&e.actualPrice>e.dailydealFee?e.depositsPaid=e.dailydealFee:e.actualPrice<e.dailydealFee&&(e.depositsPaid=e.actualPrice),e.depositsPercentage=_onlineCheckout.calculatedDepositsAmount(e.Price,1),e.depositsTax=e.taxprice,e.paidType=_onlineCheckout.arrpaidType.DepositsClass):(e.paidType=_onlineCheckout.arrpaidType.PaidClass,e.depositsPaid=0,e.depositsTax=0,e.actualPrice<e.dailydealFee&&cartDailyDealFee>0&&(e.dailydealFee=e.actualPrice),0==e.Price?1==e.isMembershipApply||e.discount>0?e.paidType=_onlineCheckout.arrpaidType.PaidClass:e.paidType=_onlineCheckout.arrpaidType.UnPaid:1==e.isMembershipApply&&0==onlineShoppingCartmain.DepositAmtType&&onlineShoppingCart.DepositsPer<100&&(e.paidType=_onlineCheckout.arrpaidType.PartiallyPaidClass)):(0!=e.Price||1!=e.isMembershipApply&&0!=e.discount?1==e.isMembershipApply?e.paidType=_onlineCheckout.arrpaidType.PartiallyPaidClass:0==e.discount&&(e.paidType=_onlineCheckout.arrpaidType.UnPaid):e.paidType=_onlineCheckout.arrpaidType.PaidClass,e.depositsPaid=0,e.depositsPercentage=0,e.depositsTax=e.taxprice),e.paidType!=_onlineCheckout.arrpaidType.PaidClass&&(e.IsPartialPoint?e.IsDepositsOver?(n=_onlineCheckout.parseTodecimal(n+_onlineCheckout.parseTodecimal(e.Price-e.depositsPaid,2)+_onlineCheckout.parseTodecimal(e.depositsTax,2),2),e.depositsPaid>=e.Price?e.depositsRemaining=_onlineCheckout.parseTodecimal(0,2):e.depositsRemaining=_onlineCheckout.parseTodecimal(e.Price-e.depositsPaid,2)):(n=_onlineCheckout.parseTodecimal(n+_onlineCheckout.parseTodecimal(e.Price-e.depositsPaid-e.PartialPrice,2)+_onlineCheckout.parseTodecimal(e.depositsTax,2),2),e.depositsRemaining=_onlineCheckout.parseTodecimal(e.Price-e.depositsPaid-e.PartialPrice,2)):(n=_onlineCheckout.parseTodecimal(n+_onlineCheckout.parseTodecimal(e.Price-e.depositsPaid,2)+_onlineCheckout.parseTodecimal(e.depositsTax,2),2),e.depositsRemaining=_onlineCheckout.parseTodecimal(e.Price-e.depositsPaid,2))))}),n},_onlineCheckout.ApplyPointsOnAddonEvents=function(t,i,n,o){var a=e.extend(!0,[],n);t.calssdiscountprice=0;var s={IsDealGCApply:!0,PerUserOneFlag:!1};null!=o&&null!=o&&o.length>0&&e.grep(o,function(n){var o=0,r=_onlineCheckout.GetPackageListAddon(a,t,n,s);n.OriginalpaidType=n.paidType,e.grep(i,function(e){if(n.Price>0)if(n.customerID>0&&e.userId>0&&n.customerID==e.userId||n.customerID<=0&&e.userId>0&&n.cUserEmail==e.emailId){o=e.pointsBalance;var t=String.isNullOrUndefineOrBlank(n.PointRedeem)?0:n.PointRedeem;if(!(t>0&&o>0&&o>=t&&("true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==n.isPaid&&0==r.length)||Number(n.dailydealFee)>0||_shopdetail.EnableFMBFee()&&null!=n.PromotionID&&Number(n.PromotionID)>0)if(!(_onlineCheckout.IsPartialPointAllowed&&t>0&&o>0&&("true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==n.isPaid&&0==r.length)||Number(n.dailydealFee)>0||_shopdetail.EnableFMBFee()&&null!=n.PromotionID&&Number(n.PromotionID)>0)n.isPointApply=!1,n.pointsRedeem=0,(void 0===n.Originalprice||String.isNullOrUndefineOrBlank(n.Originalprice))&&(n.Originalprice=parseFloat(n.Price)),n.Originaltaxprice=parseFloat(n.taxprice);else{var i=parseInt(o);if(n.pointsRedeem=i,n.isPointApply=!0,(void 0===n.Originalprice||String.isNullOrUndefineOrBlank(n.Originalprice))&&(n.Originalprice=parseFloat(n.Price)),1==onlineShoppingCartmain.DepositAmtType){var a=_onlineCheckout.calculatedDepositsAmount(n.actualPrice);n.depositsPercentage=a;var s=_shopdetail.GetDepositsAmount(n.actualPrice,a);if((d=Math.ceil(n.PointRedeem*s/parseFloat(n.Originalprice)))>o){n.pointsRedeem=o,n.PartialPrice=_onlineCheckout.parseTodecimal(_onlineCheckout.CalculateApplyPointsClassPrice(n.Price,n.pointsRedeem,n.PointRedeem),2);var l=_shopdetail.parseTodecimal(onlineShoppingCartmain.DepositsPer-n.PartialPrice);n.depositsPaid=l,n.Price=_onlineCheckout.parseTodecimal(parseFloat(n.Price-n.PartialPrice),2),n.IsDepositsOver=!1,n.IsPartialDeposits=!0}else n.depositsPaid=onlineShoppingCartmain.DepositsPer,n.pointsRedeem=d,n.PartialPrice=n.depositsPaid,n.Price=_onlineCheckout.parseTodecimal(parseFloat(n.Price-n.PartialPrice),2),n.IsDepositsOver=!0,n.IsPartialDeposits=!0}else if(0==onlineShoppingCartmain.DepositAmtType&&100!=onlineShoppingCartmain.DepositsPer&&n.Price>0){var c=_onlineCheckout.calculatedDepositsAmount(n.actualPrice),d=Math.ceil(n.PointRedeem*c/parseFloat(n.Originalprice));if(n.depositsPercentage=onlineShoppingCartmain.DepositsPer,d>o){n.pointsRedeem=o,n.PartialPrice=_onlineCheckout.parseTodecimal(_onlineCheckout.CalculateApplyPointsClassPrice(n.Price,n.pointsRedeem,n.PointRedeem),2);l=_shopdetail.parseTodecimal(c-n.PartialPrice);n.depositsPaid=l,n.Price=_onlineCheckout.parseTodecimal(parseFloat(n.Price-n.PartialPrice),2),n.IsDepositsOver=!1,n.IsPartialDeposits=!0}else n.depositsPaid=c,n.pointsRedeem=d,n.PartialPrice=c,n.Price=_onlineCheckout.parseTodecimal(parseFloat(n.Price-n.PartialPrice),2),n.IsDepositsOver=!0,n.IsPartialDeposits=!0}else n.PartialPrice=_onlineCheckout.parseTodecimal(_onlineCheckout.CalculateApplyAddonPointsClassPrice(n.Price,n.PointRedeem,i),2),n.Price=_onlineCheckout.parseTodecimal(parseFloat(n.Price-n.PartialPrice),2);e.pointsBalance=parseInt(o-n.pointsRedeem),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(n.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(n.pointsRedeem),n.IsPartialPoint=!0,n.Originaltaxprice=parseFloat(n.taxprice),1==_onlineCheckout.isValidForCheckoutInvoice()?n.taxprice=0:n.taxprice=_onlineCheckout.parseTodecimal(n.Price*n.tax/100,3)}else n.isPointApply=!0,n.pointsRedeem=t,e.pointsBalance=parseInt(o-t),onlineShoppingCart.AppliedPoints=String.isNullOrUndefineOrBlank(onlineShoppingCart.AppliedPoints)?parseInt(n.pointsRedeem):parseInt(onlineShoppingCart.AppliedPoints)+parseInt(n.pointsRedeem),(void 0===n.Originalprice||String.isNullOrUndefineOrBlank(n.Originalprice))&&(n.Originalprice=parseFloat(n.Price)),n.Price=0,n.Originaltaxprice=parseFloat(n.taxprice),n.taxprice=0,n.actualPrice=0,n.actualTaxprice=0,n.IsPartialPoint=!1}else _onlineCheckout.isValidForCheckoutInvoice()&&(n.isPointApply=!1,n.Originalprice=parseFloat(n.actualPrice),n.Originaltaxprice=parseFloat(n.actualTaxprice));else void 0!==n.isPointApply||n.isPointApply||(n.isPointApply=!1,n.Originalprice=parseFloat(n.actualPrice),n.Originaltaxprice=parseFloat(n.actualTaxprice))}),n.BusinessTax=_onlineCheckout.ApplyMultipleTax(n.Price,n)})},_onlineCheckout.GetAllAddonsWithSeparator=function(e,t){var i={addonids:"",price:"",duration:"",addonsName:""};return e.length>0&&(i.addonids+=Array.prototype.map.call(e,function(e){return e.ServiceId}).join(t),i.addonsName+=Array.prototype.map.call(e,function(e){return e.ServiceTitle}).join(t),i.price+=Array.prototype.map.call(e,function(e){return e.Price}).join(t),i.duration+=Array.prototype.map.call(e,function(e){return e.Duration}).join(t)),i},_onlineCheckout.LoadEventForAddonClass=function(){e("#accordion").off("show.bs.collapse"),e("#accordion").on("show.bs.collapse",function(t){e(".panel-collapse").removeClass("show");var i=0-e(".familyclassheight").scrollTop(),n=e(window).height();e(t.target).css("top",i+"px");var o=e(".panel-heading").width();e(".ffattendeelist-bg").attr("style","Width:"+o+"px");var a=e(t.target).attr("style");e(t.target).css({visibility:"hidden",display:"block"});var s=e(t.target).find(".ffattendeelist-bg").height(),r=e(t.target).find(".ffattendeelist-bg").position().top+i;e(t.target).attr("style",a||""),s+r+10>n&&e(t.target).css("top",i-(s+54)+"px")}),e("div#divclassaddonpopup div.modal-content .familyclassheight").off("scroll").on("scroll",function(t){var i=e("div.panel-collapse.attendeelist.collapse.show",t.target);void 0!==i&&null!=i&&i.length>0&&(e(i).css("height","0px"),e("#divAddonPopupSection").addClass("scrollbackhide"),e(i).parent().find("a.tocollapse").click())})},_onlineCheckout.ApplyPresetDiscountOnEventsAddon=function(t,n,o,a){var s={PromoApplied:!1,addonTotalPrice:0,addonTotalTaxPrice:0,addonTotalGCUsed:0,addonDiscountprice:0,FinalTotal:0};e.grep(t,function(t){!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(r){var l=e.grep(n,function(e){return e.ServiceID==r.ServiceId&&e.ItemTypeID==v});if(null!=l&&l.length>0){if(l=l[0],void 0!==a&&(null!=a||null==a)){var c=r.Originalprice,d=0,u=l.ServiceProviderIDs,p=t.sPID,h=!1;for(i=0;i<u.split(",").length;i++)p==u.split(",")[i]&&(h=!0);var m=moment(t.workshopActualDate),g=moment(l.StartDate.replace("A"," A").replace("P"," P")),f=moment(l.EndDate.replace("A"," A").replace("P"," P"));if(g.diff(m,"min")>0&&(h=!1),""!=l.EndDate&&f.diff(m,"min")<0&&(h=!1),0==o&&(void 0!==r.isPresetApply&&0==r.isPresetApply&&r.DiscountID!=l.PromotionID||void 0===r.isPresetApply||void 0!==r.isPresetApply&&1==r.isPresetApply&&r.DiscountID!=l.PromotionID)&&(h=!1),1==r.isPointApply||null!=r.gcId&&1==r.isPackage||0==h){if(1!=r.isPointApply){if(r.gcId>0&&(c=r.actualPrice),1==r.isMembershipApply){var C=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==r.MembershipID&&e.ItemType==v&&e.MembershipItemId==r.MembershipItemId});d=_onlineCheckout.parseTodecimal(c*C[0].Discount/100,2)}if(void 0!==r.isPresetApply&&1==r.isPresetApply&&(0==r.IsAmount?d=_onlineCheckout.parseTodecimal(d+c*r.AmountValue/100,2):(d=r.actualPrice<d+r.AmountValue?c:_onlineCheckout.parseTodecimal(d+r.AmountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(d=parseFloat(ConvertTodecimalMorePrecious(parseFloat(d)/(1+r.tax/100),!0,4))))),(null==r.gcId||0==r.gcId||r.gcId>0&&0==r.isPackage)&&0!=r.PromotionID){var S=0;1==r.IsAmount?(S=r.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(S=parseFloat(ConvertTodecimalMorePrecious(parseFloat(S)/(1+r.tax/100),!0,4)))):S=c*r.AmountValue/100,d+=S}r.actualPrice<d&&(d=c),r.discount=d,r.Price=_onlineCheckout.parseTodecimal(c-r.discount,2),r.actualPrice=r.Price,(r.gcId<0||r.gcId>0)&&1==r.isPackage?r.actualTaxprice=0:r.actualTaxprice=_onlineCheckout.parseTodecimal(r.Price*r.tax/100,3),s.addonDiscountprice=_onlineCheckout.parseTodecimal(s.addonDiscountprice+r.discount,2),r.taxprice=r.actualTaxprice,null!=r.gcId&&0==r.isPackage&&(0==r.Price&&(r.gcId=null,_onlineCheckout.RemoveDicount(v,1,r.eventID,r.autoID)),r.redeemTax=r.actualTaxprice,r.redeemAmt=r.actualPrice),r.BusinessTax=_onlineCheckout.ApplyMultipleTax(r.Price,r),s.addonTotalPrice=_onlineCheckout.parseTodecimal(s.addonTotalPrice+r.Price,2),s.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(s.addonTotalTaxPrice+r.actualTaxprice,2),r.gcId>0&&0==r.isPackage&&(s.addonTotalGCUsed=_onlineCheckout.parseTodecimal(s.addonTotalGCUsed+r.Price,2))}}else{if(0!=r.PromotionID&&(r.PromotionID=0),1==r.isMembershipApply)null!=(C=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==r.MembershipID&&e.ItemType==v&&e.MembershipItemId==r.MembershipItemId}))&&C.length>0&&1==C[0].IsAllowPreSetDiscount?d=_onlineCheckout.parseTodecimal(c*C[0].Discount/100,2):_onlineCheckout.RemoveDicount(v,4,r.eventID,r.autoID);(void 0===r.isPresetApply||void 0!==r.isPresetApply&&1==r.isPresetApply||o)&&(0==l.IsAmount?d=_onlineCheckout.parseTodecimal(d+c*l.DiscountValue/100,2):(d=_onlineCheckout.parseTodecimal(d+l.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(d=parseFloat(ConvertTodecimalMorePrecious(parseFloat(d)/(1+r.tax/100),!0,4)))),r.isPresetApply=!0,r.DiscountID=l.PromotionID,r.IsAmount=l.IsAmount,r.AmountValue=l.DiscountValue,s.PromoApplied=!0),c<d&&(d=c),r.discount=d,r.Price=_onlineCheckout.parseTodecimal(c-r.discount,2),r.actualPrice=r.Price,r.actualTaxprice=_onlineCheckout.parseTodecimal(r.Price*r.tax/100,3),s.addonDiscountprice=_onlineCheckout.parseTodecimal(s.addonDiscountprice+r.discount,2),r.isPointApply=!1,r.isPackage=!1,r.taxprice=r.actualTaxprice,null!=r.gcId&&0==r.isPackage&&(0==r.Price&&(r.gcId=null,_onlineCheckout.RemoveDicount(v,1,r.eventID,r.autoID)),r.redeemTax=r.actualTaxprice,r.redeemAmt=r.actualPrice),r.BusinessTax=_onlineCheckout.ApplyMultipleTax(r.Price,r),s.addonTotalPrice=_onlineCheckout.parseTodecimal(s.addonTotalPrice+r.Price,2),s.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(s.addonTotalTaxPrice+r.taxprice,2),r.gcId>0&&0==r.isPackage&&(s.addonTotalGCUsed=_onlineCheckout.parseTodecimal(s.addonTotalGCUsed+r.Price,2))}}}else if(1!=r.isPointApply){c=r.Originalprice;r.gcId>0&&(c=r.actualPrice);d=0;if(1==r.isMembershipApply){C=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==r.MembershipID&&2==e.ItemType&&e.MembershipItemId==r.MembershipItemId});d=_onlineCheckout.parseTodecimal(c*C[0].Discount/100,2)}if(void 0!==r.isPresetApply&&1==r.isPresetApply&&(0==r.IsAmount?d=_onlineCheckout.parseTodecimal(d+c*r.AmountValue/100,2):(d=r.actualPrice<d+r.AmountValue?c:_onlineCheckout.parseTodecimal(d+r.AmountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(d=parseFloat(ConvertTodecimalMorePrecious(parseFloat(d)/(1+r.tax/100),!0,4))))),(null==r.gcId||0==r.gcId||r.gcId>0&&0==r.isPackage)&&0!=r.PromotionID){S=0;1==r.IsAmount?(S=r.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(S=parseFloat(ConvertTodecimalMorePrecious(parseFloat(S)/(1+r.tax/100),!0,4)))):S=c*r.AmountValue/100,d+=S}r.actualPrice<d&&(d=c),r.discount=d,r.Price=_onlineCheckout.parseTodecimal(c-r.discount,2),r.actualPrice=r.Price,(r.gcId<0||r.gcId>0)&&1==r.isPackage?r.actualTaxprice=0:r.actualTaxprice=_onlineCheckout.parseTodecimal(r.Price*r.tax/100,3),s.addonDiscountprice=_onlineCheckout.parseTodecimal(s.addonDiscountprice+r.discount,2),r.taxprice=r.actualTaxprice,null!=r.gcId&&0==r.isPackage&&(0==r.Price&&(r.gcId=null,_onlineCheckout.RemoveDicount(v,1,r.eventID,r.autoID)),r.redeemTax=r.actualTaxprice,r.redeemAmt=r.actualPrice),r.BusinessTax=_onlineCheckout.ApplyMultipleTax(r.Price,r),s.addonTotalPrice=_onlineCheckout.parseTodecimal(s.addonTotalPrice+r.Price,2),s.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(s.addonTotalTaxPrice+r.taxprice,2),r.gcId>0&&0==r.isPackage&&(s.addonTotalGCUsed=_onlineCheckout.parseTodecimal(s.addonTotalGCUsed+r.Price,2))}})});var r=parseFloat((s.addonTotalPrice+s.addonTotalTaxPrice-s.addonTotalGCUsed).toFixed(2));return s.addonTotalTaxPrice=parseFloat(s.addonTotalTaxPrice.toFixed(2)),s.addonTotalGCUsed=s.addonTotalGCUsed,s.FinalTotal=r,s.PromoApplied=s.PromoApplied,s.addonDiscountprice=s.addonDiscountprice,s},_onlineCheckout.RemovePresetDiscountOnEventsAddon=function(t,i,n){var o={PromoApplied:!1,addonTotalPrice:0,addonTotalTaxPrice:0,addonTotalGCUsed:0,addonDiscountprice:0,FinalTotal:0};e.grep(t,function(t){!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(a){var s=e.grep(i,function(e){return e.ServiceID==a.ServiceId&&e.ItemTypeID==v});if(null!=s&&s.length>0){s=s[0];var r=a.Originalprice,l=0;if(void 0!==a.isPresetApply&&1==a.isPresetApply&&a.DiscountID==n)l=0==s.IsAmount?_onlineCheckout.parseTodecimal(r*s.DiscountValue/100,2):a.actualPrice<s.DiscountValue?r:_onlineCheckout.parseTodecimal(s.DiscountValue,2),a.discount=a.discount-l,a.Price=_onlineCheckout.parseTodecimal(a.Price+a.discount,2),a.actualPrice=a.Price,(a.gcId<0||a.gcId>0)&&1==a.isPackage?a.actualTaxprice=0:a.actualTaxprice=_onlineCheckout.parseTodecimal(a.Price*t.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+a.discount,2),o.addonDiscountprice=_onlineCheckout.parseTodecimal(o.addonDiscountprice+a.discount,2),a.isPresetApply=!1,a.isPointApply=!1,a.isPackage,a.DiscountID=0,a.IsAmount=!1,a.AmountValue=0,a.taxprice=a.actualTaxprice,null!=a.gcId&&0==a.isPackage&&(a.redeemTax=a.actualTaxprice,a.redeemAmt=a.actualPrice,onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed+l);else{if(1==a.isMembershipApply){var c=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==a.MembershipID&&2==e.ItemType&&e.MembershipItemId==a.MembershipItemId});l=_onlineCheckout.parseTodecimal(r*c[0].Discount/100,2)}a.discount=l,a.Price=a.Price,a.actualPrice=a.Price,(a.gcId<0||a.gcId>0)&&1==a.isPackage?a.actualTaxprice=0:a.actualTaxprice=_onlineCheckout.parseTodecimal(a.Price*t.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+a.discount,2),o.addondiscountprice=_onlineCheckout.parseTodecimal(o.addondiscountprice+a.discount,2),a.taxprice=a.actualTaxprice,null!=a.gcId&&0==a.isPackage&&(0==a.Price?_onlineCheckout.RemoveDicount(v,1,a.eventID,a.autoID):onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed-a.discount,a.redeemTax=a.actualTaxprice,a.redeemAmt=a.actualPrice)}o.addonTotalPrice=_onlineCheckout.parseTodecimal(o.addonTotalPrice+a.Price,2),o.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(o.addonTotalTaxPrice+a.actualTaxprice,2),a.gcId>0&&0==a.isPackage&&(o.addonTotalGCUsed=_onlineCheckout.parseTodecimal(o.addonTotalGCUsed+a.Price,2))}else{r=a.actualPrice,l=0;if(1==a.isMembershipApply){c=e.grep(onlineShoppingCart.lstMembership,function(e){return e.MembershipID==a.MembershipID&&2==e.ItemType&&e.MembershipItemId==a.MembershipItemId});l=_onlineCheckout.parseTodecimal(r*c[0].Discount/100,2)}a.discount=l,a.Price=a.Price,a.actualPrice=a.Price,(a.gcId<0||a.gcId>0)&&1==a.isPackage?a.actualTaxprice=0:a.actualTaxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,3),onlineShoppingCart.classdiscount=_onlineCheckout.parseTodecimal(onlineShoppingCart.classdiscount+a.discount,2),o.addonDiscountprice=_onlineCheckout.parseTodecimal(o.addonDiscountprice+a.discount,2),a.taxprice=a.actualTaxprice,null!=a.gcId&&0==a.isPackage&&(0==a.Price?_onlineCheckout.RemoveDicount(p,1,a.eventID,a.autoID):onlineShoppingCart.classGCUsed=onlineShoppingCart.classGCUsed-a.discount,a.redeemTax=a.actualTaxprice,a.redeemAmt=a.actualPrice),o.addonTotalPrice=_onlineCheckout.parseTodecimal(o.addonTotalPrice+a.Price,2),o.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(o.addonTotalTaxPrice+a.actualTaxprice,2),a.gcId>0&&0==a.isPackage&&(o.addonTotalGCUsed=_onlineCheckout.parseTodecimal(o.addonTotalGCUsed+a.Price,2))}})});var a=parseFloat((o.addonTotalPrice+o.addonTotalTaxPrice-o.addonTotalGCUsed).toFixed(2));return o.addonTotalTaxPrice=parseFloat(o.addonTotalTaxPrice.toFixed(2)),o.addonTotalGCUsed=o.addonTotalGCUsed,o.FinalTotal=a,o.PromoApplied=o.PromoApplied,o.addonDiscountprice=o.addonDiscountprice,o},_onlineCheckout.ApplyMembershipONEventsAddon_ShowDiscount=function(t,i){var n=e.grep(i,function(e){return e.ItemType==v}),o={addonTotalPrice:0,addonTotalTaxPrice:0,addonTotalGCUsed:0,addonDiscountprice:0,FinalTotal:0};if(null!=n&&n.length>0){e.each(t,function(t,i){!String.isNullOrUndefineOrBlank(i.lstAddonService)&&i.lstAddonService.length>0&&(e.each(i.lstAddonService,function(t,a){void 0===a.IsOutsideBilling&&(a.IsOutsideBilling=!1),void 0===a.IsWaivedApply&&(a.IsWaivedApply=!1);var s=e.grep(n,function(e){return i.customerID>0&&e.UserID>0&&(i.customerID==e.UserID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,i.customerID))||i.customerID<=0&&e.UserID>0&&i.cUserEmail==e.EmailId});e.each(s,function(t,n){if(n.ServiceProductName.toLowerCase().trim()==a.ServiceTitle.toLowerCase().trim()&&null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))>new Date(moment(n.strValidUpto).format("YYYY/MM/DD"))&&null!=n.strAdvanceLimitDate&&""!=n.strAdvanceLimitDate&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strAdvanceLimitDate).format("YYYY/MM/DD"))&&0==a.IsOutsideBilling&&0==a.IsWaivedApply&&(a.strAdvanceLimitDate=n.strAdvanceLimitDate,a.IsWaivedApply=!0,a.AppliedName=n.MembershipName),1==a.isMembershipRemove&&n.ServiceProductName.toLowerCase().trim()==a.ServiceTitle.toLowerCase().trim()&&n.Discount>0&&(i.customerID>0&&n.UserID>0&&(i.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,i.customerID))||i.customerID<=0&&n.UserID>0&&i.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)){n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining>0?n.VisitRemaining-1:n.VisitRemaining;var o=e.grep(s,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});e.each(o,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)});return 1==a.isPointApply||!(null==a.gcId||0==a.gcId||a.gcId>0&&0==a.isPackage)||0==a.PromotionID&&1!=a.isPresetApply||(a.discount,a.Price=a.Originalprice-a.discount,a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,3),a.actualPrice=a.Price,a.actualTaxprice=a.taxprice),!1}if(a.Price>0&&1!=a.isPointApply&&1!=a.isPackage&&(null==a.gcId||0==a.gcId)&&n.ServiceProductName.toLowerCase().trim()==a.ServiceTitle.toLowerCase().trim()&&n.Discount>0&&(i.customerID>0&&n.UserID>0&&(i.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,i.customerID))||i.customerID<=0&&n.UserID>0&&i.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)&&(!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&(0!=a.PromotionID&&1==n.isPromotionalDiscount||0==a.PromotionID||void 0===a.PromotionID)&&(null==n.strValidUpto||""==n.strValidUpto||null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strValidUpto).format("YYYY/MM/DD")))){var r=parseFloat(a.Originalprice);a.discount=a.discount+_onlineCheckout.parseTodecimal(a.Originalprice*n.Discount/100,2),r<a.discount&&(a.discount=r),a.Price=_onlineCheckout.parseTodecimal(a.Originalprice-a.discount,2),r>0&&(a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.taxprice/r,2)),a.isMembershipApply=!0,a.membershipDiscount=n.Discount,a.membershipuserid=n.UserID,a.membershipUniqueID=n.MembershipUniqueId,n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining-1,a.RedeemBusinessId=n.BusinessID,a.BusinessID=onlineShoppingCart.BusinessID,a.MembershipID=n.MembershipID,a.MembershipItemId=n.MembershipItemId,a.membershipName=n.MembershipName,a.GroupId=n.GroupId,a.VisitRemaining=n.VisitRemaining;var l=e.grep(s,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});return e.each(l,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)}),!1}if(1!=a.isMembershipApply)if(a.discount=0,a.isMembershipApply=!1,a.membershipDiscount=0,a.membershipUniqueID=null,1!=a.isPointApply&&(null==a.gcId||0==a.gcId||a.gcId>0&&0==a.isPackage)&&void 0!==a.PromotionID&&0!=a.PromotionID){var c=0;c=1==a.IsAmount?a.AmountValue:a.Originalprice*a.AmountValue/100,a.discount=c,a.Price=a.Originalprice-c,a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,3),a.actualPrice=a.Price,a.actualTaxprice=a.taxprice}else _onlineCheckout.isValidForCheckoutInvoice()&&1!=a.isPointApply&&(null==a.gcId||0==a.gcId||a.gcId>0&&0==a.isPackage)&&(a.discount=a.originalDiscount,a.Price=a.Originalprice-a.discount,a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,3),a.actualPrice=a.Price,a.actualTaxprice=a.taxprice)}),o.addonTotalPrice=_onlineCheckout.parseTodecimal(o.addonTotalPrice+a.Price,2),o.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(o.addonTotalTaxPrice+a.taxprice,2),a.gcId>0&&0==a.isPackage&&(o.addonTotalGCUsed=_onlineCheckout.parseTodecimal(o.addonTotalGCUsed+a.Price,2),a.classAddonGCUsed=_onlineCheckout.parseTodecimal(a.Price,2)),(a.gcId<0||a.gcId>0)&&1==a.isPackage&&(a.classAddonGCUsed=_onlineCheckout.parseTodecimal(a.Price,2))}),e.each(i.lstAddonService,function(e,t){o.addonDiscountprice+=t.discount})),o.addonDiscountprice=_onlineCheckout.parseTodecimal(o.addonDiscountprice,2)});var a=parseFloat((o.addonTotalPrice+o.addonTotalTaxPrice-o.addonTotalGCUsed).toFixed(2));o.addonTotalTaxPrice=parseFloat(o.addonTotalTaxPrice.toFixed(2)),o.addonTotalGCUsed=o.addonTotalGCUsed,o.addonDiscountprice=o.addonDiscountprice,o.FinalTotal=a}return o},_onlineCheckout.ApplyMembershipONEventsAddon=function(t,i){var n=e.grep(i,function(e){return e.ItemType==v}),o={addonTotalPrice:0,addonTotalTaxPrice:0,addonTotalGCUsed:0,addonDiscountprice:0,addonFinalTotal:0};if(null!=n&&n.length>0){e.each(t,function(t,i){!String.isNullOrUndefineOrBlank(i.lstAddonService)&&i.lstAddonService.length>0&&(e.each(i.lstAddonService,function(t,a){var s=e.grep(n,function(e){return i.customerID>0&&e.UserID>0&&(i.customerID==e.UserID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,i.customerID))||i.customerID<=0&&e.UserID>0&&i.cUserEmail==e.EmailId});e.each(s,function(t,n){if(n.ServiceProductName.toLowerCase().trim()==a.ServiceTitle.toLowerCase().trim()&&null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))>new Date(moment(n.strValidUpto).format("YYYY/MM/DD"))&&null!=n.strAdvanceLimitDate&&""!=n.strAdvanceLimitDate&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strAdvanceLimitDate).format("YYYY/MM/DD"))&&0==a.IsOutsideBilling&&0==a.IsWaivedApply&&(a.strAdvanceLimitDate=n.strAdvanceLimitDate,a.IsWaivedApply=!0,a.AppliedName=n.MembershipName),_onlineCheckout.isValidForCheckoutInvoice()&&(void 0!==a.isPresetApply&&1==a.isPresetApply&&0==n.IsAllowPreSetDiscount||0!=a.PromotionID&&0==n.isPromotionalDiscount))return!1;if(1==a.isMembershipRemove&&n.ServiceProductName.toLowerCase().trim()==a.ServiceTitle.toLowerCase().trim()&&n.Discount>0&&(i.customerID>0&&n.UserID>0&&(i.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,i.customerID))||i.customerID<=0&&n.UserID>0&&i.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)){n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining>0?n.VisitRemaining-1:n.VisitRemaining;var o=e.grep(s,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});return e.each(o,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)}),1==a.isPointApply||!(null==a.gcId||0==a.gcId||a.gcId>0&&0==a.isPackage)||0==a.PromotionID&&1!=a.isPresetApply||(a.Price=a.Originalprice-a.discount,a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,3),a.actualPrice=a.Price,a.actualTaxprice=a.taxprice),!1}if(a.Price>0&&1!=a.isPointApply&&1!=a.isPackage&&(null==a.gcId||0==a.gcId)&&n.ServiceProductName.toLowerCase().trim()==a.ServiceTitle.toLowerCase().trim()&&n.Discount>0&&(i.customerID>0&&n.UserID>0&&(i.customerID==n.UserID||_onlineCheckout.IsUserHaveSharedMS(n.SharedUserIDs,i.customerID))||i.customerID<=0&&n.UserID>0&&i.cUserEmail==n.EmailId)&&(n.VisitRemaining>0||-1==n.VisitRemaining)&&(1==_onlineCheckout.IsUpSellMemPkgAdd||"true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&(0!=a.PromotionID&&1==n.isPromotionalDiscount||0==a.PromotionID||void 0===a.PromotionID)&&0==a.isPaid&&(null==n.strValidUpto||""==n.strValidUpto||null!=n.strValidUpto&&""!=n.strValidUpto&&new Date(moment(i.eventDate).format("YYYY/MM/DD"))<=new Date(moment(n.strValidUpto).format("YYYY/MM/DD")))){var r=parseFloat(a.Originalprice);if(_onlineCheckout.isValidForCheckoutInvoice()){if(r=parseFloat(a.Originalprice),1==n.isPromotionalDiscount&&0!=a.PromotionID){var l=_onlineCheckout.parseTodecimal(a.Originalprice*n.Discount/100,2);a.discount=_onlineCheckout.parseTodecimal(a.discount,2)+_onlineCheckout.parseTodecimal(l,2)}else if(void 0!==a.isPresetApply&&1==a.isPresetApply&&1==n.IsAllowPreSetDiscount){l=_onlineCheckout.parseTodecimal(a.Originalprice*n.Discount/100,2);a.discount=_onlineCheckout.parseTodecimal(a.discount,2)+_onlineCheckout.parseTodecimal(l,2)}else a.discount=0,a.discount=_onlineCheckout.parseTodecimal(a.Originalprice*n.Discount/100,2);a.Originalprice=r}else a.discount=a.discount+_onlineCheckout.parseTodecimal(a.Originalprice*n.Discount/100,2);r<a.discount&&(a.discount=r),a.Price=_onlineCheckout.parseTodecimal(a.Originalprice-a.discount,2),r>0&&(a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,2)),a.isMembershipApply=!0,a.membershipDiscount=n.Discount,a.membershipUniqueID=n.MembershipUniqueId,a.membershipuserid=n.UserID,n.VisitRemaining=-1==n.VisitRemaining?n.VisitRemaining:n.VisitRemaining-1,a.RedeemBusinessId=n.BusinessID,a.BusinessID=onlineShoppingCart.BusinessID,a.MembershipID=n.MembershipID,a.MembershipItemId=n.MembershipItemId,a.membershipName=n.MembershipName,a.GroupId=n.GroupId,a.VisitRemaining=n.VisitRemaining;o=e.grep(s,function(e){return 0!=n.GroupId&&n.GroupId==e.GroupId&&n.ServiceProductName.toLowerCase().trim()!=e.ServiceProductName.toLowerCase().trim()&&n.BusinessID==e.BusinessID});return e.each(o,function(e,t){t.GroupId==n.GroupId&&(t.VisitRemaining=n.VisitRemaining)}),!1}if(1!=a.isMembershipApply&&0==a.isPaid)if(a.discount=0,a.isMembershipApply=!1,a.membershipDiscount=0,a.membershipUniqueID=null,1!=a.isPointApply&&(null==a.gcId||0==a.gcId||a.gcId>0&&0==a.isPackage)&&void 0!==a.PromotionID&&0!=a.PromotionID){var c=0;c=1==a.IsAmount?a.AmountValue:a.Originalprice*a.AmountValue/100,a.discount=c,a.Price=a.Originalprice-c,a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,3),a.actualPrice=a.Price,a.actualTaxprice=a.taxprice}else _onlineCheckout.isValidForCheckoutInvoice()&&1!=a.isPointApply&&(null==a.gcId||0==a.gcId||a.gcId>0&&0==a.isPackage)&&(a.discount=a.originalDiscount,a.Price=a.Originalprice-a.discount,a.taxprice=_onlineCheckout.parseTodecimal(a.Price*a.tax/100,3),a.actualPrice=a.Price,a.actualTaxprice=a.taxprice)}),a.BusinessTax=_onlineCheckout.ApplyMultipleTax(a.Price,a),o.addonTotalPrice=_onlineCheckout.parseTodecimal(o.addonTotalPrice+a.Price,2),o.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(o.addonTotalTaxPrice+a.taxprice,2),a.gcId>0&&0==a.isPackage&&(o.addonTotalGCUsed=_onlineCheckout.parseTodecimal(o.addonTotalGCUsed+a.Price,2))}),e.each(i.lstAddonService,function(e,t){o.addonDiscountprice+=t.discount})),o.addonDiscountprice=_onlineCheckout.parseTodecimal(o.addonDiscountprice,2)});var a=parseFloat((o.addonTotalPrice+o.addonTotalTaxPrice-o.addonTotalGCUsed).toFixed(2));o.addonTotalTaxPrice=parseFloat(o.addonTotalTaxPrice.toFixed(2)),o.addonTotalGCUsed=o.addonTotalGCUsed,o.addonDiscountprice=o.addonDiscountprice,o.addonFinalTotal=a}else e.each(t,function(e,t){if(!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0){var i=_onlineCheckout.GetAllAddonCalculationDetailsByEvent(t.lstAddonService);o.addonTotalPrice=o.addonTotalPrice+i.addonTotalPrice,o.addonTotalTaxPrice=o.addonTotalTaxPrice+i.addonTotalTaxPrice,o.addonTotalGCUsed=o.addonTotalGCUsed+i.addonTotalGCUsed,o.addonDiscountprice=o.addonDiscountprice+i.addonDiscountprice}});return o},_onlineCheckout.setClassAddonCheckoutData=function(t,i,n,o){if(null!=t&&t.length>0)for(var a=o,s=0;s<t.length;s++){var r=t[s];if(checkoutGridrow={},checkoutGridrow.uniqID=a+1,checkoutGridrow.userName="",checkoutGridrow.emailId=n.cUserEmail,checkoutGridrow.userID=null==n.tmpcustomerID?n.customerID:n.tmpcustomerID,checkoutGridrow.serviceProviderID=n.sPID,checkoutGridrow.itemID=r.ServiceId,checkoutGridrow.packageDetailId=String.isNullOrUndefineOrBlank(r.gcId)?0:r.gcId,checkoutGridrow.itemName=r.ServiceTitle,checkoutGridrow.pointsGained=r.PointGiven,checkoutGridrow.pointsRedeem=r.pointsRedeem,checkoutGridrow.recordType=v,checkoutGridrow.barcodeID=A,checkoutGridrow.FmbFee=r.dailydealFee,checkoutGridrow.FMBPercentage=r.FMBPercentage,checkoutGridrow.DealBookingType=_onlineCheckout.GetDealBookingType(r.dailydealFee,r.FMBPercentage),checkoutGridrow.price=void 0!==r.isPointApply&&r.isPointApply?r.Originalprice:parseFloat(String.isNullOrUndefineOrBlank(r.Price)?0:r.Price)+parseFloat(String.isNullOrUndefineOrBlank(r.discount)?0:r.discount),checkoutGridrow.discount=String.isNullOrUndefineOrBlank(r.discount)?0:r.discount,checkoutGridrow.discountedPrice=void 0!==r.isPointApply&&r.isPointApply?r.Originalprice:r.Price,void 0!==r.dailydealFee&&null!=r.dailydealFee&&Number(r.dailydealFee)>0&&(checkoutGridrow.price=Math.max(0,checkoutGridrow.price-r.dailydealFee),checkoutGridrow.discountedPrice=Math.max(0,checkoutGridrow.discountedPrice-r.dailydealFee)),checkoutGridrow.quantity=1,checkoutGridrow.packageAssignStatus=void 0!==r.isPackage&&r.isPackage?1:0,checkoutGridrow.pointAssignStatus=void 0!==r.isPointApply&&r.isPointApply?1:0,checkoutGridrow.appointmentDate=n.eventDate,checkoutGridrow.appointmentID=n.appointmentID,checkoutGridrow.appointmentTime=n.startTime,checkoutGridrow.serviceProviderName=n.sPName,checkoutGridrow.startTime=n.startTime,checkoutGridrow.originalServicePriceForPackage=r.Originalprice,checkoutGridrow.businessPackageID=0,checkoutGridrow.PromotionID=r.PromotionID,checkoutGridrow.ConstantOriginalServicePrice=r.Originalprice,_onlineCheckout.isValidForCheckoutInvoice()&&(checkoutGridrow.parentAppointmentID=r.parentAppointmentID,checkoutGridrow.sessionAttendeeID=r.sessionAttendeeID),checkoutGridrow.membershipDiscount=String.isNullOrUndefineOrBlank(r.membershipDiscount)?0:r.membershipDiscount,r.isMembershipApply){var l={};l.BusinessID=n.BusinessID,l.RedeemBusinessId=n.RedeemBusinessId,l.UserID=n.customerID,l.MembershipID=r.MembershipID,l.MembershipItemId=r.MembershipItemId,l.ItemType=20,l.VisitUsed=1,l.Type=2,l.GroupId=r.GroupId,l.ServiceProductName=r.ServiceTitle,checkoutGridrow.MembershipRedeemedDetails=l}if(r.isPackage?(objGC={},objGC.giftcertificateId=r.gcId,objGC.serviceId=r.ServiceId,objGC.redeemAmt=r.redeemAmt,objGC.RedeemServiceId=r.RedeemServiceId,objGC.uniqID=checkoutGridrow.uniqID,objGC.AppointmentID=n.appointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,onlineShoppingCart.RedeemedByGC.push(objGC)):!String.isNullOrUndefineOrBlank(r.gcId)&&r.gcId>0&&(objGC={},objGC.giftcertificateId=r.gcId,objGC.serviceId=r.ServiceId,null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&e.grep(onlineShoppingCart.lstGCPkgData,function(e){e.giftCertificateID==r.gcId&&null!=e.Taxes&&(n.redeemTax=0,r.TaxValue="0",r.taxprice=0)}),objGC.redeemAmt=r.redeemAmt+(String.isNullOrUndefineOrBlank(r.redeemTax)?0:r.redeemTax),objGC.RedeemServiceId=r.RedeemServiceId,objGC.uniqID=checkoutGridrow.uniqID,objGC.AppointmentID=n.appointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,objGC.serviceId>0&&objGC.giftcertificateId>0&&onlineShoppingCart.RedeemedByGC.push(objGC)),checkoutGridrow.calculatedTax=_onlineCheckout.parseTodecimal(r.taxprice,3),checkoutGridrow.BusinessTax=r.BusinessTax,checkoutGridrow.DiscountID=r.DiscountID,checkoutGridrow.DiscountType=_onlineCheckout.isValidForCheckoutInvoice()?String.isNullOrUndefineOrBlank(r.DiscountType)?1==r.IsAmount?2:1:r.DiscountType:1==r.IsAmount?2:1,checkoutGridrow.AmountValue=r.AmountValue,r.isPaid&&(r.paidType==_onlineCheckout.arrpaidType.Deposits&&(checkoutGridrow.price=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(r.payableAmount,2)-_onlineCheckout.parseTodecimal(r.deposit,2),2)),checkoutGridrow.isPaid=r.isPaid,checkoutGridrow.paidType=r.paidType,checkoutGridrow.DiscountID=0,checkoutGridrow.PromotionID=0),(r.paidType==_onlineCheckout.arrpaidType.PaidClass||r.paidType==_onlineCheckout.arrpaidType.Paid)&&onlineShoppingCart.tipPercent>0){_onlineCheckout.TipApplyCounter=++_onlineCheckout.TipApplyCounter;var c=_onlineCheckout.parseTodecimal(r.Price,2);(1==r.isPackage||1==r.isPointApply||r.isMembershipApply)&&(c=_onlineCheckout.parseTodecimal(r.Originalprice,2));var d=0;d=_onlineCheckout.TipApplyCounter==_onlineCheckout.TotalPaidCount||0==c?_onlineCheckout.parseTodecimal(onlineShoppingCart.tipValue-_onlineCheckout.TipAppliedSum,2):_onlineCheckout.parseTodecimal(c*onlineShoppingCart.tipPercent/100,2),checkoutGridrow.calculatedTip=d,_onlineCheckout.TipAppliedSum+=d}r.paidType!=_onlineCheckout.arrpaidType.OfflineDeposit&&r.paidType!=_onlineCheckout.arrpaidType.OfflineDepositPrepay&&r.paidType!=_onlineCheckout.arrpaidType.DepositsClass||(checkoutGridrow.payableAmount=_onlineCheckout.parseTodecimal(r.payableAmount,2),"undefined"==r.depositsRemaining||null==r.depositsRemaining||isNaN(r.depositsRemaining)?checkoutGridrow.DepositsRemaining=0:checkoutGridrow.DepositsRemaining=_onlineCheckout.parseTodecimal(r.depositsRemaining,2),"undefined"==r.depositsPaid||null==r.depositsPaid||isNaN(r.depositsPaid)?checkoutGridrow.DepositsPaid=0:r.IsPartialPoint&&!r.IsDepositsOver?checkoutGridrow.DepositsPaid=_onlineCheckout.parseTodecimal(r.depositsPaid+r.PartialPrice,2):checkoutGridrow.DepositsPaid=_onlineCheckout.parseTodecimal(r.depositsPaid,2),checkoutGridrow.depositsPercentage=_onlineCheckout.parseTodecimal(r.depositsPercentage,3),checkoutGridrow.paidType=r.paidType,r.paidType!=_onlineCheckout.arrpaidType.OfflineDepositPrepay&&(checkoutGridrow.calculatedTax=0,checkoutGridrow.BusinessTax=null)),1==r.IsPartialPoint&&(checkoutGridrow.payableAmount=r.IsPartialDeposits?r.Price-r.PartialPrice:r.Price),checkoutGridrow.calculatedTaxTypeWise="[]",String.isNullOrUndefineOrBlank(r.BusinessTax)||(checkoutGridrow.calculatedTaxTypeWise=String.isNullOrUndefineOrBlank(r.BusinessTax)?"[]":JSON.stringify(r.BusinessTax)),checkoutGridrow.taxes=r.TaxValue,9==r.OriginalpaidType&&(checkoutGridrow.paidType=r.OriginalpaidType,checkoutGridrow.IsChargeFee=r.IsChargeFee),"undefined"==typeof _common||String.isNullOrUndefineOrBlank(_common.IsWidgetForServiceProvider)?checkoutGridrow.WidgetSpId=null:checkoutGridrow.WidgetSpId=1==_common.IsWidgetForServiceProvider(!0)?_common.IsWidgetForServiceProvider(!1):null,"undefined"==typeof hdnPriceWithTaxSwitch||null!=hdnPriceWithTaxSwitch||null==hdnPriceWithTaxSwitch||String.isNullOrUndefineOrBlank(hdnPriceWithTaxSwitch.value)||(checkoutGridrow.IsIncludeTaxInOnlinePricing=!0),void 0!==r.dailydealFee&&null!=r.dailydealFee&&Number(r.dailydealFee)>0&&(checkoutGridrow.dailydealFee=r.dailydealFee),i.push(checkoutGridrow)}return a},_onlineCheckout.UpdateAttendeeSelectionOnAddonPopup=function(t){e(t).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").html(e(t).find("div.ffshipping-bg").html()),e(t).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-value",e(t).find("div.ffshipping-bg").data("value")),e(t).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-email",e(t).find("div.ffshipping-bg").data("email")),e(t).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-cell",e(t).find("div.ffshipping-bg").data("cell")),e(t).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-cellcountryid",e(t).find("div.ffshipping-bg").data("cellcountryid")),e(t).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-fullname",e(t).find("div.ffshipping-bg").data("fullname")),e(t).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-cellcountryid",e(t).find("div.ffshipping-bg").data("cellcountryid")),e(t).closest("div.panel-default").attr("data-value",e(t).find("div.ffshipping-bg").data("value")),e(t).closest("div.panel-default").attr("data-email",e(t).find("div.ffshipping-bg").data("email")),e(t).closest("div.panel-default").attr("data-cell",e(t).find("div.ffshipping-bg").data("cell")),e(t).closest("div.panel-default").attr("data-cellcountryid",e(t).find("div.ffshipping-bg").data("cellcountryid")),e(t).closest("div.panel-default").attr("data-fullname",e(t).find("div.ffshipping-bg").data("fullname")),e(t).closest("div.collapse").collapse("hide")},_onlineCheckout.AddToCartSuggestUpsellClick=function(t,i,n,o,a,s,r,l,c,d,u,p,h,m,g){if(_onlineCheckout.IsUpSellMemPkgAdd=1,1==i)if(null!=onlineShoppingCartmain.Memberships&&onlineShoppingCartmain.Memberships.length>0){if(onlineShoppingCartmain.Memberships[0].MembershipId==t)return!0;_onlineCheckout.SuccessMembershipUpsellClick(t,!0),setTimeout(function(){e("#tabVagaroPayLater").hide()},100)}else _onlineCheckout.SuccessMembershipUpsellClick(t,!0),setTimeout(function(){e("#tabVagaroPayLater").hide()},100);if(1==n){if(null!=onlineShoppingCartmain.Packages&&onlineShoppingCartmain.Packages.length>0){var v=e.grep(onlineShoppingCartmain.Packages,function(e){return e.ServiceId==t&&4==e.eventType});return null!=v&&v.length>0||(message="A pacakge already exists in your cart, would you like to replace it?",swal({html:!0,title:message,text:"",type:"",showCancelButton:!0,confirmButtonText:"Replace Package",cancelButtonText:"No",closeOnCancel:!0},function(i){i&&(_onlineCheckout.RemoveMembersipPackageCartItems(onlineShoppingCart.BusinessID,onlineShoppingCart.loginUserId,"PackageUpSell",1),onlineShoppingCartmain.Packages=e.grep(onlineShoppingCartmain.Packages,function(e){return 4!=e.eventType}),_onlineCheckout.SuccessPackageUpsellClick(t,!0))}),void setTimeout(function(){e(".gencutom-title").html("Multiple Package in Cart")},100))}_onlineCheckout.SuccessPackageUpsellClick(t,!0)}},_onlineCheckout.SuccessMembershipUpsellClick=function(t,i){null==onlineShoppingCartmain.Memberships&&(onlineShoppingCartmain.Memberships=[]);var n=e.extend(!0,[],_shopdetail.MembershipPackageUpSell.MembershipUpSellData),o=e.grep(n,function(e){return e.IsUpsell=!0,e.MembershipUniqueId=e.MembershipID+"~UMD",e.MembershipID==t});if(void 0!==o&&null!=o&&o.length>0&&void 0!==o[0].IsRecurring&&null!=o[0].IsRecurring&&1==o[0].IsRecurring&&(_onlineCheckout.IsRecurringMembership=!0,e("#tabVagaroPayLater").data("IsFromUpsell",!0),_shopdetail.ResetVPLPaymentMethod(!0,!0)),1==i&&(_onlineCheckout.setSuggestUpsellMembershipsData(o,onlineShoppingCartmain.Memberships,2),null!=o&&o.length>0)){var a=o[0].PromotionDetail,s=o[0].PromotionTitle,r=!1,l=0,c=!1,d=0;String.isNullOrUndefineOrBlank(a)||String.isNullOrUndefineOrBlank(s)?(r=o[0].IsInitialDiscount,l=o[0].InitialDiscount,c=o[0].IsAmount,d=o[0].BillingCycle):d=o[0].BillingCycle,_onlineCheckout.SuggestUpsellMembershipAddToCart(onlineShoppingCart.BusinessID,t,"true",0,!1,a,s,r,l,c,d)}lstCheckoutMembershipDetail=[],e.extend(lstCheckoutMembershipDetail,o);var u=e.extend(!0,[],onlineShoppingCartmain.objGcPackagePointAndUserTaxDetail);u.lstMembershipForCheckout.push.apply(u.lstMembershipForCheckout,lstCheckoutMembershipDetail),_onlineCheckout.ApplyDiscounts(u.lstGcAndPackagesForCheckout,u.lstUserListForCheckout,u.lstMembershipForCheckout,u.IsPromotionEnable),_onlineCheckout.DisplaySelectionInUpsellItem(1,t),_onlineCheckout.IsVCFEnable()&&1==i&&setTimeout(function(){_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.MembershipUpSell)},1e3),ShowLoader(!1)},_onlineCheckout.GetPackageId=function(t){if(null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0){var i=e.grep(onlineShoppingCart.Packages,function(e){return e.GCUpdatePendingID==t});if(null!=i&&i.length>0)return i[0].SellPackageServiceID}return 0},_onlineCheckout.SuccessPackageUpsellClick=function(t,i){null==onlineShoppingCartmain.Packages&&(onlineShoppingCartmain.Packages=[]);var n=e.extend(!0,[],_shopdetail.MembershipPackageUpSell.PackageUpSellData),o=e.grep(n,function(e){return e.ServiceId==t});void 0!==o&&null!=o&&o.length>0&&void 0!==o[0].IsRecurring&&null!=o[0].IsRecurring&&1==o[0].IsRecurring&&(_onlineCheckout.IsRecurringPkg,e("#tabVagaroPayLater").data("IsFromUpsell",!0),_shopdetail.ResetVPLPaymentMethod(!0,!0)),1==i?(_onlineCheckout.setSuggestUpsellPackageData(o,onlineShoppingCartmain.Packages,2),_onlineCheckout.SuggestUpsellServiceAddToCart(onlineShoppingCart.BusinessID,t,0,!0,"","",!1,0,!1,"0")):null!=o&&o.length>0&&e.grep(onlineShoppingCartmain.Packages,function(t,i){o[0].ServiceId==t.ServiceId&&4==t.eventType&&(t.lstPackageForCheckout=String.isNullOrUndefineOrBlank(o[0].PackageJSON)?[]:JSON.parse(o[0].PackageJSON),null!=t.lstPackageForCheckout&&t.lstPackageForCheckout.length>0&&(t.lstPackageForCheckout=e.grep(t.lstPackageForCheckout,function(e){return 1==e.isPackage&&(e.isPackage=!0),1==e.isCustomPackage&&(e.isCustomPackage=!0),e})),t.GCUpdatePendingID=!String.isNullOrUndefineOrBlank(t.lstPackageForCheckout)&&t.lstPackageForCheckout.length>0?t.lstPackageForCheckout[0].giftCertificateID:0)}),lstCheckoutPackageDetail=_shopdetail.createGCPackageForPackageUpSellItem(2);var a=e.extend(!0,[],onlineShoppingCartmain.objGcPackagePointAndUserTaxDetail);a.lstGcAndPackagesForCheckout.push.apply(a.lstGcAndPackagesForCheckout,lstCheckoutPackageDetail),_onlineCheckout.ApplyDiscounts(a.lstGcAndPackagesForCheckout,a.lstUserListForCheckout,a.lstMembershipForCheckout,a.IsPromotionEnable),_onlineCheckout.DisplaySelectionInUpsellItem(2,t),_onlineCheckout.IsVCFEnable()&&1==i&&setTimeout(function(){_onlineCheckout.RemoveVCFFee(),_onlineCheckout.VCFAmountDistribution(_onlineCheckout.ApplyVCFLocation.PackageUpSell)},1e3),ShowLoader(!1)},_onlineCheckout.CheckCartItems=function(){null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(e){_onlineCheckout.SuccessMembershipUpsellClick(e.MembershipId,!1)}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(e){4==e.eventType&&_onlineCheckout.SuccessPackageUpsellClick(e.ServiceId,!1)}),e("#divSuggestUpsell").find(".vg-filter-mobile-tab.segment-tab-middle.package.w--current").length<=0&&1!=e("#divSuggestUpsell").find(".vg-filter-mobile-tab.segment-tab-middle.membership.w--current").length&&e("#divSuggestUpsell").find(".vg-switch-tab-first").addClass("w--current")},_onlineCheckout.IsCheckMemPkgUpsellExists=function(t,i){if(1==t){if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0){var n=e.grep(onlineShoppingCart.Memberships,function(e){return i==e.MembershipId});return null!=n&&n.length>0}return!1}return!0},_onlineCheckout.DisplaySelectionInUpsellItem=function(t,i){1==t&&(e("#Nothanks").removeClass("w--current"),e("#divSuggestUpsell").find(".membership").removeClass("w--current"),e("#M_"+i).addClass("w--current")),2==t&&(e("#Nothanks").removeClass("w--current"),e("#divSuggestUpsell").find(".package").removeClass("w--current"),e("#P_"+i).addClass("w--current"))},_onlineCheckout.CheckCartTotalAmt=function(){var t=0;return null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&e.grep(onlineShoppingCart.Memberships,function(e){t=_shopdetail.parseTodecimal(t,2)+_onlineCheckout.parseTodecimal(e.ActualPrice,2)}),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&e.grep(onlineShoppingCart.Packages,function(e){4==e.eventType&&(t=_shopdetail.parseTodecimal(t,2)+_onlineCheckout.parseTodecimal(e.ActualPrice,2))}),t},_onlineCheckout.ApplyDailyDealONEventsAddon=function(t){var i={addonTotalPrice:0,addonTotalTaxPrice:0,addonTotalGCUsed:0,addonDiscountprice:0};return null!=t&&t.length>0&&e.each(t,function(e,t){var n=t.Price;if(_onlineCheckout.isValidForCheckoutInvoice()&&(n=t.actualPrice),t.discount=0,(1!=t.isPointApply||t.IsPartialPoint)&&(t.isPointApply&&t.IsPartialPoint?t.IsPartialPoint&&1==_onlineCheckout.isValidForCheckoutInvoice()?void 0!==t.depositsPercentage&&!String.isNullOrUndefineOrBlank(t.depositsPercentage)&&t.depositsPercentage<100?t.Price=n:t.Price=t.actualPrice:t.IsPartialPoint&&"undefined"!=typeof onlineShoppingCartmain&&void 0!==onlineShoppingCartmain.DepositsPer&&onlineShoppingCartmain.DepositsPer<100&&(t.Price=t.actualPrice):t.Price=n,null!=t.gcId&&(t.gcId>0||t.gcId<0&&1==t.isPackage)&&(t.Price=t.actualPrice),n>0&&(t.isPointApply&&t.IsPartialPoint?t.taxprice=_onlineCheckout.parseTodecimal(n*t.tax/100,3):t.taxprice=_onlineCheckout.parseTodecimal(t.Price*t.taxprice/n,2)),!_onlineCheckout.isValidForCheckoutInvoice()||0!=t.isPackage&&null!=t.isPackage||(t.discount=t.discount,t.Price=n-t.discount,t.actualPrice=t.Price,t.actualTaxprice=t.taxprice),(null==t.gcId||0==t.gcId||t.gcId>0&&0==t.isPackage)&&void 0!==t.PromotionID&&0!=t.PromotionID&&0==t.isPaid)){var o=getCookie("Referral");if(void 0===o||""==o||null==o||null==o)if(null==t.IsDailyDealApply||t.IsDailyDealApply)t.PromotionID=0;else if(t.Price>0){var a=0;1==t.IsAmount?(a=t.AmountValue,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(a=parseFloat(ConvertTodecimalMorePrecious(parseFloat(a)/(1+t.tax/100),!0,4)))):a=_onlineCheckout.parseTodecimal(n*t.AmountValue/100,2),t.Originalprice<a&&(a=t.Originalprice),t.discount=a,t.isPointApply&&t.IsPartialPoint?t.Price=t.actualPrice-a:t.Price=n-a,t.taxprice=_onlineCheckout.parseTodecimal(t.Price*t.tax/100,3),t.actualPrice=t.Price,t.actualTaxprice=t.taxprice}else t.PromotionID=0;else if(t.Price>0){a=0;a=1==t.IsAmount?t.AmountValue:_onlineCheckout.parseTodecimal(n*t.AmountValue/100,2),t.Originalprice<a&&(a=t.Originalprice),t.discount=a,t.isPointApply&&t.IsPartialPoint?t.Price=t.actualPrice-a:t.Price=n-a,t.taxprice=_onlineCheckout.parseTodecimal(t.Price*t.tax/100,3),t.actualPrice=t.Price,t.actualTaxprice=t.taxprice}else t.PromotionID=0}i.addonDiscountprice=_onlineCheckout.parseTodecimal(i.addonDiscountprice+t.discount,2),t.isPointApply&&t.IsPartialPoint?(t.BusinessTax=_onlineCheckout.ApplyMultipleTax(n,t),i.addonTotalPrice=_onlineCheckout.parseTodecimal(i.addonTotalPrice+t.Price,2)):(t.BusinessTax=_onlineCheckout.ApplyMultipleTax(t.Price,t),i.addonTotalPrice=_onlineCheckout.parseTodecimal(i.addonTotalPrice+t.Price,2)),i.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(i.addonTotalTaxPrice+t.taxprice,2),t.gcId>0&&0==t.isPackage&&(i.addonTotalGCUsed=_onlineCheckout.parseTodecimal(i.addonTotalGCUsed+t.Price,2)),(t.gcId<0||t.gcId>0)&&1==t.isPackage&&(t.classAddonGCUsed=_onlineCheckout.parseTodecimal(t.Price,2))}),i},_onlineCheckout.ApplyPriceBaseGCOnEventsAddon=function(t,i,n){var o={addonTotalPrice:0,addonTotalTaxPrice:0,addonTotalGCUsed:0};if(i.length>0){var a=e.grep(i,function(e){return 1==e.eventType&&null==e.quantity&&e.currentBalance>0});if(null!=a&&a.length>0){a.keySort({serviceID:"desc",GiftCertificateAmt:"asc"})}if(a.length>0){if(e.each(t,function(t,i){!String.isNullOrUndefineOrBlank(i.lstAddonService)&&i.lstAddonService.length>0&&e.each(i.lstAddonService,function(t,s){if(s.isPriceBaseGCApply=!1,s.paidType==_onlineCheckout.arrpaidType.PaidClass||s.paidType==_onlineCheckout.arrpaidType.DepositsClass||1==n||_onlineCheckout.isValidForCheckoutInvoice()){var r=e.grep(a,function(e){return i.customerID>0&&e.assignTo>=0||i.customerID<=0&&e.assignTo>=0&&(i.cUserEmail==e.emailId||0==e.assignTo)});if((1!=s.isPointApply||1==s.IsPartialPoint)&&1!=s.isPackage&&(1==n||"true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())){var l=0,c=0;l=parseFloat(s.Price),c=parseFloat(s.taxprice),s.paidType==_onlineCheckout.arrpaidType.DepositsClass&&(l=s.depositsPaid,c=0,1==s.IsPartialPoint&&(l=0==s.IsDepositsOver?s.depositsPaid:s.depositsPaid-s.PartialPrice)),s.RemainingPrice=parseFloat(l),s.RemainingTax=parseFloat(c),null!=onlineShoppingCart.lstGCPkgData&&onlineShoppingCart.lstGCPkgData.length>0&&e.grep(onlineShoppingCart.lstGCPkgData,function(e){e.giftCertificateID==s.gcId&&null!=e.Taxes&&(s.RemainingTax=0)}),s.GCDetail=[],s.redeemAmt=0,s.redeemTax=0,e.grep(r,function(e){if((null==s.gcId||0==s.gcId)&&s.RemainingPrice>0&&e.currentBalance>0)if(e.currentBalance>=s.RemainingPrice){s.isPriceBaseGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=s.RemainingPrice,objGC.giftCertificateNo=e.giftCertificateNo,objGC.IsClass=!0,s.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),s.gcId=e.giftCertificateID,s.redeemAmt=_onlineCheckout.parseTodecimal(s.redeemAmt+s.RemainingPrice,2),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-s.RemainingPrice,2),s.RemainingPrice=0;var t=onlineShoppingCart.lstGCPkgData.filter(function(e){return e.giftCertificateID==s.gcId});String.isNullOrUndefineOrBlank(t)||(t[0].currentBalance=e.currentBalance)}else if(s.RemainingPrice>e.currentBalance&&e.currentBalance>0){s.isPriceBaseGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=e.currentBalance,objGC.giftCertificateNo=e.giftCertificateNo,objGC.IsClass=!0,s.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),s.gcId=e.giftCertificateID,s.redeemAmt=_onlineCheckout.parseTodecimal(s.redeemAmt+e.currentBalance,2),s.RemainingPrice=_onlineCheckout.parseTodecimal(s.RemainingPrice-e.currentBalance,2),e.currentBalance=0;t=onlineShoppingCart.lstGCPkgData.filter(function(e){return e.giftCertificateID==s.gcId});String.isNullOrUndefineOrBlank(t)||(t[0].currentBalance=e.currentBalance)}s.RemainingTax>0&&e.currentBalance>0&&(s.RemainingTax=_onlineCheckout.parseTodecimal(s.RemainingTax,3),e.currentBalance>=s.RemainingTax?(s.isPriceBaseGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=s.RemainingTax,objGC.giftCertificateNo=e.giftCertificateNo,s.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),objGC.IsClass=!0,s.redeemTax=_onlineCheckout.parseTodecimal(s.redeemTax+s.RemainingTax,2),e.currentBalance=_onlineCheckout.parseTodecimal(e.currentBalance-s.RemainingTax,2),s.RemainingTax=0):s.RemainingTax>e.currentBalance&&e.currentBalance>0&&(s.isPriceBaseGCApply=!0,objGC={},objGC.GCId=e.giftCertificateID,objGC.GCAmount=e.currentBalance,objGC.giftCertificateNo=e.giftCertificateNo,s.GCDetail.push(objGC),onlineShoppingCart.RedeemedByGCtemp.push(objGC),objGC.IsClass=!0,s.redeemTax=_onlineCheckout.parseTodecimal(s.redeemTax+e.currentBalance,2),s.RemainingTax=_onlineCheckout.parseTodecimal(s.RemainingTax-e.currentBalance,2),e.currentBalance=0))})}}s.BusinessTax=_onlineCheckout.ApplyMultipleTax(s.Price,s),o.addonTotalPrice=_onlineCheckout.parseTodecimal(o.addonTotalPrice+s.Price,2),o.addonTotalTaxPrice=_onlineCheckout.parseTodecimal(o.addonTotalTaxPrice+s.taxprice,2),s.gcId>0&&0==s.isPackage?o.addonTotalGCUsed=_onlineCheckout.parseTodecimal(o.addonTotalGCUsed+s.Price+s.redeemTax,2):(s.gcId<0||s.gcId>0)&&1==s.isPackage?o.addonTotalGCUsed=_onlineCheckout.parseTodecimal(o.addonTotalGCUsed+s.Price,2):1==s.isPriceBaseGCApply&&(o.addonTotalGCUsed=_onlineCheckout.parseTodecimal(o.addonTotalGCUsed+s.redeemAmt+s.redeemTax,2),s.classAddonGCUsed=_onlineCheckout.parseTodecimal(s.redeemAmt+s.redeemTax,2))})}),_onlineCheckout.isValidForCheckoutInvoice()&&onlineShoppingCart.RedeemedByGCtemp.length>0){onlineShoppingCart.RedeemedByGC=[];var s=onlineShoppingCart.RedeemedByGCtemp.uniqueObjects(["GCId"]);e.grep(s,function(t){_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg==t.Type?(objGC={},objGC.giftcertificateId=t.giftcertificateId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=0,objGC.uniqID=t.uniqID,objGC.RedeemServiceId=t.serviceId,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg,e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),onlineShoppingCart.RedeemedByGC.push(objGC)):_onlineCheckout.CheckoutBarcodeCodePrepayOnline.srvcGC==t.Type?(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=t.serviceId,objGC.redeemAmt=0,objGC.uniqID=t.uniqID,objGC.RedeemServiceId=t.serviceId,objGC.AppointmentID=t.AppointmentID,objGC.Type=_onlineCheckout.CheckoutBarcodeCodePrepayOnline.GC,e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.redeemAmt,2))}),objGC.GCredeemAmtForDisc=objGC.redeemAmt,onlineShoppingCart.RedeemedByGC.push(objGC)):(objGC={},objGC.giftcertificateId=t.GCId,objGC.giftCertificateNo=t.giftCertificateNo,objGC.serviceId=0,objGC.redeemAmt=0,objGC.uniqID=0,objGC.AppointmentID=0,objGC.Type="GC",e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){t.GCId==e.GCId&&(objGC.redeemAmt=_onlineCheckout.parseTodecimal(objGC.redeemAmt+e.GCAmount,2))}),onlineShoppingCart.RedeemedByGC.push(objGC))})}o.addonTotalTaxPrice=parseFloat(o.addonTotalTaxPrice.toFixed(2)),o.addonTotalGCUsed=o.addonTotalGCUsed,o.addonTotalPrice=o.addonTotalPrice}}return o},_onlineCheckout.CheckUserExistanceWhenAddonUpdate=function(t,i,n,o){var a=!1;return e.grep(n.eventEnrollment,function(e){return new Date(e.eventDate).format("yyyy-MM-dd")==new Date(o.eventDate).format("yyyy-MM-dd")&&(1==e.hasOwnProperty("isTempData")&&1!=e.isTempData||0==e.hasOwnProperty("isTempData"))&&e.startTime==o.startTime&&e.eventID==o.eventID&&e.sPID==o.sPID&&(t>0&&e.customerID==t||t<=0&&void 0!==e.cUserEmail&&null!=e.cUserEmail&&e.cUserEmail.toLowerCase()==i.toLowerCase())}).length>0&&(a=!0),a},_onlineCheckout.GetAllAddonCalculationDetailsByEvent=function(t){var i={addonTotalPrice:0,addonTotalTaxPrice:0,addonTotalGCUsed:0,addonDiscountprice:0};return!String.isNullOrUndefineOrBlank(t)&&t.length>0&&e.each(t,function(e,t){i.addonTotalPrice=i.addonTotalPrice+t.Price,i.addonTotalTaxPrice=i.addonTotalTaxPrice+t.taxprice,i.addonDiscountprice=i.addonDiscountprice+t.discount}),i},_onlineCheckout.SetAppointmentIdOfSelectedAddonService=function(t,i){String.isNullOrUndefineOrBlank(t)||e.grep(t,function(t){if(String.isNullOrUndefineOrBlank(ReschedualAddonService))t.AppointmentID=0,t.ParentAppointmentID=0;else{var n=e.grep(ReschedualAddonService,function(e){return e.EventServiceID==1*i.ServiceID&&e.ServiceId==t.ServiceId&&e.ServiceProviderID==i.ServiceProviderID});n.length>0?(n[0].Status=11,t.AppointmentID=1*n[0].AppointmentID,t.ParentAppointmentID=1*i.AppointmentID):(t.AppointmentID=0,t.ParentAppointmentID=0)}})},_onlineCheckout.getiOSCustomerAppVersion=function(){var e=null!=navigator.userAgent.toLowerCase()?navigator.userAgent.toLowerCase():"",t="";return String.isNullOrUndefineOrBlank(e)||(t=e.split("(vagaroapp")[1].trim().split(")")[0]),t},_onlineCheckout.RecalcGCONAllAddonItems=function(t){e.grep(t,function(t){String.isNullOrUndefineOrBlank(t.lstAddonService)||e.grep(t.lstAddonService,function(e){_onlineCheckout.SDValueIfPropUndefined(e,"redeemAmt",0),_onlineCheckout.SDValueIfPropUndefined(e,"redeemTax",0),onlineShoppingCart.discount=_onlineCheckout.parseTodecimal(onlineShoppingCart.discount+e.discount,2),1!=e.isPointApply&&((e.isGCApply=null!=e.GCDetail&&e.GCDetail.length>0)&&(onlineShoppingCart.RedeemedByGCtemp=onlineShoppingCart.RedeemedByGCtemp.concat(e.GCDetail)),onlineShoppingCart.ccAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.ccAmt+(e.Price+_onlineCheckout.parseTodecimal(e.taxprice,3))-(e.redeemAmt+e.redeemTax),3),onlineShoppingCart.amtPaid=_onlineCheckout.parseTodecimal(onlineShoppingCart.amtPaid+(e.Price+_onlineCheckout.parseTodecimal(e.taxprice,3)),3),onlineShoppingCart.tax=_onlineCheckout.parseTodecimal(onlineShoppingCart.tax+e.taxprice,2),onlineShoppingCart.Rtax=_onlineCheckout.parseTodecimal(onlineShoppingCart.Rtax+e.taxprice,3),onlineShoppingCart.gcAmt=_onlineCheckout.parseTodecimal(onlineShoppingCart.gcAmt+e.redeemAmt+e.redeemTax,2))})})},_onlineCheckout.SDValueIfPropUndefined=function(e,t,i){String.isNullOrUndefineOrBlank(e[t])&&(e[t]=i)},_onlineCheckout.ApplyPresetDiscountOnAddOnPackages=function(t,i,n,o){var a=!1;return e.grep(i,function(i){if(null!=o&&i.autoId+"0"==o.autoId.toString()+o.EnrollAutoID.toString()||null==o){var s=e.grep(n,function(e){return e.ServiceID==i.ServiceId&&3==e.ItemTypeID&&4==i.eventType||e.ServiceID==i.ServiceId&&19==e.ItemTypeID}),r=e.grep(onlineShoppingCartmain.Packages,function(e){return e.autoId==t.autoId}),l=e.grep(r[0].lstAddonService,function(e){return e.ServiceId==i.ServiceId});if(null!=s&&s.length>0){s=s[0];var c=l[0].Price,d=0;0!=i.PromotionID&&(i.PromotionID=0),0==s.IsAmount?d=_onlineCheckout.parseTodecimal(d+c*s.DiscountValue/100,2):(d=_onlineCheckout.parseTodecimal(d+s.DiscountValue,2),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&_shopdetail.CheckPriceWithTaxSwitch()&&(d=parseFloat(ConvertTodecimalMorePrecious(parseFloat(d)/(1+i.tax/100),!0,4))));var u=t.NoOfVisit;t.SellPackageServiceID>0&&(u=1),c-d<0&&(d=c),i.discount=null!=o?d:d*u,i.Price=_onlineCheckout.parseTodecimal(c*u-i.discount,2),i.ActualPrice=i.Price,i.calculatedTax=_onlineCheckout.parseTodecimal(i.Price*i.tax/100,3),i.ActualTax=i.calculatedTax,i.BusinessTax=_onlineCheckout.ApplyMultipleTax(i.Price,i),i.isPresetApply=!0,i.DiscountID=s.PromotionID,i.IsAmount=s.IsAmount,i.AmountValue=s.DiscountValue,1==i.IsRecurring&&(i.BillingCycle=s.BillingCycle,i.IsInitialDiscount=!1,i.InitialDiscount=0,i.IsAmountForInitialDiscount=!1),a=!0}}}),a},_onlineCheckout.IsVagaroDailDeal=function(){return!String.isNullOrUndefineOrBlank(document.referrer)&&!String.isNullOrUndefineOrBlank(document.location.origin)&&document.referrer.indexOf(document.location.origin)>=0&&document.referrer.indexOf("isdeal")>0},_onlineCheckout.CheckPromotionDetail=function(t,i){if(null!=PromotionDetails&&PromotionDetails.length>0)return e.grep(PromotionDetails,function(e){if(e.PromotionID==i)return 1==_onlineCheckout.CheckFileType(t.toString(),e.ServiceIDs)}).length>0},_onlineCheckout.CheckFileType=function(t,i){return"-1"==i||-1!==e.inArray(t,i.split(","))},_onlineCheckout.IsVCFEnable=function(){var e=_onlineCheckout.parseTodecimal(onlineShoppingCart.FinalCCAmount,2);return 1==onlineShoppingCartmain.IsEnableVCFFee&&e>0&&1==_onlineCheckout.IsValidatePrepayVCFFee()},_onlineCheckout.VCFAmountDistribution=function(t){var i=null;if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0||null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0||null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0||_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0||!_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&"true"!=isCCRequiredForOnlineClass.toLowerCase()&&"true"==IsCCCapturedAllowed.toLowerCase()&&null!=AllowCCCapturedAbove&&""!=AllowCCCapturedAbove&&_onlineCheckout.loginUserClassCheckoutAmount()>=parseFloat(AllowCCCapturedAbove)&&("false"==IsClassReschedule.toLowerCase()||"true"==IsClassReschedule.toLowerCase()&&("undefined"==typeof IsPaid||"false"==IsPaid.toString().toLowerCase()))||1==_onlineCheckout.isCheckoutVPLChanged||null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0){isCheckout=!0,i={},"undefined"==typeof vui||String.isNullOrUndefineOrBlank(vui.stripeRadarSession)||(i.StripeRadarSession=vui.stripeRadarSession),_onlineCheckout.isValidForCheckoutInvoice()?(i.ccAmt=parseFloat(onlineShoppingCart.ccAmt)+parseFloat(onlineShoppingCart.classFinalTotal)+parseFloat(onlineShoppingCart.tipValue)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining+onlineShoppingCart.DepositsRemaining+onlineShoppingCart.FeeDepositsRemaining),i.tax=parseFloat(onlineShoppingCart.tax)+parseFloat(onlineShoppingCart.classTax)+parseFloat(1==String.isNullOrUndefineOrBlank(onlineShoppingCart.classAddonTotalTaxPrice)?0:onlineShoppingCart.classAddonTotalTaxPrice),i.amtPaid=parseFloat(onlineShoppingCart.amtPaid)+parseFloat(onlineShoppingCart.classSubTotal)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining+onlineShoppingCart.DepositsRemaining+onlineShoppingCart.FeeDepositsRemaining),i.gcAmt=parseFloat(onlineShoppingCart.gcAmt)+parseFloat(onlineShoppingCart.classGCUsed),i.vplAmt=parseFloat(onlineShoppingCart.vplAmt)+parseFloat(onlineShoppingCart.classFinalTotal)+parseFloat(onlineShoppingCart.tipValue)-parseFloat(onlineShoppingCart.InvoiceDepositsRemaining+onlineShoppingCart.DepositsRemaining)):(i.gcAmt=onlineShoppingCart.gcAmt,i.ccAmt=parseFloat(onlineShoppingCart.ccAmt)+parseFloat(onlineShoppingCart.classFinalTotal)-parseFloat(onlineShoppingCart.FeeDepositsRemaining),i.amtPaid=onlineShoppingCart.amtPaid-parseFloat(onlineShoppingCart.FeeDepositsRemaining),i.tax=onlineShoppingCart.tax-parseFloat(onlineShoppingCart.FeeTaxDepositsRemaining),i.vplAmt=onlineShoppingCart.vplAmt),i.businessID=onlineShoppingCart.BusinessID,i.CurrencyCode=currencyCode,i.loginUserID=onlineShoppingCart.loginUserId,i.isSaveCard=!1,i.isUserCardonFile=!1,i.onlineGCDevice="",onlineShoppingCart.RedeemedByGCDistri=[],onlineShoppingCart.RedeemedByGCDistri=e.extend(!0,[],onlineShoppingCart.RedeemedByGC),(i.isSaveCard||i.isUserCardonFile)&&(i.isUserCardonFile=!0);var n=[];if(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0){var o=e.grep(onlineShoppingCart.Inventories,function(e){return 1==String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)});_onlineCheckout.setProductCheckoutData(o,n,i)}if(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&_onlineCheckout.setMembershipCheckoutData(onlineShoppingCart.Memberships,n,i),null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0&&(_onlineCheckout.setGCCheckoutData(onlineShoppingCart.GiftCertificates,n,i),void 0!==_siteBuilderDetail.IsFromGoogleMyBusiness&&1==_siteBuilderDetail.IsFromGoogleMyBusiness&&(i.onlineGCDevice="google")),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&_onlineCheckout.setPackageCheckoutData(onlineShoppingCart.Packages,n,i),null!=onlineShoppingCart.BusinessFee&&onlineShoppingCart.BusinessFee.length>0&&(_onlineCheckout.UpdateBusinessTaxForBusinessFee(),_onlineCheckout.setBusinessFeesCheckoutData(onlineShoppingCart.BusinessFee,n,i),i.TotalFeeAmount=onlineShoppingCart.totalFeeAmount,i.TotalFeeTax=onlineShoppingCart.totalFeeTax),1==_onlineCheckout.IsThisNewCustomer)for(var a=0;a<=n.length-1;a++)n[a].isNewCustomer=_onlineCheckout.IsThisNewCustomer;if(1==_onlineCheckout.IsPaidClass()&&null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&_onlineCheckout.setClassCheckoutData(onlineShoppingCart.Events,n,i,!0),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&_onlineCheckout.setServiceCheckoutData(onlineShoppingCart.ServiceInvoice,n,i),_onlineCheckout.isValidForCheckoutInvoice()?(i.invoiceID=_onlineCheckout.InvoiceID,null==onlineShoppingCart.invoiceDetails||String.isNullOrUndefineOrBlank(onlineShoppingCart.invoiceDetails.InvoiceGridObject.isExpiryDate)||1!=onlineShoppingCart.invoiceDetails.InvoiceGridObject.isExpiryDate?i.invExpiredMonthForGCPackage=0:i.invExpiredMonthForGCPackage=String.isNullOrUndefineOrBlank(onlineShoppingCart.invoiceDetails.InvoiceGridObject.ExpiryMonths)?parseInt(0):parseFloat(onlineShoppingCart.invoiceDetails.InvoiceGridObject.ExpiryMonths),i.tip=onlineShoppingCart.tipValue,(void 0===i.loginUserID||null==i.loginUserID||0==i.loginUserID)&&void 0!==onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId&&null!=onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId&&onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId>0&&(i.loginUserID=onlineShoppingCart.invoiceDetails.InvoiceGridObject.PayeeId)):(i.invoiceID=0,i.tip=parseFloat(onlineShoppingCart.tipValue),i.ccAmt=i.ccAmt+i.tip),null!=i&&0==_onlineCheckout.isCheckoutVPLChanged&&(i.vplAmt=0),"undefined"==typeof hdnPriceWithTaxSwitch||null==hdnPriceWithTaxSwitch||null==hdnPriceWithTaxSwitch||String.isNullOrUndefineOrBlank(hdnPriceWithTaxSwitch.value)||"1"!=hdnPriceWithTaxSwitch.value||(i.IsIncludeTaxInOnlinePricing=!0),i.ccAmt>0){i.ccDetails={},i.RedeemedByGC=onlineShoppingCart.RedeemedByGCDistri,i.checkoutGridrow=n,ShowLoader(!0);i.isOnlineCheckout=!0,i.IsVCFDistribution=!0,i.distributionRequestType=0;var s=new vagaro.ajax;s.datamodel.Token="SaveCheckoutCCDistribution",s.datamodel.callback=function(i){if(null!=i&&null!=i.ccDistribution&&i.ccDistribution.length>0){if(i.ccDistribution.length>1){i.ccDistribution=e.grep(i.ccDistribution,function(e){return 1==e.IsConsiderMerchant}),_onlineCheckout.RemoveDuplicateVCFFee();var n=_onlineCheckout.GetVCFFeeList();if(void 0!==n&&null!=n&&n.length>0)for(var o=0;o<i.ccDistribution.length-1;o++){n[0].autoId=onlineShoppingCart.BusinessFee.keySort({autoId:"desc"})[0].autoId+1,onlineShoppingCart.BusinessFee=e.extend(!0,[],e.merge(onlineShoppingCart.BusinessFee,n))}}_onlineCheckout.SetProviderInVCFFee(i.ccDistribution),_onlineCheckout.VCFRecalculateAllDiscount(t)}ShowLoader(!1)},s.datamodel.data=[i],s.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert("Some error occured. Please try again.")},s.Post()}else t==_onlineCheckout.ApplyVCFLocation.ShippingMethod&&_onlineCheckout.VCFRecalculateAllDiscount(t)}},_onlineCheckout.VCFRecalculateAllDiscount=function(){_onlineCheckout.IsVCFRequire=!0,_onlineCheckout.RemoveVCFFee(),_onlineCheckout.displayFinalCalculatedPrice()},_onlineCheckout.RemoveDuplicateVCFFee=function(){try{if(!String.isNullOrUndefineOrBlank(onlineShoppingCart.BusinessFee)){var t=e.grep(onlineShoppingCart.BusinessFee,function(e){return 1==e.FeeType});if(!String.isNullOrUndefineOrBlank(t)&&t.length>0){var i=e.grep(t,function(e,t){return 1==e.FeeType&&0==t}),n=e.grep(onlineShoppingCart.BusinessFee,function(e){return 0==e.FeeType});!String.isNullOrUndefineOrBlank(n)&&n.length>0?onlineShoppingCart.BusinessFee=e.merge(n,i):onlineShoppingCart.BusinessFee=i}}}catch(e){}},_onlineCheckout.GetVCFFeeList=function(){var t=e.extend(!0,[],onlineShoppingCart.BusinessFee);return e.grep(t,function(e){return 1==e.FeeType})},_onlineCheckout.SetProviderInVCFFee=function(t){if(null!=t&&t.length>0){var i=0;e.grep(onlineShoppingCart.BusinessFee,function(e){1==e.FeeType&&(e.ShopOwnerId=t[i].serviceproviderId,e.FeeAccountType=t[i].AccountType,i++)})}else e.grep(onlineShoppingCart.BusinessFee,function(e){1==e.FeeType&&(e.ShopOwnerId=_shopdetail.BookingDetail.spid.split(",")[0],e.FeeAccountType=1,i++)})},_onlineCheckout.IsValidatePrepayVCFFee=function(){return 1==_onlineCheckout.isValidForCheckoutInvoice()||(null!=onlineShoppingCart.Inventories&&onlineShoppingCart.Inventories.length>0||null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0||null!=onlineShoppingCart.GiftCertificates&&onlineShoppingCart.GiftCertificates.length>0||null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0||null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0)&&(null==onlineShoppingCart.Events||onlineShoppingCart.Events.length<0||null!=onlineShoppingCart.Events&&onlineShoppingCart.Events.length>0&&1==_onlineCheckout.IsPrepayBusinessFee())},_onlineCheckout.IsVCFFeeExists=function(){if(null!=onlineShoppingCart.BusinessFee&&1==_onlineCheckout.IsValidatePrepayVCFFee()){var t=e.grep(onlineShoppingCart.BusinessFee,function(e){return 1==e.FeeType});return!String.isNullOrUndefineOrBlank(t)&&t.length>0}return!1},_onlineCheckout.IsVCFFeeApplied=function(){if(null!=onlineShoppingCart.BusinessFee){var t=e.grep(onlineShoppingCart.BusinessFee,function(e){return 1==e.FeeType&&e.CalculatedFees>0});return!String.isNullOrUndefineOrBlank(t)&&t.length>0}return!1},_onlineCheckout.RemoveVCFFee=function(){if(null!=onlineShoppingCart.BusinessFee){var t=0,i=0,n=0,o=0,a=0,s=0;e.grep(onlineShoppingCart.BusinessFee,function(e){1==e.FeeType&&(i+=e.CalculatedFees,t+=e.CalculatedTax,e.CalculatedFees=0,e.CalculatedTax=0,e.Qty=0,e.CalculatedFeesForClass=0,e.CalculatedTaxForClass=0,e.ActualPrice=0,e.ActualTax=0)}),e.grep(onlineShoppingCart.BusinessFee,function(e){e.DisplayCalculatedFees=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(e.CalculatedFees,2)-_onlineCheckout.parseTodecimal(e.CalculatedFeesForClass,2),2),e.DisplayCalculatedTax=_onlineCheckout.parseTodecimal(_onlineCheckout.parseTodecimal(e.CalculatedTax,2)-_onlineCheckout.parseTodecimal(e.CalculatedTaxForClass,2),2),n=_onlineCheckout.parseTodecimal(n+_onlineCheckout.parseTodecimal(e.CalculatedFeesForClass,2)+_onlineCheckout.parseTodecimal(e.CalculatedTaxForClass,2),2),a+=e.DisplayCalculatedFees,s+=e.DisplayCalculatedTax,o=_onlineCheckout.parseTodecimal(o+_onlineCheckout.parseTodecimal(e.CalculatedTaxForClass,2),2)}),onlineShoppingCart.totalFeeAmount=onlineShoppingCart.totalFeeAmount-i,onlineShoppingCart.totalFeeTax=onlineShoppingCart.totalFeeTax-t,onlineShoppingCart.totalFeeAmountPrepay=a,onlineShoppingCart.totalFeeTaxPrepay=s,onlineShoppingCart.FeeDepositsRemaining=n,onlineShoppingCart.FeeTaxDepositsRemaining=o,onlineShoppingCart.ccAmt=onlineShoppingCart.ccAmt-i,onlineShoppingCart.amtPaid=onlineShoppingCart.amtPaid-i}},_onlineCheckout.BindPaymentOption=function(t){var i=[],n=1;if(t.lstGcAndPackagesForCheckout.length>0){var o=[];if(_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0){var a=!1,s=e.grep(t.lstGcAndPackagesForCheckout,function(e,t){return 1==e.isPackage&&(0==e.isCustomPackage||1==e.isCustomPackage&&null==e.serviceID)&&(1==e.isCustomPackage&&null==e.serviceID&&0==a&&(a=!0),!0)});if(null!=s&&s.length>0){s.keySort({expiresOn:"asc",quantity:"asc"});var r=[];1==a&&(e.grep(s,function(i){r.push(i);var n=e.grep(t.lstGcAndPackagesForCheckout,function(e){return 1==e.isPackage&&1==e.isCustomPackage&&i.giftCertificateID==e.giftCertificateID&&null!=e.serviceID});n.length>0&&(r=r.concat(n))}),s=r),null!=s&&s.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(t){e.grep(s,function(e){if(e.serviceName.toLowerCase().trim()==t.servicename.toLowerCase().trim()&&(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))>=new Date(moment(t.startTime).format("YYYY/MM/DD")))&&0==t.isPaid&&!(void 0!==t.isPresetApply&&0!=t.isPresetApply||void 0!==t.isPointApply&&0!=t.isPointApply||void 0!==t.isPackageApplied&&0!=t.isPackageApplied||void 0!==t.isMembershipApply&&0!=t.isMembershipApply||void 0!==t.isServiceBaseGC&&0!=t.isServiceBaseGC||void 0!==t.isGCApply&&0!=t.isGCApply||!(t.PromotionId<=0))&&-1==jQuery.inArray(e.giftCertificateID,o)){var a={IsEnd:!1};a.Id=e.giftCertificateID,a.DIVId="div_"+_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+e.giftCertificateID,a.Name=_onlineCheckout.PaymentOptionText.TextPkg+(1==e.isCustomPackage?e.pkgName:e.serviceName),a.Type=y,a.Index=n,a.RequestParam=JSON.stringify(a),i.push(a),o.push(e.giftCertificateID),n+=1}})})}}!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(a){e.grep(t.lstGcAndPackagesForCheckout,function(t,s){if(-1==jQuery.inArray(t.giftCertificateID,o)&&1==t.isPackage){var r={IsEnd:!1};t.serviceName.toLowerCase()==a.eventName.toLowerCase()&&0!=t.quantity&&a.eventEnrollment[0].Originalprice>0&&(null==t.strValidUpto||""==t.strValidUpto||null!=t.strValidUpto&&""!=t.strValidUpto&&new Date(moment(a.eventEnrollment[0].eventDate).format("YYYY/MM/DD"))<=new Date(moment(t.strValidUpto).format("YYYY/MM/DD")))&&(r.DIVId="div_"+_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+t.giftCertificateID,r.Id=t.giftCertificateID,r.Name=_onlineCheckout.PaymentOptionText.TextPkg+(1==t.isCustomPackage?t.pkgName:t.serviceName),r.Type=y,r.Index=n,r.RequestParam=JSON.stringify(r),i.push(r),o.push(t.giftCertificateID),n+=1),isNullOrUndefineOrBlank(a.eventEnrollment[0].lstAddonService)||e.grep(a.eventEnrollment[0].lstAddonService,function(e,s){-1==jQuery.inArray(t.giftCertificateID,o)&&t.serviceName.toLowerCase()==e.ServiceTitle.toLowerCase()&&0!=t.quantity&&e.Originalprice>0&&(null==t.strValidUpto||""==t.strValidUpto||null!=t.strValidUpto&&""!=t.strValidUpto&&new Date(moment(a.eventEnrollment[0].eventDate).format("YYYY/MM/DD"))<=new Date(moment(t.strValidUpto).format("YYYY/MM/DD")))&&(r.Id=t.giftCertificateID,r.DIVId="div_"+_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+t.giftCertificateID,r.Name=_onlineCheckout.PaymentOptionText.TextPkg+(1==t.isCustomPackage?t.pkgName:t.serviceName),r.Type=y,r.Index=n,r.RequestParam=JSON.stringify(r),i.push(r),o.push(t.giftCertificateID),n+=1)})}})}),!isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(a){e.grep(t.lstGcAndPackagesForCheckout,function(e,t){if(-1==jQuery.inArray(e.giftCertificateID,o)&&e.serviceName==a.ProductName&&e.serviceID==(a.IsPartial?a.InventoryMasterID:a.InventoryId)){var s=!1,r={IsEnd:!1};if(r.Id=e.giftCertificateID,r.DIVId="div_"+_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+e.giftCertificateID,r.Name=_onlineCheckout.PaymentOptionText.TextPkg+(1==e.isCustomPackage?e.pkgName:e.serviceName),r.Type=y,r.Index=n,r.RequestParam=JSON.stringify(r),o.push(e.giftCertificateID),n+=1,i.length>0){for(t=0;t<i.length;t++)if(i[t].Id===r.Id){s=!0;break}s||i.push(r)}else i.push(r)}})})}if(t.lstUserListForCheckout.length>0){var l=0,c=0;if(e.grep(t.lstUserListForCheckout,function(t){!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(n){if(o=n,!(_shopdetail.EnableFMBFee()&&null!=o&&void 0!==o.PromotionID&&null!=o.PromotionID&&o.PromotionID>0)){var o,a=void 0===n.Originalprice?n.actualPrice:n.Originalprice;t.userId==n.customerID&&t.pointsBalance>0&&(t.pointsBalance>=_onlineCheckout.ConvertDecimalWithFixed(i.PointRedeem,!1,2)||_onlineCheckout.IsPartialPointAllowed)&&_onlineCheckout.ConvertDecimalWithFixed(i.PointRedeem,!1,2)>0&&a>0&&(l+=1),!isNullOrUndefineOrBlank(n.lstAddonService)&&n.lstAddonService.length>0&&e.grep(n.lstAddonService,function(e){t.userId==n.customerID&&t.pointsBalance>0&&(t.pointsBalance>=_onlineCheckout.ConvertDecimalWithFixed(e.PointRedeem,!1,2)||_onlineCheckout.IsPartialPointAllowed)&&_onlineCheckout.ConvertDecimalWithFixed(e.PointRedeem,!1,2)>0&&e.Originalprice>0&&(l+=1)})}})}),!isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(e){var i=e.pointsRedeem*parseInt(e.Quantity);t.userId==onlineShoppingCart.loginUserId&&t.pointsBalance>0&&i>0&&(t.pointsBalance>=i||_onlineCheckout.IsPartialPointAllowed)&&(l+=1)}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){t.userId==e.userID&&t.pointsBalance>0&&(t.pointsBalance>=_onlineCheckout.ConvertDecimalWithFixed(e.pointredeemOriginal,!1,2)||_onlineCheckout.IsPartialPointAllowed)&&_onlineCheckout.ConvertDecimalWithFixed(e.pointredeemOriginal,!1,2)>0&&e.priceOriginal>0&&(l+=1)}),c+=t.pointsBalance}),l>0){var d={};d.DIVId="div_"+_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Point+"_"+b,d.Id=b,d.Name=_onlineCheckout.PaymentOptionText.TextPoint+c,d.Type=b,d.Index=n,d.IsEnd=!1,d.RequestParam=JSON.stringify(d),i.push(d),n+=1}}if(!isNullOrUndefineOrBlank(t.lstMembershipForCheckout)&&t.lstMembershipForCheckout.length>0&&0!=t.lstMembershipForCheckout[0].VisitRemaining){var u=!1;if(!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&e.each(onlineShoppingCart.Events,function(i,n){e.each(n.eventEnrollment,function(i,n){var o=e.grep(t.lstMembershipForCheckout,function(e){return(n.customerID>0&&e.UserID>0&&(n.customerID==e.UserID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,n.customerID))||n.customerID<=0&&e.UserID>0&&n.cUserEmail==e.EmailId)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strValidUpto).format("YYYY/MM/DD")))});isNullOrUndefineOrBlank(o)||(u=!0)})}),!isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(i){var n=e.grep(t.lstMembershipForCheckout,function(e){return e.ServiceProductName==i.ProductName&&(e.VisitRemaining>0&&i.Quantity<=e.VisitRemaining||-1==e.VisitRemaining)});isNullOrUndefineOrBlank(n)||(u=!0)}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0){var p=e.grep(t.lstMembershipForCheckout,function(e){return 1==e.ItemType||19==e.ItemType});null!=p&&p.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(t){e.each(p,function(e,i){if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==t.isPresetApply&&1==t.isPresetApply&&0==i.IsAllowPreSetDiscount)return!1;i.ServiceProductName==t.servicename&&(i.VisitRemaining>0&&1<=i.VisitRemaining||-1==i.VisitRemaining)&&(0==t.PromotionId||1==i.isPromotionalDiscount&&0!=t.PromotionId)&&(null==i.strValidUpto||""==i.strValidUpto||null!=i.strValidUpto&&""!=i.strValidUpto&&new Date(moment(t.startTime).format("YYYY/MM/DD"))<=new Date(moment(i.strValidUpto).format("YYYY/MM/DD")))&&(u=!0)})})}if(u)for(var h=0;h<t.lstMembershipForCheckout.length;h++){var m={};m.DIVId="div_"+_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS+"_"+t.lstMembershipForCheckout[h].MembershipID,m.Id=t.lstMembershipForCheckout[h].MembershipID,m.Name=_onlineCheckout.PaymentOptionText.TextMS+t.lstMembershipForCheckout[h].MembershipName,m.Type=k,m.Index=n,m.IsEnd=!1,m.RequestParam=JSON.stringify(m);for(var g=!1,v=0;v<i.length;v++)if(i[v].Id===m.Id){g=!0;break}g||(i.push(m),n+=1)}}_onlineCheckout.Model.IsPaymentOption=!1,i.length>0&&(i[i.length-1].IsEnd=!0,e(_onlineCheckout.Controls.DivPaymentOption).html(""),e(_onlineCheckout.Controls.TmplBookingPaymentOption).tmpl(i).appendTo(_onlineCheckout.Controls.DivPaymentOption),_onlineCheckout.Model.IsPaymentOption=!0)},_onlineCheckout.PaymentTabClick=function(t,i){1==e(t).hasClass(_onlineCheckout.CssClass.ActiveTab)?_onlineCheckout.RemoveDicountByType(i):(_onlineCheckout.ApplyDicountByType(i),_onlineCheckout.ReApplyDiscounts())},_onlineCheckout.PaymentOptionSelectDeselect=function(){if(e(_onlineCheckout.Controls.PaymentOptionMsPkgPoint).removeClass(_onlineCheckout.CssClass.ActiveTab),!String.isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){1==e.isPointApply?_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Point+"_"+b,!0):1==e.isPackageApplied?_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+e.redeemID,!0):1==e.isMembershipApply&&_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS+"_"+e.MembershipID,!0)}),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(t){1==t.isPointApply?_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Point+"_"+b,!0):1==t.isPackage?_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+t.gcId,!0):1==t.isMembershipApply&&_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS+"_"+t.MembershipID,!0),!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){1==e.isPointApply?_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Point+"_"+b,!0):1==e.isPackage?_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+e.gcId,!0):1==e.isMembershipApply&&_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS+"_"+e.MembershipID,!0)})})}),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0){var t=!1,i=!1,n=!1;e.grep(onlineShoppingCart.Inventories,function(e){String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)||(1==e.isPackageApplied&&(t=!0),i=!0),String.isNullOrUndefineOrBlank(e.isPointApply)||1!=e.isPointApply?String.isNullOrUndefineOrBlank(e.isMembershipApply)||1!=e.isMembershipApply?String.isNullOrUndefineOrBlank(e.isPackageApplied)||1!=e.isPackageApplied||(0==i||1==i&&t)&&_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Pkg+"_"+e.MembershipID,!0):(0==i&&0==t&&_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS+"_"+e.MembershipID,!0),1==e.isMembershipApply&&1==i&&(n=!0),1==i&&1==n&&_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.MS+"_"+e.MembershipID,!0)):_onlineCheckout.SelectDeselect(_onlineCheckout.CheckoutBarcodeCodePrepayOnline.Point+"_"+b,!0)})}},_onlineCheckout.SelectDeselect=function(t,i){1==i?e("#div_"+t).addClass(_onlineCheckout.CssClass.ActiveTab):e("#div_"+t).removeClass(_onlineCheckout.CssClass.ActiveTab)},_onlineCheckout.ApplyDicountByType=function(t){if(t.Type==b)_onlineCheckout.RemoveExistingGC(),_onlineCheckout.RemoveExistingDicount(onlineShoppingCart.UsersPoints,t),!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&_onlineCheckout.ApplyPointsONEvents(onlineShoppingCart.Events,onlineShoppingCart.UsersPoints,[]),!isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&(_onlineCheckout.ApplyPointsONProduct(onlineShoppingCart.Inventories,onlineShoppingCart.UsersPoints),e.each(onlineShoppingCart.Inventories,function(t,i){if(!String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)){i.isPresetApply=!1,i.isGCApply=!1,i.isMembershipApply=!1,i.isPointApply=!1,i.isPointApplyPartial=!1,i.membershipName="",i.packageName="",i.Price=0;var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==i.InventoryId}),o=0,a=[],s=[],r=!1,l=!1;if(e.each(n,function(e,t){void 0!==t.isPointApply&&0==t.isPointApply?i.Price+=t.Price:void 0!==t.isPointApply&&1==t.isPointApply&&1==t.IsPartialPoint?i.Price+=t.Price-t.PartialPrice:o+=1,void 0!==t.isPointApply&&1==t.isPointApply&&1==_onlineCheckout.IsPartialPointAllowed&&(i.pointsRedeem+=t.pointsRedeem),i.isPresetApply=1==i.isPresetApply||t.isPresetApply,i.isGCApply=1==i.isGCApply||t.isGCApply,i.isMembershipApply=1!=t.isPackageApplied&&(1==i.isMembershipApply||t.isMembershipApply),i.isPackageApplied=1==i.isPackageApplied||t.isPackageApplied,t.isPackageApplied&&(r=!0),t.isMembershipApply&&(l=!0),t.isMembershipApply&&-1==a.indexOf(t.membershipName)&&a.push(t.membershipName),t.isPackageApplied&&-1==s.indexOf(t.membershipName)&&s.push(t.membershipName)}),r&&null!=s&&s.length>0){var c=s.join();i.packageName=c,i.membershipName=c,i.isPackageBundleApplied=!0}if(l&&null!=a&&a.length>0){var d=a.join();i.membershipName=d,i.isMembershipBundleApplied=!0}n.length==o?i.isPointApply=!0:o>0&&(i.isPointApplyPartial=!0)}})),_onlineCheckout.isValidForCheckoutInvoice()&&!isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&_onlineCheckout.ApplyPointsONServices(onlineShoppingCart.ServiceInvoice,onlineShoppingCart.UsersPoints);else if(t.Type==y){var i=onlineShoppingCart.lstGCPkgData.filter(function(e){return e.giftCertificateID==t.Id});if(_onlineCheckout.RemoveExistingGC(),_onlineCheckout.RemoveExistingDicount(i,t),!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&i.length>0&&(onlineShoppingCart.Events=_onlineCheckout.CalculatePriceAndTaxOnCartForClass(onlineShoppingCart.Events,!0,i,!0)),_onlineCheckout.isValidForCheckoutInvoice()&&!isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&i.length>0&&_onlineCheckout.ApplyPackageOnServices(onlineShoppingCart.ServiceInvoice,i),!isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0){var n=e.grep(onlineShoppingCart.lstGCPkgData,function(e,t){return 1==e.eventType}),o=e.grep(onlineShoppingCart.lstGCPkgData,function(e,t){return 1==e.eventType||2==e.eventType});if(null!=n&&n.length>0){var a={serviceID:"desc",GiftCertificateAmt:"asc"};n.keySort(a)}if(null!=(l=e.grep(onlineShoppingCart.Inventories,function(e){return 1==String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)}))&&l.length>0){for(var s=[],r=0;r<o.length;r++)o[r].giftCertificateID===t.Id&&s.push(o[r]);_onlineCheckout.ApplyGCONAllItems(l,s,c)}e.each(onlineShoppingCart.Inventories,function(t,i){if(!String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)){i.isPresetApply=!1,i.isGCApply=!1,i.isMembershipApply=!1,i.isPointApply=!1,i.isPointApplyPartial=!1,i.membershipName="",i.packageName="",i.Price=0;var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==i.InventoryId}),o=0,a=[],s=[],r=!1;if(e.each(n,function(e,t){void 0!==t.isPointApply&&0==t.isPointApply?i.Price+=t.Price:o+=1,i.isPresetApply=1==i.isPresetApply||t.isPresetApply,i.isGCApply=1==i.isGCApply||t.isGCApply,i.isPackageApplied=1==i.isPackageApplied||t.isPackageApplied,t.isPackageApplied&&(r=!0),t.isMembershipApply&&-1==a.indexOf(t.membershipName)&&a.push(t.membershipName),t.isPackageApplied&&-1==s.indexOf(t.membershipName)&&s.push(t.membershipName)}),r){if(null!=s&&s.length>0){var l=s.join();i.membershipName=l,i.packageName=l}}else if(null!=a&&a.length>0){var c=a.join();i.membershipName=c}n.length==o?i.isPointApply=!0:o>0&&(i.isPointApplyPartial=!0)}})}}else if(t.Type==k){if(_onlineCheckout.RemoveExistingGC(),_onlineCheckout.RemoveExistingDicount(onlineShoppingCart.lstMembership,t),!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&(e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(t){t.isMembershipRemove=!1,!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){e.isMembershipRemove=!1})})}),_onlineCheckout.ApplyMembershipONEvents(onlineShoppingCart.Events,onlineShoppingCart.lstMembership)),!isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0){var l;if(null!=(n=e.grep(onlineShoppingCart.lstGCPkgData,function(e,t){return 1==e.eventType}))&&n.length>0){a={serviceID:"desc",GiftCertificateAmt:"asc"};n.keySort(a)}if(null!=(l=e.grep(onlineShoppingCart.Inventories,function(e){return 1==String.isNullOrUndefineOrBlank(e.InventoryBundleCartDetails)}))&&l.length>0){var d=[];for(r=0;r<onlineShoppingCart.lstMembership.length;r++)onlineShoppingCart.lstMembership[r].MembershipID===t.Id&&d.push(onlineShoppingCart.lstMembership[r]);_onlineCheckout.ApplyMembershipONProduct(l,d)}e.each(onlineShoppingCart.Inventories,function(t,i){if(!String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)){i.isPresetApply=!1,i.isGCApply=!1,i.isMembershipApply=!1,i.isPointApply=!1,i.isPointApplyPartial=!1,i.membershipName="",i.packageName="",i.Price=0;var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.MasterInventoryId==i.InventoryId}),o=0,a=[],s=[],r=!1;if(e.each(n,function(e,t){void 0!==t.isPointApply&&0==t.isPointApply?i.Price+=t.Price:o+=1,i.isPresetApply=1==i.isPresetApply||t.isPresetApply,i.isGCApply=1==i.isGCApply||t.isGCApply,i.isMembershipApply=1!=t.isPackageApplied&&(1==i.isMembershipApply||t.isMembershipApply),i.isPackageApplied=1==i.isPackageApplied||t.isPackageApplied,t.isPackageApplied&&(r=!0),t.isMembershipApply&&(isMembershipBundleApplied=!0),t.isMembershipApply&&-1==a.indexOf(t.membershipName)&&a.push(t.membershipName),t.isPackageApplied&&-1==s.indexOf(t.membershipName)&&s.push(t.membershipName)}),r&&null!=s&&s.length>0){var l=s.join();i.membershipName=l,i.packageName=l,i.isPackageBundleApplied=!0}if(isMembershipBundleApplied&&null!=a&&a.length>0){var c=a.join();i.membershipName=c,i.isMembershipBundleApplied=!0}n.length==o?i.isPointApply=!0:o>0&&(i.isPointApplyPartial=!0)}})}_onlineCheckout.isValidForCheckoutInvoice()&&!isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&_onlineCheckout.ApplyMembershipONServices(onlineShoppingCart.ServiceInvoice,onlineShoppingCart.lstMembership)}},_onlineCheckout.RemoveDicountByType=function(t){_onlineCheckout.isValidForCheckoutInvoice()&&!String.isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){t.Type==b&&e.isPointApply?_onlineCheckout.RemoveDicount(m,b,e.AppSrNo):t.Type==y?e.redeemID==t.Id&&_onlineCheckout.RemoveDicount(m,y,e.AppSrNo):1==e.isMembershipApply&&e.MembershipID==t.Id&&_onlineCheckout.RemoveDicount(m,k,e.AppSrNo)}),!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0&&e.grep(onlineShoppingCart.Events,function(i){e.grep(i.eventEnrollment,function(i){t.Type==b?String.isNullOrUndefineOrBlank(i.isPointApply)||1!=i.isPointApply||setTimeout(function(){_onlineCheckout.RemoveDicount(p,b,i.eventID,i.autoID)},200):t.Type==y?i.gcId==t.Id&&setTimeout(function(){_onlineCheckout.RemoveDicount(p,y,i.eventID,i.autoID)},200):t.Type==k&&i.MembershipID==t.Id&&1==i.isMembershipApply&&setTimeout(function(){_onlineCheckout.RemoveDicount(p,k,i.eventID,i.autoID)},200),!String.isNullOrUndefineOrBlank(i.lstAddonService)&&i.lstAddonService.length>0&&e.grep(i.lstAddonService,function(e){t.Type==b?String.isNullOrUndefineOrBlank(e.isPointApply)||1!=e.isPointApply||setTimeout(function(){_onlineCheckout.RemoveDicount(v,b,i.eventID,i.autoID+"_"+e.ServiceId)},200):t.Type==y?e.gcId==t.Id&&setTimeout(function(){_onlineCheckout.RemoveDicount(v,y,i.eventID,i.autoID+"_"+e.ServiceId)},200):t.Type==k&&e.MembershipID==t.Id&&1==e.isMembershipApply&&setTimeout(function(){_onlineCheckout.RemoveDicount(v,k,i.eventID,i.autoID+"_"+e.ServiceId)},200)})})}),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(i){var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==i.MasterInventoryId});t.Type==b?String.isNullOrUndefineOrBlank(i.isPointApply)||1!=i.isPointApply||setTimeout(function(){String.isNullOrUndefineOrBlank(n)?_onlineCheckout.RemoveDicount(c,b,i.autoId):_onlineCheckout.RemoveDicount(c,b,n[0].autoId)},100):t.Type==k?i.MembershipID!=t.Id&&String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)||String.isNullOrUndefineOrBlank(i.isMembershipApply)||1!=i.isMembershipApply||setTimeout(function(){String.isNullOrUndefineOrBlank(n)?_onlineCheckout.RemoveDicount(c,k,i.autoId):_onlineCheckout.RemoveDicount(c,k,n[0].autoId)},100):t.Type==y&&(i.MembershipID!=t.Id&&String.isNullOrUndefineOrBlank(i.InventoryBundleCartDetails)||String.isNullOrUndefineOrBlank(i.isPackageApplied)||1!=i.isPackageApplied||setTimeout(function(){String.isNullOrUndefineOrBlank(n)?_onlineCheckout.RemoveDicount(c,y,i.autoId):_onlineCheckout.RemoveDicount(c,y,n[0].autoId)},100))})},_onlineCheckout.RemoveExistingDicount=function(t,i){if(i.Type==y){if(String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)||e.grep(onlineShoppingCart.Events,function(i){var n=i.eventEnrollment.uniqueObjects(["customerID","cUserEmail"]);if(n.length>0)for(var o=0;o<=n.length-1;o++){var a=[],s=e.grep(t,function(e){return(n[o].customerID>0&&e.assignTo==n[o].customerID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,n[o].customerID)||n[o].customerID<=0&&e.emailId==n[o].cUserEmail)&&null!=e.serviceID&&(e.serviceID==i.eventID||e.serviceName.toLowerCase().trim()==i.eventName.toLowerCase().trim())});null!=s&&s.length>0&&(a=s);var r=1,l=0,c=0;e.grep(i.eventEnrollment,function(e){(n[o].customerID>0&&e.customerID==n[o].customerID||n[o].customerID<=0&&e.cUserEmail==n[o].cUserEmail)&&(0==e.StreamingStatus?c+=1:1==e.StreamingStatus&&(l+=1))});var d=1;l>0&&c>0?(d=2,r=3):0==c&&l>0&&(r=2);for(var u=1;u<=d;u++){var h=e.grep(i.eventEnrollment,function(e){return 1==u&&3==r||1==r?(n[o].customerID>0&&e.customerID==n[o].customerID||n[o].customerID<=0&&e.cUserEmail==n[o].cUserEmail)&&0==e.StreamingStatus:(n[o].customerID>0&&e.customerID==n[o].customerID||n[o].customerID<=0&&e.cUserEmail==n[o].cUserEmail)&&1==e.StreamingStatus});null!=h&&h.length>0&&e.each(h,function(i,n){e.grep(a,function(e){return null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))>new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))&&null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))&&(0==n.IsOutsideBilling&&(n.strAdvanceLimitDate=e.strAdvanceLimitDate),n.IsWaivedApply=!0,n.AppliedName=e.pkgName),(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strValidUpto).format("YYYY/MM/DD")))}).length>0&&(1==n.isPointApply?_onlineCheckout.RemoveDicount(p,b,n.eventID,n.autoID):1==n.isMembershipApply?_onlineCheckout.RemoveDicount(p,k,n.eventID,n.autoID):String.isNullOrUndefineOrBlank(n.isPackage)||1!=n.isPackage||_onlineCheckout.RemoveDicount(p,y,n.eventID,n.autoID)),e.each(n.lstAddonService,function(i,o){var a=[],s=e.grep(t,function(e){return(o.customerID>0&&e.assignTo==o.customerID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,o.customerID)||o.customerID<=0&&e.emailId==o.cUserEmail)&&null!=e.serviceID&&(e.serviceID==o.ServiceId||e.serviceName.toLowerCase().trim()==o.ServiceTitle.toLowerCase().trim())});null!=s&&s.length>0&&(a=s),e.grep(a,function(e){return null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))>new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))&&null!=e.strAdvanceLimitDate&&""!=e.strAdvanceLimitDate&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strAdvanceLimitDate).format("YYYY/MM/DD"))&&(0==o.IsOutsideBilling&&(o.strAdvanceLimitDate=e.strAdvanceLimitDate),o.IsWaivedApply=!0,o.AppliedName=e.pkgName),(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(e.strValidUpto).format("YYYY/MM/DD")))}).length>0&&(1==o.isPointApply?_onlineCheckout.RemoveDicount(v,b,n.eventID,n.autoID+"_"+o.ServiceId):1==o.isMembershipApply?_onlineCheckout.RemoveDicount(v,k,n.eventID,n.autoID+"_"+o.ServiceId):String.isNullOrUndefineOrBlank(o.isPackage)||1!=o.isPackage||_onlineCheckout.RemoveDicount(v,y,n.eventID,n.autoID+"_"+o.ServiceId))})})}}}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0){var n=e.grep(t,function(e){return e.giftCertificateID==i.Id});null!=n&&n.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(t){e.grep(n,function(e){e.serviceName.toLowerCase().trim()==t.servicename.toLowerCase().trim()&&(e.quantity>0||1==e.isCustomPackage&&-1==e.quantity)&&(null==e.strValidUpto||""==e.strValidUpto||null!=e.strValidUpto&&""!=e.strValidUpto&&new Date(moment(e.strValidUpto).format("YYYY/MM/DD"))>=new Date(moment(t.startTime).format("YYYY/MM/DD")))&&0==t.isPaid&&(String.isNullOrUndefineOrBlank(t.isPointApply)||1!=t.isPointApply?String.isNullOrUndefineOrBlank(t.isMembershipApply)||1!=t.isMembershipApply||_onlineCheckout.RemoveDicount(m,k,t.AppSrNo):_onlineCheckout.RemoveDicount(m,b,t.AppSrNo))})})}!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(i){var n=e.grep(t,function(e){return 2==e.eventType});null!=n&&n.length>0&&e.each(n,function(t,n){if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==i.isPresetApply&&1==i.isPresetApply)return!1;if(String.isNullOrUndefineOrBlank(i.BundleName)||String.isNullOrUndefineOrBlank(i.isPackageApplied)||1!=i.isPackageApplied||_onlineCheckout.RemoveDicount(c,y,i.autoId),n.serviceName==i.ProductName&&(n.quantity>0&&i.Quantity<=n.quantity||-1==n.quantity)){if(!String.isNullOrUndefineOrBlank(i.isPointApply)&&1==i.isPointApply){var o=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==i.MasterInventoryId});String.isNullOrUndefineOrBlank(o)?_onlineCheckout.RemoveDicount(c,b,i.autoId):_onlineCheckout.RemoveDicount(c,b,o[0].autoId)}if(!String.isNullOrUndefineOrBlank(i.isMembershipApply)&&1==i.isMembershipApply){o=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==i.MasterInventoryId});String.isNullOrUndefineOrBlank(o)?_onlineCheckout.RemoveDicount(c,k,i.autoId):_onlineCheckout.RemoveDicount(c,k,o[0].autoId)}if(!String.isNullOrUndefineOrBlank(i.isPackageApplied)&&1==i.isPackageApplied){o=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==i.MasterInventoryId});String.isNullOrUndefineOrBlank(o)?_onlineCheckout.RemoveDicount(c,y,i.autoId):_onlineCheckout.RemoveDicount(c,y,o[0].autoId)}}})})}else if(i.Type==k){if(String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)||e.each(onlineShoppingCart.Events,function(i,n){e.each(n.eventEnrollment,function(i,o){var a=e.grep(t,function(e){return o.customerID>0&&e.UserID>0&&(o.customerID==e.UserID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,o.customerID))||o.customerID<=0&&e.UserID>0&&o.cUserEmail==e.EmailId});e.each(a,function(e,t){t.ServiceProductName.toLowerCase().trim()==n.eventName.toLowerCase().trim()&&null!=t.strValidUpto&&""!=t.strValidUpto&&new Date(moment(o.eventDate).format("YYYY/MM/DD"))>new Date(moment(t.strValidUpto).format("YYYY/MM/DD"))&&null!=t.strAdvanceLimitDate&&""!=t.strAdvanceLimitDate&&new Date(moment(o.eventDate).format("YYYY/MM/DD"))<=new Date(moment(t.strAdvanceLimitDate).format("YYYY/MM/DD"))&&0==o.IsOutsideBilling&&0==o.IsWaivedApply&&(o.strAdvanceLimitDate=t.strAdvanceLimitDate,o.IsWaivedApply=!0,o.AppliedName=t.MembershipName),o.Originalprice>0&&t.ServiceProductName.toLowerCase().trim()==n.eventName.toLowerCase().trim()&&t.Discount>0&&(o.customerID>0&&t.UserID>0&&(o.customerID==t.UserID||_onlineCheckout.IsUserHaveSharedMS(t.SharedUserIDs,o.customerID))||o.customerID<=0&&t.UserID>0&&o.cUserEmail==t.EmailId)&&(t.VisitRemaining>0||-1==t.VisitRemaining)&&(1==_onlineCheckout.IsUpSellMemPkgAdd||"true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&(0!=o.PromotionID&&1==t.isPromotionalDiscount||0==o.PromotionID||void 0===o.PromotionID)&&0==o.isPaid&&(null==t.strValidUpto||""==t.strValidUpto||null!=t.strValidUpto&&""!=t.strValidUpto&&new Date(moment(o.eventDate).format("YYYY/MM/DD"))<=new Date(moment(t.strValidUpto).format("YYYY/MM/DD")))&&(String.isNullOrUndefineOrBlank(o.isPointApply)||1!=o.isPointApply?String.isNullOrUndefineOrBlank(o.isPackage)||1!=o.isPackage||_onlineCheckout.RemoveDicount(p,y,o.eventID,o.autoID):_onlineCheckout.RemoveDicount(p,b,o.eventID,o.autoID))}),!String.isNullOrUndefineOrBlank(o.lstAddonService)&&o.lstAddonService.length>0&&e.each(o.lstAddonService,function(i,n){var a=e.grep(t,function(e){return o.customerID>0&&e.UserID>0&&(o.customerID==e.UserID||_onlineCheckout.IsUserHaveSharedMS(e.SharedUserIDs,o.customerID))||o.customerID<=0&&e.UserID>0&&o.cUserEmail==e.EmailId});e.each(a,function(e,t){t.ServiceProductName.toLowerCase().trim()==n.ServiceTitle.toLowerCase().trim()&&null!=t.strValidUpto&&""!=t.strValidUpto&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))>new Date(moment(t.strValidUpto).format("YYYY/MM/DD"))&&null!=t.strAdvanceLimitDate&&""!=t.strAdvanceLimitDate&&new Date(moment(n.eventDate).format("YYYY/MM/DD"))<=new Date(moment(t.strAdvanceLimitDate).format("YYYY/MM/DD"))&&0==n.IsOutsideBilling&&0==n.IsWaivedApply&&(n.strAdvanceLimitDate=t.strAdvanceLimitDate,n.IsWaivedApply=!0,n.AppliedName=t.MembershipName),n.Originalprice>0&&t.ServiceProductName.toLowerCase().trim()==n.ServiceTitle.toLowerCase().trim()&&t.Discount>0&&(o.customerID>0&&t.UserID>0&&(o.customerID==t.UserID||_onlineCheckout.IsUserHaveSharedMS(t.SharedUserIDs,o.customerID))||o.customerID<=0&&t.UserID>0&&o.cUserEmail==t.EmailId)&&(t.VisitRemaining>0||-1==t.VisitRemaining)&&(1==_onlineCheckout.IsUpSellMemPkgAdd||"true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&(0!=n.PromotionID&&1==t.isPromotionalDiscount||0==n.PromotionID||void 0===n.PromotionID)&&0==n.isPaid&&(null==t.strValidUpto||""==t.strValidUpto||null!=t.strValidUpto&&""!=t.strValidUpto&&new Date(moment(o.eventDate).format("YYYY/MM/DD"))<=new Date(moment(t.strValidUpto).format("YYYY/MM/DD")))&&(String.isNullOrUndefineOrBlank(n.isPointApply)||1!=n.isPointApply?String.isNullOrUndefineOrBlank(n.isPackage)||1!=n.isPackage||_onlineCheckout.RemoveDicount(v,y,o.eventID,o.autoID+"_"+n.ServiceId):_onlineCheckout.RemoveDicount(v,b,o.eventID,o.autoID+"_"+n.ServiceId))})})})}),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(i){MembershipList=e.grep(t,function(e){return 3==e.ItemType}),null!=MembershipList&&MembershipList.length>0&&e.each(MembershipList,function(t,n){if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==i.isPresetApply&&1==i.isPresetApply&&0==n.IsAllowPreSetDiscount)return!1;if(String.isNullOrUndefineOrBlank(i.BundleName)||String.isNullOrUndefineOrBlank(i.isPackageApplied)||1!=i.isPackageApplied||_onlineCheckout.RemoveDicount(c,y,i.autoId),n.ServiceProductName==i.ProductName&&(n.VisitRemaining>0&&i.Quantity<=n.VisitRemaining||-1==n.VisitRemaining)){if(!String.isNullOrUndefineOrBlank(i.isPointApply)&&1==i.isPointApply){var o=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==i.MasterInventoryId});String.isNullOrUndefineOrBlank(o)?_onlineCheckout.RemoveDicount(c,b,i.autoId):_onlineCheckout.RemoveDicount(c,b,o[0].autoId)}if(!String.isNullOrUndefineOrBlank(i.isMembershipApply)&&1==i.isMembershipApply){o=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==i.MasterInventoryId});String.isNullOrUndefineOrBlank(o)||_onlineCheckout.RemoveDicount(c,k,o[0].autoId)}if(!String.isNullOrUndefineOrBlank(i.isPackageApplied)&&1==i.isPackageApplied){o=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==i.MasterInventoryId});String.isNullOrUndefineOrBlank(o)?_onlineCheckout.RemoveDicount(c,y,i.autoId):_onlineCheckout.RemoveDicount(c,y,o[0].autoId)}}})}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0){var o=e.grep(t,function(e){return 1==e.ItemType||19==e.ItemType});null!=o&&o.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(t){e.each(o,function(e,i){if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==t.isPresetApply&&1==t.isPresetApply&&0==i.IsAllowPreSetDiscount)return!1;i.ServiceProductName==t.servicename&&(i.VisitRemaining>0&&1<=i.VisitRemaining||-1==i.VisitRemaining)&&(0==t.PromotionId||1==i.isPromotionalDiscount&&0!=t.PromotionId)&&(null==i.strValidUpto||""==i.strValidUpto||null!=i.strValidUpto&&""!=i.strValidUpto&&new Date(moment(t.startTime).format("YYYY/MM/DD"))<=new Date(moment(i.strValidUpto).format("YYYY/MM/DD")))&&(String.isNullOrUndefineOrBlank(t.isPointApply)||1!=t.isPointApply?String.isNullOrUndefineOrBlank(t.isPackageApplied)||1!=t.isPackageApplied||_onlineCheckout.RemoveDicount(m,y,t.AppSrNo):_onlineCheckout.RemoveDicount(m,b,t.AppSrNo))})})}}else if(i.Type==b){var a=null;e.grep(t,function(t){null==a&&(a=t.pointsBalance),String.isNullOrUndefineOrBlank(onlineShoppingCart.Events)||e.each(onlineShoppingCart.Events,function(i,n){e.each(n.eventEnrollment,function(i,o){if(o.customerID>0&&t.userId>0&&o.customerID==t.userId||o.customerID<=0&&t.userId>0&&o.cUserEmail==t.emailId){if(o.Originalprice>0){var s=n.PointRedeem;s>0&&a>0&&(a>=s||1==_onlineCheckout.IsPartialPointAllowed)&&("true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==o.isPaid&&(a-=s,String.isNullOrUndefineOrBlank(o.isPackage)||1!=o.isPackage?String.isNullOrUndefineOrBlank(o.isMembershipApply)||1!=o.isMembershipApply||_onlineCheckout.RemoveDicount(p,k,o.eventID,o.autoID):_onlineCheckout.RemoveDicount(p,y,o.eventID,o.autoID))}!String.isNullOrUndefineOrBlank(o.lstAddonService)&&o.lstAddonService.length>0&&e.each(o.lstAddonService,function(e,i){if(i.Originalprice>0&&(o.customerID>0&&t.userId>0&&o.customerID==t.userId||o.customerID<=0&&t.userId>0&&o.cUserEmail==t.emailId)){var n=String.isNullOrUndefineOrBlank(i.PointRedeem)?0:i.PointRedeem;n>0&&a>0&&a>=n&&("true"==isCCRequiredForOnlineClass.toLowerCase()&&!_onlineCheckout.isValidForCheckoutInvoice()||_onlineCheckout.isValidForCheckoutInvoice())&&0==i.isPaid&&(a-=n,String.isNullOrUndefineOrBlank(i.isPackage)||1!=i.isPackage?String.isNullOrUndefineOrBlank(i.isMembershipApply)||1!=i.isMembershipApply||_onlineCheckout.RemoveDicount(v,k,o.eventID,o.autoID+"_"+i.ServiceId):_onlineCheckout.RemoveDicount(v,y,o.eventID,o.autoID+"_"+i.ServiceId))}})}})}),!String.isNullOrUndefineOrBlank(onlineShoppingCart.Inventories)&&onlineShoppingCart.Inventories.length>0&&e.grep(onlineShoppingCart.Inventories,function(t){String.isNullOrUndefineOrBlank(t.OriginalPointsRedeem)&&(t.OriginalPointsRedeem=t.pointsRedeem);var i=Math.round(t.OriginalPointsRedeem*(t.IsPartial?_onlineCheckout.parseTodecimal(t.Quantity,2):parseInt(t.Quantity)));if(i>0&&a>=i&&a>0)if(_onlineCheckout.isValidForCheckoutInvoice()&&void 0!==t.isPresetApply&&1==t.isPresetApply);else{if(!String.isNullOrUndefineOrBlank(t.isMembershipApply)&&1==t.isMembershipApply){a-=i;var n=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==t.MasterInventoryId});String.isNullOrUndefineOrBlank(n)?_onlineCheckout.RemoveDicount(c,k,t.autoId):_onlineCheckout.RemoveDicount(c,k,n[0].autoId)}if(!String.isNullOrUndefineOrBlank(t.isPackageApplied)&&1==t.isPackageApplied){a-=i;n=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==t.MasterInventoryId});String.isNullOrUndefineOrBlank(n)?_onlineCheckout.RemoveDicount(c,y,t.autoId):_onlineCheckout.RemoveDicount(c,y,n[0].autoId)}}else if(t.OriginalPointsRedeem>0){if(!String.isNullOrUndefineOrBlank(t.isMembershipApply)&&1==t.isMembershipApply){a-=i;n=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==t.MasterInventoryId});String.isNullOrUndefineOrBlank(n)?_onlineCheckout.RemoveDicount(c,k,t.autoId):_onlineCheckout.RemoveDicount(c,k,n[0].autoId)}if(!String.isNullOrUndefineOrBlank(t.isPackageApplied)&&1==t.isPackageApplied){a-=i;n=e.grep(onlineShoppingCart.Inventories,function(e){return e.InventoryId==t.MasterInventoryId});String.isNullOrUndefineOrBlank(n)?_onlineCheckout.RemoveDicount(c,y,t.autoId):_onlineCheckout.RemoveDicount(c,y,n[0].autoId)}}}),_onlineCheckout.isValidForCheckoutInvoice()&&null!=onlineShoppingCart.ServiceInvoice&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){var t=e.pointredeemOriginal;t>0&&a>=t&&a>0&&(a-=t,String.isNullOrUndefineOrBlank(e.isPackageApplied)||1!=e.isPackageApplied?1==e.isMembershipApply&&_onlineCheckout.RemoveDicount(m,k,e.AppSrNo):_onlineCheckout.RemoveDicount(m,y,e.AppSrNo))})})}},_onlineCheckout.RemoveExistingGC=function(t,i){if(_onlineCheckout.isValidForCheckoutInvoice()&&!isNullOrUndefineOrBlank(onlineShoppingCart.ServiceInvoice)&&onlineShoppingCart.ServiceInvoice.length>0&&e.grep(onlineShoppingCart.ServiceInvoice,function(e){e.isGCApply&&(e.GCDetail=[],e.isGCApply=!1,e.redeemAmt=0,e.redeemTax=0,e.redeemID=null,e.isServiceBaseGC=!1)}),!isNullOrUndefineOrBlank(onlineShoppingCart.Events)&&onlineShoppingCart.Events.length>0){var n=0;e.grep(onlineShoppingCart.Events,function(t){e.grep(t.eventEnrollment,function(t){if(null!=t.gcId&&t.gcId>0&&(1!=t.isPointApply||1==t.IsPartialPoint)&&(void 0===i||void 0!==i&&t.autoID==i)){var o=onlineShoppingCart.lstGCPkgData.filter(function(e){return e.giftCertificateID==t.gcId});o[0].currentBalance=o[0].currentBalance+t.redeemAmt,null!=o[0].quantity&&-1!=o[0].quantity&&(o[0].quantity+=1),n=t.gcId,t.gcId=null,t.GCDetail=[],t.isPriceBaseGCApply=!1,t.isGCApply=!1,t.isDecisionTaken=null,t.redeemAmt=0,t.redeemTax=0,t.isServiceBaseGC=!1,t.isMembershipRemove=!0}!String.isNullOrUndefineOrBlank(t.lstAddonService)&&t.lstAddonService.length>0&&e.grep(t.lstAddonService,function(e){if(null!=e.gcId&&e.gcId>0&&(1!=e.isPointApply||1==e.IsPartialPoint)){var t=onlineShoppingCart.lstGCPkgData.filter(function(t){return t.giftCertificateID==e.gcId});!String.isNullOrUndefineOrBlank(t.length)&&t.length>0&&(t[0].currentBalance=t[0].currentBalance+e.redeemAmt,null!=t[0].quantity&&-1!=t[0].quantity&&(t[0].quantity+=1),n=e.gcId,e.gcId=null,e.GCDetail=[],e.isPriceBaseGCApply=!1,e.isGCApply=!1,e.isDecisionTaken=null,e.redeemAmt=0,e.redeemTax=0,e.isServiceBaseGC=!1,e.isMembershipRemove=!0)}})})}),onlineShoppingCart.RedeemedByGCtemp=e.grep(onlineShoppingCart.RedeemedByGCtemp,function(e){return e.GCId!=n})}},_onlineCheckout.DisplayVPLCetegeyOrAffirm=function(t){1==_siteBuilderDetail.isAffirmEnable?1==t&&(e("#tabVagaroPayLaterCertegy").hide(),e("#tabVagaroPayLaterAffirm").show()):1==t&&(e("#tabVagaroPayLaterCertegy").show(),e("#tabVagaroPayLaterAffirm").hide())},_onlineCheckout.StartApplePaySession=function(){try{if(e(_onlineCheckout.Controls.tabApplePay).length>0&&e(_onlineCheckout.Controls.tabApplePay).is(":visible")&&e(_onlineCheckout.Controls.tabApplePay).hasClass("w--current")){var t=_onlineCheckout.GetApplePayAmount();paymentOpenPopup("applepay",t,_onlineCheckout.GPayApplePaySuccessResponse,_siteBuilderDetail.PaymentErrorHandler)}}catch(e){console.error("Apple Pay session init failed:",e)}return!0},_onlineCheckout.GetApplePayAmount=function(){try{if("undefined"!=typeof onlineShoppingCart&&null!=onlineShoppingCart&&void 0!==onlineShoppingCart.FinalCCAmount&&null!=onlineShoppingCart.FinalCCAmount&&!isNaN(onlineShoppingCart.FinalCCAmount))return parseFloat(onlineShoppingCart.FinalCCAmount);let t=e("#divfinalTotalPrice").text();if(!t||""===t.trim())throw new Error("Price text is empty");let i=t.replace(/[^0-9.]/g,"");if(!i||isNaN(i))throw new Error("Invalid price format: "+t);let n=parseFloat(i);if(isNaN(n))throw new Error("Price is not a number after parsing");return n}catch(e){console.error("Error while getting Apple Pay Amount:",e.message)}},_onlineCheckout.resetTipData=function(){"undefined"!=typeof _onlineCheckout&&(_onlineCheckout.TipAppliedSum=0,_onlineCheckout.TipApplyCounter=0)}}(jQuery,window,document),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery),jQuery.fn.pumselect2=jQuery.fn.select2}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;return function(){
/**
               * @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
               * Available via the MIT or new BSD license.
               * see: http://github.com/jrburke/almond for details
               */
var e,i,n;t&&t.requirejs||(t?i=t:t={},function(t){var o,a,s,r,l={},c={},d={},u={},p=Object.prototype.hasOwnProperty,h=[].slice,m=/\.js$/;function g(e,t){return p.call(e,t)}function v(e,t){var i,n,o,a,s,r,l,c,u,p,h,g=t&&t.split("/"),v=d.map,f=v&&v["*"]||{};if(e&&"."===e.charAt(0))if(t){for(g=g.slice(0,g.length-1),s=(e=e.split("/")).length-1,d.nodeIdCompat&&m.test(e[s])&&(e[s]=e[s].replace(m,"")),e=g.concat(e),u=0;u<e.length;u+=1)if("."===(h=e[u]))e.splice(u,1),u-=1;else if(".."===h){if(1===u&&(".."===e[2]||".."===e[0]))break;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((g||f)&&v){for(u=(i=e.split("/")).length;u>0;u-=1){if(n=i.slice(0,u).join("/"),g)for(p=g.length;p>0;p-=1)if((o=v[g.slice(0,p).join("/")])&&(o=o[n])){a=o,r=u;break}if(a)break;!l&&f&&f[n]&&(l=f[n],c=u)}!a&&l&&(a=l,r=c),a&&(i.splice(0,r,a),e=i.join("/"))}return e}function f(e,i){return function(){return a.apply(t,h.call(arguments,0).concat([e,i]))}}function C(e){return function(t){l[e]=t}}function S(e){if(g(c,e)){var i=c[e];delete c[e],u[e]=!0,o.apply(t,i)}if(!g(l,e)&&!g(u,e))throw new Error("No "+e);return l[e]}function y(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function b(e){return function(){return d&&d.config&&d.config[e]||{}}}s=function(e,t){var i,n=y(e),o=n[0];return e=n[1],o&&(i=S(o=v(o,t))),o?e=i&&i.normalize?i.normalize(e,function(e){return function(t){return v(t,e)}}(t)):v(e,t):(o=(n=y(e=v(e,t)))[0],e=n[1],o&&(i=S(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:i}},r={require:function(e){return f(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:b(e)}}},o=function(e,i,n,o){var a,d,p,h,m,v,y=[],b=typeof n;if(o=o||e,"undefined"===b||"function"===b){for(i=!i.length&&n.length?["require","exports","module"]:i,m=0;m<i.length;m+=1)if("require"===(d=(h=s(i[m],o)).f))y[m]=r.require(e);else if("exports"===d)y[m]=r.exports(e),v=!0;else if("module"===d)a=y[m]=r.module(e);else if(g(l,d)||g(c,d)||g(u,d))y[m]=S(d);else{if(!h.p)throw new Error(e+" missing "+d);h.p.load(h.n,f(o,!0),C(d),{}),y[m]=l[d]}p=n?n.apply(l[e],y):void 0,e&&(a&&a.exports!==t&&a.exports!==l[e]?l[e]=a.exports:p===t&&v||(l[e]=p))}else e&&(l[e]=n)},e=i=a=function(e,i,n,l,c){if("string"==typeof e)return r[e]?r[e](i):S(s(e,i).f);if(!e.splice){if((d=e).deps&&a(d.deps,d.callback),!i)return;i.splice?(e=i,i=n,n=null):e=t}return i=i||function(){},"function"==typeof n&&(n=l,l=c),l?o(t,e,i,n):setTimeout(function(){o(t,e,i,n)},4),a},a.config=function(e){return a(e)},e._defined=l,(n=function(e,t,i){t.splice||(i=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,i])}).amd={jQuery:!0}}(),t.requirejs=e,t.require=i,t.define=n)}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){var t={};function i(e){var t=e.prototype,i=[];for(var n in t){"function"==typeof t[n]&&("constructor"!==n&&i.push(n))}return i}t.Extend=function(e,t){var i={}.hasOwnProperty;function n(){this.constructor=e}for(var o in t)i.call(t,o)&&(e[o]=t[o]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},t.Decorate=function(e,t){var n=i(t),o=i(e);function a(){var i=Array.prototype.unshift,n=t.prototype.constructor.length,o=e.prototype.constructor;n>0&&(i.call(arguments,e.prototype.constructor),o=t.prototype.constructor),o.apply(this,arguments)}t.displayName=e.displayName,a.prototype=new function(){this.constructor=a};for(var s=0;s<o.length;s++){var r=o[s];a.prototype[r]=e.prototype[r]}for(var l=function(e){var i=function(){};e in a.prototype&&(i=a.prototype[e]);var n=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,i),n.apply(this,arguments)}},c=0;c<n.length;c++){var d=n[c];a.prototype[d]=l(d)}return a};var n=function(){this.listeners={}};return n.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},n.prototype.trigger=function(e){var t=Array.prototype.slice;this.listeners=this.listeners||{},e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},n.prototype.invoke=function(e,t){for(var i=0,n=e.length;i<n;i++)e[i].apply(this,t)},t.Observable=n,t.generateChars=function(e){for(var t="",i=0;i<e;i++){t+=Math.floor(36*Math.random()).toString(36)}return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var i=t.split("-"),n=e;if(1!==i.length){for(var o=0;o<i.length;o++){var a=i[o];(a=a.substring(0,1).toLowerCase()+a.substring(1))in n||(n[a]={}),o==i.length-1&&(n[a]=e[t]),n=n[a]}delete e[t]}}return e},t.hasScroll=function(t,i){var n=e(i),o=i.style.overflowX,a=i.style.overflowY;return(o!==a||"hidden"!==a&&"visible"!==a)&&("scroll"===o||"scroll"===a||(n.innerHeight()<i.scrollHeight||n.innerWidth()<i.scrollWidth))},t.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},t.appendMany=function(t,i){if("1.7"===e.fn.jquery.substr(0,3)){var n=e();e.map(i,function(e){n=n.add(e)}),i=n}t.append(i)},t}),t.define("select2/results",["jquery","./utils"],function(e,t){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(t){var i=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=e('<li role="treeitem" class="select2-results__option"></li>'),o=this.options.get("translations").get(t.message);n.append(i(o(t.args))),this.$results.append(n)},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var i=0;i<e.results.length;i++){var n=e.results[i],o=this.option(n);t.push(o)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.setClasses=function(){var t=this;this.data.current(function(i){var n=e.map(i,function(e){return e.id.toString()}),o=t.$results.find(".select2-results__option[aria-selected]");o.each(function(){var t=e(this),i=e.data(this,"data"),o=""+i.id;null!=i.element&&i.element.selected||null==i.element&&e.inArray(o,n)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")});var a=o.filter("[aria-selected=true]");a.length>0?a.first().trigger("mouseenter"):o.first().trigger("mouseenter")})},i.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},i=this.option(t);i.className+=" loading-results",this.$results.prepend(i)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(t){var i=document.createElement("li");try{var n=this.options.get("defaultselectedid")||"",o=this.options.get("addSelectedClass")||!1;null!=t.id&&t.id==n&&1==o?i.className="select2-results__option defaultselcteditem":i.className="select2-results__option"}catch(e){i.className="select2-results__option"}var a={role:"treeitem","aria-selected":"false"};for(var s in t.disabled&&(delete a["aria-selected"],a["aria-disabled"]="true"),null==t.id&&delete a["aria-selected"],null!=t._resultId&&(i.id=t._resultId),t.title&&(i.title=t.title),t.children&&(a.role="group",a["aria-label"]=t.text,delete a["aria-selected"]),a){var r=a[s];i.setAttribute(s,r)}if(t.children){var l=e(i),c=document.createElement("strong");c.className="select2-results__group down";e(c);this.template(t,c);for(var d=[],u=0;u<t.children.length;u++){var p=t.children[u],h=this.option(p);d.push(h)}var m=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested",style:"display: block;"});m.append(d),l.append(c),l.append(m)}else this.template(t,i);return e.data(i,"data",t),i},i.prototype.bind=function(t,i){var n=this,o=t.id+"-results";this.$results.attr("id",o),t.on("results:all",function(e){n.clear(),n.append(e.data),t.isOpen()&&n.setClasses()}),t.on("results:append",function(e){n.append(e.data),t.isOpen()&&n.setClasses()}),t.on("query",function(e){n.showLoading(e)}),t.on("select",function(){t.isOpen()&&n.setClasses()}),t.on("unselect",function(){t.isOpen()&&n.setClasses()}),t.on("open",function(){n.$results.attr("aria-expanded","true"),n.$results.attr("aria-hidden","false"),n.setClasses(),n.ensureHighlightVisible()}),t.on("close",function(){n.$results.attr("aria-expanded","false"),n.$results.attr("aria-hidden","true"),n.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=n.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=n.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?n.trigger("close"):n.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),i=t.index(e);if(0!==i){var o=i-1;0===e.length&&(o=0);var a=t.eq(o);a.trigger("mouseenter");var s=n.$results.offset().top,r=a.offset().top,l=n.$results.scrollTop()+(r-s);0===o?n.$results.scrollTop(0):r-s<0&&n.$results.scrollTop(l)}}),t.on("results:next",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),i=t.index(e)+1;if(!(i>=t.length)){var o=t.eq(i);o.trigger("mouseenter");var a=n.$results.offset().top+n.$results.outerHeight(!1),s=o.offset().top+o.outerHeight(!1),r=n.$results.scrollTop()+s-a;0===i?n.$results.scrollTop(0):s>a&&n.$results.scrollTop(r)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){n.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=n.$results.scrollTop(),i=n.$results.get(0).scrollHeight-n.$results.scrollTop()+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,a=e.deltaY<0&&i<=n.$results.height();o?(n.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):a&&(n.$results.scrollTop(n.$results.get(0).scrollHeight-n.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var i=e(this),o=i.data("data");"true"!==i.attr("aria-selected")?n.trigger("select",{originalEvent:t,data:o}):n.options.get("multiple")?n.trigger("unselect",{originalEvent:t,data:o}):n.trigger("close")}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(t){var i=e(this).data("data");n.getHighlightedResults().removeClass("select2-results__option--highlighted"),n.trigger("results:focus",{data:i,element:e(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),i=this.$results.offset().top,n=e.offset().top,o=this.$results.scrollTop()+(n-i),a=n-i;o-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(a>this.$results.outerHeight()||a<0)&&this.$results.scrollTop(o)}},i.prototype.template=function(t,i){var n=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),a=n(t);null==a?i.style.display="none":"string"==typeof a?i.innerHTML=o(a):e(i).append(a)},i}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(e,t,i){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-selection" role="link"aria-autocomplete="list" aria-label="Any Instructor dropdown"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},n.prototype.bind=function(e,t){var n=this,o=(e.id,e.id+"-results");this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n.trigger("blur",e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",o),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.focus(),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex)}),e.on("disable",function(){n.$selection.attr("tabindex","-1")})},n.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.select2."+t.id,function(t){var i=e(t.target).closest(".select2");e(".select2.select2-container--open").each(function(){var t=e(this);this!=i[0]&&t.data("element").select2("close")})})},n.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},n.prototype.position=function(e,t){t.find(".selection").append(e)},n.prototype.destroy=function(){this._detachCloseHandler(this.container)},n.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},n}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,i,n){function o(){o.__super__.constructor.apply(this,arguments)}return i.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation" aria-hidden="true"><b role="presentation"></b></span>'),e},o.prototype.bind=function(e,t){var i=this;o.__super__.bind.apply(this,arguments);var n=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",n),this.$selection.attr("aria-labelledby",n),this.$selection.on("mousedown",function(e){1===e.which&&i.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("selection:update",function(e){i.update(e.data)})},o.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},o.prototype.display=function(e){var t=this.options.get("templateSelection");return this.options.get("escapeMarkup")(t(e))},o.prototype.selectionContainer=function(){return e("<span></span>")},o.prototype.update=function(e){if(0!==e.length){var t=e[0],i=this.display(t),n=this.$selection.find(".select2-selection__rendered");n.empty().append(i),n.prop("title",t.title||t.text)}else this.clear()},o}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(e,t,i){function n(e,t){n.__super__.constructor.apply(this,arguments)}return i.Extend(n,t),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},n.prototype.bind=function(t,i){var o=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(t){var i=e(this).parent().data("data");o.trigger("unselect",{originalEvent:t,data:i})})},n.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},n.prototype.display=function(e){var t=this.options.get("templateSelection");return this.options.get("escapeMarkup")(t(e))},n.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},n.prototype.update=function(t){if(this.clear(),0!==(t=e.grep(t,function(e){return 0==e.disabled})).length){var n=[],o=this.$selection.find(".select2-selection__rendered");if(t.length>0){var a=0;if(this.$element.find("option").each(function(t){e(this).is(":disabled")||a++}),a==t.length)if("undefined"!=typeof SearchClsOrSrv&&null!=SearchClsOrSrv&&""!=SearchClsOrSrv)if(1==t.length)var s="<span>"+(t[0].title||t[0].text)+"</span>";else s="<span>Any "+SearchClsOrSrv+"</span>";else s="<span>All Selected</span>";else if(1==t.length)s="<span>"+(t[0].title||t[0].text)+"</span>";else if("undefined"!=typeof SearchClsOrSrv&&null!=SearchClsOrSrv&&""!=SearchClsOrSrv)s="<span>"+t.length+" "+SearchClsOrSrv+"s Selected</span>";else s="<span>"+t.length+" Selected</span>";o.empty().append(s)}else{for(var r=0;r<t.length;r++){var l=t[r],c=(s=this.display(l),this.selectionContainer());c.append(s),c.prop("title",l.title||l.text),c.data("data",l),n.push(c)}i.appendMany(o,n)}}},n}),t.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,i){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),e.call(this,t,i)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var i=this.selectionContainer();return i.html(this.display(t)),i.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),i},t.prototype.update=function(e,t){var i=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||i)return e.call(this,t);this.clear();var n=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(n)},t}),t.define("select2/selection/allowClear",["jquery","../keys"],function(e,t){function i(){}return i.prototype.bind=function(e,t,i){var n=this;e.call(this,t,i),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){n._handleClear(e)}),t.on("keypress",function(e){n._handleKeyboardClear(e,t)})},i.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var i=this.$selection.find(".select2-selection__clear");if(0!==i.length){t.stopPropagation();for(var n=i.data("data"),o=0;o<n.length;o++){var a={data:n[o]};if(this.trigger("unselect",a),a.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle")}}},i.prototype._handleKeyboardClear=function(e,i,n){n.isOpen()||i.which!=t.DELETE&&i.which!=t.BACKSPACE||this._handleClear(i)},i.prototype.update=function(t,i){if(t.call(this,i),!(this.$selection.find(".select2-selection__placeholder").length>0||0===i.length)){var n=e('<span class="select2-selection__clear">&times;</span>');n.data("data",i),this.$selection.find(".select2-selection__rendered").prepend(n)}},i}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(e,t,i){function n(e,t,i){e.call(this,t,i)}return n.prototype.render=function(t){var i=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></li>');return this.$searchContainer=i,this.$search=i.find("input"),t.call(this)},n.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),1!=o.options.options.selectAll&&(t.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus()}),t.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val(""),o.$search.focus()}),t.on("enable",function(){o.$search.prop("disabled",!1)}),t.on("disable",function(){o.$search.prop("disabled",!0)}),this.$selection.on("focusin",".select2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){o.trigger("blur",e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===i.BACKSPACE&&""===o.$search.val()){var t=o.$searchContainer.prev(".select2-selection__choice");if(t.length>0){var n=t.data("data");o.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("input",".select2-search--inline",function(e){o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input",".select2-search--inline",function(e){o.handleSearch(e)}))},n.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},n.prototype.update=function(e,t){this.$search.attr("placeholder",""),e.call(this,t),0==t.length&&this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch()},n.prototype.handleSearch=function(){if(1!=this.options.options.selectAll){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1}},n.prototype.searchRemoveChoice=function(e,t){1!=this.options.options.selectAll&&(this.trigger("unselect",{data:t}),this.trigger("open"),this.$search.val(t.text+" "))},n.prototype.resizeSearch=function(){if(1!=this.options.options.selectAll){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".select2-selection__rendered").innerWidth();else e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)}},n}),t.define("select2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,i,n){var o=this,a=["open","opening","close","closing","select","selecting","unselect","unselecting"],s=["opening","closing","selecting","unselecting"];t.call(this,i,n),i.on("*",function(t,i){if(-1!==e.inArray(t,a)){i=i||{};var n=e.Event("select2:"+t,{params:i});o.$element.trigger(n),-1!==e.inArray(t,s)&&(i.prevented=n.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(e,t){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},i._cache={},i.loadPath=function(e){if(!(e in i._cache)){var n=t(e);i._cache[e]=n}return new i(i._cache[e])},i}),t.define("select2/diacritics",[],function(){return{"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),t.define("select2/data/base",["../utils"],function(e){function t(e,i){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,i){var n=t.id+"-result-";return n+=e.generateChars(4),null!=i.id?n+="-"+i.id.toString():n+="-"+e.generateChars(4),n},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(e,t,i){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,e),n.prototype.current=function(e){var t=[],n=this;this.$element.find(":selected").each(function(){var e=i(this),o=n.item(e);t.push(o)}),e(t)},n.prototype.select=function(e){var t=this;if(e.selected=!0,i(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(n){var o=[];(e=[e]).push.apply(e,n);for(var a=0;a<e.length;a++){var s=e[a].id;-1===i.inArray(s,o)&&o.push(s)}t.$element.val(o),t.$element.trigger("change")});else{var n=e.id;this.$element.val(n),this.$element.trigger("change")}},n.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,i(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("change");this.current(function(n){for(var o=[],a=0;a<n.length;a++){var s=n[a].id;s!==e.id&&-1===i.inArray(s,o)&&o.push(s)}t.$element.val(o),t.$element.trigger("change")})}},n.prototype.bind=function(e,t){var i=this;this.container=e,e.on("select",function(e){i.select(e.data)}),e.on("unselect",function(e){i.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){i.removeData(this,"data")})},n.prototype.query=function(e,t){var n=[],o=this;this.$element.children().each(function(){var t=i(this);if(t.is("option")||t.is("optgroup")){var a=o.item(t),s=o.matches(e,a);null!==s&&n.push(s)}}),t({results:n})},n.prototype.addOptions=function(e){t.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=i(t),o=this._normalizeItem(e);return o.element=t,i.data(t,"data",o),n},n.prototype.item=function(e){var t={};if(null!=(t=i.data(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),o=[],a=0;a<n.length;a++){var s=i(n[a]),r=this.item(s);o.push(r)}t.children=o}return(t=this._normalizeItem(t)).element=e[0],i.data(e[0],"data",t),t},n.prototype._normalizeItem=function(e){i.isPlainObject(e)||(e={id:e,text:e});return null!=(e=i.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),i.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),t.define("select2/data/array",["./select","../utils","jquery"],function(e,t,i){function n(e,t){var i=t.get("data")||[];n.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(i))}return t.Extend(n,e),n.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,i){return i.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),n.__super__.select.call(this,e)},n.prototype.convertToOptions=function(e){var n=this,o=this.$element.find("option"),a=o.map(function(){return n.item(i(this)).id}).get(),s=[];function r(e){return function(){return i(this).val()==e.id}}for(var l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(i.inArray(c.id,a)>=0){var d=o.filter(r(c)),u=this.item(d),p=(i.extend(!0,{},u,c),this.option(u));d.replaceWith(p)}else{var h=this.option(c);if(c.children){var m=this.convertToOptions(c.children);t.appendMany(h,m)}s.push(h)}}return s},n}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,i){function n(t,i){this.ajaxOptions=this._applyDefaults(i.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),e.__super__.constructor.call(this,t,i)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return{q:e.term}},transport:function(e,t,n){var o=i.ajax(e);return o.then(t),o.fail(n),o}};return i.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(e,t){var n=this;null!=this._request&&(i.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=i.extend({type:"GET"},this.ajaxOptions);function a(){var a=o.transport(o,function(o){var a=n.processResults(o,e);n.options.get("debug")&&window.console&&console.error&&(a&&a.results&&i.isArray(a.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(a)},function(){});n._request=a}"function"==typeof o.url&&(o.url=o.url(e)),"function"==typeof o.data&&(o.data=o.data(e)),this.ajaxOptions.delay&&""!==e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(a,this.ajaxOptions.delay)):a()},n}),t.define("select2/data/tags",["jquery"],function(e){function t(t,i,n){var o=n.get("tags"),a=n.get("createTag");if(void 0!==a&&(this.createTag=a),t.call(this,i,n),e.isArray(o))for(var s=0;s<o.length;s++){var r=o[s],l=this._normalizeItem(r),c=this.option(l);this.$element.append(c)}}return t.prototype.query=function(e,t,i){var n=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,function e(o,a){for(var s=o.results,r=0;r<s.length;r++){var l=s[r],c=null!=l.children&&!e({results:l.children},!0);if(l.text===t.term||c)return!a&&(o.data=s,void i(o))}if(a)return!0;var d=n.createTag(t);if(null!=d){var u=n.option(d);u.attr("data-select2-tag",!0),n.addOptions([u]),n.insertTag(s,d)}o.results=s,i(o)}):e.call(this,t,i)},t.prototype.createTag=function(t,i){var n=e.trim(i.term);return""===n?null:{id:n,text:n}},t.prototype.insertTag=function(e,t,i){t.unshift(i)},t.prototype._removeOldTags=function(t){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||e(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(e){function t(e,t,i){var n=i.get("tokenizer");void 0!==n&&(this.tokenizer=n),e.call(this,t,i)}return t.prototype.bind=function(e,t,i){e.call(this,t,i),this.$search=t.dropdown.$search||t.selection.$search||i.find(".select2-search__field")},t.prototype.query=function(e,t,i){var n=this;t.term=t.term||"";var o=this.tokenizer(t,this.options,function(e){n.select(e)});o.term!==t.term&&(this.$search.length&&(this.$search.val(o.term),this.$search.focus()),t.term=o.term),e.call(this,t,i)},t.prototype.tokenizer=function(t,i,n,o){for(var a=n.get("tokenSeparators")||[],s=i.term,r=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};r<s.length;){var c=s[r];if(-1!==e.inArray(c,a)){var d=s.substr(0,r);o(l(e.extend({},i,{term:d}))),s=s.substr(r+1)||"",r=0}else r++}return{term:s}},t}),t.define("select2/data/minimumInputLength",[],function(){function e(e,t,i){this.minimumInputLength=i.get("minimumInputLength"),e.call(this,t,i)}return e.prototype.query=function(e,t,i){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,i)},e}),t.define("select2/data/maximumInputLength",[],function(){function e(e,t,i){this.maximumInputLength=i.get("maximumInputLength"),e.call(this,t,i)}return e.prototype.query=function(e,t,i){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,i)},e}),t.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,i){this.maximumSelectionLength=i.get("maximumSelectionLength"),e.call(this,t,i)}return e.prototype.query=function(e,t,i){var n=this;this.current(function(o){var a=null!=o?o.length:0;n.maximumSelectionLength>0&&a>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):e.call(n,t,i)})},e}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},i.prototype.position=function(e,t){},i.prototype.destroy=function(){this.$dropdown.remove()},i}),t.define("select2/dropdown/selectAll",["jquery","../utils"],function(e,t){function i(){}return i.prototype.render=function(t){var i=t.call(this),n=e('<span class="select2-search select2-selectAll--dropdown"><a href="javascript:void(0);" class="selectall">Select All</a><a href="javascript:void(0);" class="selectnone">Select None</a></span>');return this.$selectallContainer=n,this.$selectall=n.find("a.selectall"),this.$selectnone=n.find("a.selectnone"),i.prepend(n),i},i.prototype.bind=function(e,t,i){var n=this;e.call(this,t,i),this.$selectall.on("click",function(e){n.handleselectall(e)}),this.$selectnone.on("click",function(e){n.handleselectnone(e)})},i.prototype.handleselectall=function(t){this.$dropdown.find(".select2-results__option[aria-selected='false']").attr("aria-selected","true"),this.$element.find("option").attr("selected","selected");var i;i=e.map(this.$element.find("option"),function(t){if(0==t.disabled)return e(t).val().toString()}),this.$element.val(i),this.$element.trigger("change")},i.prototype.handleselectnone=function(e){this.$dropdown.find(".select2-results__option[aria-selected='true']").attr("aria-selected","false"),this.$element.find("option").removeAttr("selected"),this.$element.trigger("change",this.$element)},i}),t.define("select2/dropdown/search",["jquery","../utils"],function(e,t){function i(){}return i.prototype.render=function(t){var i=t.call(this),n=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),i.prepend(n),i},i.prototype.bind=function(t,i,n){var o=this;t.call(this,i,n),this.$search.on("keydown",function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()});var a=function(){return/MSIE\s/.test(navigator.userAgent)&&parseFloat(navigator.appVersion.split("MSIE")[1])<10};this.$search.on("input",function(t){0==a&&e(this).off("keyup")}),this.$search.on("keyup",function(t){a&&e(this).off("input")}),this.$search.on("keyup input",function(e){o.handleSearch(e),o.$search.focus()}),0==/iPad/i.test(navigator.userAgent)&&i.on("open",function(){o.$search.attr("tabindex",0),o.$search.focus(),window.setTimeout(function(){o.$search.focus()},0)}),i.on("close",function(){o.$search.attr("tabindex",-1),o.$search.val("")}),i.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(o.showSearch(e)?o.$searchContainer.removeClass("select2-search--hide"):o.$searchContainer.addClass("select2-search--hide"))})},i.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},i.prototype.showSearch=function(e,t){return!0},i}),t.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,i,n){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),e.call(this,t,i,n)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var i=t.slice(0),n=t.length-1;n>=0;n--){var o=t[n];this.placeholder.id===o.id&&i.splice(n,1)}return i},e}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,i,n){this.lastParams={},e.call(this,t,i,n),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,i,n){var o=this;t.call(this,i,n),i.on("query",function(e){o.lastParams=e,o.loading=!0}),i.on("query:append",function(e){o.lastParams=e,o.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,o.$loadingMore[0]);!o.loading&&t&&(o.$results.offset().top+o.$results.outerHeight(!1)+50>=o.$loadingMore.offset().top+o.$loadingMore.outerHeight(!1)&&o.loadMore())})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="option load-more" role="treeitem"></li>'),i=this.options.get("translations").get("loadingMore");return t.html(i(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(e,t){function i(e,t,i){this.$dropdownParent=i.get("dropdownParent")||document.body,e.call(this,t,i)}return i.prototype.bind=function(e,t,i){var n=this,o=!1;e.call(this,t,i),t.on("open",function(){n._showDropdown(),n._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}))}),t.on("close",function(){n._hideDropdown(),n._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},i.prototype.position=function(e,t,i){t.attr("class",i.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open");var n=this.options.get("dropdownCssClass")||"";""!=n&&t.addClass(n),t.css({position:"absolute",top:-999999}),this.$container=i},i.prototype.render=function(t){var i=e("<span></span>"),n=t.call(this);return i.append(n),this.$dropdownContainer=i,i},i.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},i.prototype._attachPositioningHandler=function(i){var n=this,o="scroll.select2."+i.id,a="resize.select2."+i.id,s="orientationchange.select2."+i.id,r=this.$container.parents().filter(t.hasScroll);r.each(function(){e(this).data("select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),r.on(o,function(t){var i=e(this).data("select2-scroll-position");e(this).scrollTop(i.y)}),e(window).on(o+" "+a+" "+s,function(e){n._positionDropdown(),n._resizeDropdown()})},i.prototype._detachPositioningHandler=function(i){var n="scroll.select2."+i.id,o="resize.select2."+i.id,a="orientationchange.select2."+i.id;this.$container.parents().filter(t.hasScroll).off(n),e(window).off(n+" "+o+" "+a)},i.prototype._positionDropdown=function(){var t=e(window),i=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),o=null,a=(this.$container.position(),this.$container.offset());a.bottom=a.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=a.top,s.bottom=a.top+s.height;var r=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),d=l<a.top-r,u=c>a.bottom+r,p={left:a.left,top:s.bottom};i||n||(o="below"),u||!d||i?!d&&u&&i&&(o="below"):o="above",("above"==o||i&&"below"!==o)&&(p.top=s.top-r),null!=o&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+o),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+o)),this.$dropdownContainer.css(p)},i.prototype._resizeDropdown=function(){this.$dropdownContainer.width();var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.width="auto"),this.$dropdown.css(e)},i.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},i}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var i=0,n=0;n<t.length;n++){var o=t[n];o.children?i+=e(o.children):i++}return i}function t(e,t,i,n){this.minimumResultsForSearch=i.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,i,n)}return t.prototype.showSearch=function(t,i){return!(e(i.data.results)<this.minimumResultsForSearch)&&t.call(this,i)},t}),t.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,i){var n=this;e.call(this,t,i),t.on("close",function(){n._handleSelectOnClose()})},e.prototype._handleSelectOnClose=function(){var e=this.getHighlightedResults();e.length<1||this.trigger("select",{data:e.data("data")})},e}),t.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,i){var n=this;e.call(this,t,i),t.on("select",function(e){n._selectTriggered(e)}),t.on("unselect",function(e){n._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var i=t.originalEvent;i&&i.ctrlKey||this.trigger("close")},e}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,i="Please delete "+t+" character";return 1!=t&&(i+="s"),i},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./dropdown/selectAll","./i18n/en"],function(e,t,i,n,o,a,s,r,l,c,d,u,p,h,m,g,v,f,C,S,y,b,k,_,D,I,w,P,A,T){function x(){this.reset()}return x.prototype.apply=function(u){if(null==(u=e.extend({},this.defaults,u)).dataAdapter){if(null!=u.ajax?u.dataAdapter=m:null!=u.data?u.dataAdapter=h:u.dataAdapter=p,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,f)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,C)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,S)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,v)),null!=u.query){var T=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,T)}if(null!=u.initSelection){var x=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,x)}}if(null==u.resultsAdapter&&(u.resultsAdapter=i,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,_)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,k)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,w))),null==u.dropdownAdapter){var F=c.Decorate(y,b);u.dropdownAdapter=F,0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,I)),0!==u.selectAll&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,A)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,P)),null!=u.dropdownCssClass||null!=u.dropdownCss||u.adaptDropdownCssClass,u.dropdownAdapter=c.Decorate(u.dropdownAdapter,D)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=o:u.selectionAdapter=n,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,r)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var $=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,$)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}if("string"==typeof u.language)if(u.language.indexOf("-")>0){var O=u.language.split("-")[0];u.language=[u.language,O]}else u.language=[u.language];if(e.isArray(u.language)){var M=new d;u.language.push("en");for(var B=u.language,E=0;E<B.length;E++){var L=B[E],N={};try{N=d.loadPath(L)}catch(e){try{L=this.defaults.amdLanguageBase+L,N=d.loadPath(L)}catch(e){u.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+L+'" could not be automatically loaded. A fallback will be used instead.');continue}}M.extend(N)}u.translations=M}else{var U=d.loadPath(this.defaults.amdLanguageBase+"en"),R=new d(u.language);R.extend(U),u.translations=R}return u},x.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return u[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:T,matcher:function i(n,o){if(""===e.trim(n.term))return o;if(o.children&&o.children.length>0){for(var a=e.extend(!0,{},o),s=o.children.length-1;s>=0;s--){null==i(n,o.children[s])&&a.children.splice(s,1)}return a.children.length>0?a:i(n,a)}var r=t(o.text).toUpperCase(),l=t(n.term).toUpperCase();return r.indexOf(l)>-1?o:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectAll:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},x.prototype.set=function(t,i){var n={};n[e.camelCase(t)]=i;var o=c._convertData(n);e.extend(this.defaults,o)},new x}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(e,t,i,n){function o(t,o){if(this.options=t,null!=o&&this.fromElement(o),this.options=i.apply(this.options),o&&o.is("input")){var a=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=n.Decorate(this.options.dataAdapter,a)}}return o.prototype.fromElement=function(e){var i=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var o={};o=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var a=t.extend(!0,{},o);for(var s in a=n._convertData(a))t.inArray(s,i)>-1||(t.isPlainObject(this.options[s])?t.extend(this.options[s],a[s]):this.options[s]=a[s]);return this},o.prototype.get=function(e){return this.options[e]},o.prototype.set=function(e,t){this.options[e]=t},o}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(e,t,i,n){var o=function(e,i){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),i=i||{},this.options=new t(i,e),o.__super__.constructor.call(this);var n=e.attr("tabindex")||0;e.data("old-tabindex",n),e.attr("tabindex","-1");var a=this.options.get("dataAdapter");this.dataAdapter=new a(e,this.options);var s=this.render();this._placeContainer(s);var r=this.options.get("selectionAdapter");this.selection=new r(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,s);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,s);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var d=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){d.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return i.Extend(o,i.Observable),o.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+i.generateChars(2):i.generateChars(4))},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var i=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var n=this._resolveWidth(e,"style");return null!=n?n:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==t){var a=e.attr("style");if("string"!=typeof a)return null;for(var s=a.split(";"),r=0,l=s.length;r<l;r+=1){var c=s[r].replace(/\s/g,"").match(i);if(null!==c&&c.length>=1)return c[1]}return null}return t},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this._sync=i.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var n=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=n?(this._observer=new n(function(i){e.each(i,t._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",t._sync,!1)},o.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,i){e.trigger(t,i)})},o.prototype._registerSelectionEvents=function(){var t=this,i=["toggle"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("*",function(n,o){-1===e.inArray(n,i)&&t.trigger(n,o)})},o.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,i){e.trigger(t,i)})},o.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,i){e.trigger(t,i)})},o.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2-container--open");var t=this.options.get("dropdownCssClass")||"";""!=t&&e.$container.addClass(t)}),this.on("close",function(){e.$container.removeClass("select2-container--open");var t=this.options.get("dropdownCssClass")||"";""!=t&&e.$container.removeClass(t)}),this.on("enable",function(){e.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2-container--disabled")}),this.on("focus",function(){e.$container.addClass("select2-container--focus")}),this.on("blur",function(){e.$container.removeClass("select2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open"),this.dataAdapter.query(t,function(i){e.trigger("results:all",{data:i,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(i){e.trigger("results:append",{data:i,query:t})})}),this.on("keypress",function(t){var i=t.which;e.isOpen()?i===n.ENTER?(e.trigger("results:select"),t.preventDefault()):i===n.SPACE&&t.ctrlKey?(e.trigger("results:toggle"),t.preventDefault()):i===n.UP?(e.trigger("results:previous"),t.preventDefault()):i===n.DOWN?(e.trigger("results:next"),t.preventDefault()):i!==n.ESC&&i!==n.TAB||(e.close(),t.preventDefault()):(i===n.ENTER||i===n.SPACE||(i===n.DOWN||i===n.UP)&&t.altKey)&&(e.open(),t.preventDefault())})},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable")):this.trigger("enable")},o.prototype.trigger=function(e,t){var i=o.__super__.trigger,n={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(e in n){var a=n[e],s={prevented:!1,name:e,args:t};if(i.call(this,a,s),s.prevented)return void(t.prevented=!0)}i.call(this,e,t)},o.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||(this.trigger("open"),this.trigger("query",{}))},o.prototype.close=function(){this.isOpen()&&this.trigger("close")},o.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},o.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var i=t[0];e.isArray(i)&&(i=e.map(i,function(e){return e.toString()})),this.$element.val(i).trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),t.data("element",this.$element),t},o}),t.define("select2/compat/utils",["jquery"],function(e){return{syncCssClasses:function(t,i,n){var o,a,s=[];(o=e.trim(t.attr("class")))&&e((o=""+o).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&s.push(this)}),(o=e.trim(i.attr("class")))&&e((o=""+o).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(a=n(this))&&s.push(a)}),t.attr("class",s.join(" "))}}}),t.define("select2/compat/containerCss",["jquery","./utils"],function(e,t){function i(e){return null}function n(){}return n.prototype.render=function(n){var o=n.call(this),a=this.options.get("containerCssClass")||"";e.isFunction(a)&&(a=a(this.$element));var s=this.options.get("adaptContainerCssClass");if(s=s||i,-1!==a.indexOf(":all:")){a=a.replace(":all:","");var r=s;s=function(e){var t=r(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,s),o.css(l),o.addClass(a),o},n}),t.define("select2/compat/dropdownCss",["jquery","./utils"],function(e,t){function i(e){return null}function n(){}return n.prototype.render=function(n){var o=n.call(this),a=this.options.get("dropdownCssClass")||"";e.isFunction(a)&&(a=a(this.$element));var s=this.options.get("adaptDropdownCssClass");if(s=s||i,-1!==a.indexOf(":all:")){a=a.replace(":all:","");var r=s;s=function(e){var t=r(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(o,this.$element,s),o.css(l),o.addClass(a),o},n}),t.define("jquery.select2",["jquery","require","./select2/core","./select2/defaults"],function(e,t,i,n){if(t("jquery.mousewheel"),null==e.fn.select2){var o=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var n=e.extend({},t,!0);new i(e(this),n)}),this;if("string"==typeof t){var n=this.data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2.");var a=Array.prototype.slice.call(arguments,1),s=n[t](a);return e.inArray(t,o)>-1?this:s}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=n),i}),t.define("jquery.mousewheel",["jquery"],function(e){return e}),{define:t.define,require:t.require}}(),i=t.require("jquery.select2");return e.fn.select2.amd=t,i}),function(e){void 0===e.fn.each2&&e.extend(e.fn,{each2:function(t){for(var i=e([0]),n=-1,o=this.length;++n<o&&(i.context=i[0]=this[n])&&!1!==t.call(i[0],n,i););return this}})}(jQuery),function(){var e=!1,t=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(i){var n=this.prototype;e=!0;var o=new this;for(var a in e=!1,i)o[a]="function"==typeof i[a]&&"function"==typeof n[a]&&t.test(i[a])?function(e,t){return function(){var i=this._super;this._super=n[e];var o=t.apply(this,arguments);return this._super=i,o}}(a,i[a]):i[a];function s(){!e&&this.init&&this.init.apply(this,arguments)}return s.prototype=o,s.prototype.constructor=s,s.extend=arguments.callee,s}}(),function(e,t){"use strict";if(window.Select2===t){var i,n,o,a,s,r,l,c,d,u={x:0,y:0},p={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case p.LEFT:case p.RIGHT:case p.UP:case p.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case p.SHIFT:case p.CTRL:case p.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return(e=e.which?e.which:e)>=112&&e<=123}},h={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"};l=e(document),d=1,s=function(){return d++},l.on("mousemove",function(e){u.x=e.pageX,u.y=e.pageY}),i=Class.extend({bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(i){var n,o,a,r,l,d=".select2-results";this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&i.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+s()).replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.containerSelector="#"+this.containerId,this.container.attr("id",this.containerId),this.body=(a=function(){return i.element.closest("body")},l=!1,function(){return!1===l&&(r=a(),l=!0),r}),_(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",i.element.attr("style")),this.container.css(x(i.containerCss)),this.container.addClass(x(i.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").attr("aria-hidden",!0).before(this.container).on("click.select2",k),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),_(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(x(i.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",k),this.results=n=this.container.find(d),this.search=o=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",k),this.results.on("mousemove",function(i){var n=u;n!==t&&n.x===i.pageX&&n.y===i.pageY||e(i.target).trigger("mousemove-filtered",i)}),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",d,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchend",d,this.bind(this.selectHighlighted)),this.dropdown.on("touchmove",d,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",d,this.bind(this.clearTouchMoved)),function(e,t){var i=b(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){v(e.target,t.get())>=0&&i(e)})}(80,this.results),this.dropdown.on("scroll-debounced",d,this.bind(this.loadMoreIfNeeded)),e(this.container,this.dropdown).on("change",".select2-input",this.bind(function(t){t.stopPropagation(),e(t.target).trigger("native-change",t)})),e.fn.mousewheel&&n.mousewheel(function(e,t,i,o){var a=n.scrollTop();o>0&&a-o<=0?(n.scrollTop(0),k(e)):o<0&&n.get(0).scrollHeight-n.scrollTop()+o<=n.height()&&(n.scrollTop(n.get(0).scrollHeight-n.height()),k(e))}),y(o),o.on("keyup-change input paste",this.bind(this.updateResults)),o.on("focus",function(){o.addClass("select2-focused")}),o.on("blur",function(){o.removeClass("select2-focused")}),this.dropdown.on("mouseup",d,this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=t,e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength);var p=i.element.prop("disabled");p===t&&(p=!1),this.enable(!p);var h=i.element.prop("readonly");h===t&&(h=!1),this.readonly(h),c=c||function(){var t=e("<div class='select2-measure-scrollbar'></div>");t.appendTo("body");var i={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),i}(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",i.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,i=e.data("select2");this.close(),this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),i!==t&&(i.container.remove(),i.liveRegion.remove(),i.dropdown.remove(),e.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show())},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:f(e.attr("locked"),"locked")||f(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(i){var n,o,a,r,l=this;if("select"===(n=i.element).get(0).tagName.toLowerCase()&&(this.select=o=i.element),o&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),i=e.extend({},{populateResults:function(n,o,a){var r,c=this.opts.id,d=this.liveRegion,u=this.opts.collapasable,p=o.length;r=function(n,o,h,m){var g,v,f,C,S,y,b,k,_,D,I;for(g=0,v=(n=i.sortResults(n,o,a)).length;g<v;g+=1)C=!(S=!0===(f=n[g]).disabled)&&c(f)!==t,y=f.children&&f.children.length>0,I=!1,void 0!==f.IsDefault&&f.IsDefault?(I=!0,C=!0):I=!1,void 0!==f.children&&0==f.children.length&&0==I||(b=e("<li></li>"),1==u&&void 0!==m&&1==m&&(void 0!==f.isShow&&1==f.isShow?b.css("display",""):b.css("display","none")),b.addClass("select2-results-dept-"+h),b.addClass("select2-result"),b.addClass(C?"select2-result-selectable":"select2-result-unselectable"),S&&b.addClass("select2-disabled"),y&&b.addClass("select2-result-with-children"),I&&b.addClass("select2-result-with-children select2-hilight-title"),b.addClass(l.opts.formatResultCssClass(f)),b.attr("role","presentation"),k=e(document.createElement("div")),void 0!==f.serviceDisplayClass&&null!=f.serviceDisplayClass&&""!=f.serviceDisplayClass&&b.addClass(f.serviceDisplayClass),k.addClass("select2-result-label"),k.attr("id","select2-result-label-"+s()),k.attr("role","option"),(D=i.formatResult(f,k,a,l.opts.escapeMarkup))!==t&&(k.html(D),b.append(k)),y&&((_=e("<ul></ul>")).addClass("select2-result-sub text-primary"),r(f.children,_,h+1,!0),b.append(_)),b.data("select2-data",f),o.append(b),1==u&&1==y&&(b.off("click.custom"),b.on("click.custom",function(){e(this).find("li").is(":visible")?(e(this).find("li").hide(),e(this).removeClass("parentli-expanded")):(e(this).addClass("parentli-expanded"),e(this).find("li").show())}),1==p&&(b.addClass("parentli-expanded"),b.find("li").show())));d.text(i.formatMatches(n.length))},r(o,n,0)}},e.fn.select2.defaults,i),"function"!=typeof i.id&&(a=i.id,i.id=function(e){return e[a]}),e.isArray(i.element.data("select2Tags"))){if("tags"in i)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+i.element.attr("id");i.tags=i.element.data("select2Tags")}if(o?(i.query=this.bind(function(e){var i,o,a,s={results:[],more:!1},r=e.term;a=function(t,i){var n;t.is("option")?e.matcher(r,t.text(),t)&&i.push(l.optionToData(t)):t.is("optgroup")&&(n=l.optionToData(t),t.children().each2(function(e,t){a(t,n.children)}),n.children.length>0&&i.push(n))},i=n.children(),this.getPlaceholder()!==t&&i.length>0&&(o=this.getPlaceholderOption())&&(i=i.not(o)),i.each2(function(e,t){a(t,s.results)}),e.callback(s)}),i.id=function(e){return e.id}):"query"in i||("ajax"in i?((r=i.element.data("ajax-url"))&&r.length>0&&(i.ajax.url=r),i.query=w.call(i.element,i.ajax)):"data"in i?i.query=P(i.data):"tags"in i&&(i.query=A(i.tags),i.createSearchChoice===t&&(i.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),i.initSelection===t&&(i.initSelection=function(t,n){var o=[];e(C(t.val(),i.separator)).each(function(){var t={id:this,text:this},n=i.tags;e.isFunction(n)&&(n=n()),e(n).each(function(){if(f(this.id,t.id))return t=this,!1}),o.push(t)}),n(o)}))),"function"!=typeof i.query)throw"query function not defined for Select2 "+i.element.attr("id");if("top"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof i.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return i},monitorSource:function(){var e,i,n=this.opts.element;n.on("change.select2",this.bind(function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),e=this.bind(function(){var e=n.prop("disabled");e===t&&(e=!1),this.enable(!e);var i=n.prop("readonly");i===t&&(i=!1),this.readonly(i),_(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(x(this.opts.containerCssClass)),_(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(x(this.opts.dropdownCssClass))}),n.on("propertychange.select2",e),this.mutationCallback===t&&(this.mutationCallback=function(t){t.forEach(e)}),(i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==t&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new i(this.mutationCallback),this.propertyObserver.observe(n.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var i=e.Event("select2-selecting",{val:this.id(t),object:t});return this.opts.element.trigger(i),!i.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,i,n,o,a,s=this.dropdown,r=this.container.offset(),l=this.container.outerHeight(!1),d=this.container.outerWidth(!1),u=s.outerHeight(!1),p=e(window),h=p.width(),m=p.height(),g=p.scrollLeft()+h,v=p.scrollTop()+m,f=r.top+l,C=r.left,S=f+u<=v,y=r.top-u>=p.scrollTop(),b=s.outerWidth(!1),k=C+b<=g;s.hasClass("select2-drop-above")?(i=!0,!y&&S&&(n=!0,i=!1)):(i=!1,!S&&y&&(n=!0,i=!0)),n&&(s.hide(),r=this.container.offset(),l=this.container.outerHeight(!1),d=this.container.outerWidth(!1),u=s.outerHeight(!1),g=p.scrollLeft()+h,v=p.scrollTop()+m,f=r.top+l,k=(C=r.left)+(b=s.outerWidth(!1))<=g,s.show()),this.opts.dropdownAutoWidth?(a=e(".select2-results",s)[0],s.addClass("select2-drop-auto-width"),s.css("width",""),(b=s.outerWidth(!1)+(a.scrollHeight===a.clientHeight?0:c.width))>d?d=b:b=d,k=C+b<=g):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(f-=(t=this.body().offset()).top,C-=t.left),k||(C=r.left+this.container.outerWidth(!1)-b),o={left:C,width:d},i?(o.top=r.top-u,o.bottom="auto",this.container.addClass("select2-drop-above"),s.addClass("select2-drop-above")):(o.top=f,o.bottom="auto",this.container.removeClass("select2-drop-above"),s.removeClass("select2-drop-above")),o=e.extend(o,x(this.opts.dropdownCss)),s.css(o)},shouldOpen:function(){var t;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),!0)},opening:function(){var t,i=this.containerId,n="scroll."+i,o="resize."+i,a="orientationchange."+i;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),0==(t=e("#select2-drop-mask")).length&&((t=e(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body()),t.on("mousedown touchstart click",function(i){m(t);var n,o=e("#select2-drop");o.length>0&&((n=o.data("select2")).opts.selectOnBlur&&n.selectHighlighted({noFocus:!0}),"undefined"!=typeof _common&&void 0!==_common.closeServiceSelection&&_common.closeServiceSelection(),n.close(),i.stopPropagation())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var s=this;this.container.parents().add(window).each(function(){e(this).on(o+" "+n+" "+a,function(e){s.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerId,i="scroll."+t,n="resize."+t,o="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(i).off(n).off(o)}),this.clearDropdownAlignmentPreference(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close")),setTimeout(function(){e("#select2-drop-mask").hide()},400)}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return 0==this.opts.maximumSelectionSize?e("#select2-drop ul.select2-results").parent().addClass("selectbox-hide"):e("#select2-drop ul.select2-results").parent().removeClass("selectbox-hide"),x(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t,i,n,o,a,s,r,l=this.results;(i=this.highlight())<0||(0!=i?(t=this.findHighlightableChoices().find(".select2-result-label"),o=(n=e(t[i])).offset().top+n.outerHeight(!0),i===t.length-1&&(r=l.find("li.select2-more-results")).length>0&&(o=r.offset().top+r.outerHeight(!0)),o>(a=l.offset().top+l.outerHeight(!0))&&l.scrollTop(l.scrollTop()+(o-a)),(s=n.offset().top-l.offset().top)<0&&"none"!=n.css("display")&&l.scrollTop(l.scrollTop()+s)):l.scrollTop(0))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){for(var i=this.findHighlightableChoices(),n=this.highlight();n>=-1&&n<i.length;){var o=e(i[n+=t]);if(o.hasClass("select2-result-selectable")&&!o.hasClass("select2-disabled")&&!o.hasClass("select2-selected")){this.highlight(n);break}}},highlight:function(t){var i,n,o=this.findHighlightableChoices();if(0===arguments.length)return v(o.filter(".select2-highlighted")[0],o.get());t>=o.length&&(t=o.length-1),t<0&&(t=0),this.removeHighlight(),(i=e(o[t])).addClass("select2-highlighted"),this.ensureHighlightVisible(),this.liveRegion.text(i.text()),(n=i.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(n),choice:n})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var i=e(t.target).closest(".select2-result-selectable");if(i.length>0&&!i.is(".select2-highlighted")){var n=this.findHighlightableChoices();this.highlight(n.index(i))}else 0==i.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),i=e.parent().find("li.select2-more-pager"),n=this.resultsPage+1,o=this,a=this.search.val(),s=this.context;0!==t.length&&t.offset().top-e.offset().top-e.height()<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:a,page:n,context:s,matcher:this.opts.matcher,callback:this.bind(function(r){o.opened()&&(o.opts.populateResults.call(this,e,r.results,{term:a,page:n,context:s}),o.postprocessResults(r,!1,!1),null!=i&&i.appendTo(e.parent()).text(x(o.opts.formatPager,n+1)),!0===r.more?(t.detach().appendTo(e).text(x(o.opts.formatLoadMore,n+1)),window.setTimeout(function(){o.loadMoreIfNeeded()},10)):t.remove(),o.positionDropdown(),o.resultsPage=n,o.context=r.context,this.opts.element.trigger({type:"select2-loaded",items:r}))})}))},tokenize:function(){},updateResults:function(i){var n,o,a,s=this.search,r=this.results,l=this.opts,c=this,d=s.val(),u=e.data(this.container,"select2-last-term");if((!0===i||!u||!f(d,u))&&(e.data(this.container,"select2-last-term",d),!0===i||!1!==this.showSearchInput&&this.opened())){a=++this.queryCount;var p=this.getMaximumSelectionSize();if(!(p>=1&&(n=this.data(),e.isArray(n)&&n.length>=p&&T(l.formatSelectionTooBig,"formatSelectionTooBig"))))return s.val().length<l.minimumInputLength?(T(l.formatInputTooShort,"formatInputTooShort")?(m("<li class='select2-no-results'>"+x(l.formatInputTooShort,s.val(),l.minimumInputLength)+"</li>"),e(".select2-more-pager").remove()):m(""),void(i&&this.showSearch&&this.showSearch(!0))):void(l.maximumInputLength&&s.val().length>l.maximumInputLength?T(l.formatInputTooLong,"formatInputTooLong")?m("<li class='select2-no-results'>"+x(l.formatInputTooLong,s.val(),l.maximumInputLength)+"</li>"):m(""):(l.formatSearching&&this.findHighlightableChoices().length<=10&&m("<li class='select2-searching'>"+x(l.formatSearching)+"</li>"),s.addClass("select2-active"),this.removeHighlight(),(o=this.tokenize())!=t&&null!=o&&s.val(o),this.resultsPage=1,l.query({element:l.element,term:s.val(),page:this.resultsPage,context:null,matcher:l.matcher,callback:this.bind(function(n){var o;if(a==this.queryCount)if(this.opened()){if(this.context=n.context===t?null:n.context,this.opts.createSearchChoice&&""!==s.val()&&(o=this.opts.createSearchChoice.call(c,s.val(),n.results))!==t&&null!==o&&c.id(o)!==t&&null!==c.id(o)&&0===e(n.results).filter(function(){return f(c.id(this),c.id(o))}).length&&this.opts.createSearchChoicePosition(n.results,o),0===n.results.length&&T(l.formatNoMatches,"formatNoMatches"))return"s2id_txtSearchServiceMain"==this.containerId||"s2id_ddlLiveStreamClass"==this.containerId||"s2id_ddlServices"==this.containerId||"s2id_txtMobileService"==this.containerId?m(x(l.formatEmptyMessage,s.val())):m("<li class='select2-no-results'>"+x(l.formatNoMatches,s.val())+"</li>"),void r.parent().find("li.select2-more-pager").remove();r.empty(),r.parent().find("li.select2-more-pager").remove(),c.opts.populateResults.call(this,r,n.results,{term:s.val(),page:this.resultsPage,context:null}),!0===n.more&&T(l.formatLoadMore,"formatLoadMore")&&(r.append("<li class='select2-more-results'>"+c.opts.escapeMarkup(x(l.formatLoadMore,this.resultsPage))+"</li>"),r.parent().append("<li class='select2-more-pager'>"+c.opts.escapeMarkup(x(l.formatPager,this.resultsPage))+"</li>"),window.setTimeout(function(){c.loadMoreIfNeeded()},10)),this.postprocessResults(n,i),h(),this.opts.element.trigger({type:"select2-loaded",items:n})}else this.search.removeClass("select2-active")})})));m("<li class='select2-selection-limit'>"+x(l.formatSelectionTooBig,p)+"</li>")}function h(){s.removeClass("select2-active"),c.positionDropdown(),r.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?c.liveRegion.text(r.text()):c.liveRegion.text(c.opts.formatMatches(r.find(".select2-result-selectable").length))}function m(e){r.html(e),h()}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){var e;(e=this.search)[0]!==document.activeElement&&window.setTimeout(function(){var t,i=e[0],n=e.val().length;e.focus(),(i.offsetWidth>0||i.offsetHeight>0)&&i===document.activeElement&&(i.setSelectionRange?i.setSelectionRange(n,n):i.createTextRange&&((t=i.createTextRange()).collapse(!1),t.select()))},0)},selectHighlighted:function(e){if(this._touchMoved)this.clearTouchMoved();else{var i=this.highlight(),n=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");n?(this.highlight(i),this.onSelect(n,e)):e&&e.noFocus&&this.close(),"s2id_txtSearchServiceMain"!=this.containerId&&"s2id_ddlLiveStreamClass"!=this.containerId&&"s2id_ddlServices"!=this.containerId&&"s2id_txtMobileService"!=this.containerId||e==t&&this.close()}},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==t?e.text():t)},getPlaceholderOption:function(){if(this.select){var i=this.select.children("option").first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&i||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===e.trim(i.text())&&""===i.val())return i}},initContainerWidth:function(){var i=function(){var i,n,o,a,s;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if((i=this.opts.element.attr("style"))!==t)for(a=0,s=(n=i.split(";")).length;a<s;a+=1)if(null!==(o=n[a].replace(/\s/g,"").match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&o.length>=1)return o[1];return"resolve"===this.opts.width?(i=this.opts.element.css("width")).indexOf("%")>0?i:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}.call(this);null!==i&&this.container.css("width",i)}}),n=i.extend({createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>","   <div class='select2-search' style='display:none;'>","       <label for='' class='select2-offscreen'></label>","       <input type='text' autocomplete='false' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input text-primary' role='combobox' aria-expanded='true'","       aria-autocomplete='list' />","   </div>","   <ul class='select2-results' role='listbox'>","   </ul>","</div>"].join(""))},enableInterface:function(){this._super.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var i,n,o;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this._super.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.search.focus(),(i=this.search.get(0)).createTextRange?((n=i.createTextRange()).collapse(!1),n.select()):i.setSelectionRange&&(o=this.search.val().length,i.setSelectionRange(o,o)),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this._super.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this._super.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this._super.apply(this,arguments)},initContainer:function(){var t,i,n=this.container,o=this.dropdown,a=s();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+a),this.focusser.attr("aria-labelledby","select2-chosen-"+a),this.results.attr("id","select2-results-"+a),this.search.attr("aria-owns","select2-results-"+a),this.focusser.attr("id","s2id_autogen"+a),i=e("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(i.text()).attr("for",this.focusser.attr("id"));var r=this.opts.element.attr("title");this.opts.element.attr("title",r||i.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(e("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled())if(e.which!==p.PAGE_UP&&e.which!==p.PAGE_DOWN)switch(e.which){case p.UP:case p.DOWN:return this.moveHighlight(e.which===p.UP?-1:1),void k(e);case p.ENTER:return this.selectHighlighted(),void k(e);case p.TAB:return void this.selectHighlighted({noFocus:!0});case p.ESC:return this.cancel(e),void k(e)}else k(e)})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==p.TAB&&!p.isControl(e)&&!p.isFunctionKey(e)&&e.which!==p.ESC){if(!1!==this.opts.openOnEnter||e.which!==p.ENTER){if(e.which==p.DOWN||e.which==p.UP||e.which==p.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void k(e)}return e.which==p.DELETE||e.which==p.BACKSPACE?(this.opts.allowClear&&this.clear(),void k(e)):void 0}k(e)}})),y(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),function(e){e.preventDefault(),e.stopImmediatePropagation()}(e),this.close(),this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(i){m(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),k(i)})),o.on("mousedown touchstart",this.bind(function(){this.search.focus()})),t.on("focus",this.bind(function(e){k(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(t){var i=this.selection.data("select2-data");if(i){var n=e.Event("select2-clearing");if(this.opts.element.trigger(n),n.isDefaultPrevented())return;var o=this.getPlaceholderOption();this.opts.element.val(o?o.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==t&&(this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.setPlaceholder(),e.nextSearchTerm=e.opts.nextSearchTerm(i,e.search.val()))})}},isPlaceholderOptionSelected:function(){var e;return!!this.getPlaceholder()&&((e=this.getPlaceholderOption())!==t&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val())},prepareOpts:function(){var t=this._super.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=e.find("option").filter(function(){return this.selected&&!this.disabled});t(i.optionToData(n))}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var o=i.val(),a=null;t.query({matcher:function(e,i,n){var s=f(o,t.id(n));return s&&(a=n),s},callback:e.isFunction(n)?function(){n(a)}:e.noop})}),t},getPlaceholder:function(){if(this.select&&this.getPlaceholderOption()===t)return t;this._super.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,i){var n=0,o=this;if(this.findHighlightableChoices().each2(function(e,t){if(f(o.id(t.data("select2-data")),o.opts.element.val()))return n=e,!1}),!1!==i&&(!0===t&&n>=0?this.highlight(n):this.highlight(0)),!0===t){var a=this.opts.minimumResultsForSearch;a>=0&&this.showSearch(F(e.results)>=a)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var i=this.opts.element.val(),n=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),f(i,this.id(e))||this.triggerChange({added:e,removed:n})}},updateSelection:function(e){var i,n,o=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),o.empty(),null!==e&&(i=this.opts.formatSelection(e,o,this.opts.escapeMarkup)),i!==t&&o.append(i),(n=this.opts.formatSelectionCssClass(e,o))!==t&&o.addClass(n),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,i=!1,n=null,o=this,a=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(i=arguments[1]),this.select)this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return n=o.optionToData(t),!1}),this.updateSelection(n),this.setPlaceholder(),i&&this.triggerChange({added:n,removed:a});else{if(!e&&0!==e)return void this.clear(i);if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){o.opts.element.val(e?o.id(e):""),o.updateSelection(e),o.setPlaceholder(),i&&o.triggerChange({added:e,removed:a})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var i,n=!1;if(0===arguments.length)return(i=this.selection.data("select2-data"))==t&&(i=null),i;arguments.length>1&&(n=arguments[1]),e?(i=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),n&&this.triggerChange({added:e,removed:i})):this.clear(n)}}),o=i.extend({createContainer:function(){var t="<input type='text' autocomplete='true' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input standrad-maphour-block'";return t+=">",e(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field other'>","    <label for='' class='select2-offscreen' aria-hidden='true'></label>",t,"  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},prepareOpts:function(){var t=this._super.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){n.push(i.optionToData(t))}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var o=C(i.val(),t.separator),a=[];t.query({matcher:function(i,n,s){var r=e.grep(o,function(e){return f(e,t.id(s))}).length;return r&&a.push(s),r},callback:e.isFunction(n)?function(){for(var e=[],i=0;i<o.length;i++)for(var s=o[i],r=0;r<a.length;r++){var l=a[r];if(f(s,t.id(l))){e.push(l),a.splice(r,1);break}}n(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){e("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this._super.apply(this,arguments)},initContainer:function(){var t,i=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(i);var n=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(t){n.search[0].focus(),n.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+s()),this.search.attr("role","combobox"),this.search.attr("aria-autocomplete","list"),this.search.attr("aria-expanded","false"),this.search.attr("aria-controls","select2-drop"),this.search.prev().text(e("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(i){if(this.isInterfaceEnabled()){++this.keydowns;var n=t.find(".select2-search-choice-focus"),o=n.prev(".select2-search-choice:not(.select2-locked)"),a=n.next(".select2-search-choice:not(.select2-locked)"),s=function(t){var i=0,n=0;if("selectionStart"in(t=e(t)[0]))i=t.selectionStart,n=t.selectionEnd-i;else if("selection"in document){t.focus();var o=document.selection.createRange();n=document.selection.createRange().text.length,o.moveStart("character",-t.value.length),i=o.text.length-n}return{offset:i,length:n}}(this.search);if(n.length&&(i.which==p.LEFT||i.which==p.RIGHT||i.which==p.BACKSPACE||i.which==p.DELETE||i.which==p.ENTER)){var r=n;return i.which==p.LEFT&&o.length?r=o:i.which==p.RIGHT?r=a.length?a:null:i.which===p.BACKSPACE?this.unselect(n.first())&&(this.search.width(10),r=o.length?o:a):i.which==p.DELETE?this.unselect(n.first())&&(this.search.width(10),r=a.length?a:null):i.which==p.ENTER&&(r=null),this.selectChoice(r),k(i),void(r&&r.length||this.open())}if((i.which===p.BACKSPACE&&1==this.keydowns||i.which==p.LEFT)&&0==s.offset&&!s.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void k(i);if(this.selectChoice(null),this.opened())switch(i.which){case p.UP:case p.DOWN:return this.moveHighlight(i.which===p.UP?-1:1),void k(i);case p.ENTER:if(this.selectHighlighted(),"s2id_txtSearchServiceMain"==this.containerId&&"undefined"!=typeof _common&&void 0!==_common.GetChoiceForSeleect2){var l=_common.GetChoiceForSeleect2(e("#txtSearchServiceMain")).text;void 0!==l&&""!=l&&"undefined"!=typeof _common&&void 0!==_common.SetLocationBySearch&&_common.SetLocationBySearch(i)}return void k(i);case p.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case p.ESC:return this.cancel(i),void k(i)}if(i.which!==p.TAB&&!p.isControl(i)&&!p.isFunctionKey(i)&&i.which!==p.BACKSPACE&&i.which!==p.ESC){if(i.which===p.ENTER){if(!1===this.opts.openOnEnter)return;if(i.altKey||i.ctrlKey||i.shiftKey||i.metaKey)return}this.open(),i.which!==p.PAGE_UP&&i.which!==p.PAGE_DOWN||k(i),i.which===p.ENTER&&k(i)}}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("click",i,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",i,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active vagaro-dropdown-multilayer"),null!=document.getElementById("divLiveStreamLocationSearchPopUp")&&"undefind"!=typeof document.getElementById("divLiveStreamLocationSearchPopUp")&&"block"==document.getElementById("divLiveStreamLocationSearchPopUp").style.display&&this.dropdown.addClass("select-list-popup"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this._super.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),i=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(i>0?i:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this._super.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this._super.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var i=[],n=[],o=this;e(t).each(function(){v(o.id(this),i)<0&&(i.push(o.id(this)),n.push(this))}),t=n,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){o.addSelectedChoice(this)}),o.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts))&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,i){this.triggerSelect(e)&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.clearSearch(),this.updateResults(),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),i&&i.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(i){var n,o,a=!i.locked,s=e("<li class='select2-search-choice'>    <div></div>    <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),r=e("<li class='select2-search-choice select2-locked'><div></div></li>"),l=a?s:r,c=this.id(i),d=this.getVal();(n=this.opts.formatSelection(i,l.find("div"),this.opts.escapeMarkup))!=t&&l.find("div").replaceWith("<div>"+n+"</div>"),(o=this.opts.formatSelectionCssClass(i,l.find("div")))!=t&&l.addClass(o),a&&l.find(".select2-search-choice-close").on("mousedown",k).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),k(t),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),l.data("select2-data",i),l.insertBefore(this.searchContainer),d.push(c),this.setVal(d)},unselect:function(t){var i,n,o=this.getVal();if(0===(t=t.closest(".select2-search-choice")).length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(i=t.data("select2-data")){var a=e.Event("select2-removing");if(a.val=this.id(i),a.choice=i,this.opts.element.trigger(a),a.isDefaultPrevented())return!1;for(;(n=v(this.id(i),o))>=0;)o.splice(n,1),this.setVal(o),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}),!0}},postprocessResults:function(e,t,i){var n=this.getVal(),o=this.results.find(".select2-result"),a=this.results.find(".select2-result-with-children"),s=this;o.each2(function(e,t){v(s.id(t.data("select2-data")),n)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),a.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&!1!==i&&("s2id_txtSearchServiceMain"==this.containerId||"s2id_ddlLiveStreamClass"==this.containerId||"s2id_ddlServices"==this.containerId||"s2id_txtMobileService"==this.containerId||s.highlight(0)),!this.opts.createSearchChoice&&!o.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&T(s.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+x(s.opts.formatNoMatches,s.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-S(this.search)},resizeSearch:function(){var t,i,n,o,a=S(this.search);t=function(t){if(!r){var i=t[0].currentStyle||window.getComputedStyle(t[0],null);(r=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),e("body").append(r)}return r.text(t.val()),r.width()}(this.search)+10,i=this.search.offset().left,(o=(n=this.selection.width())-(i-this.selection.offset().left)-a)<t&&(o=n-a),o<40&&(o=n-a),o<=0&&(o=t),this.search.width(Math.floor(o))},getVal:function(){var e;return this.select?null===(e=this.select.val())?[]:e:C(e=this.opts.element.val(),this.opts.separator)},setVal:function(t){var i;this.select?this.select.val(t):(i=[],e(t).each(function(){v(this,i)<0&&i.push(this)}),this.opts.element.val(0===i.length?"":i.join(this.opts.separator)))},buildChangeDetails:function(e,t){t=t.slice(0),e=e.slice(0);for(var i=0;i<t.length;i++)for(var n=0;n<e.length;n++)f(this.opts.id(t[i]),this.opts.id(e[n]))&&(t.splice(i,1),i>0&&i--,e.splice(n,1),n--);return{added:t,removed:e}},val:function(i,n){var o,a=this;if(0===arguments.length)return this.getVal();if((o=this.data()).length||(o=[]),!i&&0!==i)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(n&&this.triggerChange({added:this.data(),removed:o}));if(this.setVal(i),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),n&&this.triggerChange(this.buildChangeDetails(o,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var i=e.map(t,a.id);a.setVal(i),a.updateSelection(t),a.clearSearch(),n&&a.triggerChange(a.buildChangeDetails(o,a.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],i=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(i.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,i){var n,o,a=this;if(0===arguments.length)return this.selection.children(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();o=this.data(),t||(t=[]),n=e.map(t,function(e){return a.opts.id(e)}),this.setVal(n),this.updateSelection(t),this.clearSearch(),i&&this.triggerChange(this.buildChangeDetails(o,this.data()))}}),a=o.extend({initContainer:function(){this._super.apply(this,arguments),this.search.on("native-change",this.bind(this.triggerChange)).on("input paste",this.bind(function(){this.setVal(this.search.val())}))},clearSearch:function(){},onSelect:function(e,t){this.triggerSelect(e)&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect&&this.close(),this.triggerChange({added:e}))},addSelectedChoice:function(e){this.setVal(e.text),this.search.val(e.text)},setVal:function(e){this.select?this.select.val(e):this.opts.element.val(e)}}),e.fn.select2=function(){var i,n,o,a,s,r=Array.prototype.slice.call(arguments,0),l=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search","onSelect"],c=["opened","isFocused","container","dropdown"],d=["val","data"],u={search:"externalSearch"};return this.each(function(){if(0===r.length||"object"==typeof r[0]){if((i=0===r.length?{}:e.extend({},r[0])).element=e(this),i.combobox)return void new window.Select2.class.combobox(i);"select"===i.element.get(0).tagName.toLowerCase()?s=i.element.prop("multiple"):(s=i.multiple||!1,"tags"in i&&(i.multiple=s=!0)),n=s?new window.Select2.class.multi(i):new window.Select2.class.single(i)}else{if("string"!=typeof r[0])throw"Invalid arguments to select2 plugin: "+r;if(v(r[0],l)<0)throw"Unknown method: "+r[0];if(a=t,(n=e(this).data("select2"))===t)return;if("container"===(o=r[0])?a=n.container:"dropdown"===o?a=n.dropdown:(u[o]&&(o=u[o]),a=n[o].apply(n,r.slice(1))),v(r[0],c)>=0||v(r[0],d)&&1==r.length)return!1}}),a===t?this:a},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,i,n){var o=[];return D(e.text,i.term,o,n),o.join("")},formatSelection:function(e,i,n){return e?n(e.text):t},sortResults:function(e,t,i){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(e,i){return t},formatMatches:function(e){return e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatEmptyMessage:function(){return""},formatInputTooShort:function(e,t){var i=t-e.length;return"Please enter "+i+" or more character"+(1==i?"":"s")},formatInputTooLong:function(e,t){var i=e.length-t;return"Please delete "+i+" character"+(1==i?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(e){return"Loading more results…"},formatPager:function(e){return""},formatSearching:function(){return"Searching…"},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==t?null:e.id},collapasable:!1,matcher:function(e,t,i){return g(""+t).toUpperCase().indexOf(g(""+e).toUpperCase())>=0==1&&(void 0!==i&&"object"==typeof i&&(i.isShow=!0),!0)},separator:",",tokenSeparators:[],tokenizer:function(e,i,n,o){var a,s,r,l,c,d=e,u=!1;if(!o.createSearchChoice||!o.tokenSeparators||o.tokenSeparators.length<1)return t;for(;;){for(s=-1,r=0,l=o.tokenSeparators.length;r<l&&(c=o.tokenSeparators[r],!((s=e.indexOf(c))>=0));r++);if(s<0)break;if(a=e.substring(0,s),e=e.substring(s+c.length),a.length>0&&(a=o.createSearchChoice.call(this,a,i))!==t&&null!==a&&o.id(a)!==t&&null!==o.id(a)){for(u=!1,r=0,l=i.length;r<l;r++)if(f(o.id(a),o.id(i[r]))){u=!0;break}u||n(a)}}return d!==e?e:void 0},escapeMarkup:I,blurOnChange:!1,selectOnBlur:!1,selectOnClick:!0,formContainer:"body",adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null},nextSearchTerm:function(e,i){return t},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){return!(e.opts.minimumResultsForSearch<0)}},e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:w,local:P,tags:A},util:{debounce:b,markMatch:D,escapeMarkup:I,stripDiacritics:g},class:{abstract:i,single:n,multi:o,combobox:a}}}function m(t){var i=e(document.createTextNode(""));t.before(i),i.before(t),i.remove()}function g(e){var t,i,n,o;if(!e||e.length<1)return e;for(t="",i=0,n=e.length;i<n;i++)o=e.charAt(i),t+=h[o]||o;return t}function v(e,t){for(var i=0,n=t.length;i<n;i+=1)if(f(e,t[i]))return i;return-1}function f(e,i){return e===i||e!==t&&i!==t&&(null!==e&&null!==i&&(e.constructor===String?e+""==i+"":i.constructor===String&&i+""==e+""))}function C(t,i){var n,o,a;if(null===t||t.length<1)return[];for(o=0,a=(n=t.split(i)).length;o<a;o+=1)n[o]=e.trim(n[o]);return n}function S(e){return e.outerWidth(!1)-e.width()}function y(i){var n="keyup-change-value";i.on("keydown",function(){e.data(i,n)===t&&e.data(i,n,i.val())}),i.on("keyup",function(){var o=e.data(i,n);o!==t&&i.val()!==o&&(e.removeData(i,n),i.trigger("keyup-change"))})}function b(e,i,n){var o;return n=n||t,function(){var t=arguments;window.clearTimeout(o),o=window.setTimeout(function(){i.apply(n,t)},e)}}function k(e){e.preventDefault(),e.stopPropagation()}function _(t,i,n){var o,a,s=[];(o=t.attr("class"))&&e((o=""+o).split(" ")).each2(function(){0===this.indexOf("select2-")&&s.push(this)}),(o=i.attr("class"))&&e((o=""+o).split(" ")).each2(function(){0!==this.indexOf("select2-")&&(a=n(this))&&s.push(a)}),t.attr("class",s.join(" "))}function D(e,t,i,n){var o=g(e.toUpperCase()).indexOf(g(t.toUpperCase())),a=t.length;o<0?i.push(n(e)):(i.push(n(e.substring(0,o))),i.push("<span class='select2-match'>"),i.push(n(e.substring(o,o+a))),i.push("</span>"),i.push(n(e.substring(o+a,e.length))))}function I(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function w(i){var n,o=null,a=i.quietMillis||100,s=i.url,r=i.minimumInputLengthForAjaxCall||0,l=this;return function(c){window.clearTimeout(n),n=window.setTimeout(function(){var n=i.data,a=s,d=i.transport||e.fn.select2.ajaxDefaults.transport,u={type:i.type||"GET",cache:i.cache||!1,jsonpCallback:i.jsonpCallback||t,dataType:i.dataType||"json"},p=e.extend({},e.fn.select2.ajaxDefaults.params,u);if(n=n?n.call(l,c.term,c.page,c.context):null,a="function"==typeof a?a.call(l,c.term,c.page,c.context):a,o&&"function"==typeof o.abort&&o.abort(),i.params&&(e.isFunction(i.params)?e.extend(p,i.params.call(l)):e.extend(p,i.params)),0==r||r<=n.searchText.length)e.extend(p,{url:a,dataType:i.dataType,data:n,success:function(e){var t=i.results(e,c.page);c.callback(t)}});else{var h=i.results(null,c.page);c.callback(h)}o=d.call(l,p)},a)}}function P(t){var i,n,o=t,a=function(e){return""+e.text};e.isArray(o)&&(o={results:n=o}),!1===e.isFunction(o)&&(n=o,o=function(){return n});var s=o();return s.text&&(a=s.text,e.isFunction(a)||(i=s.text,a=function(e){return e[i]})),function(t){var i,n=t.term,s={results:[]};""!==n?(i=function(o,s){var r,l;if((o=o[0]).children){for(l in r={},o)o.hasOwnProperty(l)&&(r[l]=o[l]);r.children=[],e(o.children).each2(function(e,t){i(t,r.children)}),(r.children.length||t.matcher(n,a(r),o))&&s.push(r)}else t.matcher(n,a(o),o)&&s.push(o)},e(o().results).each2(function(e,t){i(t,s.results)}),t.callback(s)):t.callback(o())}}function A(i){var n=e.isFunction(i);return function(o){var a=o.term,s={results:[]};e(n?i():i).each(function(){var e=this.text!==t,i=e?this.text:this;(""===a||o.matcher(a,i))&&s.results.push(e?this:{id:this,text:this})}),o.callback(s)}}function T(t,i){if(e.isFunction(t))return!0;if(!t)return!1;if("string"==typeof t)return!0;throw new Error(i+" must be a string, function, or falsy value")}function x(t){if(e.isFunction(t)){var i=Array.prototype.slice.call(arguments,1);return t.apply(null,i)}return t}function F(t){var i=0;return e.each(t,function(e,t){t.children?i+=F(t.children):i++}),i}}(jQuery),function(e){"use strict";function t(t,i){var n=this,o=t.attr("name")||i.name||"";t.parent().hide();var a=t.css("width");t.parent().show(),"0px"==a&&(a=t.outerWidth()+20),this.$el=t.hide(),this.options=i,this.$parent=e("<div"+e.map(["class","title"],function(e){var t=n.$el.attr(e)||"";return(t=("class"===e?"ms-parent"+(t?" ":""):"")+t)?" "+e+'="'+t+'"':""}).join("")+" />"),this.$choice=e('<button type="button" class="ms-choice"><span class="placeholder" style="color:'+i.placeholdercolor+';">'+i.placeholder+"</span><div></div></button>"),this.$drop=e('<div class="ms-drop '+i.position+'"></div>'),this.$el.after(this.$parent),this.$parent.append(this.$choice),this.$parent.append(this.$drop),this.$el.prop("disabled")&&this.$choice.addClass("disabled"),this.$parent.css("width",i.width||a),this.options.keepOpen||e("body").click(function(t){e(t.target)[0]!==n.$choice[0]&&e(t.target).parents(".ms-choice")[0]!==n.$choice[0]&&(e(t.target)[0]!==n.$drop[0]&&e(t.target).parents(".ms-drop")[0]===n.$drop[0]||!n.options.isOpen||n.close())}),this.selectAllName='name="selectAll'+o+'"',this.selectGroupName='name="selectGroup'+o+'"',this.selectItemName='name="selectItem'+o+'"'}t.prototype={constructor:t,init:function(){var t=this,i=[];this.options.filter&&i.push('<div class="ms-search">','<input type="text" autocomplete="off" autocorrect="off" autocapitilize="off" spellcheck="false">',"</div>"),i.push("<ul>"),this.options.selectAll&&!this.options.single&&i.push('<li class="ms-select-all ">',"<label>",'<input type="checkbox" '+this.selectAllName+" /> ",this.options.selectAllDelimiter[0]+this.options.selectAllText+this.options.selectAllDelimiter[1],"</label>","</li>"),e.each(this.$el.children(),function(e,n){i.push(t.optionToHtml(e,n))}),i.push('<li class="ms-no-results">'+this.options.noMatchesFound+"</li>"),i.push("</ul>"),this.$drop.html(i.join("")),this.$drop.find("ul").css("max-height",this.options.maxHeight+"px"),this.$drop.find(".multiple").css("width",this.options.multipleWidth+"px"),this.$searchInput=this.$drop.find(".ms-search input"),this.$selectAll=this.$drop.find("input["+this.selectAllName+"]"),this.$selectGroups=this.$drop.find("input["+this.selectGroupName+"]"),this.$selectItems=this.$drop.find("input["+this.selectItemName+"]:enabled"),this.$disableItems=this.$drop.find("input["+this.selectItemName+"]:disabled"),this.$noResults=this.$drop.find(".ms-no-results"),this.events(),this.updateSelectAll(!0),this.update(!0),this.options.isOpen&&this.open()},optionToHtml:function(t,i,n,o){var a,s=this,r=e(i),l=[],c=this.options.multiple,d=e.map(["class","title"],function(e,t){var i="class"===e&&c,n=r.attr(e)||"";return i||n?" "+e+'="'+(i?"multiple"+(n?" ":""):"")+n+'"':""}).join(""),u=this.options.single?"radio":"checkbox";if(r.is("option")){var p=r.val(),h=s.options.textTemplate(r),m=null!=s.$el.attr("multiple")?r.prop("selected"):"selected"==r.attr("selected"),g=this.options.styler(p)?' style="'+this.options.styler(p)+'"':"";a=o||r.prop("disabled"),this.options.blockSeparator>""&&this.options.blockSeparator==r.val()?l.push("<li"+d+g+">",'<label class="'+this.options.blockSeparator+(a?"disabled":"")+'">',h,"</label>","</li>"):l.push("<li"+d+g+">","<label"+(a?' class="disabled"':"")+">",'<input type="'+u+'" '+this.selectItemName+' value="'+p+'"'+(m?' checked="checked"':"")+(a?' disabled="disabled"':"")+(n?' data-group="'+n+'"':"")+"/> ",h,"</label>","</li>")}else if(!n&&r.is("optgroup")){var v="group_"+t,f=r.attr("label");a=r.prop("disabled"),l.push('<li class="group">','<label class="optgroup'+(a?" disabled":"")+'" data-group="'+v+'">',this.options.hideOptgroupCheckboxes?"":'<input type="checkbox" '+this.selectGroupName+(a?' disabled="disabled"':"")+" /> ",f,"</label>","</li>"),e.each(r.children(),function(e,t){l.push(s.optionToHtml(e,t,v,a))})}return l.join("")},events:function(){var t=this;function i(e){e.preventDefault(),t[t.options.isOpen?"close":"open"]()}var n=this.$el.parent().closest("label")[0]||e("label[for="+this.$el.attr("id")+"]")[0];n&&e(n).off("click").on("click",function(e){"label"===e.target.nodeName.toLowerCase()&&e.target===this&&(i(e),t.options.filter&&t.options.isOpen||t.focus(),e.stopPropagation())}),this.$choice.off("click").on("click",i).off("focus").on("focus",this.options.onFocus).off("blur").on("blur",this.options.onBlur),this.$parent.off("keydown").on("keydown",function(e){if(27===e.which)t.close(),t.$choice.focus()}),this.$searchInput.off("keydown").on("keydown",function(e){9===e.keyCode&&e.shiftKey&&t.close()}).off("keyup").on("keyup",function(e){if(t.options.filterAcceptOnEnter&&(13===e.which||32==e.which)&&t.$searchInput.val())return t.$selectAll.click(),t.close(),void t.focus();t.filter()}),this.$selectAll.off("click").on("click",function(){var i=e(this).prop("checked"),n=t.$selectItems.filter(":visible");n.length===t.$selectItems.length?t[i?"checkAll":"uncheckAll"]():(t.$selectGroups.prop("checked",i),n.prop("checked",i),t.options[i?"onCheckAll":"onUncheckAll"](),t.update()),i&&e(this).closest("li").addClass("selected")}),this.$selectGroups.off("click").on("click",function(){var i=e(this).parent().attr("data-group"),n=t.$selectItems.filter(":visible").filter('[data-group="'+i+'"]'),o=n.length!==n.filter(":checked").length;n.prop("checked",o),t.updateSelectAll(),t.update(),t.options.onOptgroupClick({label:e(this).parent().text(),checked:o,children:n.get()})}),this.$selectItems.off("click").on("click",function(){t.updateSelectAll(),t.update(),t.updateOptGroupSelect(),t.options.onClick({label:e(this).parent().text(),value:e(this).val(),checked:e(this).prop("checked")}),t.options.single&&t.options.isOpen&&!t.options.keepOpen&&t.close()})},open:function(){if(!this.$choice.hasClass("disabled")){if(this.options.isOpen=!0,this.$choice.find(">div").addClass("open"),this.$drop.show(),this.$selectAll.parent().show(),this.$noResults.hide(),0===this.$el.children().length&&(this.$selectAll.parent().hide(),this.$noResults.show()),this.options.container){var t=this.$drop.offset();this.$drop.appendTo(e(this.options.container)),this.$drop.offset({top:t.top,left:t.left})}this.options.filter&&(this.$searchInput.val(""),this.$searchInput.focus(),this.filter()),this.options.onOpen()}},close:function(){this.options.isOpen=!1,this.$choice.find(">div").removeClass("open"),this.$drop.hide(),this.options.container&&(this.$parent.append(this.$drop),this.$drop.css({top:"auto",left:"auto"})),this.options.onClose()},update:function(t){var i=this.getSelects(),n=this.$choice.find(">span");0===i.length?n.addClass("placeholder").html(this.options.placeholder):this.options.countSelected&&i.length<this.options.minimumCountSelected?n.removeClass("placeholder").html((this.options.displayValues?i:this.getSelects("text")).join(this.options.delimiter)):this.options.allSelected&&i.length===this.$selectItems.length+this.$disableItems.length?n.removeClass("placeholder").html(this.options.allSelected):(this.options.countSelected||this.options.etcaetera)&&i.length>this.options.minimumCountSelected?this.options.etcaetera?n.removeClass("placeholder").html((this.options.displayValues?i:this.getSelects("text").slice(0,this.options.minimumCountSelected)).join(this.options.delimiter)+"..."):n.removeClass("placeholder").html(this.options.countSelected.replace("#",i.length).replace("%",this.$selectItems.length+this.$disableItems.length)):n.removeClass("placeholder").html((this.options.displayValues?i:this.getSelects("text")).join(this.options.delimiter)),this.$el.val(this.getSelects()),this.$drop.find("li").removeClass("selected"),this.$drop.find("input["+this.selectItemName+"]:checked").each(function(){e(this).parents("li").first().addClass("selected")});var o=this.$selectItems;o.length===o.filter(":checked").length?this.$drop.find(".ms-select-all").addClass("selected"):this.$drop.find(".ms-select-all").removeClass("selected"),t||this.$el.trigger("change")},updateSelectAll:function(e){var t=this.$selectItems;e||(t=t.filter(":visible")),this.$selectAll.prop("checked",t.length&&t.length===t.filter(":checked").length),this.$selectAll.prop("checked")},updateOptGroupSelect:function(){var t=this.$selectItems.filter(":visible");e.each(this.$selectGroups,function(i,n){var o=e(n).parent().attr("data-group"),a=t.filter('[data-group="'+o+'"]');e(n).prop("checked",a.length&&a.length===a.filter(":checked").length)})},getSelects:function(t){var i=this,n=[],o=[];return this.$drop.find("input["+this.selectItemName+"]:checked").each(function(){n.push(e(this).parents("li").first().text()),o.push(e(this).val())}),"text"===t&&this.$selectGroups.length&&(n=[],this.$selectGroups.each(function(){var t=[],o=e.trim(e(this).parent().text()),a=e(this).parent().data("group"),s=i.$drop.find("["+i.selectItemName+'][data-group="'+a+'"]'),r=s.filter(":checked");if(0!==r.length){if(t.push("["),t.push(o),s.length>r.length){var l=[];r.each(function(){l.push(e(this).parent().text())}),t.push(": "+l.join(", "))}t.push("]"),n.push(t.join(""))}})),"text"===t?n:o},setSelects:function(t){var i=this;this.$selectItems.prop("checked",!1),e.each(t,function(e,t){i.$selectItems.filter('[value="'+t+'"]').prop("checked",!0)}),this.$selectAll.prop("checked",this.$selectItems.length===this.$selectItems.filter(":checked").length),this.update()},enable:function(){this.$choice.removeClass("disabled")},disable:function(){this.$choice.addClass("disabled")},checkAll:function(){this.$selectItems.prop("checked",!0),this.$selectGroups.prop("checked",!0),this.$selectAll.prop("checked",!0),this.update(),this.options.onCheckAll()},uncheckAll:function(){this.$selectItems.prop("checked",!1),this.$selectGroups.prop("checked",!1),this.$selectAll.prop("checked",!1),this.update(),this.options.onUncheckAll()},focus:function(){this.$choice.focus(),this.options.onFocus()},blur:function(){this.$choice.blur(),this.options.onBlur()},refresh:function(){this.init()},filter:function(){var t=this,i=e.trim(this.$searchInput.val()).toLowerCase();0===i.length?(this.$selectItems.parent().show(),this.$disableItems.parent().show(),this.$selectGroups.parent().show()):(this.$selectItems.each(function(){var t=e(this).parent();t[t.text().toLowerCase().indexOf(i)<0?"hide":"show"]()}),this.$disableItems.parent().hide(),this.$selectGroups.each(function(){var i=e(this).parent(),n=i.attr("data-group");i[0===t.$selectItems.filter(":visible").filter('[data-group="'+n+'"]').length?"hide":"show"]()}),this.$selectItems.filter(":visible").length?(this.$selectAll.parent().show(),this.$noResults.hide()):(this.$selectAll.parent().hide(),this.$noResults.show())),this.updateOptGroupSelect(),this.updateSelectAll()}},e.fn.multipleSelect=function(){var i,n=arguments[0],o=arguments,a=["getSelects","setSelects","enable","disable","checkAll","uncheckAll","focus","blur","refresh"];return this.each(function(){var s=e(this),r=s.data("multipleSelect"),l=e.extend({},e.fn.multipleSelect.defaults,s.data(),"object"==typeof n&&n);if(r||(r=new t(s,l),s.data("multipleSelect",r)),"string"==typeof n){if(e.inArray(n,a)<0)throw"Unknown method: "+n;i=r[n](o[1])}else r.init(),o[1]&&(i=r[o[1]].apply(r,[].slice.call(o,2)))}),i||this},e.fn.multipleSelect.defaults={name:"",isOpen:!1,placeholder:"",selectAll:!0,selectAllText:"Select all",selectAllDelimiter:["[","]"],allSelected:"All selected",minimumCountSelected:3,countSelected:"# of % selected",noMatchesFound:"No matches found",multiple:!1,multipleWidth:80,single:!1,filter:!1,width:void 0,maxHeight:250,container:null,position:"bottom",keepOpen:!1,blockSeparator:"",displayValues:!1,delimiter:", ",styler:function(){return!1},textTemplate:function(e){return e.text()},onOpen:function(){return!1},onClose:function(){return!1},onCheckAll:function(){return!1},onUncheckAll:function(){return!1},onFocus:function(){return!1},onBlur:function(){return!1},onOptgroupClick:function(){return!1},onClick:function(){return!1}}}(jQuery),InfoBox.prototype=new google.maps.OverlayView,InfoBox.prototype.createInfoBoxDiv_=function(){var e,t,i,n=this,o=function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),void 0===this.content_.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!==this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(i=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-i.left-i.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],t=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],e=0;e<t.length;e++)this.eventListeners_.push(google.maps.event.addDomListener(this.div_,t[e],o));this.eventListeners_.push(google.maps.event.addDomListener(this.div_,"mouseover",function(){this.style.cursor="default"}))}this.contextListener_=google.maps.event.addDomListener(this.div_,"contextmenu",function(e){e.returnValue=!1,e.preventDefault&&e.preventDefault(),n.enableEventPropagation_||o(e)}),google.maps.event.trigger(this,"domready")}},InfoBox.prototype.getCloseBoxImg_=function(){var e="";return""!==this.closeBoxURL_&&(e="<img",e+=" src='"+this.closeBoxURL_+"'",e+=" align=right",e+=" style='",e+=" position: relative;",e+=" cursor: pointer;",e+=" margin: "+this.closeBoxMargin_+";",e+="'>"),e},InfoBox.prototype.addClickHandler_=function(){var e;""!==this.closeBoxURL_?(e=this.div_.firstChild,this.closeListener_=google.maps.event.addDomListener(e,"click",this.getCloseClickHandler_())):this.closeListener_=null},InfoBox.prototype.getCloseClickHandler_=function(){var e=this;return function(t){t.cancelBubble=!0,t.stopPropagation&&t.stopPropagation(),google.maps.event.trigger(e,"closeclick"),e.close()}},InfoBox.prototype.panBox_=function(e){var t,i=0,n=0;if(!e&&(t=this.getMap())instanceof google.maps.Map){t.getBounds().contains(this.position_)||t.setCenter(this.position_),t.getBounds();var o=t.getDiv(),a=o.offsetWidth,s=o.offsetHeight,r=this.pixelOffset_.width,l=this.pixelOffset_.height,c=this.div_.offsetWidth,d=this.div_.offsetHeight,u=this.infoBoxClearance_.width,p=this.infoBoxClearance_.height,h=this.getProjection().fromLatLngToContainerPixel(this.position_);h.x<-r+u?i=h.x+r-u:h.x+c+r+u>a&&(i=h.x+c+r+u-a),this.alignBottom_?h.y<-l+p+d?n=h.y+l-p-d:h.y+l+p>s&&(n=h.y+l+p-s):h.y<-l+p?n=h.y+l-p:h.y+d+l+p>s&&(n=h.y+d+l+p-s),0===i&&0===n||(t.getCenter(),t.panBy(i,n))}},InfoBox.prototype.setBoxStyle_=function(){var e,t;if(this.div_){for(e in this.div_.className=this.boxClass_,this.div_.style.cssText="",t=this.boxStyle_)t.hasOwnProperty(e)&&(this.div_.style[e]=t[e]);this.div_.style.WebkitTransform="translateZ(0)",void 0!==this.div_.style.opacity&&""!==this.div_.style.opacity&&(this.div_.style.MsFilter='"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*this.div_.style.opacity+')"',this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},InfoBox.prototype.getBoxWidths_=function(){var e,t={top:0,bottom:0,left:0,right:0},i=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(e=i.ownerDocument.defaultView.getComputedStyle(i,""))&&(t.top=parseInt(e.borderTopWidth,10)||0,t.bottom=parseInt(e.borderBottomWidth,10)||0,t.left=parseInt(e.borderLeftWidth,10)||0,t.right=parseInt(e.borderRightWidth,10)||0):document.documentElement.currentStyle&&i.currentStyle&&(t.top=parseInt(i.currentStyle.borderTopWidth,10)||0,t.bottom=parseInt(i.currentStyle.borderBottomWidth,10)||0,t.left=parseInt(i.currentStyle.borderLeftWidth,10)||0,t.right=parseInt(i.currentStyle.borderRightWidth,10)||0),t},InfoBox.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},InfoBox.prototype.draw=function(){this.createInfoBoxDiv_();var e=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=e.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(e.y+this.pixelOffset_.height)+"px":this.div_.style.top=e.y+this.pixelOffset_.height+"px",this.div_.style.visibility=this.isHidden_?"hidden":"visible"},InfoBox.prototype.setOptions=function(e){void 0!==e.boxClass&&(this.boxClass_=e.boxClass,this.setBoxStyle_()),void 0!==e.boxStyle&&(this.boxStyle_=e.boxStyle,this.setBoxStyle_()),void 0!==e.content&&this.setContent(e.content),void 0!==e.disableAutoPan&&(this.disableAutoPan_=e.disableAutoPan),void 0!==e.maxWidth&&(this.maxWidth_=e.maxWidth),void 0!==e.pixelOffset&&(this.pixelOffset_=e.pixelOffset),void 0!==e.alignBottom&&(this.alignBottom_=e.alignBottom),void 0!==e.position&&this.setPosition(e.position),void 0!==e.zIndex&&this.setZIndex(e.zIndex),void 0!==e.closeBoxMargin&&(this.closeBoxMargin_=e.closeBoxMargin),void 0!==e.closeBoxURL&&(this.closeBoxURL_=e.closeBoxURL),void 0!==e.infoBoxClearance&&(this.infoBoxClearance_=e.infoBoxClearance),void 0!==e.isHidden&&(this.isHidden_=e.isHidden),void 0!==e.visible&&(this.isHidden_=!e.visible),void 0!==e.enableEventPropagation&&(this.enableEventPropagation_=e.enableEventPropagation),this.div_&&this.draw()},InfoBox.prototype.setContent=function(e){this.content_=e,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),void 0===e.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+e:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(e)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px",void 0===e.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+e:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(e))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},InfoBox.prototype.setPosition=function(e){this.position_=e,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},InfoBox.prototype.setZIndex=function(e){this.zIndex_=e,this.div_&&(this.div_.style.zIndex=e),google.maps.event.trigger(this,"zindex_changed")},InfoBox.prototype.setVisible=function(e){this.isHidden_=!e,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},InfoBox.prototype.getContent=function(){return this.content_},InfoBox.prototype.getPosition=function(){return this.position_},InfoBox.prototype.getZIndex=function(){return this.zIndex_},InfoBox.prototype.getVisible=function(){return void 0!==this.getMap()&&null!==this.getMap()&&!this.isHidden_},InfoBox.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},InfoBox.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},InfoBox.prototype.open=function(e,t){var i=this;t&&(this.position_="function"==typeof t.getPosition?t.getPosition():t.position instanceof google.maps.LatLng?t.position:new google.maps.LatLng("function"==typeof t.position.lat?t.position.lat():t.position.lat,"function"==typeof t.position.lng?t.position.lng():t.position.lng),this.moveListener_=google.maps.event.addListener(t,"position_changed",function(){i.setPosition("function"==typeof this.getPosition?this.getPosition():this.position)})),this.setMap(e),this.div_&&this.panBox_()},InfoBox.prototype.close=function(){var e;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(e=0;e<this.eventListeners_.length;e++)google.maps.event.removeListener(this.eventListeners_[e]);this.eventListeners_=null}this.moveListener_&&(google.maps.event.removeListener(this.moveListener_),this.moveListener_=null),this.contextListener_&&(google.maps.event.removeListener(this.contextListener_),this.contextListener_=null),this.setMap(null)},function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){"use strict";e.ui=e.ui||{},e.ui.version="1.13.0";var t,i,n,o,a,s,r,l,c,d,u,p,h,m=0,g=Array.prototype.hasOwnProperty,v=Array.prototype.slice;function f(e,t,i){return[parseFloat(e[0])*(c.test(e[0])?t/100:1),parseFloat(e[1])*(c.test(e[1])?i/100:1)]}function C(t,i){return parseInt(e.css(t,i),10)||0}function S(e){return null!=e&&e===e.window}e.cleanData=(t=e.cleanData,function(i){for(var n,o,a=0;null!=(o=i[a]);a++)(n=e._data(o,"events"))&&n.remove&&e(o).triggerHandler("remove");t(i)}),e.widget=function(t,i,n){var o,a,s,r={},l=t.split(".")[0],c=l+"-"+(t=t.split(".")[1]);return n||(n=i,i=e.Widget),Array.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr.pseudos[c.toLowerCase()]=function(t){return!!e.data(t,c)},e[l]=e[l]||{},o=e[l][t],a=e[l][t]=function(e,t){if(!this._createWidget)return new a(e,t);arguments.length&&this._createWidget(e,t)},e.extend(a,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),(s=new i).options=e.widget.extend({},s.options),e.each(n,function(e,t){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}r[e]="function"==typeof t?function(){var e,i=this._super,a=this._superApply;return this._super=n,this._superApply=o,e=t.apply(this,arguments),this._super=i,this._superApply=a,e}:t}),a.prototype=e.widget.extend(s,{widgetEventPrefix:o&&s.widgetEventPrefix||t},r,{constructor:a,namespace:l,widgetName:t,widgetFullName:c}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),e.widget.bridge(t,a),a},e.widget.extend=function(t){for(var i,n,o=v.call(arguments,1),a=0,s=o.length;a<s;a++)for(i in o[a])n=o[a][i],g.call(o[a],i)&&void 0!==n&&(e.isPlainObject(n)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],n):e.widget.extend({},n):t[i]=n);return t},e.widget.bridge=function(t,i){var n=i.prototype.widgetFullName||t;e.fn[t]=function(o){var a="string"==typeof o,s=v.call(arguments,1),r=this;return a?this.length||"instance"!==o?this.each(function(){var i,a=e.data(this,n);return"instance"===o?(r=a,!1):a?"function"!=typeof a[o]||"_"===o.charAt(0)?e.error("no such method '"+o+"' for "+t+" widget instance"):(i=a[o].apply(a,s))!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0:e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+o+"'")}):r=void 0:(s.length&&(o=e.widget.extend.apply(null,[o].concat(s))),this.each(function(){var t=e.data(this,n);t?(t.option(o||{}),t._init&&t._init()):e.data(this,n,new i(o,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=m++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,i){t._removeClass(i,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,o,a,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(n=t.split(".")).shift(),n.length){for(o=s[t]=e.widget.extend({},this.options[t]),a=0;a<n.length-1;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(t=n.pop(),1===arguments.length)return void 0===o[t]?null:o[t];o[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=i}return this._setOptions(s),this},_setOptions:function(e){for(var t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var i,n,o;for(i in t)o=this.classesElementLookup[i],t[i]!==this.options.classes[i]&&o&&o.length&&(n=e(o.get()),this._removeClass(o,i),n.addClass(this._classes({element:n,keys:i,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){var i=[],n=this;function o(o,a){for(var s,r=0;r<o.length;r++)s=n.classesElementLookup[o[r]]||e(),s=t.add?(t.element.each(function(t,i){e.map(n.classesElementLookup,function(e){return e}).some(function(e){return e.is(i)})||n._on(e(i),{remove:"_untrackClassesElement"})}),e(e.uniqueSort(s.get().concat(t.element.get())))):e(s.not(t.element).get()),n.classesElementLookup[o[r]]=s,i.push(o[r]),a&&t.classes[o[r]]&&i.push(t.classes[o[r]])}return(t=e.extend({element:this.element,classes:this.options.classes||{}},t)).keys&&o(t.keys.match(/\S+/g)||[],!0),t.extra&&o(t.extra.match(/\S+/g)||[]),i.join(" ")},_untrackClassesElement:function(t){var i=this;e.each(i.classesElementLookup,function(n,o){-1!==e.inArray(t.target,o)&&(i.classesElementLookup[n]=e(o.not(t.target).get()))}),this._off(e(t.target))},_removeClass:function(e,t,i){return this._toggleClass(e,t,i,!1)},_addClass:function(e,t,i){return this._toggleClass(e,t,i,!0)},_toggleClass:function(e,t,i,n){var o="string"==typeof e||null===e;return(i={extra:o?t:i,keys:o?e:t,element:o?this.element:e,add:n="boolean"==typeof n?n:i}).element.toggleClass(this._classes(i),n),this},_on:function(t,i,n){var o,a=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=o=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,o=this.widget()),e.each(n,function(n,s){function r(){if(t||!0!==a.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof s?a[s]:s).apply(a,arguments)}"string"!=typeof s&&(r.guid=s.guid=s.guid||r.guid||e.guid++);var l;n=(l=n.match(/^([\w:-]*)\s*(.*)$/))[1]+a.eventNamespace;(l=l[2])?o.on(n,l,r):i.on(n,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){var i=this;return setTimeout(function(){return("string"==typeof e?i[e]:e).apply(i,arguments)},t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,i,n){var o,a,s=this.options[t];if(n=n||{},(i=e.Event(i)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(o in a)o in i||(i[o]=a[o]);return this.element.trigger(i,n),!("function"==typeof s&&!1===s.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,o,a){var s,r=(o="string"==typeof o?{effect:o}:o)?!0!==o&&"number"!=typeof o&&o.effect||i:t;"number"==typeof(o=o||{})?o={duration:o}:!0===o&&(o={}),s=!e.isEmptyObject(o),o.complete=a,o.delay&&n.delay(o.delay),s&&e.effects&&e.effects.effect[r]?n[t](o):r!==t&&n[r]?n[r](o.duration,o.easing,a):n.queue(function(i){e(this)[t](),a&&a.call(n[0]),i()})}}),e.widget,n=Math.max,o=Math.abs,a=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,c=/%$/,d=e.fn.position,e.position={scrollbarWidth:function(){if(void 0!==i)return i;var t,n=e("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),o=n.children()[0];return e("body").append(n),t=o.offsetWidth,n.css("overflow","scroll"),t===(o=o.offsetWidth)&&(o=n[0].clientWidth),n.remove(),i=t-o},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),n=t.isWindow||t.isDocument?"":t.element.css("overflow-y");i="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=S(i[0]),o=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:o,offset:n||o?{left:0,top:0}:e(t).offset(),scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return d.apply(this,arguments);var i,c,u,p,h,m,g="string"==typeof(t=e.extend({},t)).of?e(document).find(t.of):e(t.of),v=e.position.getWithinInfo(t.within),y=e.position.getScrollInfo(v),b=(t.collision||"flip").split(" "),k={},_=9===(m=(_=g)[0]).nodeType?{width:_.width(),height:_.height(),offset:{top:0,left:0}}:S(m)?{width:_.width(),height:_.height(),offset:{top:_.scrollTop(),left:_.scrollLeft()}}:m.preventDefault?{width:0,height:0,offset:{top:m.pageY,left:m.pageX}}:{width:_.outerWidth(),height:_.outerHeight(),offset:_.offset()};return g[0].preventDefault&&(t.at="left top"),c=_.width,u=_.height,h=e.extend({},p=_.offset),e.each(["my","at"],function(){var e,i,n=(t[this]||"").split(" ");(n=1===n.length?a.test(n[0])?n.concat(["center"]):s.test(n[0])?["center"].concat(n):["center","center"]:n)[0]=a.test(n[0])?n[0]:"center",n[1]=s.test(n[1])?n[1]:"center",e=r.exec(n[0]),i=r.exec(n[1]),k[this]=[e?e[0]:0,i?i[0]:0],t[this]=[l.exec(n[0])[0],l.exec(n[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===t.at[0]?h.left+=c:"center"===t.at[0]&&(h.left+=c/2),"bottom"===t.at[1]?h.top+=u:"center"===t.at[1]&&(h.top+=u/2),i=f(k.at,c,u),h.left+=i[0],h.top+=i[1],this.each(function(){var a,s,r=e(this),l=r.outerWidth(),d=r.outerHeight(),m=C(this,"marginLeft"),S=C(this,"marginTop"),_=l+m+C(this,"marginRight")+y.width,D=d+S+C(this,"marginBottom")+y.height,I=e.extend({},h),w=f(k.my,r.outerWidth(),r.outerHeight());"right"===t.my[0]?I.left-=l:"center"===t.my[0]&&(I.left-=l/2),"bottom"===t.my[1]?I.top-=d:"center"===t.my[1]&&(I.top-=d/2),I.left+=w[0],I.top+=w[1],a={marginLeft:m,marginTop:S},e.each(["left","top"],function(n,o){e.ui.position[b[n]]&&e.ui.position[b[n]][o](I,{targetWidth:c,targetHeight:u,elemWidth:l,elemHeight:d,collisionPosition:a,collisionWidth:_,collisionHeight:D,offset:[i[0]+w[0],i[1]+w[1]],my:t.my,at:t.at,within:v,elem:r})}),t.using&&(s=function(e){var i=p.left-I.left,a=i+c-l,s=p.top-I.top,h=s+u-d,m={target:{element:g,left:p.left,top:p.top,width:c,height:u},element:{element:r,left:I.left,top:I.top,width:l,height:d},horizontal:a<0?"left":0<i?"right":"center",vertical:h<0?"top":0<s?"bottom":"middle"};c<l&&o(i+a)<c&&(m.horizontal="center"),u<d&&o(s+h)<u&&(m.vertical="middle"),n(o(i),o(a))>n(o(s),o(h))?m.important="horizontal":m.important="vertical",t.using.call(this,e,m)}),r.offset(e.extend(I,{using:s}))})},e.ui.position={fit:{left:function(e,t){var i=t.within,o=i.isWindow?i.scrollLeft:i.offset.left,a=i.width,s=e.left-t.collisionPosition.marginLeft,r=o-s,l=s+t.collisionWidth-a-o;t.collisionWidth>a?0<r&&l<=0?(i=e.left+r+t.collisionWidth-a-o,e.left+=r-i):e.left=!(0<l&&r<=0)&&l<r?o+a-t.collisionWidth:o:0<r?e.left+=r:0<l?e.left-=l:e.left=n(e.left-s,e.left)},top:function(e,t){var i=t.within,o=i.isWindow?i.scrollTop:i.offset.top,a=t.within.height,s=e.top-t.collisionPosition.marginTop,r=o-s,l=s+t.collisionHeight-a-o;t.collisionHeight>a?0<r&&l<=0?(i=e.top+r+t.collisionHeight-a-o,e.top+=r-i):e.top=!(0<l&&r<=0)&&l<r?o+a-t.collisionHeight:o:0<r?e.top+=r:0<l?e.top-=l:e.top=n(e.top-s,e.top)}},flip:{left:function(e,t){var i=(c=t.within).offset.left+c.scrollLeft,n=c.width,a=c.isWindow?c.scrollLeft:c.offset.left,s=(d=e.left-t.collisionPosition.marginLeft)-a,r=d+t.collisionWidth-n-a,l="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,c="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,d=-2*t.offset[0];s<0?((i=e.left+l+c+d+t.collisionWidth-n-i)<0||i<o(s))&&(e.left+=l+c+d):0<r&&(0<(a=e.left-t.collisionPosition.marginLeft+l+c+d-a)||o(a)<r)&&(e.left+=l+c+d)},top:function(e,t){var i=(c=t.within).offset.top+c.scrollTop,n=c.height,a=c.isWindow?c.scrollTop:c.offset.top,s=(d=e.top-t.collisionPosition.marginTop)-a,r=d+t.collisionHeight-n-a,l="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,c="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,d=-2*t.offset[1];s<0?((i=e.top+l+c+d+t.collisionHeight-n-i)<0||i<o(s))&&(e.top+=l+c+d):0<r&&(0<(a=e.top-t.collisionPosition.marginTop+l+c+d-a)||o(a)<r)&&(e.top+=l+c+d)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},e.ui.position,e.extend(e.expr.pseudos,{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])}}),e.fn.extend({disableSelection:(u="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(u+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}),e.ui.focusable=function(t,i){var n,o,a,s,r=t.nodeName.toLowerCase();return"area"===r?(o=(n=t.parentNode).name,!(!t.href||!o||"map"!==n.nodeName.toLowerCase())&&0<(o=e("img[usemap='#"+o+"']")).length&&o.is(":visible")):(/^(input|select|textarea|button|object)$/.test(r)?(a=!t.disabled)&&(s=e(t).closest("fieldset")[0])&&(a=!s.disabled):a="a"===r&&t.href||i,a&&e(t).is(":visible")&&function(e){for(var t=e.css("visibility");"inherit"===t;)t=(e=e.parent()).css("visibility");return"visible"===t}(e(t)))},e.extend(e.expr.pseudos,{focusable:function(t){return e.ui.focusable(t,null!=e.attr(t,"tabindex"))}}),e.ui.focusable,e.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):e(this[0].form)},e.ui.formResetMixin={_formResetHandler:function(){var t=e(this);setTimeout(function(){var i=t.data("ui-form-reset-instances");e.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){var e;this.form=this.element._form(),this.form.length&&((e=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(e.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},e.expr.pseudos||(e.expr.pseudos=e.expr[":"]),e.uniqueSort||(e.uniqueSort=e.unique),e.escapeSelector||(p=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,h=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},e.escapeSelector=function(e){return(e+"").replace(p,h)}),e.fn.even&&e.fn.odd||e.fn.extend({even:function(){return this.filter(function(e){return e%2==0})},odd:function(){return this.filter(function(e){return e%2==1})}}),e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.fn.labels=function(){var t,i,n;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(i=this.eq(0).parents("label"),(t=this.attr("id"))&&(n=(n=this.eq(0).parents().last()).add((n.length?n:this).siblings()),t="label[for='"+e.escapeSelector(t)+"']",i=i.add(n.find(t).addBack(t))),this.pushStack(i)):this.pushStack([])},e.fn.scrollParent=function(t){var i=this.css("position"),n="absolute"===i,o=t?/(auto|scroll|hidden)/:/(auto|scroll)/;t=this.parents().filter(function(){var t=e(this);return(!n||"static"!==t.css("position"))&&o.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&t.length?t:e(this[0].ownerDocument||document)},e.extend(e.expr.pseudos,{tabbable:function(t){var i=e.attr(t,"tabindex"),n=null!=i;return(!n||0<=i)&&e.ui.focusable(t,n)}}),e.fn.extend({uniqueId:(y=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++y)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var y,b=!1;function k(e,t,i){return t<=e&&e<t+i}e(document).on("mouseup",function(){b=!1}),e.widget("ui.mouse",{version:"1.13.0",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(i){if(!0===e.data(i.target,t.widgetName+".preventClickEvent"))return e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!b){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,n=1===t.which,o=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&e(t.target).closest(this.options.cancel).length;return!(n&&!o&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),b=!0))}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,b=!1,t.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.ui.plugin={add:function(t,i,n){var o,a=e.ui[t].prototype;for(o in n)a.plugins[o]=a.plugins[o]||[],a.plugins[o].push([i,n[o]])},call:function(e,t,i,n){var o,a=e.plugins[t];if(a&&(n||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(o=0;o<a.length;o++)e.options[a[o][0]]&&a[o][1].apply(e.element,i)}},e.ui.safeActiveElement=function(e){var t;try{t=e.activeElement}catch(i){t=e.body}return(t=t||e.body).nodeName?t:e.body},e.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&e(t).trigger("blur")},e.widget("ui.draggable",e.ui.mouse,{version:"1.13.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var i=this.options;return!(this.helper||i.disabled||0<e(t.target).closest(".ui-resizable-handle").length||(this.handle=this._getHandle(t),!this.handle||(this._blurActiveElement(t),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),0)))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=e.ui.safeActiveElement(this.document[0]);e(t.target).closest(i).length||e.ui.safeBlur(i)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){if(i=this._uiHash(),!1===this._trigger("drag",t,i))return this._mouseUp(new e.Event("mouseup",t)),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,n=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,n)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",t)&&i._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new e.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!e(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var i=this.options,n="function"==typeof i.helper;return(t=n?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element).parents("body").length||t.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),"left"in(e=Array.isArray(e)?{left:+e[0],top:+e[1]||0}:e)&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n,o=this.options,a=this.document[0];this.relativeContainer=null,o.containment?"window"!==o.containment?"document"!==o.containment?o.containment.constructor!==Array?("parent"===o.containment&&(o.containment=this.helper[0].parentNode),(n=(i=e(o.containment))[0])&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i)):this.containment=o.containment:this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(e,t){t=t||this.position;var i="absolute"===e?1:-1;e=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:e?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:e?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,n=this.options,o=this._isRootNode(this.scrollParent[0]),a=e.pageX,s=e.pageY;return o&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,e.pageX-this.offset.click.left<i[0]&&(a=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(s=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(a=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(s=i[3]+this.offset.click.top)),n.grid&&(e=n.grid[1]?this.originalPageY+Math.round((s-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY,s=!i||e-this.offset.click.top>=i[1]||e-this.offset.click.top>i[3]?e:e-this.offset.click.top>=i[1]?e-n.grid[1]:e+n.grid[1],e=n.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX,a=!i||e-this.offset.click.left>=i[0]||e-this.offset.click.left>i[2]?e:e-this.offset.click.left>=i[0]?e-n.grid[0]:e+n.grid[0]),"y"===n.axis&&(a=this.originalPageX),"x"===n.axis&&(s=this.originalPageY)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:o?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:o?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,n){return n=n||this._uiHash(),e.ui.plugin.call(this,t,[i,n,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),n.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,n){var o=e.extend({},i,{item:n.element});n.sortables=[],e(n.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(n.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,o))})},stop:function(t,i,n){var o=e.extend({},i,{item:n.element});n.cancelHelperRemoval=!1,e.each(n.sortables,function(){var e=this;e.isOver?(e.isOver=0,n.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,o))})},drag:function(t,i,n){e.each(n.sortables,function(){var o=!1,a=this;a.positionAbs=n.positionAbs,a.helperProportions=n.helperProportions,a.offset.click=n.offset.click,a._intersectsWith(a.containerCache)&&(o=!0,e.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,o=(this===a||!this._intersectsWith(this.containerCache)||!e.contains(a.element[0],this.element[0]))&&o})),o?(a.isOver||(a.isOver=1,n._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=n.offset.click.top,a.offset.click.left=n.offset.click.left,a.offset.parent.left-=n.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=n.offset.parent.top-a.offset.parent.top,n._trigger("toSortable",t),n.dropped=a.element,e.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,a.fromOutside=n),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(n._parent),n._refreshOffsets(t),i.position=n._generatePosition(t,!0),n._trigger("fromSortable",t),n.dropped=!1,e.each(n.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,n){var o=e("body");n=n.options;o.css("cursor")&&(n._cursor=o.css("cursor")),o.css("cursor",n.cursor)},stop:function(t,i,n){(n=n.options)._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,n){i=e(i.helper),n=n.options,i.css("opacity")&&(n._opacity=i.css("opacity")),i.css("opacity",n.opacity)},stop:function(t,i,n){(n=n.options)._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,n){var o=n.options,a=!1,s=n.scrollParentNotHidden[0],r=n.document[0];s!==r&&"HTML"!==s.tagName?(o.axis&&"x"===o.axis||(n.overflowOffset.top+s.offsetHeight-t.pageY<o.scrollSensitivity?s.scrollTop=a=s.scrollTop+o.scrollSpeed:t.pageY-n.overflowOffset.top<o.scrollSensitivity&&(s.scrollTop=a=s.scrollTop-o.scrollSpeed)),o.axis&&"y"===o.axis||(n.overflowOffset.left+s.offsetWidth-t.pageX<o.scrollSensitivity?s.scrollLeft=a=s.scrollLeft+o.scrollSpeed:t.pageX-n.overflowOffset.left<o.scrollSensitivity&&(s.scrollLeft=a=s.scrollLeft-o.scrollSpeed))):(o.axis&&"x"===o.axis||(t.pageY-e(r).scrollTop()<o.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<o.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+o.scrollSpeed))),o.axis&&"y"===o.axis||(t.pageX-e(r).scrollLeft()<o.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<o.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+o.scrollSpeed)))),!1!==a&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(n,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,n){var o=n.options;n.snapElements=[],e(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var t=e(this),i=t.offset();this!==n.element[0]&&n.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,n){for(var o,a,s,r,l,c,d,u,p,h=n.options,m=h.snapTolerance,g=i.offset.left,v=g+n.helperProportions.width,f=i.offset.top,C=f+n.helperProportions.height,S=n.snapElements.length-1;0<=S;S--)c=(l=n.snapElements[S].left-n.margins.left)+n.snapElements[S].width,u=(d=n.snapElements[S].top-n.margins.top)+n.snapElements[S].height,v<l-m||c+m<g||C<d-m||u+m<f||!e.contains(n.snapElements[S].item.ownerDocument,n.snapElements[S].item)?(n.snapElements[S].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,t,e.extend(n._uiHash(),{snapItem:n.snapElements[S].item})),n.snapElements[S].snapping=!1):("inner"!==h.snapMode&&(o=Math.abs(d-C)<=m,a=Math.abs(u-f)<=m,s=Math.abs(l-v)<=m,r=Math.abs(c-g)<=m,o&&(i.position.top=n._convertPositionTo("relative",{top:d-n.helperProportions.height,left:0}).top),a&&(i.position.top=n._convertPositionTo("relative",{top:u,left:0}).top),s&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l-n.helperProportions.width}).left),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:c}).left)),p=o||a||s||r,"outer"!==h.snapMode&&(o=Math.abs(d-f)<=m,a=Math.abs(u-C)<=m,s=Math.abs(l-g)<=m,r=Math.abs(c-v)<=m,o&&(i.position.top=n._convertPositionTo("relative",{top:d,left:0}).top),a&&(i.position.top=n._convertPositionTo("relative",{top:u-n.helperProportions.height,left:0}).top),s&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l}).left),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:c-n.helperProportions.width}).left)),!n.snapElements[S].snapping&&(o||a||s||r||p)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,t,e.extend(n._uiHash(),{snapItem:n.snapElements[S].item})),n.snapElements[S].snapping=o||a||s||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,n){var o;n=n.options,n=e.makeArray(e(n.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});n.length&&(o=parseInt(e(n[0]).css("zIndex"),10)||0,e(n).each(function(t){e(this).css("zIndex",o+t)}),this.css("zIndex",o+n.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,n){i=e(i.helper),n=n.options,i.css("zIndex")&&(n._zIndex=i.css("zIndex")),i.css("zIndex",n.zIndex)},stop:function(t,i,n){(n=n.options)._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.droppable",{version:"1.13.0",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof i?i:function(e){return e.is(i)},this.proportions=function(){if(!arguments.length)return e=e||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};e=arguments[0]},this._addToManager(t.scope),t.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;t<e.length;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,i){var n;"accept"===t?this.accept="function"==typeof i?i:function(e){return e.is(i)}:"scope"===t&&(n=e.ui.ddmanager.droppables[this.options.scope],this._splice(n),this._addToManager(i)),this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var n=i||e.ui.ddmanager.current,o=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");if(i.options.greedy&&!i.options.disabled&&i.options.scope===n.options.scope&&i.accept.call(i.element[0],n.currentItem||n.element)&&e.ui.intersect(n,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t))return!(o=!0)}),!o&&!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(n)),this.element))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),e.ui.intersect=function(e,t,i,n){if(!t.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,s=o+e.helperProportions.width,r=a+e.helperProportions.height,l=t.offset.left,c=t.offset.top,d=l+t.proportions().width,u=c+t.proportions().height;switch(i){case"fit":return l<=o&&s<=d&&c<=a&&r<=u;case"intersect":return l<o+e.helperProportions.width/2&&s-e.helperProportions.width/2<d&&c<a+e.helperProportions.height/2&&r-e.helperProportions.height/2<u;case"pointer":return k(n.pageY,c,t.proportions().height)&&k(n.pageX,l,t.proportions().width);case"touch":return(c<=a&&a<=u||c<=r&&r<=u||a<c&&u<r)&&(l<=o&&o<=d||l<=s&&s<=d||o<l&&d<s);default:return!1}},!(e.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,i){var n,o,a=e.ui.ddmanager.droppables[t.options.scope]||[],s=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<a.length;n++)if(!(a[n].options.disabled||t&&!a[n].accept.call(a[n].element[0],t.currentItem||t.element))){for(o=0;o<r.length;o++)if(r[o]===a[n].element[0]){a[n].proportions().height=0;continue e}a[n].visible="none"!==a[n].element.css("display"),a[n].visible&&("mousedown"===s&&a[n]._activate.call(a[n],i),a[n].offset=a[n].element.offset(),a[n].proportions({width:a[n].element[0].offsetWidth,height:a[n].element[0].offsetHeight}))}},drop:function(t,i){var n=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(n=this._drop.call(this,i)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),n},dragStart:function(t,i){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){var n,o,a,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(a=e.ui.intersect(t,this,this.options.tolerance,i))&&this.isover?"isout":a&&!this.isover?"isover":null)&&(this.options.greedy&&(o=this.options.scope,(a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===o})).length&&((n=e(a[0]).droppable("instance")).greedyChild="isover"===s)),n&&"isover"===s&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,i),n&&"isout"===s&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))})},dragStop:function(t,i){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}})!==e.uiBackCompat&&e.widget("ui.droppable",e.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),e.ui.droppable,e.widget("ui.resizable",e.ui.mouse,{version:"1.13.0",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseFloat(e)||0},_isNumber:function(e){return!isNaN(parseFloat(e))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop";i=!1;if(0<t[n])return!0;try{t[n]=1,i=0<t[n],t[n]=0}catch(t){}return i},_create:function(){var t,i=this.options,n=this;this._addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),i.autoHide&&e(this.element).on("mouseenter",function(){i.disabled||(n._removeClass("ui-resizable-autohide"),n._handles.show())}).on("mouseleave",function(){i.disabled||n.resizing||(n._addClass("ui-resizable-autohide"),n._handles.hide())}),this._mouseInit()},_destroy:function(){function t(t){e(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var i;return this._mouseDestroy(),this._addedHandles.remove(),this.elementIsWrapper&&(t(this.element),i=this.element,this.originalElement.css({position:i.css("position"),width:i.outerWidth(),height:i.outerHeight(),top:i.css("top"),left:i.css("left")}).insertAfter(i),i.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(e,t){switch(this._super(e,t),e){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!t}},_setupHandles:function(){var t,i,n,o,a,s=this.options,r=this;if(this.handles=s.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this._addedHandles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i<n.length;i++)o="ui-resizable-"+(t=String.prototype.trim.call(n[i])),a=e("<div>"),this._addClass(a,"ui-resizable-handle "+o),a.css({zIndex:s.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(a),this._addedHandles=this._addedHandles.add(a));this._renderAxis=function(t){var i,n,o;for(i in t=t||this.element,this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(n=e(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=a&&a[1]?a[1]:"se")}),s.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var i,n,o=!1;for(i in this.handles)(n=e(this.handles[i])[0])!==t.target&&!e.contains(n,t.target)||(o=!0);return!this.options.disabled&&o},_mouseStart:function(t){var i,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),n=this._num(this.helper.css("top")),o.containment&&(i+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:n},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===o?this.axis+"-resize":o),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i=this.originalMousePosition,n=this.axis,o=t.pageX-i.left||0;i=t.pageY-i.top||0,n=this._change[n];return this._updatePrevProperties(),n&&(i=n.apply(this,[t,o,i]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),i=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(i)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var i,n,o,a=this.options,s=this;return this._helper&&(o=(i=(n=this._proportionallyResizeElements).length&&/textarea/i.test(n[0].nodeName))&&this._hasScroll(n[0],"left")?0:s.sizeDiff.height,n=i?0:s.sizeDiff.width,i={width:s.helper.width()-n,height:s.helper.height()-o},n=parseFloat(s.element.css("left"))+(s.position.left-s.originalPosition.left)||null,o=parseFloat(s.element.css("top"))+(s.position.top-s.originalPosition.top)||null,a.animate||this.element.css(e.extend(i,{top:o,left:n})),s.helper.height(s.size.height),s.helper.width(s.size.width),this._helper&&!a.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,n=this.options,o={minWidth:this._isNumber(n.minWidth)?n.minWidth:0,maxWidth:this._isNumber(n.maxWidth)?n.maxWidth:1/0,minHeight:this._isNumber(n.minHeight)?n.minHeight:0,maxHeight:this._isNumber(n.maxHeight)?n.maxHeight:1/0};(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,i=o.minWidth/this.aspectRatio,n=o.maxHeight*this.aspectRatio,e=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),i>o.minHeight&&(o.minHeight=i),n<o.maxWidth&&(o.maxWidth=n),e<o.maxHeight&&(o.maxHeight=e)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,n=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,n=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,o=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,s=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,c=/sw|nw|w/.test(i);i=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),s&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),o&&(e.height=t.maxHeight),a&&c&&(e.left=r-t.minWidth),n&&c&&(e.left=r-t.maxWidth),s&&i&&(e.top=l-t.minHeight),o&&i&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],n=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],o=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];t<4;t++)i[t]=parseFloat(n[t])||0,i[t]+=parseFloat(o[t])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;t<this._proportionallyResizeElements.length;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize;return{left:this.originalPosition.left+t,width:i.width-t}},n:function(e,t,i){var n=this.originalSize;return{top:this.originalPosition.top+i,height:n.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},sw:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,n]))},ne:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},nw:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,n]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),n=i.options,o=i._proportionallyResizeElements,a=(r=o.length&&/textarea/i.test(o[0].nodeName))&&i._hasScroll(o[0],"left")?0:i.sizeDiff.height,s=r?0:i.sizeDiff.width,r={width:i.size.width-s,height:i.size.height-a};s=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,a=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(r,a&&s?{top:a,left:s}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};o&&o.length&&e(o[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,n=e(this).resizable("instance"),o=n.options,a=n.element,s=o.containment,r=s instanceof e?s.get(0):/parent/.test(s)?a.parent().get(0):s;r&&(n.containerElement=e(r),/document/.test(s)||s===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(r),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,o){i[e]=n._num(t.css("padding"+o))}),n.containerOffset=t.offset(),n.containerPosition=t.position(),n.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},o=n.containerOffset,a=n.containerSize.height,s=n.containerSize.width,s=n._hasScroll(r,"left")?r.scrollWidth:s,a=n._hasScroll(r)?r.scrollHeight:a,n.parentData={element:r,left:o.left,top:o.top,width:s,height:a}))},resize:function(t){var i=e(this).resizable("instance"),n=i.options,o=i.containerOffset,a=i.position,s=i._aspectRatio||t.shiftKey,r={top:0,left:0},l=i.containerElement;t=!0;l[0]!==document&&/static/.test(l.css("position"))&&(r=o),a.left<(i._helper?o.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-o.left:i.position.left-r.left),s&&(i.size.height=i.size.width/i.aspectRatio,t=!1),i.position.left=n.helper?o.left:0),a.top<(i._helper?o.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-o.top:i.position.top),s&&(i.size.width=i.size.height*i.aspectRatio,t=!1),i.position.top=i._helper?o.top:0),n=i.containerElement.get(0)===i.element.parent().get(0),a=/relative|absolute/.test(i.containerElement.css("position")),n&&a?(i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top):(i.offset.left=i.element.offset().left,i.offset.top=i.element.offset().top),a=Math.abs(i.sizeDiff.width+(i._helper?i.offset.left-r.left:i.offset.left-o.left)),o=Math.abs(i.sizeDiff.height+(i._helper?i.offset.top-r.top:i.offset.top-o.top)),a+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-a,s&&(i.size.height=i.size.width/i.aspectRatio,t=!1)),o+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-o,s&&(i.size.width=i.size.height*i.aspectRatio,t=!1)),t||(i.position.left=i.prevPosition.left,i.position.top=i.prevPosition.top,i.size.width=i.prevSize.width,i.size.height=i.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,n=t.containerOffset,o=t.containerPosition,a=t.containerElement,s=(l=e(t.helper)).offset(),r=l.outerWidth()-t.sizeDiff.width,l=l.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:s.left-o.left-n.left,width:r,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:s.left-o.left-n.left,width:r,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance").options;e(t.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var n=e(this).resizable("instance"),o=n.options,a=n.originalSize,s=n.originalPosition,r={height:n.size.height-a.height||0,width:n.size.width-a.width||0,top:n.position.top-s.top||0,left:n.position.left-s.left||0};e(o.alsoResize).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),o={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&0<=i&&(o[t]=i||null)}),t.css(o)})},stop:function(){e(this).removeData("ui-resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==e.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),n=i.options,o=i.size,a=i.originalSize,s=i.originalPosition,r=i.axis,l="number"==typeof n.grid?[n.grid,n.grid]:n.grid,c=l[0]||1,d=l[1]||1,u=Math.round((o.width-a.width)/c)*c,p=Math.round((o.height-a.height)/d)*d,h=a.width+u,m=a.height+p,g=n.maxWidth&&n.maxWidth<h,v=n.maxHeight&&n.maxHeight<m,f=n.minWidth&&n.minWidth>h;o=n.minHeight&&n.minHeight>m;n.grid=l,f&&(h+=c),o&&(m+=d),g&&(h-=c),v&&(m-=d),/^(se|s|e)$/.test(r)?(i.size.width=h,i.size.height=m):/^(ne)$/.test(r)?(i.size.width=h,i.size.height=m,i.position.top=s.top-p):/^(sw)$/.test(r)?(i.size.width=h,i.size.height=m,i.position.left=s.left-u):((m-d<=0||h-c<=0)&&(t=i._getPaddingPlusBorderDimensions(this)),0<m-d?(i.size.height=m,i.position.top=s.top-p):(m=d-t.height,i.size.height=m,i.position.top=s.top+a.height-m),0<h-c?(i.size.width=h,i.position.left=s.left-u):(h=c-t.width,i.size.width=h,i.position.left=s.left+a.width-h))}}),e.ui.resizable,e.widget("ui.selectable",e.ui.mouse,{version:"1.13.0",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t.elementPos=e(t.element[0]).offset(),t.selectees=e(t.options.filter,t.element[0]),t._addClass(t.selectees,"ui-selectee"),t.selectees.each(function(){var i=e(this),n={left:(n=i.offset()).left-t.elementPos.left,top:n.top-t.elementPos.top};e.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=e("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(t){var i=this,n=this.options;this.opos=[t.pageX,t.pageY],this.elementPos=e(this.element[0]).offset(),this.options.disabled||(this.selectees=e(n.filter,this.element[0]),this._trigger("start",t),e(n.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=e.data(this,"selectable-item");n.startselected=!0,t.metaKey||t.ctrlKey||(i._removeClass(n.$element,"ui-selected"),n.selected=!1,i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",t,{unselecting:n.element}))}),e(t.target).parents().addBack().each(function(){var n,o=e.data(this,"selectable-item");if(o)return n=!t.metaKey&&!t.ctrlKey||!o.$element.hasClass("ui-selected"),i._removeClass(o.$element,n?"ui-unselecting":"ui-selected")._addClass(o.$element,n?"ui-selecting":"ui-unselecting"),o.unselecting=!n,o.selecting=n,(o.selected=n)?i._trigger("selecting",t,{selecting:o.element}):i._trigger("unselecting",t,{unselecting:o.element}),!1}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,n=this,o=this.options,a=this.opos[0],s=this.opos[1],r=t.pageX,l=t.pageY;return r<a&&(i=r,r=a,a=i),l<s&&(i=l,l=s,s=i),this.helper.css({left:a,top:s,width:r-a,height:l-s}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),c=!1,d={};i&&i.element!==n.element[0]&&(d.left=i.left+n.elementPos.left,d.right=i.right+n.elementPos.left,d.top=i.top+n.elementPos.top,d.bottom=i.bottom+n.elementPos.top,"touch"===o.tolerance?c=!(d.left>r||d.right<a||d.top>l||d.bottom<s):"fit"===o.tolerance&&(c=d.left>a&&d.right<r&&d.top>s&&d.bottom<l),c?(i.selected&&(n._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(n._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(n._addClass(i.$element,"ui-selecting"),i.selecting=!0,n._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,n._addClass(i.$element,"ui-selected"),i.selected=!0):(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),n._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(n._removeClass(i.$element,"ui-selected"),i.selected=!1,n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");i._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1,n.startselected=!1,i._trigger("unselected",t,{unselected:n.element})}),e(".ui-selecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");i._removeClass(n.$element,"ui-selecting")._addClass(n.$element,"ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,i._trigger("selected",t,{selected:n.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.13.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return t<=e&&e<t+i},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),e.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var e=this.items.length-1;0<=e;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var n=null,o=!1,a=this;return!(this.reverting||this.options.disabled||"static"===this.options.type||(this._refreshItems(t),e(t.target).parents().each(function(){if(e.data(this,a.widgetName+"-item")===a)return n=e(this),!1}),!(n=e.data(t.target,a.widgetName+"-item")===a?e(t.target):n)||this.options.handle&&!i&&(e(this.options.handle,n).find("*").addBack().each(function(){this===t.target&&(o=!0)}),!o)||(this.currentItem=n,this._removeCurrentsFromItems(),0)))},_mouseStart:function(t,i,n){var o,a,s=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=e("parent"!==s.appendTo?s.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),e.extend(this.offset,{parent:this._getParentOffset()}),s.containment&&this._setContainment(),s.cursor&&"auto"!==s.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",s.cursor),this.storedStylesheet=e("<style>*{ cursor: "+s.cursor+" !important; }</style>").appendTo(a)),s.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",s.zIndex)),s.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",s.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(o=this.containers.length-1;0<=o;o--)this.containers[o]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(e){var t=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<t.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+t.scrollSpeed:e.pageY-this.overflowOffset.top<t.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-t.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<t.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+t.scrollSpeed:e.pageX-this.overflowOffset.left<t.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-t.scrollSpeed)):(e.pageY-this.document.scrollTop()<t.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-t.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<t.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+t.scrollSpeed)),e.pageX-this.document.scrollLeft()<t.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-t.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<t.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+t.scrollSpeed))),i},_mouseDrag:function(t){var i,n,o,a,s=this.options;if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),this._contactContainers(t),null!==this.innermostContainer)for(s.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},i=this.items.length-1;0<=i;i--)if(o=(n=this.items[i]).item[0],(a=this._intersectsWithPointer(n))&&n.instance===this.currentContainer&&!(o===this.currentItem[0]||this.placeholder[1===a?"next":"prev"]()[0]===o||e.contains(this.placeholder[0],o)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],o))){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(t,n),this._trigger("change",t,this._uiHash());break}return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){var n,o,a,s;if(t)return e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert?(o=(n=this).placeholder.offset(),s={},(a=this.options.axis)&&"x"!==a||(s.left=o.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(s.top=o.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(s,parseInt(this.options.revert,10)||500,function(){n._clear(t)})):this._clear(t,i),!1},cancel:function(){if(this.dragging){this._mouseUp(new e.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&n.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!n.length&&t.key&&n.push(t.key+"="),n.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},i.each(function(){n.push(e(t.item||this).attr(t.attribute||"id")||"")}),n},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,n=this.positionAbs.top,o=n+this.helperProportions.height,a=e.left,s=a+e.width,r=e.top,l=r+e.height,c=this.offset.click.top,d=this.offset.click.left;c="x"===this.options.axis||r<n+c&&n+c<l,d="y"===this.options.axis||a<t+d&&t+d<s;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c&&d:a<t+this.helperProportions.width/2&&i-this.helperProportions.width/2<s&&r<n+this.helperProportions.height/2&&o-this.helperProportions.height/2<l},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height);e="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width);return!(!t||!e)&&(t=this.dragDirection.vertical,e=this.dragDirection.horizontal,this.floating?"right"===e||"down"===t?2:1:t&&("down"===t?2:1))},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),n=this.dragDirection.vertical;e=this.dragDirection.horizontal;return this.floating&&e?"right"===e&&i||"left"===e&&!i:n&&("down"===n&&t||"up"===n&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!=e&&(0<e?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!=e&&(0<e?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var i,n,o,a,s=[],r=[],l=this._connectWith();if(l&&t)for(i=l.length-1;0<=i;i--)for(n=(o=e(l[i],this.document[0])).length-1;0<=n;n--)(a=e.data(o[n],this.widgetFullName))&&a!==this&&!a.options.disabled&&r.push(["function"==typeof a.options.items?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);function c(){s.push(this)}for(r.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;0<=i;i--)r[i][0].each(c);return e(s)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;i<t.length;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,n,o,a,s,r,l,c,d=this.items,u=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(i=p.length-1;0<=i;i--)for(n=(o=e(p[i],this.document[0])).length-1;0<=n;n--)(a=e.data(o[n],this.widgetFullName))&&a!==this&&!a.options.disabled&&(u.push(["function"==typeof a.options.items?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;0<=i;i--)for(s=u[i][1],c=(r=u[i][n=0]).length;n<c;n++)(l=e(r[n])).data(this.widgetName+"-item",s),d.push({item:l,instance:s,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var i,n,o=this.items.length-1;0<=o;o--)i=this.items[o],this.currentContainer&&i.instance!==this.currentContainer&&i.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,i.item):i.item,t||(i.width=n.outerWidth(),i.height=n.outerHeight()),n=n.offset(),i.left=n.left,i.top=n.top)},refreshPositions:function(e){var t,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),null!==this.innermostContainer&&this._refreshItemPositions(e),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(t=this.containers.length-1;0<=t;t--)i=this.containers[t].element.offset(),this.containers[t].containerCache.left=i.left,this.containers[t].containerCache.top=i.top,this.containers[t].containerCache.width=this.containers[t].element.outerWidth(),this.containers[t].containerCache.height=this.containers[t].element.outerHeight();return this},_createPlaceholder:function(t){var i,n,o=(t=t||this).options;o.placeholder&&o.placeholder.constructor!==String||(i=o.placeholder,n=t.currentItem[0].nodeName.toLowerCase(),o.placeholder={element:function(){var o=e("<"+n+">",t.document[0]);return t._addClass(o,"ui-sortable-placeholder",i||t.currentItem[0].className)._removeClass(o,"ui-sortable-helper"),"tbody"===n?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(o)):"tr"===n?t._createTrPlaceholder(t.currentItem,o):"img"===n&&o.attr("src",t.currentItem.attr("src")),i||o.css("visibility","hidden"),o},update:function(e,a){i&&!o.forcePlaceholderSize||(a.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||a.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),a.width()||a.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(o.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),o.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var n=this;t.children().each(function(){e("<td>&#160;</td>",n.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){for(var i,n,o,a,s,r,l,c,d,u=null,p=null,h=this.containers.length-1;0<=h;h--)e.contains(this.currentItem[0],this.containers[h].element[0])||(this._intersectsWith(this.containers[h].containerCache)?u&&e.contains(this.containers[h].element[0],u.element[0])||(u=this.containers[h],p=h):this.containers[h].containerCache.over&&(this.containers[h]._trigger("out",t,this._uiHash(this)),this.containers[h].containerCache.over=0));if(this.innermostContainer=u)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,a=(c=u.floating||this._isFloating(this.currentItem))?"left":"top",s=c?"width":"height",d=c?"pageX":"pageY",i=this.items.length-1;0<=i;i--)e.contains(this.containers[p].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(r=this.items[i].item.offset()[a],l=!1,t[d]-r>this.items[i][s]/2&&(l=!0),Math.abs(t[d]-r)<n&&(n=Math.abs(t[d]-r),o=this.items[i],this.direction=l?"up":"down"));(o||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[p]?(o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var i=this.options;return(t="function"==typeof i.helper?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem).parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!i.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!i.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),"left"in(e=Array.isArray(e)?{left:+e[0],top:+e[1]||0}:e)&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),"document"!==n.containment&&"window"!==n.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),n="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(n?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(n?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i=i||this.position;var n="absolute"===t?1:-1,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;t=/(html|body)/i.test(o[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:o.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:o.scrollLeft())*n}},_generatePosition:function(t){var i=this.options,n=t.pageX,o=t.pageY,a="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(a[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(n=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(n=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(t=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-i.grid[1]:t+i.grid[1],t=this.originalPageX+Math.round((n-this.originalPageX)/i.grid[0])*i.grid[0],n=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-i.grid[0]:t+i.grid[0])),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:a.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:a.scrollLeft())}},_rearrange:function(e,t,i,n){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!n)})},_clear:function(e,t){this.reverting=!1;var i,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(e,t,i){return function(n){i._trigger(e,n,t._uiHash(t))}}for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)t||n.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(n.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(i=0;i<n.length;i++)n[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===e.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.13.0",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(e){return e.find("> li > :first-child").add(e.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t,i=this.options.icons;i&&(t=e("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+i.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,i.header)._addClass(t,null,i.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"!==e?("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons())):this._activate(t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,n=this.headers.length,o=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(o+1)%n];break;case i.LEFT:case i.UP:a=this.headers[(o-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[n-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),e(a).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=e()):!1===t.active?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,n=i.heightStyle,o=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),n=t.next(),o=n.uniqueId().attr("id");t.attr("aria-controls",o),n.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===n?(t=o.height(),this.element.siblings(":visible").each(function(){var i=e(this),n=i.css("position");"absolute"!==n&&"fixed"!==n&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===n&&(t=0,this.headers.next().each(function(){var i=e(this).is(":visible");i||e(this).show(),t=Math.max(t,e(this).css("height","").height()),i||e(this).hide()}).height(t))},_activate:function(t){(t=this._findActive(t)[0])!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,n=this.active,o=e(t.currentTarget),a=o[0]===n[0],s=a&&i.collapsible,r=s?e():o.next(),l=n.next();r={oldHeader:n,oldPanel:l,newHeader:s?e():o,newPanel:r};t.preventDefault(),a&&!i.collapsible||!1===this._trigger("beforeActivate",t,r)||(i.active=!s&&this.headers.index(o),this.active=a?e():o,this._toggle(r),this._removeClass(n,"ui-accordion-header-active","ui-state-active"),i.icons&&(n=n.children(".ui-accordion-header-icon"),this._removeClass(n,null,i.icons.activeHeader)._addClass(n,null,i.icons.header)),a||(this._removeClass(o,"ui-accordion-header-collapsed")._addClass(o,"ui-accordion-header-active","ui-state-active"),i.icons&&(a=o.children(".ui-accordion-header-icon"),this._removeClass(a,null,i.icons.header)._addClass(a,null,i.icons.activeHeader)),this._addClass(o.next(),"ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,n=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,t):(n.hide(),i.show(),this._toggleComplete(t)),n.attr({"aria-hidden":"true"}),n.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&n.length?n.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var n,o,a,s=this,r=0,l=e.css("box-sizing"),c=e.length&&(!t.length||e.index()<t.index()),d=this.options.animate||{},u=c&&d.down||d;c=function(){s._toggleComplete(i)};return o=(o="string"==typeof u?u:o)||u.easing||d.easing,a=(a="number"==typeof u?u:a)||u.duration||d.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:o,step:function(e,t){t.now=Math.round(e)}}),void e.hide().animate(this.showProps,{duration:a,easing:o,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===l&&(r+=i.now):"content"!==s.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-r),r=0)}})):t.animate(this.hideProps,a,o,c):e.animate(this.showProps,a,o,c)},_toggleComplete:function(e){var t=e.oldPanel,i=t.prev();this._removeClass(t,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.13.0",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault(),this._activateItem(e)},"click .ui-menu-item":function(t){var i=e(t.target),n=e(e.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&n.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this._menuItems().first();t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],e.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e,!0),this.mouseHandled=!1}})},_activateItem:function(t){var i,n;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},i=e(t.target).closest(".ui-menu-item"),n=e(t.currentTarget),i[0]===n[0]&&(n.is(".ui-state-active")||(this._removeClass(n.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,n))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=e(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var i,n,o,a=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:i=this.previousFilter||"",o=a=!1,n=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),n===i?o=!0:n=i+n,i=this._filterMenuItems(n),(i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i).length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&t.preventDefault()},_activate:function(e){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,i,n=this,o=this.options.icons.submenu,a=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),i=a.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.prev(),a=e("<span>").data("ui-menu-submenu-caret",!0);n._addClass(a,"ui-menu-icon","ui-icon "+o),i.attr("aria-haspopup","true").prepend(a),t.attr("aria-labelledby",i.attr("id"))}),this._addClass(i,"ui-menu","ui-widget ui-widget-content ui-front"),(t=a.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=e(this);n._isDivider(t)&&n._addClass(t,"ui-menu-divider","ui-widget-content")}),a=(i=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(a,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){var i;"icons"===e&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,t.submenu)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",String(e)),this._toggleClass(null,"ui-state-disabled",!!e)},focus:function(e,t){var i;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=t.children(".ui-menu")).length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,n,o;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,o=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-o,n=this.activeMenu.scrollTop(),o=this.activeMenu.height(),t=t.outerHeight(),i<0?this.activeMenu.scrollTop(n+i):o<i+t&&this.activeMenu.scrollTop(n+i-o+t))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",e,{item:this.active}),this.active=null)},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var n=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(t),this._removeClass(n.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=n},i?0:this.delay)},_close:function(e){(e=e||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this._menuItems(this.active.children(".ui-menu")).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(e){return(e||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(e,t,i){var n;(n=this.active?"first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").last():this.active[e+"All"](".ui-menu-item").first():n)&&n.length&&this.active||(n=this._menuItems(this.activeMenu)[t]()),this.focus(i,n)},nextPage:function(t){var i,n,o;this.active?this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,o=this.element.innerHeight(),0===e.fn.jquery.indexOf("3.2.")&&(o+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(i=e(this)).offset().top-n-o<0}),this.focus(t,i)):this.focus(t,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var i,n,o;this.active?this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,o=this.element.innerHeight(),0===e.fn.jquery.indexOf("3.2.")&&(o+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(i=e(this)).offset().top-n+o}),this.focus(t,i)):this.focus(t,this._menuItems(this.activeMenu).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");var i=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return i.test(String.prototype.trim.call(e(this).children(".ui-menu-item-wrapper").text()))})}}),e.widget("ui.autocomplete",{version:"1.13.0",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,n,o="textarea"===(a=this.element[0].nodeName.toLowerCase()),a="input"===a;this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(o){if(this.element.prop("readOnly"))i=n=t=!0;else{i=n=t=!1;var a=e.ui.keyCode;switch(o.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",o);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",o);break;case a.UP:t=!0,this._keyEvent("previous",o);break;case a.DOWN:t=!0,this._keyEvent("next",o);break;case a.ENTER:this.menu.active&&(t=!0,o.preventDefault(),this.menu.select(o));break;case a.TAB:this.menu.active&&this.menu.select(o);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(o),o.preventDefault());break;default:i=!0,this._searchTimeout(o)}}},keypress:function(n){if(t)return t=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||n.preventDefault());if(!i){var o=e.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:this._move("previousPage",n);break;case o.PAGE_DOWN:this._move("nextPage",n);break;case o.UP:this._keyEvent("previous",n);break;case o.DOWN:this._keyEvent("next",n)}}},input:function(e){if(n)return n=!1,void e.preventDefault();this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault()},menufocus:function(t,i){var n;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),(n=i.item.attr("aria-label")||n.value)&&String.prototype.trim.call(n).length&&(this.liveRegion.children().hide(),e("<div>").text(n).appendTo(this.liveRegion))},menuselect:function(t,i){var n=i.item.data("ui-autocomplete-item"),o=this.previous;this.element[0]!==e.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=o,this._delay(function(){this.previous=o,this.selectedItem=n})),!1!==this._trigger("select",t,{item:n})&&this._value(n.value),this.term=this._value(),this.close(t),this.selectedItem=n}}),this.liveRegion=e("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var i=this.menu.element[0];return t.target===this.element[0]||t.target===i||e.contains(i,t.target)},_closeOnClickOutside:function(e){this._isEventTargetInWidget(e)||this.close()},_appendTo:function(){var t=this.options.appendTo;return(t=(t=t&&(t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)))&&t[0]?t:this.element.closest(".ui-front, dialog")).length?t:this.document[0].body},_initSource:function(){var t,i,n=this;Array.isArray(this.options.source)?(t=this.options.source,this.source=function(i,n){n(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,o){n.xhr&&n.xhr.abort(),n.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){o(e)},error:function(){o([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),n=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;t&&(i||n)||(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):!1!==this._trigger("search",t)?this._search(e):void 0},_search:function(e){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=++this.requestIndex;return function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(e){e=e&&this._normalize(e),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var n=this;e.each(i,function(e,i){n._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<div>").text(i.label)).appendTo(t)},_move:function(e,t){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[e](t);this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())},_isContentEditable:function(e){if(!e.length)return!1;var t=e.prop("contentEditable");return"inherit"===t?this._isContentEditable(e.parent()):"true"===t}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var n=new RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return n.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(1<e?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(t).appendTo(this.liveRegion))}}),e.ui.autocomplete;var _,D,I,w=/ui-corner-([a-z]){2,6}/g;function P(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=A(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function A(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",i,function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,T)}function T(){e.datepicker._isDisabledDatepicker((D.inline?D.dpDiv.parent():D.input)[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function x(t,i){for(var n in e.extend(t,i),i)null==i[n]&&(t[n]=i[n]);return t}function F(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.controlgroup",{version:"1.13.0",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var t=this,i=[];e.each(this.options.items,function(n,o){var a,s={};if(o)return"controlgroupLabel"===n?((a=t.element.find(o)).each(function(){var t=e(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),t._addClass(a,null,"ui-widget ui-widget-content ui-state-default"),void(i=i.concat(a.get()))):void(e.fn[n]&&(s=t["_"+n+"Options"]?t["_"+n+"Options"]("middle"):{classes:{}},t.element.find(o).each(function(){var o=e(this),a=o[n]("instance"),r=e.widget.extend({},s);"button"===n&&o.parent(".ui-spinner").length||((a=a||o[n]()[n]("instance"))&&(r.classes=t._resolveClassesValues(r.classes,a)),o[n](r),r=o[n]("widget"),e.data(r[0],"ui-controlgroup-data",a||o[n]("instance")),i.push(r[0]))})))}),this.childWidgets=e(e.uniqueSort(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(t){this.childWidgets.each(function(){var i=e(this).data("ui-controlgroup-data");i&&i[t]&&i[t]()})},_updateCornerClass:function(e,t){t=this._buildSimpleOptions(t,"label").classes.label,this._removeClass(e,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(e,null,t)},_buildSimpleOptions:function(e,t){var i="vertical"===this.options.direction,n={classes:{}};return n.classes[t]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[e],n},_spinnerOptions:function(e){return(e=this._buildSimpleOptions(e,"ui-spinner")).classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(e){return this._buildSimpleOptions(e,"ui-button")},_checkboxradioOptions:function(e){return this._buildSimpleOptions(e,"ui-checkboxradio-label")},_selectmenuOptions:function(e){var t="vertical"===this.options.direction;return{width:t&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(t?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(t?"top":"left")},last:{"ui-selectmenu-button-open":t?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(t?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[e]}},_resolveClassesValues:function(t,i){var n={};return e.each(t,function(e){var o=i.options.classes[e]||"";o=String.prototype.trim.call(o.replace(w,""));n[e]=(o+" "+t[e]).replace(/\s+/g," ")}),n},_setOption:function(e,t){"direction"===e&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(e,t),"disabled"!==e?this.refresh():this._callChildMethod(t?"disable":"enable")},refresh:function(){var t,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),t=this.childWidgets,(t=this.options.onlyVisible?t.filter(":visible"):t).length&&(e.each(["first","last"],function(e,n){var o,a=t[n]().data("ui-controlgroup-data");a&&i["_"+a.widgetName+"Options"]?((o=i["_"+a.widgetName+"Options"](1===t.length?"only":n)).classes=i._resolveClassesValues(o.classes,a),a.element[a.widgetName](o)):i._updateCornerClass(t[n](),n)}),this._callChildMethod("refresh"))}}),e.widget("ui.checkboxradio",[e.ui.formResetMixin,{version:"1.13.0",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,i=this,n=this._super()||{};return this._readType(),t=this.element.labels(),this.label=e(t[t.length-1]),this.label.length||e.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=3===this.nodeType?e(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(n.disabled=t),n},_create:function(){var e=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),e&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||e.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,i="input[name='"+e.escapeSelector(t)+"']";return t?(this.form.length?e(this.form[0].elements).filter(i):e(i).filter(function(){return 0===e(this)._form().length})).not(this.element):e([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=e(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(e,t){if("label"!==e||t){if(this._super(e,t),"disabled"===e)return this._toggleClass(this.label,null,"ui-state-disabled",t),void(this.element[0].disabled=t);this.refresh()}},_updateIcon:function(t){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=e("<span>"),this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var e=this.label.contents().not(this.element[0]);this.icon&&(e=e.not(this.icon[0])),(e=this.iconSpace?e.not(this.iconSpace[0]):e).remove(),this.label.append(this.options.label)},refresh:function(){var e=this.element[0].checked,t=this.element[0].disabled;this._updateIcon(e),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),null!==this.options.label&&this._updateLabel(),t!==this.options.disabled&&this._setOptions({disabled:t})}}]),e.ui.checkboxradio,e.widget("ui.button",{version:"1.13.0",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var e,t=this._super()||{};return this.isInput=this.element.is("input"),null!=(e=this.element[0].disabled)&&(t.disabled=e),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(t.label=this.originalLabel),t},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===e.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,i){var n="iconPosition"!==t,o=n?this.options.iconPosition:i;t="top"===o||"bottom"===o;this.icon?n&&this._removeClass(this.icon,null,this.options.icon):(this.icon=e("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),n&&this._addClass(this.icon,null,i),this._attachIcon(o),t?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(o))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(e){this.icon[/^(?:end|bottom)/.test(e)?"before":"after"](this.iconSpace)},_attachIcon:function(e){this.element[/^(?:end|bottom)/.test(e)?"append":"prepend"](this.icon)},_setOptions:function(e){var t=(void 0===e.showLabel?this.options:e).showLabel,i=(void 0===e.icon?this.options:e).icon;t||i||(e.showLabel=!0),this._super(e)},_setOption:function(e,t){"icon"===e&&(t?this._updateIcon(e,t):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===e&&this._updateIcon(e,t),"showLabel"===e&&(this._toggleClass("ui-button-icon-only",null,!t),this._updateTooltip()),"label"===e&&(this.isInput?this.element.val(t):(this.element.html(t),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(e,t),"disabled"===e&&(this._toggleClass(null,"ui-state-disabled",t),(this.element[0].disabled=t)&&this.element.trigger("blur"))},refresh:function(){var e=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOptions({disabled:e}),this._updateTooltip()}}),!1!==e.uiBackCompat&&(e.widget("ui.button",e.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(e,t){"text"!==e?("showLabel"===e&&(this.options.text=t),"icon"===e&&(this.options.icons.primary=t),"icons"===e&&(t.primary?(this._super("icon",t.primary),this._super("iconPosition","beginning")):t.secondary&&(this._super("icon",t.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",t)}}),e.fn.button=(_=e.fn.button,function(t){var i="string"==typeof t,n=Array.prototype.slice.call(arguments,1),o=this;return i?this.length||"instance"!==t?this.each(function(){var i=e(this).attr("type"),a=e.data(this,"ui-"+("checkbox"!==i&&"radio"!==i?"button":"checkboxradio"));return"instance"===t?(o=a,!1):a?"function"!=typeof a[t]||"_"===t.charAt(0)?e.error("no such method '"+t+"' for button widget instance"):(i=a[t].apply(a,n))!==a&&void 0!==i?(o=i&&i.jquery?o.pushStack(i.get()):i,!1):void 0:e.error("cannot call methods on button prior to initialization; attempted to call method '"+t+"'")}):o=void 0:(n.length&&(t=e.widget.extend.apply(null,[t].concat(n))),this.each(function(){var i,n="checkbox"!==(i=e(this).attr("type"))&&"radio"!==i?"button":"checkboxradio";(i=e.data(this,"ui-"+n))?(i.option(t||{}),i._init&&i._init()):"button"!=n?e(this).checkboxradio(e.extend({icon:!1},t)):_.call(e(this),t)})),o}),e.fn.buttonset=function(){return e.ui.controlgroup||e.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.13.0"}}),e.extend(P.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return x(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var n,o=t.nodeName.toLowerCase(),a="div"===o||"span"===o;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(n=this._newInst(e(t),a)).settings=e.extend({},i||{}),"input"===o?this._connectDatepicker(t,n):a&&this._inlineDatepicker(t,n)},_newInst:function(t,i){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?A(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var n=e(t);i.append=e([]),i.trigger=e([]),n.hasClass(this.markerClassName)||(this._attachments(n,i),n.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var n,o=this._get(i,"appendText"),a=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span>").addClass(this._appendClass).text(o),t[a?"before":"after"](i.append)),t.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),"focus"!==(n=this._get(i,"showOn"))&&"both"!==n||t.on("focus",this._showDatepicker),"button"!==n&&"both"!==n||(o=this._get(i,"buttonText"),n=this._get(i,"buttonImage"),this._get(i,"buttonImageOnly")?i.trigger=e("<img>").addClass(this._triggerClass).attr({src:n,alt:o,title:o}):(i.trigger=e("<button type='button'>").addClass(this._triggerClass),n?i.trigger.html(e("<img>").attr({src:n,alt:o,title:o})):i.trigger.text(o)),t[a?"before":"after"](i.trigger),i.trigger.on("click",function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():(e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]&&e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(e){var t,i,n,o,a,s;this._get(e,"autoSize")&&!e.inline&&(a=new Date(2009,11,20),(s=this._get(e,"dateFormat")).match(/[DM]/)&&(t=function(e){for(o=n=i=0;o<e.length;o++)e[o].length>i&&(i=e[o].length,n=o);return n},a.setMonth(t(this._get(e,s.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,s.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length))},_inlineDatepicker:function(t,i){var n=e(t);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,n,o,a){var s,r=this._dialogInst;return r||(this.uuid+=1,s="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+s+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),e("body").append(this._dialogInput),(r=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},e.data(this._dialogInput[0],"datepicker",r)),x(r.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(r,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(s=document.documentElement.clientWidth,o=document.documentElement.clientHeight,i=document.documentElement.scrollLeft||document.body.scrollLeft,a=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[s/2-100+i,o/2-150+a]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),r.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",r),this},_destroyDatepicker:function(t){var i,n=e(t),o=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(o.append.remove(),o.trigger.remove(),n.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==i&&"span"!==i||n.removeClass(this.markerClassName).empty(),D===o&&(D=null,this._curInst=null))},_enableDatepicker:function(t){var i,n=e(t),o=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&("input"===(i=t.nodeName.toLowerCase())?(t.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==i&&"span"!==i||((n=n.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,n=e(t),o=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&("input"===(i=t.nodeName.toLowerCase())?(t.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==i&&"span"!==i||((n=n.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,n){var o,a,s=this._getInst(t);if(2===arguments.length&&"string"==typeof i)return"defaults"===i?e.extend({},e.datepicker._defaults):s?"all"===i?e.extend({},s.settings):this._get(s,i):null;o=i||{},"string"==typeof i&&((o={})[i]=n),s&&(this._curInst===s&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),i=this._getMinMaxDate(s,"min"),n=this._getMinMaxDate(s,"max"),x(s.settings,o),null!==i&&void 0!==o.dateFormat&&void 0===o.minDate&&(s.settings.minDate=this._formatDate(s,i)),null!==n&&void 0!==o.dateFormat&&void 0===o.maxDate&&(s.settings.maxDate=this._formatDate(s,n)),"disabled"in o&&(o.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),s),this._autoSize(s),this._setDate(s,a),this._updateAlternate(s),this._updateDatepicker(s))},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){(e=this._getInst(e))&&this._updateDatepicker(e)},_setDateDatepicker:function(e,t){(e=this._getInst(e))&&(this._setDate(e,t),this._updateDatepicker(e),this._updateAlternate(e))},_getDateDatepicker:function(e,t){return(e=this._getInst(e))&&!e.inline&&this._setDateFromField(e,t),e?this._getDate(e):null},_doKeyDown:function(t){var i,n,o=e.datepicker._getInst(t.target),a=!0,s=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),a=!1;break;case 13:return(n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",o.dpDiv))[0]&&e.datepicker._selectDay(t.target,o.selectedMonth,o.selectedYear,n[0]),(i=e.datepicker._get(o,"onSelect"))?(n=e.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[n,o])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,"stepBigMonths"):-e.datepicker._get(o,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,"stepBigMonths"):+e.datepicker._get(o,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),a=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),a=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,s?1:-1,"D"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(o,"stepBigMonths"):-e.datepicker._get(o,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),a=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,s?-1:1,"D"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(o,"stepBigMonths"):+e.datepicker._get(o,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),a=t.ctrlKey||t.metaKey;break;default:a=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):a=!1;a&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,n=e.datepicker._getInst(t.target);if(e.datepicker._get(n,"constrainInput"))return i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),n=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||n<" "||!i||-1<i.indexOf(n)},_doKeyUp:function(t){if((t=e.datepicker._getInst(t.target)).input.val()!==t.lastVal)try{e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,e.datepicker._getFormatConfig(t))&&(e.datepicker._setDateFromField(t),e.datepicker._updateAlternate(t),e.datepicker._updateDatepicker(t))}catch(t){}return!0},_showDatepicker:function(t){var i,n,o,a;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),e.datepicker._isDisabledDatepicker(t)||e.datepicker._lastInput===t||(a=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==a&&(e.datepicker._curInst.dpDiv.stop(!0,!0),a&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),!1!==(n=(o=e.datepicker._get(a,"beforeShow"))?o.apply(t,[t,a]):{})&&(x(a.settings,n),a.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(a),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),i=!1,e(t).parents().each(function(){return!(i|="fixed"===e(this).css("position"))}),o={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,a.dpDiv.empty(),a.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(a),o=e.datepicker._checkOffset(a,o,i),a.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":i?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),a.inline||(n=e.datepicker._get(a,"showAnim"),o=e.datepicker._get(a,"duration"),a.dpDiv.css("z-index",function(e){for(var t,i;e.length&&e[0]!==document;){if(("absolute"===(t=e.css("position"))||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[n]?a.dpDiv.show(n,e.datepicker._get(a,"showOptions"),o):a.dpDiv[n||"show"](n?o:null),e.datepicker._shouldFocusInput(a)&&a.input.trigger("focus"),e.datepicker._curInst=a)))},_updateDatepicker:function(t){this.maxRows=4,(D=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,n=this._getNumberOfMonths(t),o=n[1],a=t.dpDiv.find("."+this._dayOverClass+" a"),s=e.datepicker._get(t,"onUpdateDatepicker");0<a.length&&T.apply(a.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<o&&t.dpDiv.addClass("ui-datepicker-multi-"+o).css("width",17*o+"em"),t.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year").first().replaceWith(t.yearshtml),i=t.yearshtml=null},0)),s&&s.apply(t.input?t.input[0]:null,[t])},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,n){var o=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),s=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(n?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?o-s:0,i.left-=n&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=n&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+o>l&&o<l?Math.abs(i.left+o-l):0),i.top-=Math.min(i.top,i.top+a>c&&a<c?Math.abs(a+r):0),i},_findPos:function(t){for(var i=this._getInst(t),n=this._get(i,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.pseudos.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return[(i=e(t).offset()).left,i.top]},_hideDatepicker:function(t){var i,n,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),n=this._get(o,"duration"),t=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),n,t):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,t),i||t(),this._datepickerShowing=!1,(t=this._get(o,"onClose"))&&t.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var i;e.datepicker._curInst&&(i=e(t.target),t=e.datepicker._getInst(i[0]),(i[0].id===e.datepicker._mainDivId||0!==i.parents("#"+e.datepicker._mainDivId).length||i.hasClass(e.datepicker.markerClassName)||i.closest("."+e.datepicker._triggerClass).length||!e.datepicker._datepickerShowing||e.datepicker._inDialog&&e.blockUI)&&(!i.hasClass(e.datepicker.markerClassName)||e.datepicker._curInst===t)||e.datepicker._hideDatepicker())},_adjustDate:function(t,i,n){var o=e(t);t=this._getInst(o[0]);this._isDisabledDatepicker(o[0])||(this._adjustInstDate(t,i,n),this._updateDatepicker(t))},_gotoToday:function(t){var i=e(t),n=this._getInst(i[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(t=new Date,n.selectedDay=t.getDate(),n.drawMonth=n.selectedMonth=t.getMonth(),n.drawYear=n.selectedYear=t.getFullYear()),this._notifyChange(n),this._adjustDate(i)},_selectMonthYear:function(t,i,n){var o=e(t);(t=this._getInst(o[0]))["selected"+("M"===n?"Month":"Year")]=t["draw"+("M"===n?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(t),this._adjustDate(o)},_selectDay:function(t,i,n,o){var a=e(t);e(o).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||((a=this._getInst(a[0])).selectedDay=a.currentDay=parseInt(e("a",o).attr("data-date")),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=n,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){t=e(t),this._selectDate(t,"")},_selectDate:function(t,i){var n=e(t);t=this._getInst(n[0]);i=null!=i?i:this._formatDate(t),t.input&&t.input.val(i),this._updateAlternate(t),(n=this._get(t,"onSelect"))?n.apply(t.input?t.input[0]:null,[i,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var i,n,o=this._get(t,"altField");o&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),n=this._getDate(t),t=this.formatDate(i,n,this._getFormatConfig(t)),e(document).find(o).val(t))},noWeekends:function(e){return[0<(e=e.getDay())&&e<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),e=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((e-t)/864e5)/7)+1},parseDate:function(t,i,n){if(null==t||null==i)throw"Invalid arguments";if(""===(i="object"==typeof i?i.toString():i+""))return null;for(var o,a,s,r=0,l="string"!=typeof(l=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff)?l:(new Date).getFullYear()%100+parseInt(l,10),c=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,d=(n?n.dayNames:null)||this._defaults.dayNames,u=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,p=(n?n.monthNames:null)||this._defaults.monthNames,h=-1,m=-1,g=-1,v=-1,f=!1,C=function(e){return(e=k+1<t.length&&t.charAt(k+1)===e)&&k++,e},S=function(e){var t=C(e);t="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,t=new RegExp("^\\d{"+("y"===e?t:1)+","+t+"}");if(!(t=i.substring(r).match(t)))throw"Missing number at position "+r;return r+=t[0].length,parseInt(t[0],10)},y=function(t,n,o){var a=-1;n=e.map(C(t)?o:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(n,function(e,t){var n=t[1];if(i.substr(r,n.length).toLowerCase()===n.toLowerCase())return a=t[0],r+=n.length,!1}),-1!==a)return a+1;throw"Unknown name at position "+r},b=function(){if(i.charAt(r)!==t.charAt(k))throw"Unexpected literal at position "+r;r++},k=0;k<t.length;k++)if(f)"'"!==t.charAt(k)||C("'")?b():f=!1;else switch(t.charAt(k)){case"d":g=S("d");break;case"D":y("D",c,d);break;case"o":v=S("o");break;case"m":m=S("m");break;case"M":m=y("M",u,p);break;case"y":h=S("y");break;case"@":h=(s=new Date(S("@"))).getFullYear(),m=s.getMonth()+1,g=s.getDate();break;case"!":h=(s=new Date((S("!")-this._ticksTo1970)/1e4)).getFullYear(),m=s.getMonth()+1,g=s.getDate();break;case"'":C("'")?b():f=!0;break;default:b()}if(r<i.length&&(a=i.substr(r),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===h?h=(new Date).getFullYear():h<100&&(h+=(new Date).getFullYear()-(new Date).getFullYear()%100+(h<=l?0:-100)),-1<v)for(m=1,g=v;!(g<=(o=this._getDaysInMonth(h,m-1)));)m++,g-=o;if((s=this._daylightSavingAdjust(new Date(h,m-1,g))).getFullYear()!==h||s.getMonth()+1!==m||s.getDate()!==g)throw"Invalid date";return s},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function n(e,t,i){var n=""+t;if(d(e))for(;n.length<i;)n="0"+n;return n}function o(e,t,i,n){return(d(e)?n:i)[t]}var a,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,c=(i?i.monthNames:null)||this._defaults.monthNames,d=function(t){return(t=a+1<e.length&&e.charAt(a+1)===t)&&a++,t},u="",p=!1;if(t)for(a=0;a<e.length;a++)if(p)"'"!==e.charAt(a)||d("'")?u+=e.charAt(a):p=!1;else switch(e.charAt(a)){case"d":u+=n("d",t.getDate(),2);break;case"D":u+=o("D",t.getDay(),s,r);break;case"o":u+=n("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=n("m",t.getMonth()+1,2);break;case"M":u+=o("M",t.getMonth(),l,c);break;case"y":u+=d("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":d("'")?u+="'":p=!0;break;default:u+=e.charAt(a)}return u},_possibleChars:function(e){for(var t="",i=!1,n=function(t){return(t=o+1<e.length&&e.charAt(o+1)===t)&&o++,t},o=0;o<e.length;o++)if(i)"'"!==e.charAt(o)||n("'")?t+=e.charAt(o):i=!1;else switch(e.charAt(o)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":n("'")?t+="'":i=!0;break;default:t+=e.charAt(o)}return t},_get:function(e,t){return(void 0!==e.settings[t]?e.settings:this._defaults)[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),n=e.lastVal=e.input?e.input.val():null,o=this._getDefaultDate(e),a=o,s=this._getFormatConfig(e);try{a=this.parseDate(i,n,s)||o}catch(e){n=t?"":n}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=n?a.getDate():0,e.currentMonth=n?a.getMonth():0,e.currentYear=n?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,n){var o,a;i=null==i||""===i?n:"string"==typeof i?function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(i){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,o=n.getFullYear(),a=n.getMonth(),s=n.getDate(),r=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=r.exec(i);l;){switch(l[2]||"d"){case"d":case"D":s+=parseInt(l[1],10);break;case"w":case"W":s+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),s=Math.min(s,e.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),s=Math.min(s,e.datepicker._getDaysInMonth(o,a))}l=r.exec(i)}return new Date(o,a,s)}(i):"number"==typeof i?isNaN(i)?n:(o=i,(a=new Date).setDate(a.getDate()+o),a):new Date(i.getTime());return(i=i&&"Invalid Date"===i.toString()?n:i)&&(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0)),this._daylightSavingAdjust(i)},_daylightSavingAdjust:function(e){return e?(e.setHours(12<e.getHours()?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var n=!t,o=e.selectedMonth,a=e.selectedYear;t=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=t.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=t.getMonth(),e.drawYear=e.selectedYear=e.currentYear=t.getFullYear(),o===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(n?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),n="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(n,-i,"M")},next:function(){e.datepicker._adjustDate(n,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(n)},selectDay:function(){return e.datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(n,this,"Y"),!1}};e(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var i,n,o,a,s,r,l,c,d,u,p,h,m,g,v,f,C,S,y,b,k,_,D,I,w,P,A,T,x,F,$,O,M=new Date,B=this._daylightSavingAdjust(new Date(M.getFullYear(),M.getMonth(),M.getDate())),E=this._get(t,"isRTL"),L=this._get(t,"showButtonPanel"),N=this._get(t,"hideIfNoPrevNext"),U=this._get(t,"navigationAsDateFormat"),R=this._getNumberOfMonths(t),W=this._get(t,"showCurrentAtPos"),G=(M=this._get(t,"stepMonths"),1!==R[0]||1!==R[1]),V=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),H=this._getMinMaxDate(t,"min"),j=this._getMinMaxDate(t,"max"),Y=t.drawMonth-W,q=t.drawYear;if(Y<0&&(Y+=12,q--),j)for(i=this._daylightSavingAdjust(new Date(j.getFullYear(),j.getMonth()-R[0]*R[1]+1,j.getDate())),i=H&&i<H?H:i;this._daylightSavingAdjust(new Date(q,Y,1))>i;)--Y<0&&(Y=11,q--);for(t.drawMonth=Y,t.drawYear=q,W=this._get(t,"prevText"),W=U?this.formatDate(W,this._daylightSavingAdjust(new Date(q,Y-M,1)),this._getFormatConfig(t)):W,n=this._canAdjustMonth(t,-1,q,Y)?e("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:W}).append(e("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(E?"e":"w")).text(W))[0].outerHTML:N?"":e("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:W}).append(e("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(E?"e":"w")).text(W))[0].outerHTML,W=this._get(t,"nextText"),W=U?this.formatDate(W,this._daylightSavingAdjust(new Date(q,Y+M,1)),this._getFormatConfig(t)):W,o=this._canAdjustMonth(t,1,q,Y)?e("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:W}).append(e("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(E?"w":"e")).text(W))[0].outerHTML:N?"":e("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:W}).append(e("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(E?"w":"e")).text(W))[0].outerHTML,M=this._get(t,"currentText"),N=this._get(t,"gotoCurrent")&&t.currentDay?V:B,M=U?this.formatDate(M,N,this._getFormatConfig(t)):M,W="",t.inline||(W=e("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(t,"closeText"))[0].outerHTML),U="",L&&(U=e("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(E?W:"").append(this._isInRange(t,N)?e("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(M):"").append(E?"":W)[0].outerHTML),a=parseInt(this._get(t,"firstDay"),10),a=isNaN(a)?0:a,s=this._get(t,"showWeek"),r=this._get(t,"dayNames"),l=this._get(t,"dayNamesMin"),c=this._get(t,"monthNames"),d=this._get(t,"monthNamesShort"),u=this._get(t,"beforeShowDay"),p=this._get(t,"showOtherMonths"),h=this._get(t,"selectOtherMonths"),m=this._getDefaultDate(t),g="",f=0;f<R[0];f++){for(C="",this.maxRows=4,S=0;S<R[1];S++){if(y=this._daylightSavingAdjust(new Date(q,Y,t.selectedDay)),b=" ui-corner-all",k="",G){if(k+="<div class='ui-datepicker-group",1<R[1])switch(S){case 0:k+=" ui-datepicker-group-first",b=" ui-corner-"+(E?"right":"left");break;case R[1]-1:k+=" ui-datepicker-group-last",b=" ui-corner-"+(E?"left":"right");break;default:k+=" ui-datepicker-group-middle",b=""}k+="'>"}for(k+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+b+"'>"+(/all|left/.test(b)&&0===f?E?o:n:"")+(/all|right/.test(b)&&0===f?E?n:o:"")+this._generateMonthYearHeader(t,Y,q,H,j,0<f||0<S,c,d)+"</div><table class='ui-datepicker-calendar'><thead><tr>",_=s?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",v=0;v<7;v++)_+="<th scope='col'"+(5<=(v+a+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+r[D=(v+a)%7]+"'>"+l[D]+"</span></th>";for(k+=_+"</tr></thead><tbody>",w=this._getDaysInMonth(q,Y),q===t.selectedYear&&Y===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,w)),I=(this._getFirstDayOfMonth(q,Y)-a+7)%7,w=Math.ceil((I+w)/7),P=G&&this.maxRows>w?this.maxRows:w,this.maxRows=P,A=this._daylightSavingAdjust(new Date(q,Y,1-I)),T=0;T<P;T++){for(k+="<tr>",x=s?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",v=0;v<7;v++)F=u?u.apply(t.input?t.input[0]:null,[A]):[!0,""],O=($=A.getMonth()!==Y)&&!h||!F[0]||H&&A<H||j&&j<A,x+="<td class='"+(5<=(v+a+6)%7?" ui-datepicker-week-end":"")+($?" ui-datepicker-other-month":"")+(A.getTime()===y.getTime()&&Y===t.selectedMonth&&t._keyEvent||m.getTime()===A.getTime()&&m.getTime()===y.getTime()?" "+this._dayOverClass:"")+(O?" "+this._unselectableClass+" ui-state-disabled":"")+($&&!p?"":" "+F[1]+(A.getTime()===V.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+($&&!p||!F[2]?"":" title='"+F[2].replace(/'/g,"&#39;")+"'")+(O?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+($&&!p?"&#xa0;":O?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===V.getTime()?" ui-state-active":"")+($?" ui-priority-secondary":"")+"' href='#' aria-current='"+(A.getTime()===V.getTime()?"true":"false")+"' data-date='"+A.getDate()+"'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);k+=x+"</tr>"}11<++Y&&(Y=0,q++),C+=k+="</tbody></table>"+(G?"</div>"+(0<R[0]&&S===R[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}g+=C}return g+=U,t._keyEvent=!1,g},_generateMonthYearHeader:function(e,t,i,n,o,a,s,r){var l,c,d,u,p,h,m=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),f=this._get(e,"selectMonthLabel"),C=this._get(e,"selectYearLabel"),S="<div class='ui-datepicker-title'>",y="";if(a||!m)y+="<span class='ui-datepicker-month'>"+s[t]+"</span>";else{for(l=n&&n.getFullYear()===i,c=o&&o.getFullYear()===i,y+="<select class='ui-datepicker-month' aria-label='"+f+"' data-handler='selectMonth' data-event='change'>",d=0;d<12;d++)(!l||d>=n.getMonth())&&(!c||d<=o.getMonth())&&(y+="<option value='"+d+"'"+(d===t?" selected='selected'":"")+">"+r[d]+"</option>");y+="</select>"}if(v||(S+=y+(!a&&m&&g?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!g)S+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(s=this._get(e,"yearRange").split(":"),u=(new Date).getFullYear(),p=(f=function(e){return e=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?u+parseInt(e,10):parseInt(e,10),isNaN(e)?u:e})(s[0]),h=Math.max(p,f(s[1]||"")),p=n?Math.max(p,n.getFullYear()):p,h=o?Math.min(h,o.getFullYear()):h,e.yearshtml+="<select class='ui-datepicker-year' aria-label='"+C+"' data-handler='selectYear' data-event='change'>";p<=h;p++)e.yearshtml+="<option value='"+p+"'"+(p===i?" selected='selected'":"")+">"+p+"</option>";e.yearshtml+="</select>",S+=e.yearshtml,e.yearshtml=null}return S+=this._get(e,"yearSuffix"),v&&(S+=(!a&&m&&g?"":"&#xa0;")+y),S+"</div>"},_adjustInstDate:function(e,t,i){var n=e.selectedYear+("Y"===i?t:0),o=e.selectedMonth+("M"===i?t:0);t=Math.min(e.selectedDay,this._getDaysInMonth(n,o))+("D"===i?t:0),t=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(n,o,t)));e.selectedDay=t.getDate(),e.drawMonth=e.selectedMonth=t.getMonth(),e.drawYear=e.selectedYear=t.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min");t=i&&t<i?i:t;return(e=this._getMinMaxDate(e,"max"))&&e<t?e:t},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){return null==(e=this._get(e,"numberOfMonths"))?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,n){var o=this._getNumberOfMonths(e);o=this._daylightSavingAdjust(new Date(i,n+(t<0?t:o[0]*o[1]),1));return t<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(e,o)},_isInRange:function(e,t){var i=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),o=null,a=null,s=this._get(e,"yearRange");return s&&(e=s.split(":"),s=(new Date).getFullYear(),o=parseInt(e[0],10),a=parseInt(e[1],10),e[0].match(/[+\-].*/)&&(o+=s),e[1].match(/[+\-].*/)&&(a+=s)),(!i||t.getTime()>=i.getTime())&&(!n||t.getTime()<=n.getTime())&&(!o||t.getFullYear()>=o)&&(!a||t.getFullYear()<=a)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,n){return t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear),t=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(n,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay)),this.formatDate(this._get(e,"dateFormat"),t,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).on("mousedown",e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)})},e.datepicker=new P,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.13.0",e.datepicker,e.widget("ui.dialog",{version:"1.13.0",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;i<0&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(e=t.parent.children().eq(t.index)).length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||e.ui.safeBlur(e.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var n=!1,o=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get();return(o=Math.max.apply(null,o))>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),n=!0),n&&!i&&this._trigger("focus",t),n},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=e(e.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var e=this._focusedElement;(e=(e=(e=(e=(e=e||this.element.find("[autofocus]")).length?e:this.element.find(":tabbable")).length?e:this.uiDialogButtonPane.find(":tabbable")).length?e:this.uiDialogTitlebarClose.filter(":tabbable")).length?e:this.uiDialog).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=e.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||e.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(e){e.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=e("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var i,n,o;t.keyCode!==e.ui.keyCode.TAB||t.isDefaultPrevented()||(i=this.uiDialog.find(":tabbable"),n=i.first(),o=i.last(),t.target!==o[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==n[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){o.trigger("focus")}),t.preventDefault()):(this._delay(function(){n.trigger("focus")}),t.preventDefault()))},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:e("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title?e.text(this.options.title):e.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||Array.isArray(i)&&!i.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(e.each(i,function(i,n){var o;n=e.extend({type:"button"},n="function"==typeof n?{click:n,text:i}:n),o=n.click,i={icon:n.icon,iconPosition:n.iconPosition,showLabel:n.showLabel,icons:n.icons,text:n.text},delete n.click,delete n.icon,delete n.iconPosition,delete n.showLabel,delete n.icons,"boolean"==typeof n.text&&delete n.text,e("<button></button>",n).button(i).appendTo(t.uiButtonSet).on("click",function(){o.apply(t.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var t=this,i=this.options;function n(e){return{position:e.position,offset:e.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,o){t._addClass(e(this),"ui-dialog-dragging"),t._blockFrames(),t._trigger("dragStart",i,n(o))},drag:function(e,i){t._trigger("drag",e,n(i))},stop:function(o,a){var s=a.offset.left-t.document.scrollLeft(),r=a.offset.top-t.document.scrollTop();i.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=r?"+":"")+r,of:t.window},t._removeClass(e(this),"ui-dialog-dragging"),t._unblockFrames(),t._trigger("dragStop",o,n(a))}})},_makeResizable:function(){var t=this,i=this.options,n=i.resizable,o=this.uiDialog.css("position");n="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";function a(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:n,start:function(i,n){t._addClass(e(this),"ui-dialog-resizing"),t._blockFrames(),t._trigger("resizeStart",i,a(n))},resize:function(e,i){t._trigger("resize",e,a(i))},stop:function(n,o){var s=(r=t.uiDialog.offset()).left-t.document.scrollLeft(),r=r.top-t.document.scrollTop();i.height=t.uiDialog.height(),i.width=t.uiDialog.width(),i.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=r?"+":"")+r,of:t.window},t._removeClass(e(this),"ui-dialog-resizing"),t._unblockFrames(),t._trigger("resizeStop",n,a(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||this.document.data("ui-dialog-instances",e=[]),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,n=!1,o={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(n=!0),e in i.resizableRelatedOptions&&(o[e]=t)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,i){var n,o=this.uiDialog;"disabled"!==t&&(this._super(t,i),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:e("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((n=o.is(":data(ui-draggable)"))&&!i&&o.draggable("destroy"),!n&&i&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((n=o.is(":data(ui-resizable)"))&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||!1===i||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),t=Math.max(0,n.minHeight-e),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-e):"none","auto"===n.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!e(t.target).closest(".ui-dialog").length||!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var t,i;this.options.modal&&(t=e.fn.jquery.substring(0,4),i=!0,this._delay(function(){i=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(e){var n;i||(n=this._trackingInstances()[0])._allowInteraction(e)||(e.preventDefault(),n._focusTabbable(),"3.4."!==t&&"3.5."!==t||n._delay(n._restoreTabbableFocus))}.bind(this)),this.overlay=e("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var e;this.options.modal&&this.overlay&&((e=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",e):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==e.uiBackCompat&&e.widget("ui.dialog",e.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(e,t){"dialogClass"===e&&this.uiDialog.removeClass(this.options.dialogClass).addClass(t),this._superApply(arguments)}}),e.ui.dialog,e.widget("ui.progressbar",{version:"1.13.0",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=e("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(e){if(void 0===e)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=!1===e,"number"!=typeof e&&(e=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectmenu",[e.ui.formResetMixin,{version:"1.13.0",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=e()},_drawButton:function(){var t,i=this,n=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(e){this.button.trigger("focus"),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=e("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(n).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){i=i.item.data("ui-selectmenu-item"),null!=t.focusIndex&&i.index!==t.focusIndex&&(t._trigger("focus",e,{item:i}),t.isOpen||t._select(i,e)),t.focusIndex=i.index,t.button.attr("aria-activedescendant",t.menuItems.eq(i.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e)))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var i=e("<span>");return this._setText(i,t.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(t,i){var n=this,o="";e.each(i,function(i,a){var s;a.optgroup!==o&&(s=e("<li>",{text:a.optgroup}),n._addClass(s,"ui-selectmenu-optgroup","ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),s.appendTo(t),o=a.optgroup),n._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var n=e("<li>"),o=e("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(n,null,"ui-state-disabled"),this._setText(o,i.label),n.append(o).appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),(n="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0)).length&&this.menuInstance.focus(t,n)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?((e=window.getSelection()).removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+e.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection()).rangeCount&&(this.range=e.getRangeAt(0)):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex).parent("li");t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(e)),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){e=this.menuItems.eq(e.index).attr("id"),this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(e,t){var i;"icons"===e&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,t.button)),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"width"===e&&this._resizeButton()},_setOptionDisabled:function(e){this._super(e),this.menuInstance.option("disabled",e),this.button.attr("aria-disabled",e),this._toggleClass(this.button,null,"ui-state-disabled",e),this.element.prop("disabled",e),e?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return(t=(t=t&&(t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)))&&t[0]?t:this.element.closest(".ui-front, dialog")).length?t:this.document[0].body},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;!1!==e?(null===e&&(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var e=this._super();return e.disabled=this.element.prop("disabled"),e},_parseOptions:function(t){var i=this,n=[];t.each(function(t,o){o.hidden||n.push(i._parseOption(e(o),t))}),this.items=n},_parseOption:function(e,t){var i=e.parent("optgroup");return{element:e,index:t,value:e.val(),label:e.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||e.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),e.widget("ui.slider",e.ui.mouse,{version:"1.13.0",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i=this.options,n=this.element.find(".ui-slider-handle"),o=[],a=i.values&&i.values.length||1;for(n.length>a&&(n.slice(a).remove(),n=n.slice(0,a)),t=n.length;t<a;t++)o.push("<span tabindex='0'></span>");this.handles=n.add(e(o.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:Array.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=e("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,n,o,a,s,r,l=this,c=this.options;return!c.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),r={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(r),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var s=Math.abs(i-l.values(t));(s<n||n===s&&(t===l._lastChangedValue||l.values(t)===c.min))&&(n=s,o=e(this),a=t)}),!1!==this._start(t,a)&&(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),s=o.offset(),r=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=r?{left:0,top:0}:{left:t.pageX-s.left-o.width()/2,top:t.pageY-s.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,a,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY};t=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,t),!1},_mouseStop:function(e){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t;return(e=1<(e=(e="horizontal"===this.orientation?(t=this.elementSize.width,e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)))/t)?1:e)<0&&(e=0),"vertical"===this.orientation&&(e=1-e),t=this._valueMax()-this._valueMin(),t=this._valueMin()+e*t,this._trimAlignValue(t)},_uiHash:function(e,t,i){var n={handle:this.handles[e],handleIndex:e,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(n.value=void 0!==t?t:this.values(e),n.values=i||this.values()),n},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,i){var n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(t?0:1),o=this.values(t),2===this.options.values.length&&!0===this.options.range&&(i=0===t?Math.min(n,i):Math.max(n,i)),a[t]=i),i!==o&&!1!==this._trigger("slide",e,this._uiHash(t,i,a))&&(this._hasMultipleValues()?this.values(t,i):this.value(i))},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",e,this._uiHash(t)))},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,t){var i,n,o;if(1<arguments.length)return this.options.values[e]=this._trimAlignValue(t),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!Array.isArray(e))return this._hasMultipleValues()?this._values(e):this.value();for(i=this.options.values,n=e,o=0;o<i.length;o+=1)i[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,t){var i,n=0;switch("range"===e&&!0===this.options.range&&("min"===t?(this.options.value=this._values(0),this.options.values=null):"max"===t&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,t),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(t),this.handles.css("horizontal"===t?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=n-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(e){this._super(e),this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;return this._trimAlignValue(e)},_values:function(e){var t,i;if(arguments.length)return e=this.options.values[e],this._trimAlignValue(e);if(this._hasMultipleValues()){for(t=this.options.values.slice(),i=0;i<t.length;i+=1)t[i]=this._trimAlignValue(t[i]);return t}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=0<this.options.step?this.options.step:1,i=(e-this._valueMin())%t;e-=i;return 2*Math.abs(i)>=t&&(e+=0<i?t:-t),parseFloat(e.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step;(e=Math.round((e-t)/i)*i+t)>this.options.max&&(e-=i),this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min?Math.max(e,this._precisionOf(this.options.min)):e},_precisionOf:function(e){var t=e.toString();return-1===(e=t.indexOf("."))?0:t.length-e-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){"vertical"===e&&this.range.css({width:"",left:""}),"horizontal"===e&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var t,i,n,o,a,s=this.options.range,r=this.options,l=this,c=!this._animateOff&&r.animate,d={};this._hasMultipleValues()?this.handles.each(function(n){i=(l.values(n)-l._valueMin())/(l._valueMax()-l._valueMin())*100,d["horizontal"===l.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[c?"animate":"css"](d,r.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===n&&l.range.stop(1,1)[c?"animate":"css"]({left:i+"%"},r.animate),1===n&&l.range[c?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===n&&l.range.stop(1,1)[c?"animate":"css"]({bottom:i+"%"},r.animate),1===n&&l.range[c?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(n=this.value(),o=this._valueMin(),a=this._valueMax(),i=a!==o?(n-o)/(a-o)*100:0,d["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[c?"animate":"css"](d,r.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:i+"%"},r.animate),"max"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:100-i+"%"},r.animate),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:i+"%"},r.animate),"max"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(t){var i,n,o,a=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(e(t.target),null,"ui-state-active"),!1===this._start(t,a)))return}switch(o=this.options.step,i=n=this._hasMultipleValues()?this.values(a):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;n=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;n=this._trimAlignValue(i-o)}this._slide(t,a,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),this._removeClass(e(t.target),null,"ui-state-active"))}}}),e.widget("ui.spinner",{version:"1.13.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t=this._super(),i=this.element;return e.each(["min","max","step"],function(e,n){var o=i.attr(n);null!=o&&o.length&&(t[n]=o)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e))},mousewheel:function(t,i){var n=e.ui.safeActiveElement(this.document[0]);if(this.element[0]===n&&i){if(!this.spinning&&!this._start(t))return!1;this._spin((0<i?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var i;function n(){this.element[0]===e.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=i,this._delay(function(){this.previous=i}))}i=this.element[0]===e.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),!1!==this._start(t)&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(e(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var i=this.options,n=e.ui.keyCode;switch(t.keyCode){case n.UP:return this._repeat(null,1,t),!0;case n.DOWN:return this._repeat(null,-1,t),!0;case n.PAGE_UP:return this._repeat(null,i.page,t),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_start:function(e){return!(!this.spinning&&!1===this._trigger("start",e))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",t,{value:i})||(this._value(i),this.counter++)},_increment:function(e){var t=this.options.incremental;return t?"function"==typeof t?t(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min?Math.max(e,this._precisionOf(this.options.min)):e},_precisionOf:function(e){var t=e.toString();return-1===(e=t.indexOf("."))?0:t.length-e-1},_adjustValue:function(e){var t=this.options,i=null!==t.min?t.min:0,n=e-i;return e=i+Math.round(n/t.step)*t.step,e=parseFloat(e.toFixed(this._precision())),null!==t.max&&e>t.max?t.max:null!==t.min&&e<t.min?t.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){var i;if("culture"===e||"numberFormat"===e)return i=this._parse(this.element.val()),this.options[e]=t,void this.element.val(this._format(i));"max"!==e&&"min"!==e&&"step"!==e||"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,t.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,t.down)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!e),this.element.prop("disabled",!!e),this.buttons.button(e?"disable":"enable")},_setOptions:F(function(e){this._super(e)}),_parse:function(e){return""===(e="string"==typeof e&&""!==e?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e:e)||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null!==e&&e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&null!==(i=this._parse(e))&&(t||(i=this._adjustValue(i)),e=this._format(i)),this.element.val(e),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:F(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:F(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:F(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:F(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());F(this._value).call(this,e)},widget:function(){return this.uiSpinner}}),!1!==e.uiBackCompat&&e.widget("ui.spinner",e.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),e.ui.spinner,e.widget("ui.tabs",{version:"1.13.0",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(I=/#.*$/,function(e){var t=e.href.replace(I,""),i=location.href.replace(I,"");try{t=decodeURIComponent(t)}catch(e){}try{i=decodeURIComponent(i)}catch(e){}return 1<e.hash.length&&t===i}),_create:function(){var t=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),Array.isArray(i.disabled)&&(i.disabled=e.uniqueSort(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(i.active):this.active=e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===t&&(n&&this.tabs.each(function(i,o){if(e(o).attr("aria-controls")===n)return t=i,!1}),null!==(t=null===t?this.tabs.index(this.tabs.filter(".ui-tabs-active")):t)&&-1!==t||(t=!!this.tabs.length&&0)),!1!==t&&-1===(t=this.tabs.index(this.tabs.eq(t)))&&(t=!i&&0),t=!i&&!1===t&&this.anchors.length?0:t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(e.ui.safeActiveElement(this.document[0])).closest("li"),n=this.tabs.index(i),o=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:n++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:o=!1,n--;break;case e.ui.keyCode.END:n=this.anchors.length-1;break;case e.ui.keyCode.HOME:n=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n);case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n!==this.options.active&&n);default:return}t.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,o),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){for(var n=this.tabs.length-1;-1!==e.inArray(t=(t=n<t?0:t)<0?n:t,this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).trigger("focus"),e},_setOption:function(e,t){"active"!==e?(this._super(e,t),"collapsible"===e&&(this._toggleClass("ui-tabs-collapsible",null,t),t||!1!==this.options.active||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t)):this._activate(t)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,n=this.anchors,o=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=e(),this.anchors.each(function(i,n){var o,a,s,r=e(n).uniqueId().attr("id"),l=e(n).closest("li"),c=l.attr("aria-controls");t._isLocal(n)?(s=(o=n.hash).substring(1),a=t.element.find(t._sanitizeSelector(o))):(s=l.attr("aria-controls")||e({}).uniqueId()[0].id,(a=t.element.find(o="#"+s)).length||(a=t._createPanel(s)).insertAfter(t.panels[i-1]||t.tablist),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":s,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(n.not(this.anchors)),this._off(o.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var i,n;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),n=0;i=this.tabs[n];n++)i=e(i),!0===t||-1!==e.inArray(n,t)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,n=this.element.parent();"fill"===t?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,n=this.active,o=e(t.currentTarget).closest("li"),a=o[0]===n[0],s=a&&i.collapsible,r=s?e():this._getPanelForTab(o),l=n.length?this._getPanelForTab(n):e();n={oldTab:n,oldPanel:l,newTab:s?e():o,newPanel:r};t.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||!1===this._trigger("beforeActivate",t,n)||(i.active=!s&&this.tabs.index(o),this.active=a?e():o,this.xhr&&this.xhr.abort(),l.length||r.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),r.length&&this.load(this.tabs.index(o),t),this._toggle(t,n))},_toggle:function(t,i){var n=this,o=i.newPanel,a=i.oldPanel;function s(){n.running=!1,n._trigger("activate",t,i)}function r(){n._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),o.length&&n.options.show?n._show(o,n.options.show,s):(o.show(),s())}this.running=!0,a.length&&this.options.hide?this._hide(a,this.options.hide,function(){n._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a.hide(),r()),a.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&a.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){(t=this._findActive(t))[0]!==this.active[0]&&(t=(t=t.length?t:this.active).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:e.noop}))},_findActive:function(t){return!1===t?e():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+e.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;!1!==i&&(i=void 0!==t&&(t=this._getIndex(t),Array.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setOptionDisabled(i))},disable:function(t){var i=this.options.disabled;if(!0!==i){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=Array.isArray(i)?e.merge([t],i).sort():[t]}this._setOptionDisabled(i)}},load:function(t,i){function n(e,t){"abort"===t&&o.panels.stop(!1,!0),o._removeClass(a,"ui-tabs-loading"),s.removeAttr("aria-busy"),e===o.xhr&&delete o.xhr}t=this._getIndex(t);var o=this,a=this.tabs.eq(t),s=(t=a.find(".ui-tabs-anchor"),this._getPanelForTab(a)),r={tab:a,panel:s};this._isLocal(t[0])||(this.xhr=e.ajax(this._ajaxSettings(t,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(a,"ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.done(function(e,t,a){setTimeout(function(){s.html(e),o._trigger("load",i,r),n(a,t)},1)}).fail(function(e,t){setTimeout(function(){n(e,t)},1)})))},_ajaxSettings:function(t,i,n){var o=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,a){return o._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},n))}}},_getPanelForTab:function(t){return t=e(t).attr("aria-controls"),this.element.find(this._sanitizeSelector("#"+t))}}),!1!==e.uiBackCompat&&e.widget("ui.tabs",e.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),e.ui.tabs,e.widget("ui.tooltip",{version:"1.13.0",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=e(this).attr("title");return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,t){var i=(e.attr("aria-describedby")||"").split(/\s+/);i.push(t),e.data("ui-tooltip-id",t).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),n=(t.attr("aria-describedby")||"").split(/\s+/);-1!==(i=e.inArray(i,n))&&n.splice(i,1),t.removeData("ui-tooltip-id"),(n=String.prototype.trim.call(n.join(" ")))?t.attr("aria-describedby",n):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=e([])},_setOption:function(t,i){var n=this;this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){n._updateContent(t.element)})},_setOptionDisabled:function(e){this[e?"_disable":"_enable"]()},_disable:function(){var t=this;e.each(this.tooltips,function(i,n){var o=e.Event("blur");o.target=o.currentTarget=n.element[0],t.close(o,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=e(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=e([])},open:function(t){var i=this,n=e(t?t.target:this.element).closest(this.options.items);n.length&&!n.data("ui-tooltip-id")&&(n.attr("title")&&n.data("ui-tooltip-title",n.attr("title")),n.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&n.parents().each(function(){var t,n=e(this);n.data("ui-tooltip-open")&&((t=e.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),n.attr("title")&&(n.uniqueId(),i.parents[this.id]={element:this,title:n.attr("title")},n.attr("title",""))}),this._registerCloseHandlers(t,n),this._updateContent(n,t))},_updateContent:function(e,t){var i=this.options.content,n=this,o=t?t.type:null;if("string"==typeof i||i.nodeType||i.jquery)return this._open(t,e,i);(i=i.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=o),this._open(t,e,i))})}))&&this._open(t,e,i)},_open:function(t,i,n){var o,a,s,r=e.extend({},this.options.position);function l(e){r.of=e,a.is(":hidden")||a.position(r)}n&&((o=this._find(i))?o.tooltip.find(".ui-tooltip-content").html(n):(i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.liveRegion.children().hide(),(n=e("<div>").html(a.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),n.removeAttr("id").find("[id]").removeAttr("id"),n.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:l}),l(t)):a.position(e.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(s=this.delayedShow=setInterval(function(){a.is(":visible")&&(l(r.of),clearInterval(s))},13)),this._trigger("open",t,{tooltip:a})))},_registerCloseHandlers:function(t,i){var n={keyup:function(t){t.keyCode===e.ui.keyCode.ESCAPE&&((t=e.Event(t)).currentTarget=i[0],this.close(t,!0))}};i[0]!==this.element[0]&&(n.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(n.mouseleave="close"),t&&"focusin"!==t.type||(n.focusout="close"),this._on(!0,i,n)},close:function(t){var i,n=this,o=e(t?t.currentTarget:this.element),a=this._find(o);a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),o.data("ui-tooltip-title")&&!o.attr("title")&&o.attr("title",o.data("ui-tooltip-title")),this._removeDescribedBy(o),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){n._removeTooltip(e(this))}),o.removeData("ui-tooltip-open"),this._off(o,"mouseleave focusout keyup"),o[0]!==this.element[0]&&this._off(o,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete n.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1))):o.removeData("ui-tooltip-open")},_tooltip:function(t){var i=e("<div>").attr("role","tooltip"),n=e("<div>").appendTo(i),o=i.uniqueId().attr("id");return this._addClass(n,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(t)),this.tooltips[o]={element:t,tooltip:i}},_find:function(e){return(e=e.data("ui-tooltip-id"))?this.tooltips[e]:null},_removeTooltip:function(e){clearInterval(this.delayedShow),e.remove(),delete this.tooltips[e.attr("id")]},_appendTo:function(e){return(e=e.closest(".ui-front, dialog")).length?e:this.document[0].body},_destroy:function(){var t=this;e.each(this.tooltips,function(i,n){var o=e.Event("blur");n=n.element;o.target=o.currentTarget=n[0],t.close(o,!0),e("#"+i).remove(),n.data("ui-tooltip-title")&&(n.attr("title")||n.attr("title",n.data("ui-tooltip-title")),n.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==e.uiBackCompat&&e.widget("ui.tooltip",e.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var e=this._superApply(arguments);return this.options.tooltipClass&&e.tooltip.addClass(this.options.tooltipClass),e}}),e.ui.tooltip;var $=e,O={},M=O.toString,B=/^([\-+])=\s*(\d+\.?\d*)/,E=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),e[4]?(parseInt(e[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),e[4]?(parseInt(e[4]+e[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],L=$.Color=function(e,t,i,n){return new $.Color.fn.parse(e,t,i,n)},N={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},U={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},R=L.support={},W=$("<p>")[0],G=$.each;function V(e){return null==e?e+"":"object"==typeof e?O[M.call(e)]||"object":typeof e}function H(e,t,i){var n=U[t.type]||{};return null==e?i||!t.def?null:t.def:(e=n.floor?~~e:parseFloat(e),isNaN(e)?t.def:n.mod?(e+n.mod)%n.mod:Math.min(n.max,Math.max(0,e)))}function j(e){var t=L(),i=t._rgba=[];return e=e.toLowerCase(),G(E,function(n,o){var a=(a=o.re.exec(e))&&o.parse(a);o=o.space||"rgba";if(a)return a=t[o](a),t[N[o].cache]=a[N[o].cache],i=t._rgba=a._rgba,!1}),i.length?("0,0,0,0"===i.join()&&$.extend(i,ne.transparent),t):ne[e]}function Y(e,t,i){return 6*(i=(i+1)%1)<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}W.style.cssText="background-color:rgba(1,1,1,.5)",R.rgba=-1<W.style.backgroundColor.indexOf("rgba"),G(N,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),$.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),(L.fn=$.extend(L.prototype,{parse:function(e,t,i,n){if(void 0===e)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=$(e).css(t),t=void 0);var o=this,a=V(e),s=this._rgba=[];return void 0!==t&&(e=[e,t,i,n],a="array"),"string"===a?this.parse(j(e)||ne._default):"array"===a?(G(N.rgba.props,function(t,i){s[i.idx]=H(e[i.idx],i)}),this):"object"===a?(G(N,e instanceof L?function(t,i){e[i.cache]&&(o[i.cache]=e[i.cache].slice())}:function(t,i){var n=i.cache;G(i.props,function(t,a){if(!o[n]&&i.to){if("alpha"===t||null==e[t])return;o[n]=i.to(o._rgba)}o[n][a.idx]=H(e[t],a,!0)}),o[n]&&$.inArray(null,o[n].slice(0,3))<0&&(null==o[n][3]&&(o[n][3]=1),i.from&&(o._rgba=i.from(o[n])))}),this):void 0},is:function(e){var t=L(e),i=!0,n=this;return G(N,function(e,o){var a,s=t[o.cache];return s&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],G(o.props,function(e,t){if(null!=s[t.idx])return i=s[t.idx]===a[t.idx]})),i}),i},_space:function(){var e=[],t=this;return G(N,function(i,n){t[n.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var i=(s=L(e))._space(),n=N[i],o=(e=0===this.alpha()?L("transparent"):this)[n.cache]||n.to(e._rgba),a=o.slice(),s=s[n.cache];return G(n.props,function(e,i){var n=i.idx,r=o[n],l=s[n],c=U[i.type]||{};null!==l&&(null===r?a[n]=l:(c.mod&&(l-r>c.mod/2?r+=c.mod:r-l>c.mod/2&&(r-=c.mod)),a[n]=H((l-r)*t+r,i)))}),this[i](a)},blend:function(e){if(1===this._rgba[3])return this;var t=this._rgba.slice(),i=t.pop(),n=L(e)._rgba;return L($.map(t,function(e,t){return(1-i)*n[t]+i*e}))},toRgbaString:function(){var e="rgba(",t=$.map(this._rgba,function(e,t){return null!=e?e:2<t?1:0});return 1===t[3]&&(t.pop(),e="rgb("),e+t.join()+")"},toHslaString:function(){var e="hsla(",t=$.map(this.hsla(),function(e,t){return null==e&&(e=2<t?1:0),t&&t<3?Math.round(100*e)+"%":e});return 1===t[3]&&(t.pop(),e="hsl("),e+t.join()+")"},toHexString:function(e){var t=this._rgba.slice(),i=t.pop();return e&&t.push(~~(255*i)),"#"+$.map(t,function(e){return 1===(e=(e||0).toString(16)).length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=L.fn,N.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/255,i=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,i,n),s=Math.min(t,i,n),r=a-s,l=(e=.5*(l=a+s),i=s===a?0:t===a?60*(i-n)/r+360:i===a?60*(n-t)/r+120:60*(t-i)/r+240,0==r?0:e<=.5?r/l:r/(2-l));return[Math.round(i)%360,l,e,null==o?1:o]},N.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],n=e[2];e=e[3],n=2*n-(i=n<=.5?n*(1+i):n+i-n*i);return[Math.round(255*Y(n,i,t+1/3)),Math.round(255*Y(n,i,t)),Math.round(255*Y(n,i,t-1/3)),e]},G(N,function(e,t){var i=t.props,n=t.cache,o=t.to,a=t.from;L.fn[e]=function(e){if(o&&!this[n]&&(this[n]=o(this._rgba)),void 0===e)return this[n].slice();var t=V(e),s="array"===t||"object"===t?e:arguments,r=this[n].slice();return G(i,function(e,i){null==(e=s["object"===t?e:i.idx])&&(e=r[i.idx]),r[i.idx]=H(e,i)}),a?((e=L(a(r)))[n]=r,e):L(r)},G(i,function(t,i){L.fn[t]||(L.fn[t]=function(n){var o,a=V(n),s="alpha"===t?this._hsla?"hsla":"rgba":e,r=this[s](),l=r[i.idx];return"undefined"===a?l:("function"===a&&(a=V(n=n.call(this,l))),null==n&&i.empty?this:("string"===a&&(o=B.exec(n))&&(n=l+parseFloat(o[2])*("+"===o[1]?1:-1)),r[i.idx]=n,this[s](r)))})})}),(L.hook=function(e){e=e.split(" "),G(e,function(e,t){$.cssHooks[t]={set:function(e,i){var n,o,a="";if("transparent"!==i&&("string"!==V(i)||(n=j(i)))){if(i=L(n||i),!R.rgba&&1!==i._rgba[3]){for(o="backgroundColor"===t?e.parentNode:e;(""===a||"transparent"===a)&&o&&o.style;)try{a=$.css(o,"backgroundColor"),o=o.parentNode}catch(e){}i=i.blend(a&&"transparent"!==a?a:"_default")}i=i.toRgbaString()}try{e.style[t]=i}catch(e){}}},$.fx.step[t]=function(e){e.colorInit||(e.start=L(e.elem,t),e.end=L(e.end),e.colorInit=!0),$.cssHooks[t].set(e.elem,e.start.transition(e.end,e.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),$.cssHooks.borderColor={expand:function(e){var t={};return G(["Top","Right","Bottom","Left"],function(i,n){t["border"+n+"Color"]=e}),t}};var q,z,X,Z,J,Q,K,ee,te,ie,ne=$.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},oe="ui-effects-",ae="ui-effects-style",se="ui-effects-animated";function re(e){var t,i,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(i=n.length;i--;)"string"==typeof n[t=n[i]]&&(o[t.replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})]=n[t]);else for(t in n)"string"==typeof n[t]&&(o[t]=n[t]);return o}function le(t,i,n,o){return t={effect:t=e.isPlainObject(t)?(i=t).effect:t},"function"==typeof(i=null==i?{}:i)&&(o=i,n=null,i={}),"number"!=typeof i&&!e.fx.speeds[i]||(o=n,n=i,i={}),"function"==typeof n&&(o=n,n=null),i&&e.extend(t,i),n=n||i.duration,t.duration=e.fx.off?0:"number"==typeof n?n:n in e.fx.speeds?e.fx.speeds[n]:e.fx.speeds._default,t.complete=o||i.complete,t}function ce(t){return!t||"number"==typeof t||e.fx.speeds[t]||"string"==typeof t&&!e.effects.effect[t]||"function"==typeof t||"object"==typeof t&&!t.effect}function de(e,t){var i=t.outerWidth();t=t.outerHeight(),e=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(e)||["",0,i,t,0];return{top:parseFloat(e[1])||0,right:"auto"===e[2]?i:parseFloat(e[2]),bottom:"auto"===e[3]?t:parseFloat(e[3]),left:parseFloat(e[4])||0}}e.effects={effect:{}},Z=["add","remove","toggle"],J={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&($.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(t,i,n,o){var a=e.speed(i,n,o);return this.queue(function(){var i=e(this),n=i.attr("class")||"",o=(o=a.children?i.find("*").addBack():i).map(function(){return{el:e(this),start:re(this)}}),s=function(){e.each(Z,function(e,n){t[n]&&i[n+"Class"](t[n])})};s(),o=o.map(function(){return this.end=re(this.el[0]),this.diff=function(t,i){var n,o,a={};for(n in i)o=i[n],t[n]!==o&&(J[n]||!e.fx.step[n]&&isNaN(parseFloat(o))||(a[n]=o));return a}(this.start,this.end),this}),i.attr("class",n),o=o.map(function(){var t=this,i=e.Deferred(),n=e.extend({},a,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,n),i.promise()}),e.when.apply(e,o.get()).done(function(){s(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(i[0])})})},e.fn.extend({addClass:(X=e.fn.addClass,function(t,i,n,o){return i?e.effects.animateClass.call(this,{add:t},i,n,o):X.apply(this,arguments)}),removeClass:(z=e.fn.removeClass,function(t,i,n,o){return 1<arguments.length?e.effects.animateClass.call(this,{remove:t},i,n,o):z.apply(this,arguments)}),toggleClass:(q=e.fn.toggleClass,function(t,i,n,o,a){return"boolean"==typeof i||void 0===i?n?e.effects.animateClass.call(this,i?{add:t}:{remove:t},n,o,a):q.apply(this,arguments):e.effects.animateClass.call(this,{toggle:t},i,n,o)}),switchClass:function(t,i,n,o,a){return e.effects.animateClass.call(this,{add:i,remove:t},n,o,a)}}),e.expr&&e.expr.pseudos&&e.expr.pseudos.animated&&(e.expr.pseudos.animated=(Q=e.expr.pseudos.animated,function(t){return!!e(t).data(se)||Q(t)})),!1!==e.uiBackCompat&&e.extend(e.effects,{save:function(e,t){for(var i=0,n=t.length;i<n;i++)null!==t[i]&&e.data(oe+t[i],e[0].style[t[i]])},restore:function(e,t){for(var i,n=0,o=t.length;n<o;n++)null!==t[n]&&(i=e.data(oe+t[n]),e.css(t[n],i))},setMode:function(e,t){return"toggle"===t?e.is(":hidden")?"show":"hide":t},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),float:t.css("float")},n=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),o={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(n){a=document.body}return t.wrap(n),t[0]!==a&&!e.contains(t[0],a)||e(a).trigger("focus"),n=t.parent(),"static"===t.css("position")?(n.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,n){i[n]=t.css(n),isNaN(parseInt(i[n],10))&&(i[n]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(o),n.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==i&&!e.contains(t[0],i)||e(i).trigger("focus")),t}}),e.extend(e.effects,{version:"1.13.0",define:function(t,i,n){return n||(n=i,i="effect"),e.effects.effect[t]=n,e.effects.effect[t].mode=i,n},scaledDimensions:function(e,t,i){if(0===t)return{height:0,width:0,outerHeight:0,outerWidth:0};var n="horizontal"!==i?(t||100)/100:1;t="vertical"!==i?(t||100)/100:1;return{height:e.height()*t,width:e.width()*n,outerHeight:e.outerHeight()*t,outerWidth:e.outerWidth()*n}},clipToBox:function(e){return{width:e.clip.right-e.clip.left,height:e.clip.bottom-e.clip.top,left:e.clip.left,top:e.clip.top}},unshift:function(e,t,i){var n=e.queue();1<t&&n.splice.apply(n,[1,0].concat(n.splice(t,i))),e.dequeue()},saveStyle:function(e){e.data(ae,e[0].style.cssText)},restoreStyle:function(e){e[0].style.cssText=e.data(ae)||"",e.removeData(ae)},mode:function(e,t){return e=e.is(":hidden"),"toggle"===t&&(t=e?"show":"hide"),(e?"hide"===t:"show"===t)?"none":t},getBaseline:function(e,t){var i,n;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=e[1]/t.width}return{x:n,y:i}},createPlaceholder:function(t){var i,n=t.css("position"),o=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",i=e("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(oe+"placeholder",i)),t.css({position:n,left:o.left,top:o.top}),i},removePlaceholder:function(e){var t=oe+"placeholder",i=e.data(t);i&&(i.remove(),e.removeData(t))},cleanUp:function(t){e.effects.restoreStyle(t),e.effects.removePlaceholder(t)},setTransition:function(t,i,n,o){return o=o||{},e.each(i,function(e,i){var a=t.cssUnit(i);0<a[0]&&(o[i]=a[0]*n+a[1])}),o}}),e.fn.extend({effect:function(){function t(t){var i=e(this),n=e.effects.mode(i,l)||o;i.data(se,!0),c.push(n),o&&("show"===n||n===o&&"hide"===n)&&i.show(),o&&"none"===n||e.effects.saveStyle(i),"function"==typeof t&&t()}var i=le.apply(this,arguments),n=e.effects.effect[i.effect],o=n.mode,a=i.queue,s=a||"fx",r=i.complete,l=i.mode,c=[];return e.fx.off||!n?l?this[l](i.duration,r):this.each(function(){r&&r.call(this)}):!1===a?this.each(t).each(d):this.queue(s,t).queue(s,d);function d(t){var a=e(this);function s(){"function"==typeof r&&r.call(a[0]),"function"==typeof t&&t()}i.mode=c.shift(),!1===e.uiBackCompat||o?"none"===i.mode?(a[l](),s()):n.call(a[0],i,function(){a.removeData(se),e.effects.cleanUp(a),"hide"===i.mode&&a.hide(),s()}):(a.is(":hidden")?"hide"===l:"show"===l)?(a[l](),s()):n.call(a[0],i,s)}},show:(te=e.fn.show,function(e){return ce(e)?te.apply(this,arguments):((e=le.apply(this,arguments)).mode="show",this.effect.call(this,e))}),hide:(ee=e.fn.hide,function(e){return ce(e)?ee.apply(this,arguments):((e=le.apply(this,arguments)).mode="hide",this.effect.call(this,e))}),toggle:(K=e.fn.toggle,function(e){return ce(e)||"boolean"==typeof e?K.apply(this,arguments):((e=le.apply(this,arguments)).mode="toggle",this.effect.call(this,e))}),cssUnit:function(t){var i=this.css(t),n=[];return e.each(["em","px","%","pt"],function(e,t){0<i.indexOf(t)&&(n=[parseFloat(i),t])}),n},cssClip:function(e){return e?this.css("clip","rect("+e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px)"):de(this.css("clip"),this)},transfer:function(t,i){var n=e(this),o="fixed"===(l=e(t.to)).css("position"),a=e("body"),s=o?a.scrollTop():0,r=o?a.scrollLeft():0,l=(a={top:(a=l.offset()).top-s,left:a.left-r,height:l.innerHeight(),width:l.innerWidth()},n.offset()),c=e("<div class='ui-effects-transfer'></div>");c.appendTo("body").addClass(t.className).css({top:l.top-s,left:l.left-r,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(a,t.duration,t.easing,function(){c.remove(),"function"==typeof i&&i()})}}),e.fx.step.clip=function(t){t.clipInit||(t.start=e(t.elem).cssClip(),"string"==typeof t.end&&(t.end=de(t.end,t.elem)),t.clipInit=!0),e(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},ie={},e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){ie[t]=function(t){return Math.pow(t,e+2)}}),e.extend(ie,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;e<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(ie,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?i(2*e)/2:1-i(-2*e+2)/2}}),W=e.effects,e.effects.define("blind","hide",function(t,i){var n={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},o=e(this),a=t.direction||"up",s=o.cssClip(),r={clip:e.extend({},s)},l=e.effects.createPlaceholder(o);r.clip[n[a][0]]=r.clip[n[a][1]],"show"===t.mode&&(o.cssClip(r.clip),l&&l.css(e.effects.clipToBox(r)),r.clip=s),l&&l.animate(e.effects.clipToBox(r),t.duration,t.easing),o.animate(r,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("bounce",function(t,i){var n,o,a=e(this),s="hide"===(u=t.mode),r="show"===u,l=t.direction||"up",c=t.distance,d=t.times||5,u=2*d+(r||s?1:0),p=t.duration/u,h=t.easing,m="up"===l||"down"===l?"top":"left",g="up"===l||"left"===l,v=0;t=a.queue().length;for(e.effects.createPlaceholder(a),l=a.css(m),c=c||a["top"==m?"outerHeight":"outerWidth"]()/3,r&&((o={opacity:1})[m]=l,a.css("opacity",0).css(m,g?2*-c:2*c).animate(o,p,h)),s&&(c/=Math.pow(2,d-1)),(o={})[m]=l;v<d;v++)(n={})[m]=(g?"-=":"+=")+c,a.animate(n,p,h).animate(o,p,h),c=s?2*c:c/2;s&&((n={opacity:0})[m]=(g?"-=":"+=")+c,a.animate(n,p,h)),a.queue(i),e.effects.unshift(a,t,1+u)}),e.effects.define("clip","hide",function(t,i){var n={},o=e(this),a=(s="both"===(r=t.direction||"vertical"))||"horizontal"===r,s=s||"vertical"===r,r=o.cssClip();n.clip={top:s?(r.bottom-r.top)/2:r.top,right:a?(r.right-r.left)/2:r.right,bottom:s?(r.bottom-r.top)/2:r.bottom,left:a?(r.right-r.left)/2:r.left},e.effects.createPlaceholder(o),"show"===t.mode&&(o.cssClip(n.clip),n.clip=r),o.animate(n,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("drop","hide",function(t,i){var n=e(this),o="show"===t.mode,a=t.direction||"left",s="up"===a||"down"===a?"top":"left",r="up"===a||"left"===a?"-=":"+=",l="+="==r?"-=":"+=",c={opacity:0};e.effects.createPlaceholder(n),a=t.distance||n["top"==s?"outerHeight":"outerWidth"](!0)/2,c[s]=r+a,o&&(n.css(c),c[s]=l+a,c.opacity=1),n.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("explode","hide",function(t,i){var n,o,a,s,r,l,c=t.pieces?Math.round(Math.sqrt(t.pieces)):3,d=c,u=e(this),p="show"===t.mode,h=u.show().css("visibility","hidden").offset(),m=Math.ceil(u.outerWidth()/d),g=Math.ceil(u.outerHeight()/c),v=[];function f(){v.push(this),v.length===c*d&&(u.css({visibility:"visible"}),e(v).remove(),i())}for(n=0;n<c;n++)for(s=h.top+n*g,l=n-(c-1)/2,o=0;o<d;o++)a=h.left+o*m,r=o-(d-1)/2,u.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*m,top:-n*g}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:m,height:g,left:a+(p?r*m:0),top:s+(p?l*g:0),opacity:p?0:1}).animate({left:a+(p?0:r*m),top:s+(p?0:l*g),opacity:p?1:0},t.duration||500,t.easing,f)}),e.effects.define("fade","toggle",function(t,i){var n="show"===t.mode;e(this).css("opacity",n?0:1).animate({opacity:n?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("fold","hide",function(t,i){var n=e(this),o="show"===(g=t.mode),a="hide"===g,s=t.size||15,r=/([0-9]+)%/.exec(s),l=t.horizFirst?["right","bottom"]:["bottom","right"],c=t.duration/2,d=e.effects.createPlaceholder(n),u=n.cssClip(),p={clip:e.extend({},u)},h={clip:e.extend({},u)},m=[u[l[0]],u[l[1]]],g=n.queue().length;r&&(s=parseInt(r[1],10)/100*m[a?0:1]),p.clip[l[0]]=s,h.clip[l[0]]=s,h.clip[l[1]]=0,o&&(n.cssClip(h.clip),d&&d.css(e.effects.clipToBox(h)),h.clip=u),n.queue(function(i){d&&d.animate(e.effects.clipToBox(p),c,t.easing).animate(e.effects.clipToBox(h),c,t.easing),i()}).animate(p,c,t.easing).animate(h,c,t.easing).queue(i),e.effects.unshift(n,g,4)}),e.effects.define("highlight","show",function(t,i){var n=e(this),o={backgroundColor:n.css("backgroundColor")};"hide"===t.mode&&(o.opacity=0),e.effects.saveStyle(n),n.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("size",function(t,i){var n,o=e(this),a=["fontSize"],s=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],r=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],l=t.mode,c="effect"!==l,d=t.scale||"both",u=t.origin||["middle","center"],p=o.css("position"),h=o.position(),m=e.effects.scaledDimensions(o),g=t.from||m,v=t.to||e.effects.scaledDimensions(o,0);e.effects.createPlaceholder(o),"show"===l&&(l=g,g=v,v=l),n={from:{y:g.height/m.height,x:g.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},"box"!==d&&"both"!==d||(n.from.y!==n.to.y&&(g=e.effects.setTransition(o,s,n.from.y,g),v=e.effects.setTransition(o,s,n.to.y,v)),n.from.x!==n.to.x&&(g=e.effects.setTransition(o,r,n.from.x,g),v=e.effects.setTransition(o,r,n.to.x,v))),"content"!==d&&"both"!==d||n.from.y!==n.to.y&&(g=e.effects.setTransition(o,a,n.from.y,g),v=e.effects.setTransition(o,a,n.to.y,v)),u&&(u=e.effects.getBaseline(u,m),g.top=(m.outerHeight-g.outerHeight)*u.y+h.top,g.left=(m.outerWidth-g.outerWidth)*u.x+h.left,v.top=(m.outerHeight-v.outerHeight)*u.y+h.top,v.left=(m.outerWidth-v.outerWidth)*u.x+h.left),delete g.outerHeight,delete g.outerWidth,o.css(g),"content"!==d&&"both"!==d||(s=s.concat(["marginTop","marginBottom"]).concat(a),r=r.concat(["marginLeft","marginRight"]),o.find("*[width]").each(function(){var i=e(this),o={height:(a=e.effects.scaledDimensions(i)).height*n.from.y,width:a.width*n.from.x,outerHeight:a.outerHeight*n.from.y,outerWidth:a.outerWidth*n.from.x},a={height:a.height*n.to.y,width:a.width*n.to.x,outerHeight:a.height*n.to.y,outerWidth:a.width*n.to.x};n.from.y!==n.to.y&&(o=e.effects.setTransition(i,s,n.from.y,o),a=e.effects.setTransition(i,s,n.to.y,a)),n.from.x!==n.to.x&&(o=e.effects.setTransition(i,r,n.from.x,o),a=e.effects.setTransition(i,r,n.to.x,a)),c&&e.effects.saveStyle(i),i.css(o),i.animate(a,t.duration,t.easing,function(){c&&e.effects.restoreStyle(i)})})),o.animate(v,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){var t=o.offset();0===v.opacity&&o.css("opacity",g.opacity),c||(o.css("position","static"===p?"relative":p).offset(t),e.effects.saveStyle(o)),i()}})}),e.effects.define("scale",function(t,i){var n=e(this),o=t.mode;o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==o?0:100),o=e.extend(!0,{from:e.effects.scaledDimensions(n),to:e.effects.scaledDimensions(n,o,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(o.from.opacity=1,o.to.opacity=0),e.effects.effect.size.call(this,o,i)}),e.effects.define("puff","hide",function(t,i){t=e.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150}),e.effects.effect.scale.call(this,t,i)}),e.effects.define("pulsate","show",function(t,i){var n=e(this),o="show"===(c=t.mode),a=2*(t.times||5)+(o||"hide"===c?1:0),s=t.duration/a,r=0,l=1,c=n.queue().length;for(!o&&n.is(":visible")||(n.css("opacity",0).show(),r=1);l<a;l++)n.animate({opacity:r},s,t.easing),r=1-r;n.animate({opacity:r},s,t.easing),n.queue(i),e.effects.unshift(n,c,1+a)}),e.effects.define("shake",function(t,i){var n=1,o=e(this),a=t.direction||"left",s=t.distance||20,r=t.times||3,l=2*r+1,c=Math.round(t.duration/l),d="up"===a||"down"===a?"top":"left",u="up"===a||"left"===a,p={},h={},m={};a=o.queue().length;for(e.effects.createPlaceholder(o),p[d]=(u?"-=":"+=")+s,h[d]=(u?"+=":"-=")+2*s,m[d]=(u?"-=":"+=")+2*s,o.animate(p,c,t.easing);n<r;n++)o.animate(h,c,t.easing).animate(m,c,t.easing);o.animate(h,c,t.easing).animate(p,c/2,t.easing).queue(i),e.effects.unshift(o,a,1+l)}),e.effects.define("slide","show",function(t,i){var n,o,a=e(this),s={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=t.mode,l=t.direction||"left",c="up"===l||"down"===l?"top":"left",d="up"===l||"left"===l,u=t.distance||a["top"==c?"outerHeight":"outerWidth"](!0),p={};e.effects.createPlaceholder(a),n=a.cssClip(),o=a.position()[c],p[c]=(d?-1:1)*u+o,p.clip=a.cssClip(),p.clip[s[l][1]]=p.clip[s[l][0]],"show"===r&&(a.cssClip(p.clip),a.css(c,p[c]),p.clip=n,p[c]=o),a.animate(p,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),!1!==e.uiBackCompat&&e.effects.define("transfer",function(t,i){e(this).transfer(t,i)})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery.ui.widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}(function(e){"use strict";function t(t){var i="dragover"===t;return function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var o=n.dataTransfer;o&&-1!==e.inArray("Files",o.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:n}))&&(n.preventDefault(),i&&(o.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('<input type="file">').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,function(e,i){t=t.replace("{"+e+"}",i)}),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done(function(){i.submit()})},processData:!1,contentType:!1,cache:!1},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,function(e,t){i.push({name:e,value:t})}),i):[]},_getTotal:function(t){var i=0;return e.each(t,function(e,t){i+=t.size||1}),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,o=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&o-i._time<i.progressInterval&&t.loaded!==t.total)return;i._time=o,n=Math.floor(t.loaded/t.total*(i.chunkSize||i._progress.total))+(i.uploadedBytes||0),this._progress.loaded+=n-i._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(o,this._progress.loaded,i.bitrateInterval),i._progress.loaded=i.loaded=n,i._progress.bitrate=i.bitrate=i._bitrateTimer.getBitrate(o,n,i.bitrateInterval),this._trigger("progress",e.Event("progress",{delegatedEvent:t}),i),this._trigger("progressall",e.Event("progressall",{delegatedEvent:t}),this._progress)}},_initProgressListener:function(t){var i=this,n=t.xhr?t.xhr():e.ajaxSettings.xhr();n.upload&&(e(n.upload).bind("progress",function(e){var n=e.originalEvent;e.lengthComputable=n.lengthComputable,e.loaded=n.loaded,e.total=n.total,i._onProgress(e,t)}),t.xhr=function(){return n})},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_initXHRData:function(t){var i,n=this,o=t.files[0],a=t.multipart||!e.support.xhrFileUpload,s="array"===e.type(t.paramName)?t.paramName[0]:t.paramName;t.headers=e.extend({},t.headers),t.contentRange&&(t.headers["Content-Range"]=t.contentRange),a&&!t.blob&&this._isInstanceOf("File",o)||(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(o.name)+'"'),a?e.support.xhrFormDataFileUpload&&(t.postMessage?(i=this._getFormData(t),t.blob?i.push({name:s,value:t.blob}):e.each(t.files,function(n,o){i.push({name:"array"===e.type(t.paramName)&&t.paramName[n]||s,value:o})})):(n._isInstanceOf("FormData",t.formData)?i=t.formData:(i=new FormData,e.each(this._getFormData(t),function(e,t){i.append(t.name,t.value)})),t.blob?i.append(s,t.blob,o.name):e.each(t.files,function(o,a){(n._isInstanceOf("File",a)||n._isInstanceOf("Blob",a))&&i.append("array"===e.type(t.paramName)&&t.paramName[o]||s,a,a.uploadName||a.name)})),t.data=i):(t.contentType=o.type||"application/octet-stream",t.data=t.blob||o),t.blob=null},_initIframeSettings:function(t){var i=e("<a></a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each(function(){for(var t=e(this),i=t.prop("name")||"files[]",o=(t.prop("files")||[1]).length;o;)n.push(i),o-=1}),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var o=e.Deferred(),a=o.promise();return i=i||this.options.context||a,!0===t?o.resolveWith(i,n):!1===t&&o.rejectWith(i,n),a.abort=o.promise,this._enhancePromise(a)},_addConvenienceMethods:function(t,i){var n=this,o=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,a){return(t||a)&&(i._processQueue=this._processQueue=(this._processQueue||o([this])).pipe(function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():o(arguments)}).pipe(t,a)),this._processQueue||o([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,o,a=this,s=t.files[0],r=s.size,l=t.uploadedBytes,c=t.maxChunkSize||r,d=this._blobSlice,u=e.Deferred(),p=u.promise();return!(!(this._isXHRUpload(t)&&d&&(l||c<r))||t.data)&&(!!i||(l>=r?(s.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",s.error])):(o=function(){var i=e.extend({},t),p=i._progress.loaded;i.blob=d.call(s,l,l+c,s.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+r,a._initXHRData(i),a._initProgressListener(i),n=(!1!==a._trigger("chunksend",null,i)&&e.ajax(i)||a._getXHRPromise(!1,i.context)).done(function(n,s,c){l=a._getUploadedBytes(c)||l+i.chunkSize,p+i.chunkSize-i._progress.loaded&&a._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=s,i.jqXHR=c,a._trigger("chunkdone",null,i),a._trigger("chunkalways",null,i),l<r?o():u.resolveWith(i.context,[n,s,c])}).fail(function(e,t,n){i.jqXHR=e,i.textStatus=t,i.errorThrown=n,a._trigger("chunkfail",null,i),a._trigger("chunkalways",null,i),u.rejectWith(i.context,[e,t,n])})},this._enhancePromise(p),p.abort=function(){return n.abort()},o(),p)))},_beforeSend:function(e,t){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0),this._initResponseObject(t),this._initProgressObject(t),t._progress.loaded=t.loaded=t.uploadedBytes||0,t._progress.total=t.total=this._getTotal(t.files)||1,t._progress.bitrate=t.bitrate=0,this._active+=1,this._progress.loaded+=t.loaded,this._progress.total+=t.total},_onDone:function(t,i,n,o){var a=o._progress.total,s=o._response;o._progress.loaded<a&&this._onProgress(e.Event("progress",{lengthComputable:!0,loaded:a,total:a}),o),s.result=o.result=t,s.textStatus=o.textStatus=i,s.jqXHR=o.jqXHR=n,this._trigger("done",null,o)},_onFail:function(e,t,i,n){var o=n._response;n.recalculateProgress&&(this._progress.loaded-=n._progress.loaded,this._progress.total-=n._progress.total),o.jqXHR=n.jqXHR=e,o.textStatus=n.textStatus=t,o.errorThrown=n.errorThrown=i,this._trigger("fail",null,n)},_onAlways:function(e,t,i,n){this._trigger("always",null,n)},_onSend:function(t,i){i.submit||this._addConvenienceMethods(t,i);var n,o,a,s,r=this,l=r._getAJAXSettings(i),c=function(){return r._sending+=1,l._bitrateTimer=new r._BitrateTimer,n=n||((o||!1===r._trigger("send",e.Event("send",{delegatedEvent:t}),l))&&r._getXHRPromise(!1,l.context,o)||r._chunkedUpload(l)||e.ajax(l)).done(function(e,t,i){r._onDone(e,t,i,l)}).fail(function(e,t,i){r._onFail(e,t,i,l)}).always(function(e,t,i){if(r._onAlways(e,t,i,l),r._sending-=1,r._active-=1,l.limitConcurrentUploads&&l.limitConcurrentUploads>r._sending)for(var n=r._slots.shift();n;){if("pending"===r._getDeferredState(n)){n.resolve();break}n=r._slots.shift()}0===r._active&&r._trigger("stop")})};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(a=e.Deferred(),this._slots.push(a),s=a.pipe(c)):(this._sequence=this._sequence.pipe(c,c),s=this._sequence),s.abort=function(){return o=[void 0,"abort","abort"],n?n.abort():(a&&a.rejectWith(l.context,o),c())},this._enhancePromise(s)):c()},_onAdd:function(t,i){var n,o,a,s,r=this,l=!0,c=e.extend({},this.options,i),d=i.files,u=d.length,p=c.limitMultiFileUploads,h=c.limitMultiFileUploadSize,m=c.limitMultiFileUploadSizeOverhead,g=0,v=this._getParamName(c),f=0;if(!h||u&&void 0!==d[0].size||(h=void 0),(c.singleFileUploads||p||h)&&this._isXHRUpload(c))if(c.singleFileUploads||h||!p)if(!c.singleFileUploads&&h)for(a=[],n=[],s=0;s<u;s+=1)g+=d[s].size+m,(s+1===u||g+d[s+1].size+m>h||p&&s+1-f>=p)&&(a.push(d.slice(f,s+1)),(o=v.slice(f,s+1)).length||(o=v),n.push(o),f=s+1,g=0);else n=v;else for(a=[],n=[],s=0;s<u;s+=p)a.push(d.slice(s,s+p)),(o=v.slice(s,s+p)).length||(o=v),n.push(o);else a=[d],n=[v];return i.originalFiles=d,e.each(a||d,function(o,s){var c=e.extend({},i);return c.files=a?s:[s],c.paramName=n[o],r._initResponseObject(c),r._initProgressObject(c),r._addConvenienceMethods(t,c),l=r._trigger("add",e.Event("add",{delegatedEvent:t}),c)}),l},_replaceFileInput:function(t){var i=t.fileInput,n=i.clone(!0);t.fileInputClone=n,e("<form></form>").append(n)[0].reset(),i.after(n).detach(),e.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map(function(e,t){return t===i[0]?n[0]:t}),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,o=this,a=e.Deferred(),s=function(e){e&&!e.entry&&(e.entry=t),a.resolve([e])},r=function(){n.readEntries(function(e){e.length?(l=l.concat(e),r()):function(e){o._handleFileTreeEntries(e,i+t.name+"/").done(function(e){a.resolve(e)}).fail(s)}(l)},s)},l=[];return i=i||"",t.isFile?t._file?(t._file.relativePath=i,a.resolve(t._file)):t.file(function(e){e.relativePath=i,a.resolve(e)},s):t.isDirectory?(n=t.createReader(),r()):a.resolve([]),a.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,function(e){return n._handleFileTreeEntry(e,i)})).pipe(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()})):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,o=(t=e(t)).prop("webkitEntries")||t.prop("entries");if(o&&o.length)return this._handleFileTreeEntries(o);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,function(e,t){t.name=t.fileName,t.size=t.fileSize});else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).pipe(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always(function(o){n.files=o,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)})},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)}),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,o={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always(function(n){o.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),o)&&i._onAdd(t,o)}))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,function(e,o){var a,s=o.name.toLowerCase();/^data-/.test(s)&&(s=s.slice(5).replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()}),a=n[s],t._isRegExpOption(s,a)&&(a=t._getRegExp(a)),i[s]=a)})},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always(function(e){t.files=e,i._onAdd(null,t)}):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,o=this,a=e.Deferred(),s=a.promise();return s.abort=function(){return n=!0,i?i.abort():(a.reject(null,"abort","abort"),s)},this._getFileInputFiles(t.fileInput).always(function(e){n||(e.length?(t.files=e,(i=o._onSend(null,t)).then(function(e,t,i){a.resolve(e,t,i)},function(e,t,i){a.reject(e,t,i)})):a.reject())}),this._enhancePromise(s)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}(function(e){"use strict";var t=0;e.ajaxTransport("iframe",function(i){if(i.async){var n,o,a,s=i.initialIframeSrc||"javascript:false;";return{send:function(r,l){(n=e('<form style="display:none;"></form>')).attr("accept-charset",i.formAcceptCharset),a=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+a+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+a+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+a+"_method=PATCH",i.type="POST"),o=e('<iframe src="'+s+'" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",function(){var t,a=e.isArray(i.paramName)?i.paramName:[i.paramName];o.unbind("load").bind("load",function(){var t;try{if(!(t=o.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('<iframe src="'+s+'"></iframe>').appendTo(n),window.setTimeout(function(){n.remove()},0)}),n.prop("target",o.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,function(t,i){e('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(n)}),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after(function(e){return t[e]}),i.paramName&&i.fileInput.each(function(t){e(this).prop("name",a[t]||i.paramName)}),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),n.submit(),t&&t.length&&i.fileInput.each(function(i,n){var o=e(t[i]);e(n).prop("name",o.prop("name")).attr("form",o.attr("form")),o.replaceWith(n)})}),n.append(o).appendTo(document.body)},abort:function(){o&&o.unbind("load").prop("src",s),n&&n.remove()}}}}),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}),function(e){function t(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var i={};t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,t,i){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=42)}([function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function e(t,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.data=t,this.text=i.text||t,this.options=i}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.startBin="101",this.endBin="101",this.middleBin="01010",this.Lbinary=["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],this.Gbinary=["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],this.Rbinary=["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"]}return e.prototype.encode=function(e,t,i){var n="";i=i||"";for(var o=0;o<e.length;o++)"L"==t[o]?n+=this.Lbinary[e[o]]:"G"==t[o]?n+=this.Gbinary[e[o]]:"R"==t[o]&&(n+=this.Rbinary[e[o]]),o<e.length-1&&(n+=i);return n},e}();t.default=i},function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t;i++)e="0"+e;return e}Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),a=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.encode=function(){for(var e="110",t=0;t<this.data.length;t++){var i=parseInt(this.data[t]).toString(2);i=n(i,4-i.length);for(var o=0;o<i.length;o++)e+="0"==i[o]?"100":"110"}return{data:e+="1001",text:this.text}},t.prototype.valid=function(){return-1!==this.data.search(/^[0-9]+$/)},t}(o.default);t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var i,n={};for(i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);for(i in t)t.hasOwnProperty(i)&&void 0!==t[i]&&(n[i]=t[i]);return n}},function(e,t,i){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),r=function(e){function t(i,a){n(this,t);var s=o(this,e.call(this,i.substring(1),a));s.bytes=[];for(var r=0;r<i.length;++r)s.bytes.push(i.charCodeAt(r));return s.encodings=[740,644,638,176,164,100,224,220,124,608,604,572,436,244,230,484,260,254,650,628,614,764,652,902,868,836,830,892,844,842,752,734,590,304,112,94,416,128,122,672,576,570,464,422,134,496,478,142,910,678,582,768,762,774,880,862,814,896,890,818,914,602,930,328,292,200,158,68,62,424,412,232,218,76,74,554,616,978,556,146,340,212,182,508,268,266,956,940,938,758,782,974,400,310,118,512,506,960,954,502,518,886,966,668,680,692,5379],s}return a(t,e),t.prototype.encode=function(){var e,t=this.bytes,i=t.shift()-105;if(103===i)e=this.nextA(t,1);else if(104===i)e=this.nextB(t,1);else{if(105!==i)throw new l;e=this.nextC(t,1)}return{text:this.text==this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:this.getEncoding(i)+e.result+this.getEncoding((e.checksum+i)%103)+this.getEncoding(106)}},t.prototype.getEncoding=function(e){return this.encodings[e]?(this.encodings[e]+1e3).toString(2):""},t.prototype.valid=function(){return-1!==this.data.search(/^[\x00-\x7F\xC8-\xD3]+$/)},t.prototype.nextA=function(e,t){if(e.length<=0)return{result:"",checksum:0};var i,n;if(e[0]>=200)n=e[0]-105,e.shift(),99===n?i=this.nextC(e,t+1):100===n?i=this.nextB(e,t+1):98===n?(e[0]=e[0]>95?e[0]-96:e[0],i=this.nextA(e,t+1)):i=this.nextA(e,t+1);else{var o=e[0];n=o<32?o+64:o-32,e.shift(),i=this.nextA(e,t+1)}var a=n*t;return{result:this.getEncoding(n)+i.result,checksum:a+i.checksum}},t.prototype.nextB=function(e,t){if(e.length<=0)return{result:"",checksum:0};var i,n;e[0]>=200?(n=e[0]-105,e.shift(),99===n?i=this.nextC(e,t+1):101===n?i=this.nextA(e,t+1):98===n?(e[0]=e[0]<32?e[0]+96:e[0],i=this.nextB(e,t+1)):i=this.nextB(e,t+1)):(n=e[0]-32,e.shift(),i=this.nextB(e,t+1));var o=n*t;return{result:this.getEncoding(n)+i.result,checksum:o+i.checksum}},t.prototype.nextC=function(e,t){if(e.length<=0)return{result:"",checksum:0};var i,n;e[0]>=200?(n=e[0]-105,e.shift(),i=100===n?this.nextB(e,t+1):101===n?this.nextA(e,t+1):this.nextC(e,t+1)):(n=10*(e[0]-48)+e[1]-48,e.shift(),e.shift(),i=this.nextC(e,t+1));var o=n*t;return{result:this.getEncoding(n)+i.result,checksum:o+i.checksum}},t}(s.default),l=function(e){function t(){n(this,t);var i=o(this,e.call(this));return i.name="InvalidStartCharacterException",i.message="The encoding does not start with a start character.",i}return a(t,e),t}(Error);t.default=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mod10=function(e){for(var t=0,i=0;i<e.length;i++){var n=parseInt(e[i]);t+=(i+e.length)%2==0?n:2*n%10+Math.floor(2*n/10)}return(10-t%10)%10},t.mod11=function(e){for(var t=0,i=[2,3,4,5,6,7],n=0;n<e.length;n++){var o=parseInt(e[e.length-1-n]);t+=i[n%i.length]*o}return(11-t%11)%11}},function(e,t){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(o,a){i(this,t);var s=n(this,e.call(this));return s.name="InvalidInputException",s.symbology=o,s.input=a,s.message='"'+s.input+'" is not a valid input for '+s.symbology,s}return o(t,e),t}(Error),s=function(e){function t(){i(this,t);var o=n(this,e.call(this));return o.name="InvalidElementException",o.message="Not supported type to render on",o}return o(t,e),t}(Error),r=function(e){function t(){i(this,t);var o=n(this,e.call(this));return o.name="NoElementException",o.message="No element to render on.",o}return o(t,e),t}(Error);t.InvalidInputException=a,t.InvalidElementException=s,t.NoElementException=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var i in t)t.hasOwnProperty(i)&&("string"==typeof e[i=t[i]]&&(e[i]=parseInt(e[i],10)));return"string"==typeof e.displayValue&&(e.displayValue="false"!=e.displayValue),e}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}}},function(e,t,i){"use strict";function n(e,t){return t.height+(t.displayValue&&e.text.length>0?t.fontSize+t.textMargin:0)+t.marginTop+t.marginBottom}function o(e,t,i){if(i.displayValue&&t<e){if("center"==i.textAlign)return Math.floor((e-t)/2);if("left"==i.textAlign)return 0;if("right"==i.textAlign)return Math.floor(e-t)}return 0}function a(e,t,i){var n;return(n=void 0===i?document.createElement("canvas").getContext("2d"):i).font=t.fontOptions+" "+t.fontSize+"px "+t.font,n.measureText(e).width}Object.defineProperty(t,"__esModule",{value:!0}),t.getTotalWidthOfEncodings=t.calculateEncodingAttributes=t.getBarcodePadding=t.getEncodingHeight=t.getMaximumHeightOfEncodings=void 0;var s=function(e){return e&&e.__esModule?e:{default:e}}(i(3));t.getMaximumHeightOfEncodings=function(e){for(var t=0,i=0;i<e.length;i++)e[i].height>t&&(t=e[i].height);return t},t.getEncodingHeight=n,t.getBarcodePadding=o,t.calculateEncodingAttributes=function(e,t,i){for(var r=0;r<e.length;r++){var l,c=e[r],d=(0,s.default)(t,c.options);l=d.displayValue?a(c.text,d,i):0;var u=c.data.length*d.width;c.width=Math.ceil(Math.max(l,u)),c.height=n(c,d),c.barcodePadding=o(l,u,d)}},t.getTotalWidthOfEncodings=function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].width;return t}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(20),o=i(19),a=i(26),s=i(29),r=i(28),l=i(34),c=i(36),d=i(35),u=i(27);t.default={CODE39:n.CODE39,CODE128:o.CODE128,CODE128A:o.CODE128A,CODE128B:o.CODE128B,CODE128C:o.CODE128C,EAN13:a.EAN13,EAN8:a.EAN8,EAN5:a.EAN5,EAN2:a.EAN2,UPC:a.UPC,ITF14:s.ITF14,ITF:r.ITF,MSI:l.MSI,MSI10:l.MSI10,MSI11:l.MSI11,MSI1010:l.MSI1010,MSI1110:l.MSI1110,pharmacode:c.pharmacode,codabar:d.codabar,GenericBarcode:u.GenericBarcode}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.api=t}return e.prototype.handleCatch=function(e){if("InvalidInputException"!==e.name)throw e;if(this.api._options.valid===this.api._defaults.valid)throw e.message;this.api._options.valid(!1),this.api.render=function(){}},e.prototype.wrapBarcodeCall=function(e){try{var t=e.apply(void 0,arguments);return this.api._options.valid(!0),t}catch(e){return this.handleCatch(e),this.api}},e}();t.default=i},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return e.marginTop=e.marginTop||e.margin,e.marginBottom=e.marginBottom||e.margin,e.marginRight=e.marginRight||e.margin,e.marginLeft=e.marginLeft||e.margin,e}},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){if("string"==typeof e)return function(e){var t=document.querySelectorAll(e);if(0!==t.length){for(var i=[],n=0;n<t.length;n++)i.push(o(t[n]));return i}}(e);if(Array.isArray(e)){for(var t=[],i=0;i<e.length;i++)t.push(o(e[i]));return t}if("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLImageElement)return function(e){var t=document.createElement("canvas");return{element:t,options:(0,s.default)(e),renderer:r.default.CanvasRenderer,afterRender:function(){e.setAttribute("src",t.toDataURL())}}}(e);if("undefined"!=typeof SVGElement&&e instanceof SVGElement)return{element:e,options:(0,s.default)(e),renderer:r.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement)return{element:e,options:(0,s.default)(e),renderer:r.default.CanvasRenderer};if(e&&e.getContext)return{element:e,renderer:r.default.CanvasRenderer};if(e&&"object"===(void 0===e?"undefined":a(e))&&!e.nodeName)return{element:e,renderer:r.default.ObjectRenderer};throw new l.InvalidElementException}Object.defineProperty(t,"__esModule",{value:!0});var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},s=n(i(37)),r=n(i(39)),l=i(6);t.default=o},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=[];return function e(i){if(Array.isArray(i))for(var n=0;n<i.length;n++)e(i[n]);else i.text=i.text||"",i.data=i.data||"",t.push(i)}(e),t}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(4)),o=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,String.fromCharCode(208)+i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[\x00-\x5F\xC8-\xCF]+$/)},t}(n.default);t.default=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(4)),o=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,String.fromCharCode(209)+i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[\x20-\x7F\xC8-\xCF]+$/)},t}(n.default);t.default=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(4)),o=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,String.fromCharCode(210)+i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^(\xCF*[0-9]{2}\xCF*)+$/)},t}(n.default);t.default=o},function(e,t,i){"use strict";function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e){var t=e.match(/^([\x00-\x5F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(t)return t[1]+String.fromCharCode(204)+s(e.substring(t[1].length));var i=e.match(/^[\x00-\x5F\xC8-\xCF]+/);return i[0].length===e.length?e:i[0]+String.fromCharCode(205)+a(e.substring(i[0].length))}function a(e){var t=e.match(/^([\x20-\x7F\xC8-\xCF]+?)(([0-9]{2}){2,})([^0-9]|$)/);if(t)return t[1]+String.fromCharCode(204)+s(e.substring(t[1].length));var i=e.match(/^[\x20-\x7F\xC8-\xCF]+/);return i[0].length===e.length?e:i[0]+String.fromCharCode(206)+o(e.substring(i[0].length))}function s(e){var t=e.match(/^(\xCF*[0-9]{2}\xCF*)+/)[0],i=t.length;return i===e.length?e:(e=e.substring(i)).match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length>=e.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length?t+String.fromCharCode(206)+o(e):t+String.fromCharCode(205)+a(e)}Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e&&e.__esModule?e:{default:e}}(i(4)),l=function(e){function t(i,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),-1!==i.search(/^[\x00-\x7F\xC8-\xD3]+$/))var l=n(this,e.call(this,function(e){var t=e.match(/^[\x00-\x5F\xC8-\xCF]*/)[0].length,i=e.match(/^[\x20-\x7F\xC8-\xCF]*/)[0].length;return(e.match(/^(\xCF*[0-9]{2}\xCF*)*/)[0].length>=2?String.fromCharCode(210)+s(e):t>i?String.fromCharCode(208)+o(e):String.fromCharCode(209)+a(e)).replace(new RegExp("[ÍÎ]([^])[ÍÎ]"),function(e,t){return String.fromCharCode(203)+t})}(i),r));else l=n(this,e.call(this,i,r));return n(l)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(r.default);t.default=l},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CODE128C=t.CODE128B=t.CODE128A=t.CODE128=void 0;var o=n(i(18)),a=n(i(15)),s=n(i(16)),r=n(i(17));t.CODE128=o.default,t.CODE128A=a.default,t.CODE128B=s.default,t.CODE128C=r.default},function(e,t,i){"use strict";function n(e){return function(e){return l[e].toString(2)}(o(e))}function o(e){return r.indexOf(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.CODE39=void 0;var a=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),s=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i=i.toUpperCase(),n.mod43&&(i+=function(e){return r[e]}(function(e){for(var t=0,i=0;i<e.length;i++)t+=o(e[i]);return t%43}(i))),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.encode=function(){for(var e=n("*"),t=0;t<this.data.length;t++)e+=n(this.data[t])+"0";return{data:e+=n("*"),text:this.text}},t.prototype.valid=function(){return-1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)},t}(a.default),r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],l=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];t.CODE39=s},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t,i=0;for(t=0;t<12;t+=2)i+=parseInt(e[t]);for(t=1;t<12;t+=2)i+=3*parseInt(e[t]);return(10-i%10)%10}Object.defineProperty(t,"__esModule",{value:!0});var a=n(i(1)),s=function(e){function t(i,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),-1!==i.search(/^[0-9]{12}$/)&&(i+=o(i));var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n));return!n.flat&&n.fontSize>10*n.width?a.fontSize=10*n.width:a.fontSize=n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a.lastChar=n.lastChar,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[0-9]{13}$/)&&this.data[12]==o(this.data)},t.prototype.encode=function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()},t.prototype.getStructure=function(){return["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]},t.prototype.guardedEncoding=function(){var e=new a.default,t=[],i=this.getStructure()[this.data[0]],n=this.data.substr(1,6),o=this.data.substr(7,6);return this.options.displayValue&&t.push({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:e.encode(n,i),text:this.text.substr(1,6),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:e.encode(o,"RRRRRR"),text:this.text.substr(7,6),options:{fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),this.options.lastChar&&this.options.displayValue&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}})),t},t.prototype.flatEncoding=function(){var e=new a.default,t="",i=this.getStructure()[this.data[0]];return t+="101",t+=e.encode(this.data.substr(1,6),i),t+="01010",t+=e.encode(this.data.substr(7,6),"RRRRRR"),{data:t+="101",text:this.text}},t}(n(i(0)).default);t.default=s},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(1)),a=function(e){function t(i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n));return o.structure=["LL","LG","GL","GG"],o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[0-9]{2}$/)},t.prototype.encode=function(){var e=new o.default,t=this.structure[parseInt(this.data)%4],i="1011";return{data:i+=e.encode(this.data,t,"01"),text:this.text}},t}(n(i(0)).default);t.default=a},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(1)),a=function(e){function t(i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n));return o.structure=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[0-9]{5}$/)},t.prototype.encode=function(){var e=new o.default,t=this.checksum(),i="1011";return{data:i+=e.encode(this.data,this.structure[t],"01"),text:this.text}},t.prototype.checksum=function(){var e=0;return e+=3*parseInt(this.data[0]),e+=9*parseInt(this.data[1]),e+=3*parseInt(this.data[2]),e+=9*parseInt(this.data[3]),(e+=3*parseInt(this.data[4]))%10},t}(n(i(0)).default);t.default=a},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t,i=0;for(t=0;t<7;t+=2)i+=3*parseInt(e[t]);for(t=1;t<7;t+=2)i+=parseInt(e[t]);return(10-i%10)%10}Object.defineProperty(t,"__esModule",{value:!0});var a=n(i(1)),s=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),-1!==i.search(/^[0-9]{7}$/)&&(i+=o(i)),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[0-9]{8}$/)&&this.data[7]==o(this.data)},t.prototype.encode=function(){var e=new a.default,t="",i=this.data.substr(0,4),n=this.data.substr(4,4);return t+=e.startBin,t+=e.encode(i,"LLLL"),t+=e.middleBin,t+=e.encode(n,"RRRR"),{data:t+=e.endBin,text:this.text}},t}(n(i(0)).default);t.default=s},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t,i=0;for(t=1;t<11;t+=2)i+=parseInt(e[t]);for(t=0;t<11;t+=2)i+=3*parseInt(e[t]);return(10-i%10)%10}Object.defineProperty(t,"__esModule",{value:!0});var a=n(i(1)),s=function(e){function t(i,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),-1!==i.search(/^[0-9]{11}$/)&&(i+=o(i));var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n));return a.displayValue=n.displayValue,n.fontSize>10*n.width?a.fontSize=10*n.width:a.fontSize=n.fontSize,a.guardHeight=n.height+a.fontSize/2+n.textMargin,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==o(this.data)},t.prototype.encode=function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()},t.prototype.flatEncoding=function(){var e=new a.default,t="";return t+="101",t+=e.encode(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=e.encode(this.data.substr(6,6),"RRRRRR"),{data:t+="101",text:this.text}},t.prototype.guardedEncoding=function(){var e=new a.default,t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+e.encode(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:e.encode(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:e.encode(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:e.encode(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t},t}(n(i(0)).default);t.default=s},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.UPC=t.EAN2=t.EAN5=t.EAN8=t.EAN13=void 0;var o=n(i(21)),a=n(i(24)),s=n(i(23)),r=n(i(22)),l=n(i(25));t.EAN13=o.default,t.EAN8=a.default,t.EAN5=s.default,t.EAN2=r.default,t.UPC=l.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericBarcode=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),o=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.encode=function(){return{data:"10101010101010101010101010101010101010101",text:this.text}},t.prototype.valid=function(){return!0},t}(n.default);t.GenericBarcode=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ITF=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),o=function(e){function t(i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n));return o.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^([0-9]{2})+$/)},t.prototype.encode=function(){for(var e="1010",t=0;t<this.data.length;t+=2)e+=this.calculatePair(this.data.substr(t,2));return{data:e+="11101",text:this.text}},t.prototype.calculatePair=function(e){for(var t="",i=this.binaryRepresentation[e[0]],n=this.binaryRepresentation[e[1]],o=0;o<5;o++)t+="1"==i[o]?"111":"1",t+="1"==n[o]?"000":"0";return t},t}(n.default);t.ITF=o},function(e,t,i){"use strict";function n(e){for(var t=0,i=0;i<13;i++)t+=parseInt(e[i])*(3-i%2*2);return 10*Math.ceil(t/10)-t}Object.defineProperty(t,"__esModule",{value:!0}),t.ITF14=void 0;var o=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),a=function(e){function t(i,o){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),-1!==i.search(/^[0-9]{13}$/)&&(i+=n(i));var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,o));return a.binaryRepresentation={0:"00110",1:"10001",2:"01001",3:"11000",4:"00101",5:"10100",6:"01100",7:"00011",8:"10010",9:"01010"},a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[0-9]{14}$/)&&this.data[13]==n(this.data)},t.prototype.encode=function(){for(var e="1010",t=0;t<14;t+=2)e+=this.calculatePair(this.data.substr(t,2));return{data:e+="11101",text:this.text}},t.prototype.calculatePair=function(e){for(var t="",i=this.binaryRepresentation[e[0]],n=this.binaryRepresentation[e[1]],o=0;o<5;o++)t+="1"==i[o]?"111":"1",t+="1"==n[o]?"000":"0";return t},t}(o.default);t.ITF14=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(2)),o=i(5),a=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i+(0,o.mod10)(i),n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n.default);t.default=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(2)),o=i(5),a=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i+=(0,o.mod10)(i),i+=(0,o.mod10)(i),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n.default);t.default=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(2)),o=i(5),a=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i+(0,o.mod11)(i),n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n.default);t.default=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(2)),o=i(5),a=function(e){function t(i,n){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i+=(0,o.mod11)(i),i+=(0,o.mod10)(i),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(n.default);t.default=a},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.MSI1110=t.MSI1010=t.MSI11=t.MSI10=t.MSI=void 0;var o=n(i(2)),a=n(i(30)),s=n(i(32)),r=n(i(31)),l=n(i(33));t.MSI=o.default,t.MSI10=a.default,t.MSI11=s.default,t.MSI1010=r.default,t.MSI1110=l.default},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.codabar=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),o=function(e){function t(i,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),0===i.search(/^[0-9\-\$\:\.\+\/]+$/)&&(i="A"+i+"A");var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i.toUpperCase(),n));return o.text=o.options.text||o.text.replace(/[A-D]/g,""),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.valid=function(){return-1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)},t.prototype.encode=function(){for(var e=[],t=this.getEncodings(),i=0;i<this.data.length;i++)e.push(t[this.data.charAt(i)]),i!==this.data.length-1&&e.push("0");return{text:this.text,data:e.join("")}},t.prototype.getEncodings=function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"101100110011",A:"1011001001",B:"1010010011",C:"1001001011",D:"1010011001"}},t}(n.default);t.codabar=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pharmacode=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(i(0)),o=function(e){function t(i,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,i,n));return o.number=parseInt(i,10),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.encode=function(){for(var e=this.number,t="";!isNaN(e)&&0!=e;)e%2==0?(t="11100"+t,e=(e-2)/2):(t="100"+t,e=(e-1)/2);return{data:t=t.slice(0,-2),text:this.text}},t.prototype.valid=function(){return this.number>=3&&this.number<=131070},t}(n.default);t.pharmacode=o},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(7)),a=n(i(8));t.default=function(e){var t={};for(var i in a.default)a.default.hasOwnProperty(i)&&(e.hasAttribute("jsbarcode-"+i.toLowerCase())&&(t[i]=e.getAttribute("jsbarcode-"+i.toLowerCase())),e.hasAttribute("data-"+i.toLowerCase())&&(t[i]=e.getAttribute("data-"+i.toLowerCase())));return t.value=e.getAttribute("jsbarcode-value")||e.getAttribute("data-value"),(0,o.default)(t)}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(i(3)),o=i(9),a=function(){function e(t,i,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.canvas=t,this.encodings=i,this.options=n}return e.prototype.render=function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var e=0;e<this.encodings.length;e++){var t=(0,n.default)(this.options,this.encodings[e].options);this.drawCanvasBarcode(t,this.encodings[e]),this.drawCanvasText(t,this.encodings[e]),this.moveCanvasDrawing(this.encodings[e])}this.restoreCanvas()},e.prototype.prepareCanvas=function(){var e=this.canvas.getContext("2d");e.save(),(0,o.calculateEncodingAttributes)(this.encodings,this.options,e);var t=(0,o.getTotalWidthOfEncodings)(this.encodings),i=(0,o.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=t+this.options.marginLeft+this.options.marginRight,this.canvas.height=i,e.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(e.fillStyle=this.options.background,e.fillRect(0,0,this.canvas.width,this.canvas.height)),e.translate(this.options.marginLeft,0)},e.prototype.drawCanvasBarcode=function(e,t){var i,n=this.canvas.getContext("2d"),o=t.data;i="top"==e.textPosition?e.marginTop+e.fontSize+e.textMargin:e.marginTop,n.fillStyle=e.lineColor;for(var a=0;a<o.length;a++){var s=a*e.width+t.barcodePadding;"1"===o[a]?n.fillRect(s,i,e.width,e.height):o[a]&&n.fillRect(s,i,e.width,e.height*o[a])}},e.prototype.drawCanvasText=function(e,t){var i,n,o=this.canvas.getContext("2d"),a=e.fontOptions+" "+e.fontSize+"px "+e.font;e.displayValue&&(n="top"==e.textPosition?e.marginTop+e.fontSize-e.textMargin:e.height+e.textMargin+e.marginTop+e.fontSize,o.font=a,"left"==e.textAlign||t.barcodePadding>0?(i=0,o.textAlign="left"):"right"==e.textAlign?(i=t.width-1,o.textAlign="right"):(i=t.width/2,o.textAlign="center"),o.fillText(t.text,i,n))},e.prototype.moveCanvasDrawing=function(e){this.canvas.getContext("2d").translate(e.width,0)},e.prototype.restoreCanvas=function(){this.canvas.getContext("2d").restore()},e}();t.default=a},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(38)),a=n(i(41)),s=n(i(40));t.default={CanvasRenderer:o.default,SVGRenderer:a.default,ObjectRenderer:s.default}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(t,i,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.object=t,this.encodings=i,this.options=n}return e.prototype.render=function(){this.object.encodings=this.encodings},e}();t.default=i},function(e,t,i){"use strict";function n(e,t,i){var n=document.createElementNS(l,"g");return n.setAttribute("transform","translate("+e+", "+t+")"),i.appendChild(n),n}function o(e,t){e.setAttribute("style","fill:"+t.lineColor+";")}function a(e,t,i,n,o){var a=document.createElementNS(l,"rect");return a.setAttribute("x",e),a.setAttribute("y",t),a.setAttribute("width",i),a.setAttribute("height",n),o.appendChild(a),a}Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){return e&&e.__esModule?e:{default:e}}(i(3)),r=i(9),l="http://www.w3.org/2000/svg",c=function(){function e(t,i,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.svg=t,this.encodings=i,this.options=n}return e.prototype.render=function(){var e=this.options.marginLeft;this.prepareSVG();for(var t=0;t<this.encodings.length;t++){var i=this.encodings[t],a=(0,s.default)(this.options,i.options),r=n(e,a.marginTop,this.svg);o(r,a),this.drawSvgBarcode(r,a,i),this.drawSVGText(r,a,i),e+=i.width}},e.prototype.prepareSVG=function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,r.calculateEncodingAttributes)(this.encodings,this.options);var e=(0,r.getTotalWidthOfEncodings)(this.encodings),t=(0,r.getMaximumHeightOfEncodings)(this.encodings),i=e+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(i,t),this.options.background&&a(0,0,i,t,this.svg).setAttribute("style","fill:"+this.options.background+";")},e.prototype.drawSvgBarcode=function(e,t,i){var n,o=i.data;n="top"==t.textPosition?t.fontSize+t.textMargin:0;for(var s=0,r=0,l=0;l<o.length;l++)r=l*t.width+i.barcodePadding,"1"===o[l]?s++:s>0&&(a(r-t.width*s,n,t.width*s,t.height,e),s=0);s>0&&a(r-t.width*(s-1),n,t.width*s,t.height,e)},e.prototype.drawSVGText=function(e,t,i){var n,o,a=document.createElementNS(l,"text");t.displayValue&&(a.setAttribute("style","font:"+t.fontOptions+" "+t.fontSize+"px "+t.font),o="top"==t.textPosition?t.fontSize-t.textMargin:t.height+t.textMargin+t.fontSize,"left"==t.textAlign||i.barcodePadding>0?(n=0,a.setAttribute("text-anchor","start")):"right"==t.textAlign?(n=i.width-1,a.setAttribute("text-anchor","end")):(n=i.width/2,a.setAttribute("text-anchor","middle")),a.setAttribute("x",n),a.setAttribute("y",o),a.appendChild(document.createTextNode(i.text)),e.appendChild(a))},e.prototype.setSvgAttributes=function(e,t){var i=this.svg;i.setAttribute("width",e+"px"),i.setAttribute("height",t+"px"),i.setAttribute("x","0px"),i.setAttribute("y","0px"),i.setAttribute("viewBox","0 0 "+e+" "+t),i.setAttribute("xmlns",l),i.setAttribute("version","1.1"),i.style.transform="translate(0,0)"},e}();t.default=c},function(e,t,i){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){f.prototype[t]=f.prototype[t.toUpperCase()]=f.prototype[t.toLowerCase()]=function(i,n){var o=this;return o._errorHandler.wrapBarcodeCall(function(){n.text=void 0===n.text?void 0:""+n.text;var s=(0,c.default)(o._options,n);s=(0,h.default)(s);var r=e[t],l=a(i,r,s);return o._encodings.push(l),o})}}function a(e,t,i){var n=new t(e=""+e,i);if(!n.valid())throw new g.InvalidInputException(n.constructor.name,e);var o=n.encode();o=(0,d.default)(o);for(var a=0;a<o.length;a++)o[a].options=(0,c.default)(i,o[a].options);return o}function s(){return l.default.CODE128?"CODE128":Object.keys(l.default)[0]}function r(e,t,i){t=(0,d.default)(t);for(var n=0;n<t.length;n++)t[n].options=(0,c.default)(i,t[n].options),(0,u.default)(t[n].options);(0,u.default)(i),new(0,e.renderer)(e.element,t,i).render(),e.afterRender&&e.afterRender()}var l=n(i(10)),c=n(i(3)),d=n(i(14)),u=n(i(12)),p=n(i(13)),h=n(i(7)),m=n(i(11)),g=i(6),v=n(i(8)),f=function(){},C=function(e,t,i){var n=new f;if(void 0===e)throw Error("No element to render on was provided.");return n._renderProperties=(0,p.default)(e),n._encodings=[],n._options=v.default,n._errorHandler=new m.default(n),void 0!==t&&((i=i||{}).format||(i.format=s()),n.options(i)[i.format](t,i).render()),n};for(var S in C.getModule=function(e){return l.default[e]},l.default)l.default.hasOwnProperty(S)&&o(l.default,S);f.prototype.options=function(e){return this._options=(0,c.default)(this._options,e),this},f.prototype.blank=function(e){var t="0".repeat(e);return this._encodings.push({data:t}),this},f.prototype.init=function(){var e;if(this._renderProperties)for(var t in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){e=this._renderProperties[t];var i=(0,c.default)(this._options,e.options);"auto"==i.format&&(i.format=s()),this._errorHandler.wrapBarcodeCall(function(){var t=a(i.value,l.default[i.format.toUpperCase()],i);r(e,t,i)})}},f.prototype.render=function(){if(!this._renderProperties)throw new g.NoElementException;if(Array.isArray(this._renderProperties))for(var e=0;e<this._renderProperties.length;e++)r(this._renderProperties[e],this._encodings,this._options);else r(this._renderProperties,this._encodings,this._options);return this},f.prototype._defaults=v.default,"undefined"!=typeof window&&(window.JsBarcode=C),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(e,t){var i=[];return jQuery(this).each(function(){i.push(this)}),C(i,e,t)}),e.exports=C}]),function(){var e="websiteapi/homepage/";isCheckInApp=!1;var t=!1,i=[];PromotionProviderID="";var n={geteventcartdetail:"geteventcartdetail",getnextavailabledateworkshop:"getnextavailabledateworkshop",checkuserexistanceinevent:"checkuserexistanceinevent",geteventdetailandavailabledates:"geteventdetailandavailabledates",savewaitlist:"savewaitlist",getavailablemultievents:e+"getavailablemultievents",LoadUserControl:e+"loadusercontrol",getonlinebookingtabdetail:e+"getonlinebookingtabdetail",getavailabledates:"getavailabledates",getavailabledatesforevents:e+"getavailabledatesforevents",GetCalendarDepositSettingAndCCDetails:"appointment/getcalendardepositsettingandccdetails",geteventdetailforreschedule:e+"geteventdetailforreschedule",geteventdetailforrescheduleforworkshop:e+"geteventdetailforrescheduleforworkshop"};$('INPUT[type="text"]',".eventcreditCardInfo").change(function(){$(this).removeClass("errorInput"),$(this).removeClass("errorInputCal")}),$('INPUT[type="password"]',".eventcreditCardInfo").change(function(){$(this).removeClass("errorInput"),$(this).removeClass("errorInputCal")}),$("textarea",".eventcreditCardInfo").change(function(){$(this).removeClass("errorInput"),$(this).removeClass("errorInputCal")}),$("select",".eventcreditCardInfo").change(function(){$(this).removeClass("errorInput"),$(this).removeClass("errorInputCal")}),$(".dropdowndiv",".eventcreditCardInfo").on("change","select",function(){$(this).closest("div").removeClass("errorInput"),$(this).closest("div").removeClass("errorInputCal")}),Date.isLeapYear=function(e){return e%4==0&&e%100!=0||e%400==0},Date.getDaysInMonth=function(e,t){return[31,Date.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t]},Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())},Date.prototype.addMonths=function(e){var t=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+e),this.setDate(Math.min(t,this.getDaysInMonth())),this},Array.prototype.uniqueObjects=function(e){function t(t,i){var n;if(e){for(var o=0;o<e.length;o++)if(t[n=e[o]]!=i[n])return!1}else for(n in t)if(t[n]!=i[n])return!1;return!0}return this.filter(function(e,i,n){for(var o=0;o<i;o++)if(t(e,n[o]))return!1;return!0})},Array.prototype.keySort=function(e){var t=function(e,t){var i,n=0;for(i in e)if(e.hasOwnProperty(i)){if(n==t)return i;n++}return!1},i=function(e,t,i){return i=null!==i?i:1,e==t?0:e>t?1*i:-1*i},n=function(e){var t,i=0;for(t in e)e.hasOwnProperty(t)&&i++;return i}(e=e||{});if(!n)return this.sort(i);for(var o in e)e[o]="desc"==e[o]||-1==e[o]?-1:"skip"==e[o]||0===e[o]?0:1;return this.sort(function(o,a){for(var s=0,r=0;0===s&&r<n;){var l=t(e,r);if(l){var c=e[l];s=i(o[l],a[l],c),r++}}return s}),this},String.prototype.getTextFromHtml||(String.prototype.getTextFromHtml=function(){var e=this;try{e=$(document.createElement("div")).html(e).text()}catch(e){}return e});var o=new Array,a=[],s=[],r=null,l=null,c=null,d="Class",u="Classes";IsOnlineCustomerWaitlist=!1;var p=5,h=1,m=2,g=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],v=["January","February","March","April","May","June","July","August","September","October","November","December"];"undefined"!=typeof ChangeAppStatus&&ChangeAppStatus.IsSearchFromInHouseClass()&&(_shopdetail={},_shopdetail.serviceID="",_shopdetail.providerID="",_shopdetail.PromotionID="",_shopdetail.bookingDateTime="",_shopdetail.isClassCalenderFilled=!1,_shopdetail.lastClassBookingDateConfigured=!1,_shopdetail.lastClassBookingLimit="",_shopdetail.lastClassBookingDate=""),_vgClassSessionSelection={localData:{},model:{IsOnline:!0,IsSearchFromInHouseClass:!1,ExceptionStorage:"Exception",EventStorage:"Event",WaitlistEventStorage:"Waitlist",ddlRecurringType:"ddlRecurringType",divWeek:"divWeek",liWeekDays:"liWeekDays",divMonth:"divMonth",txtNoofAttendees:"txtNoofAttendees",strSessionCountmsg:"Number of sessions cannot be less than selected week days.",ClassFullExceptionData:null,divStreamingEventPrice:"#divStreamingEventPrice",divStreamingEventPrice_Old:"#divStreamingEventPrice_Old",aAtBusinessStream:"#aAtBusinessStream",aLiveStream:"#aLiveStream",hdnUserIDAppointment:null,Somethingwentwrong:"Something went wrong.",txtCustomerSearchClass:null,DateFormatdddMMMDDYYYY:"ddd, MMM DD, YYYY",DateFormathmmA:"h:mm A",WaitlistBookSuccess:"Waitlist {0} booked successfully.",RescheduleBookSuccess:"The customer's {0} has been rescheduled.",ClassBookSuccess:" has been booked.",RescheduleAppointmentID:0,FeeStorage:"Fee",AttendeeAddonDetails:[]},commonProperty:{ClassFull:1,SPNotAvalable:2,UnAvailableDate:3,availabledates:"",otherSPavailabledates:"",businessID:0,SPID:0,UserID:0,UserCellNo:"",FullUserName:"",teacherName:"",UserEmail:"",eventID:0,eventName:"",tax:0,smallImage:"",startTime:"",shortStartTime:"",appointmentId:0,sessiondetail:"",streamingStatus:0,gCOrPackageDetail:"",cartUserList:"",isYearlySelection:!1,workshopEventOn:"",workshopEventDays:"",workshopEventDate:"",enableSessionDate:[],isWaitlist:!1,isWorkShop:!1,PromotionID:0,IsAmount:!1,AmountValue:0,IsOpenClassPopup:0,PreviousClassRow:"",lstfamilyfriendmembers:{},pointRedeem:0,MultiSPIdOpen:"",MultiSPIsClose:!1,DepositPaid:0,DepositsPaidDate:null,IsPaid:!1,promotionamt:0,CalculatedTaxTypeWise:[],isAddonPopup:!1,IsFromClass:!1,MembershipPackageDetailsForClass:null},TypeClass:{Single:1,Multiple:2,Any:3},offlineProperty:{ddAtWeeks:"ddAtWeeks",ddAtMonth:"ddAtMonth",lblAtDay:"lblAtDay",ddlblAtWeek:"ddlblAtWeek"},StreamingFilterType:{InHouseAndLiveStream:1,InHouse:2,LiveStream:3},StreamingDBFilterType:{InHouse:1,LiveStream:2,InHouseAndLiveStream:3},StreamingStatusEnum:{InHouse:0,LiveStream:1},SearchClassFrom:{Search:1,Rebook:2,Reschedule:3},ComponentResponse:{lstClass:null},Controls:{ClassSectionStencil:"#class-section-stencil",ClassesMainDiv:"#classesMainDiv",ddlFilterTypes:"#ddlFilterTypes",dvStreamType:"#dvStreamType",PageName:"searchnewclass",liSelectedClassName:"drpselected",searchClassPopup:"#searchClassPopup",txtCustomerSearchAppointment:"[id$=txtCustomerSearchClass]",hdnUserIDAppointment:"[id$=hdnUserIDAppointment]",dvBtSearchEdit:"#dvBtSearchEditCls",dvBtSearchHistory:"#dvBtSearchHistoryCls",SearchClassFromCalendar:"SearchClassFromCalendar",AddOnList:"#ClassAddOnList",tmplAddOnCategory:"#tmplClassAddOnCategory",tmplAddOnService:"#tmplClassAddOnService",AddonServices:"#Service_",divAddonPopupSection:"#divAddonPopupSection",divHdrEventPrice:"#divHdrEventPrice"},initOffline:function(e){this.model.IsOnline=e,this.model.IsSearchFromInHouseClass=_vgClassSessionSelection.IsSearchFromInHouseClass(),$("#ddAtWeeks input").each(function(){var e=$(this);e.off("change"),e.on("change",function(){_vgClassSessionSelection.WeekdayCheckbox_Change(e)})})},NoOfSessionChangedOffline:function(e,t){""==e.get_value()&&(e.set_value(1),e.set_textBoxValue("1")),_vgCal.ManageAtnd.ShowHideAtCount(),_vgClassSessionSelection.CalcAndDisplayPriceOffline()},Getgrouparray:function(){return o},GetStartDate:function(){return this.model.IsOnline?getdatepickervalue("#txtEventFromDate"):getdatepickervalue(_EndtextsessionDatePickerID,null,!0,null,!0)},GetDayNo:function(){return this.model.IsOnline?parseInt($("#txtNoofDays").val()):parseInt($("#txtSessionClassMntDate").val())},GetNoOfSessions:function(){return this.model.IsOnline?parseInt($("#txtQuantity").val()):void 0!==_vgClassSessionSelection.commonProperty.availabledates&&void 0!==_vgClassSessionSelection.commonProperty.availabledates.eventDetail&&null!=_vgClassSessionSelection.commonProperty.availabledates.eventDetail&&_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop&&void 0!==_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&null!=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates?_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length:""==$("#txtSessionFrequency").val()?1:parseInt($("#txtSessionFrequency").val())},GetNoOfweeks:function(){return this.model.IsOnline?parseInt($("#txtNoofWeeks").val()):parseInt($("#txtSessionWksFrequency").val())},GetNoOfAttendees:function(){return this.model.IsOnline?parseInt($("#"+this.model.txtNoofAttendees).val()):_vgCal.ManageAtnd.GetNoOfAttendee()},GetRecurringType:function(){var e="";this.model.IsOnline?e=$("#"+this.model.ddlRecurringType).val():e=$("#classSelectionRepeat").find("a.active").data("value").toString();return e},toWords:function(e){var t=["","thousand","million","billion","trillion"],i=["zero","one","two","three","four","five","six","seven","eight","nine"],n=["ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],o=["twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];if((e=(e=e.toString()).replace(/[\, ]/g,""))!=parseFloat(e))return"not a number";var a=e.indexOf(".");if(-1==a&&(a=e.length),a>15)return"too big";for(var s=e.split(""),r="",l=0,c=0;c<a;c++)(a-c)%3==2?"1"==s[c]?(r+=n[Number(s[c+1])]+" ",c++,l=1):0!=s[c]&&(r+=o[s[c]-2]+" ",l=1):0!=s[c]&&(r+=i[s[c]]+" ",(a-c)%3==0&&(r+="hundred "),l=1),(a-c)%3==1&&(l&&(r+=t[(a-c-1)/3]+" "),l=0);if(a!=e.length){var d=e.length;r+="point ";for(c=a+1;c<d;c++)r+=i[s[c]]+" "}return r.replace(/\s+/g," ")},HideShowWeekOrMonth:function(){$(".signupweek-day").removeClass("signup-weeks-width");var e=this.GetRecurringType();if(this.model.IsOnline)switch(e){case"1":$("#"+this.model.divWeek).hide(),$("#"+this.model.liWeekDays).hide(),$("#"+this.model.divMonth).hide();break;case"2":$("#"+this.model.divWeek).show(),$("#"+this.model.liWeekDays).show(),$("#"+this.model.divMonth).hide();break;case"3":$("#"+this.model.divWeek).hide(),$("#"+this.model.liWeekDays).hide(),$("#"+this.model.divMonth).show(),1==isCheckInApp&&$(".signupweek-day").addClass("signup-weeks-width")}else switch(e){case"1":$("#"+this.offlineProperty.ddAtMonth).slideUp(),$("#"+this.offlineProperty.ddAtWeeks).hide(),$("#ddAtMonth").addClass("datepicket-top-pos"),$("#"+this.offlineProperty.ddlblAtWeek).slideUp();break;case"2":$("#"+this.offlineProperty.ddAtMonth).slideDown(),$("#"+this.offlineProperty.ddAtWeeks).show(),$("#ddAtMonth").removeClass("datepicket-top-pos"),$("#"+this.offlineProperty.lblAtDay).text("Every:"),$("#divSessionWksFrequency").css("display","block"),$("#divSessionClassMntDate").css("display","none"),$("#"+this.offlineProperty.ddlblAtWeek).slideDown(),$("#txtSessionWksFrequency").val("1");break;case"3":$("#"+this.offlineProperty.ddAtWeeks).hide(),$("#ddAtMonth").addClass("datepicket-top-pos"),$("#"+this.offlineProperty.ddAtMonth).slideDown(),$("#"+this.offlineProperty.lblAtDay).text("Day:"),$("#divSessionWksFrequency").css("display","none"),$("#divSessionClassMntDate").css("display","block"),$("#"+this.offlineProperty.ddlblAtWeek).slideUp(),$("#txtSessionClassMntDate").val("1")}},GetSessionStorage:function(e){var t=[];if(0==this.model.IsOnline){if(void 0!==localStorage[e])try{t=JSON.parse(localStorage[e])}catch(e){t=[]}}else if(1==this.model.IsOnline){if(_vgClassSessionSelection.model.WaitlistEventStorage===e){try{t=JSON.parse(localStorage[e])}catch(e){t=[]}return t}var i;if("undefined"!=typeof onlineShoppingCartmain&&null!=onlineShoppingCartmain&&(i=onlineShoppingCartmain),$("#shoppingcartsecond").length>0&&("block"==$("#shoppingcartsecond").css("display").toLowerCase()||"flex"==$("#shoppingcartsecond").css("display").toLowerCase()||$("#shoppingcartsecond").is(":visible"))&&(i=onlineShoppingCart),void 0!==i&&null!=i)try{_vgClassSessionSelection.model.EventStorage===e&&null!=i.Events?t=i.Events:_vgClassSessionSelection.model.ExceptionStorage===e&&null!=i.Exceptions&&(t=i.Exceptions)}catch(e){t=[]}}return t},SetIntoSessionStorage:function(e,t,i){if(0==this.model.IsOnline)_vgClassSessionSelection.commonProperty.isWaitlist&&_vgClassSessionSelection.model.EventStorage===e?localStorage[this.model.WaitlistEventStorage]=JSON.stringify(t):localStorage[e]=JSON.stringify(t);else if(1==this.model.IsOnline){var n;if(_vgClassSessionSelection.commonProperty.isWaitlist&&_vgClassSessionSelection.model.EventStorage===e)localStorage[this.model.WaitlistEventStorage]=JSON.stringify(t);else if("undefined"!=typeof onlineShoppingCartmain&&null!=onlineShoppingCartmain&&(n=onlineShoppingCartmain),$("#shoppingcartsecond").length>0&&("block"==$("#shoppingcartsecond").css("display").toLowerCase()||"flex"==$("#shoppingcartsecond").css("display").toLowerCase()||$("#shoppingcartsecond").is(":visible"))&&(n=onlineShoppingCart),void 0!==n&&null!=n&&null!=n||(n={}),_vgClassSessionSelection.model.EventStorage===e){n.Events=t;var o=!0;if(String.isNullOrUndefineOrBlank(n.Events)||$.each(n.Events,function(e,t){!String.isNullOrUndefineOrBlank(t.eventEnrollment)&&t.eventEnrollment.length>0&&$.each(t.eventEnrollment,function(e,t){1==t.isTempData&&(o=!1)})}),o&&("undefined"==typeof IsClassReschedule||"undefined"!=typeof IsClassReschedule&&"false"==IsClassReschedule.toLowerCase())){if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&null!=_shopdetail.IsMemPkgReqToBook&&1==_shopdetail.IsMemPkgReqToBook){var a=_shopdetail.MembershipPackageDetails.Data.UserMemberShipAndPackageInformation.RequiredServices.split(",");null!=a&&a.length>0&&a.forEach(function(e){for(var i=0;i<t.length;i++)e==String(t[i].eventID)&&(t[i].IsMemPkgRequired=!0)})}_onlineCheckout.classAddToCart(t,i),r=[]}}else _vgClassSessionSelection.model.ExceptionStorage===e&&(n.Exceptions=t)}},ClearSessionStorage:function(e){0==this.model.IsOnline&&localStorage.removeItem(e)},validateFebDate:function(e,t){return!(e>29||29==e&&!(t%4==0&&(t%100!=0||t%400==0)))},GetevenetCapacity:function(e,t){var i=0,n=this.GetSessionStorage(this.model.EventStorage);if(null!=typeof t&&""!=t&&null!=t||(t=!1),n.length>0)for(var o=0;o<=n.length-1;o++){i+=$.grep(n[o].eventEnrollment,function(i){return 1==t?1!=i.isTempData&&i.appointmentID==e&&1==i.StreamingStatus:1!=i.isTempData&&i.appointmentID==e&&1!=i.StreamingStatus}).length}return i},ManageEventTempAndRealData:function(e,t,i){var n=this.GetSessionStorage(this.model.EventStorage),o=[];if(n.length>0)for(var a=0;a<=n.length-1;a++){var s=$.grep(n[a].eventEnrollment,function(e){return 1!=e.isTempData});if(s.length>0){if(1==t){var r={cFirstName:"asc",cLastName:"asc",eventDate:"asc"};s.keySort(r),n[a].eventEnrollment=s}else n[a].eventEnrollment=s;if(1==e){var l=_vgClassSessionSelection.GetCartUserDetail(),c=$.grep(n[a].eventEnrollment,function(e){if(null!=l&&l.length>0){var t=$.grep(l,function(t){return e.customerID>0&&t.userId==e.customerID||0==e.customerID&&t.emailId==e.cUserEmail});if(null!=t&&t.length>0)return!1}return!0});if(null!=c&&c.length>0){var d=c.uniqueObjects(["customerID","cUserEmail"]);d.length>0&&(o=o.concat(d))}}}else n.splice(a,1)}if(n.length>0){if(1==t){r={eventName:"asc"};n.keySort(r)}0!=i&&this.SetIntoSessionStorage(this.model.EventStorage,n)}else this.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage);return o},GetGCorPackage:function(){var e=[];if(""!=this.commonProperty.gCOrPackageDetail)try{e=JSON.parse(this.commonProperty.gCOrPackageDetail)}catch(t){e=[]}return e},GetCartUserDetail:function(){var e=[];if(""!=this.commonProperty.cartUserList)try{e=JSON.parse(this.commonProperty.cartUserList)}catch(t){e=[]}return e},ConfirmEventData:function(e,t){var i=this.GetSessionStorage(this.model.EventStorage);if(i.length>0)for(var n=0;n<=i.length-1;n++)if(i[n].eventID==e)for(j=0;j<=i[n].eventEnrollment.length-1;j++)i[n].eventEnrollment[j].isTempData=!1;this.SetIntoSessionStorage(this.model.EventStorage,i,t)},GetAllSessionDates:function(e){var t=1,i=this.GetRecurringType();_vgClassSessionSelection.commonProperty.isYearlySelection&&(t=12);var n=[];if("2"==i){if(1==this.model.IsOnline?$(".dayselection input:checked").each(function(){n.push($(this).data("dayid"))}):$("#rptDayClassSession").find("a").each(function(e,t){$(this).hasClass("active")&&n.push(parseInt($(this).attr("data-dayid")))}),0==n.length){var o="Please select at least one day.";return 1==this.model.IsOnline?vagaro.alertsmall(o):_vgCal.Common.ShowMsg(o),!1}if(1==this.model.IsOnline&&n.length>0){var a=this.GetNoOfSessions();if(n.length>a)return document.querySelector(".bootbox, .custom-alert")||vagaro.alertsmall(this.model.strSessionCountmsg),!1}}if(3==e)return!0;var s=new Date(this.GetStartDate()),r=this.GetDayNo(),l=this.GetNoOfweeks(),c=[],d=this.GetNoOfSessions();void 0!==_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&null!=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop&&d!=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length&&(d=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length);for(var u=1;u<=d;){var p=null;if("1"==i)u+=1,c.push(new Date(s)),s.setDate(s.getDate()+1);else if("2"==i){if(p=new Date(s),0==s.getDay()){var h=7*(parseInt(l)-1);s.setDate(s.getDate()+h)}if(s.setDate(s.getDate()+1),_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop){var m=moment(p).format("YYYY-MM-DD"),g="";if(void 0!==_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&null!=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&(g=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.find(function(e){return e.strEventDate===m})),$.inArray(p.getDay(),n)<0||!g)continue;u+=1,c.push(p)}else{if($.inArray(p.getDay(),n)<0)continue;u+=1,c.push(p)}}else if("3"==i){if(s.getDate()>r){var v=s.getMonth()+1,f=s.getFullYear();12==v&&(v=0,f+=1),s=1==v&&0==_vgClassSessionSelection.validateFebDate(r,f)?s.addMonths(t):new Date(f,v,r);continue}if(s.getDate()<r){s=1==s.getMonth()&&0==_vgClassSessionSelection.validateFebDate(r,s.getFullYear())?s.addMonths(t):new Date(s.getFullYear(),s.getMonth(),r);continue}if(_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop){p=new Date(s);m=moment(p).format("YYYY-MM-DD"),g="";void 0!==_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&null!=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&(g=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.find(function(e){return e.strEventDate===m})),g&&(u+=1,c.push(new Date(s))),s=s.addMonths(t)}else u+=1,c.push(new Date(s)),s=s.addMonths(t)}}return c},ConfirmException:function(){_vgClassSessionSelection.EventShowLoader(!0);var e=1==_vgClassSessionSelection.commonProperty.isWaitlist?this.GetSessionStorage(this.model.WaitlistEventStorage):this.GetSessionStorage(this.model.EventStorage),t=[];_vgClassSessionSelection.commonProperty.isWaitlist||(t=this.GetSessionStorage(this.model.ExceptionStorage));var i=!1;if(1==_vgClassSessionSelection.model.IsOnline&&void 0!==$("#btnConfirm").data("to")&&2==parseInt($("#btnConfirm").data("to"))&&(i=!0),t.length>0){var n=$.grep(t,function(e){return 0==e.isExNotHandle});if(n.length>0){var o={};if(o.eventID=this.commonProperty.eventID,o.eventName=this.commonProperty.eventName,o.tax=this.commonProperty.tax,o.smallimage=this.commonProperty.smallImage,o.sessiondetail=this.commonProperty.sessiondetail,o.eventEnrollment=[],e.length>0){var a=$.grep(e,function(e){return e.eventID==o.eventID});if(a.length>0&&a[0].eventEnrollment.length>0){o.eventEnrollment=a[0].eventEnrollment;for(var s=0;s<=o.eventEnrollment.length-1;s++)o.eventEnrollment[s].isTempData=!1}}for(var r=0;r<=n.length-1;r++){var l={};if(0==o.eventEnrollment.length?l.autoID=1:l.autoID=Math.max.apply(Math,o.eventEnrollment.map(function(e){return e.autoID}))+1,l.eventID=o.eventID,l.customerID=n[r].customerID,l.cFirstName=n[r].cFirstName,l.cLastName=n[r].cLastName,l.cUserEmail=n[r].cUserEmail,l.cUserCellNo=n[r].cUserCellNo,l.cCellcountryID=n[r].cCellcountryID,l.cDialingCode=n[r].cDialingCode,l.eventDate=n[r].eventDate,l.IsWorkShop=n[r].IsWorkShop,l.StreamingStatus=n[r].StreamingStatus,l.isTempData=!1,0==n[r].isMultipleSP){var c=n[r].SPAvalibility[0];l.sPID=n[r].SPID,l.sPName=n[r].SPName,l.appointmentID=parseInt(c.appointmentID),l.startTime=c.strStartTime,l.endTime=c.strEndTime,l.duration=c.eventDuration,0==_vgClassSessionSelection.model.IsOnline&&1==n[r].isCapacityFull&&(l.isHandleDuetoException=!0)}else{var d=$("#ddlSPDetail-"+n[r].autoId);if("-1"==d.val())continue;c=$.grep(n[r].SPAvalibility,function(e){return e.serviceProviderID==parseInt(d.val())});if(c.length>0){l.sPID=parseInt(d.val());var u=$("#ddlSPDetail-"+n[r].autoId+" option:selected");l.sPName=u.text(),0==_vgClassSessionSelection.model.IsOnline&&void 0!==u.data("isspfull")&&1==u.data("isspfull")&&(l.isHandleDuetoException=!0),l.appointmentID=parseInt(c[0].appointmentID),l.startTime=c[0].strStartTime,l.endTime=c[0].strEndTime,l.duration=c[0].eventDuration}}0==this.model.IsOnline&&(l.isEventTempData=!0),o.eventEnrollment.push(l)}if(o.eventEnrollment.length>0){if(e.length>0)e=$.grep(e,function(e){return e.eventID!=o.eventID});e.push(o),this.SetIntoSessionStorage(this.model.EventStorage,e,i)}}else{for(var p=0;p<=e.length-1;p++)if(e[p].eventID==_vgClassSessionSelection.commonProperty.eventID)if(e[p].eventEnrollment.length<=0)_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage);else for(var h=0;h<=e[p].eventEnrollment.length-1;h++)e[p].eventEnrollment[h].isTempData=!1;if(e.length>0){if(0==_vgClassSessionSelection.model.IsOnline&&null!=typeof txtDepositCls&&null!=txtDepositCls&&""!=txtDepositCls&&parseFloat(txtDepositCls.value)>0)if(ExecCnt=e[0].eventEnrollment.length,t.length>0&&$.grep(t,function(e){1!=e.RemarksType&&(ExecCnt+=1)}),100==parseFloat($("#txtDepositCls").data("percentage"))){var m=CalendarConfiguration.CommonDetails.BusinessTaxes,g=_vgCal.ManageAtnd.model.Taxation,v=0;if(_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop){var f=this.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream?_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates[0].workShopStreamingSellPrice:_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates[0].workShopSellPrice;v=this.CalcSessionPriceForWorkShop(f,this.GetNoOfSessions()/ExecCnt,this.GetNoOfAttendees(),!0)}else v=this.CalcSessionPrice(this.commonProperty.sessiondetail,this.GetNoOfSessions()/ExecCnt,this.GetNoOfAttendees(),!0,this.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream);var C=_vgClassSessionSelection.AddFeesToDepositPopupForException(parseFloat(v),8),S=_vgClassSessionSelection.CalculateTaxForFees(m),y=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(_vgClassSessionSelection.GetTaxTotalForService(m,g),!1,2),b=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(v*parseFloat(y)/100,!1,4);_vgCal.ManageAtnd.model.Tax=b+S,txtDepositCls.value=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(parseFloat(v)+b+C+S,!0,2),_vgCal.ManageAtnd.model.NewApp_txtPriceCls=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(parseFloat(v),!0,2)}else txtDepositCls.value=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(parseFloat($("#txtDepositCls").data("originalprice"))/ExecCnt,!0,2);this.SetIntoSessionStorage(this.model.EventStorage,e,i)}}}if(1==this.model.IsOnline)if(_vgClassSessionSelection.commonProperty.isWaitlist&&e.length>0){var k=1==_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop?e[0].eventEnrollment.uniqueObjects(["cUserEmail"]):e[0].eventEnrollment;_vgClassSessionSelection.SaveWaitlistClass(k,e[0].eventEnrollment)}else 2==parseInt($("#btnConfirm").data("to"))&&0==i&&($("#licartIcon a").attr("data-isbypass","true"),$("#licartIcon a").click()),_vgClassSessionSelection.ShowHideClassPopup(!1),_vgClassSessionSelection.EventShowLoader(!1);else{if(_vgClassSessionSelection.EventShowLoader(!1),0==e.length)return void _vgClassSessionSelection.commonMessageAlert("Please select teacher.");if(_vgClassSessionSelection.commonProperty.isWaitlist&&e.length>0){k=1==_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop?e[0].eventEnrollment.uniqueObjects(["cUserEmail"]):e[0].eventEnrollment;_vgClassSessionSelection.SaveWaitlistClass(k,e[0].eventEnrollment)}else _vgClassSessionSelection.SaveAttendeeOffline()}},RemoveAddedEnrollmentOffline:function(){var e=1==_vgClassSessionSelection.commonProperty.isWaitlist?_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.WaitlistEventStorage):_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);if(e.length>0)for(var t=0;t<=e.length-1;t++){var i=$.grep(e[t].eventEnrollment,function(e){return 1!=e.isEventTempData});i.length>0?e[t].eventEnrollment=i:e.splice(t,1)}e.length>0?_vgClassSessionSelection.SetIntoSessionStorage(_vgClassSessionSelection.commonProperty.isWaitlist?_vgClassSessionSelection.model.WaitlistEventStorage:_vgClassSessionSelection.model.EventStorage,e):_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.commonProperty.isWaitlist?_vgClassSessionSelection.model.WaitlistEventStorage:_vgClassSessionSelection.model.EventStorage)},CreateEventCollection:function(t){var i=[];if(4==t||5==t?i=a:(0==this.model.IsOnline&&a.splice(0,a.length),a.length<=0?(i=this.GetAllSessionDates(t),a=i):i=a),i.length>0){var s=[],r=[];_vgClassSessionSelection.commonProperty.isWaitlist||(r=this.GetSessionStorage(this.model.EventStorage));var l={};if(l.eventID=this.commonProperty.eventID,l.eventName=this.commonProperty.eventName,l.CalculatedTaxTypeWise=this.commonProperty.CalculatedTaxTypeWise,l.tax=this.commonProperty.tax,l.smallimage=this.commonProperty.smallImage,l.sessiondetail=this.commonProperty.sessiondetail,l.promotiondetail=_vgClassSessionSelection.GetClassPromotionWithLastMinute(this.commonProperty.promotiondetail),l.eventDesc=$("#eventDescription").text().trim(),l.eventEnrollment=[],r.length>0)(I=$.grep(r,function(e){return e.eventID==l.eventID})).length>0&&(l.eventEnrollment=$.grep(I[0].eventEnrollment,function(e){return 1!=e.isTempData}),l.eventEnrollment.length<=0&&(l.eventEnrollment=[]));var c=1;this.model.IsOnline?o.length>0&&(c=o.length+1):c=this.GetNoOfAttendees();var d=[];"undefined"!=typeof _vgClassSessionSelection&&1==_vgClassSessionSelection.model.IsOnline&&1==_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop&&void 0!==_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&$.grep(i,function(e){$.grep(_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates,function(t){if(moment(e).format("DD/MM/YYYY")==moment(t.strEventDate).format("DD/MM/YYYY"))return d.push(e),!1})}),d.length>0&&(i=d);for(var u=Math.random().toString(36).substring(7),p=0;p<=i.length-1;p++)if(_vgClassSessionSelection.model.IsOnline){var h=0;$("div.clsaccordion").find(".panel-default").each(function(){var e="",t="",n="",o=0,a="",r=0,c=0;if(_vgClassSessionSelection.model.IsOnline)o=$(this).attr("data-value"),e=$(this).attr("data-fullname").split(" ")[0],t=void 0!==$(this).attr("data-fullname").split(" ")[1]?$(this).attr("data-fullname").split(" ")[1]:"",n=$(this).attr("data-email"),a=$(this).attr("data-cell"),r=$(this).attr("data-cellcountryid"),void 0!==$(this).attr("data-dialingCode")&&null!=$(this).attr("data-dialingCode")&&""!=$(this).attr("data-dialingCode")&&(c=$(this).attr("data-dialingCode"));else{var d=_vgCal.ManageAtnd.objAtList[h];o=d.Id,e=d.fName,t=d.lName,n=d.Email}var m,g=_vgClassSessionSelection.commonProperty.SPID;if(null!=(m=$.grep(_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates,function(e){return e.strEventDate==i[p].format("yyyy-MM-dd")&&e.serviceProviderID==g}))&&m.length>0){var v=!1;if(_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?m[0].streamingEventCapacity<m[0].streamingNoOfAttendees+_vgClassSessionSelection.GetevenetCapacity(m[0].appointmentID,!0)+(h+1)&&(v=!0):m[0].eventCapacity<m[0].noOfAttendees+_vgClassSessionSelection.GetevenetCapacity(m[0].appointmentID,!1)+(h+1)&&(v=!0),_vgClassSessionSelection.model.IsOnline&&v&&0==_vgClassSessionSelection.commonProperty.isWaitlist){(y={}).eventID=l.eventID,y.appointmentID=parseInt(m[0].appointmentID),y.eventDate=i[p],y.workshopActualDate=i[p].format("MM/dd/yyyy")+" "+m[0].strStartTime,y.customerID=o,y.cFirstName=e,y.cLastName=t,y.cUserEmail=n,y.cUserCellNo=a,y.cCellcountryID=r,y.cDialingCode=c,y.teacherName=_vgClassSessionSelection.commonProperty.teacherName,y.isExNotHandle=!0,y.Remarks="This class is full.",y.RemarksType=_vgClassSessionSelection.commonProperty.ClassFull,y.IsWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,y.noOfWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length,y.randomForWorkShop=u,y.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,y.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,y.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,y.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?1:0,s.push(y)}else{var f={};if(0==_vgClassSessionSelection.model.IsOnline&&v&&0==_vgClassSessionSelection.commonProperty.isWaitlist)(y={}).eventID=l.eventID,y.appointmentID=parseInt(m[0].appointmentID),y.eventDate=i[p],y.workshopActualDate=i[p].format("MM/dd/yyyy")+" "+m[0].strStartTime,y.customerID=o,y.cFirstName=e,y.cLastName=t,y.cUserEmail=n,y.cUserCellNo=a,y.cCellcountryID=r,y.cDialingCode=c,y.teacherName=_vgClassSessionSelection.commonProperty.teacherName,y.isExNotHandle=!0,y.Remarks="This class is full.",y.RemarksType=_vgClassSessionSelection.commonProperty.ClassFull,y.IsWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,y.noOfWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length,y.randomForWorkShop=u,y.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,y.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,y.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,y.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?1:0,s.push(y),f.isHandleDuetoException=!0;0==l.eventEnrollment.length?f.autoID=1:f.autoID=Math.max.apply(Math,l.eventEnrollment.map(function(e){return e.autoID}))+1;var C=moment(m[0].strEndTime,"hh:mm A").subtract(m[0].CleanupTime,"minutes").format("hh:mm A");if(f.eventID=l.eventID,f.appointmentID=parseInt(m[0].appointmentID),f.customerID=o,f.cFirstName=e,f.cLastName=t,f.cUserEmail=n,f.cUserCellNo=a,f.cCellcountryID=r,f.cDialingCode=c,f.sPID=_vgClassSessionSelection.commonProperty.SPID,f.sPName=_vgClassSessionSelection.commonProperty.teacherName,f.eventDate=i[p],f.workshopActualDate=i[p].format("MM/dd/yyyy")+" "+m[0].strStartTime,f.startTime=m[0].strStartTime,f.endTime=C,f.duration=m[0].eventDuration,f.isTempData=!0,f.IsWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,1==f.IsWorkShop&&_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream&&0!=m[0].workShopStreamingSellPrice&&0!=m[0].workShopNoofSessions?f.workShopIndividualPrice=m[0].workShopStreamingSellPrice/m[0].workShopNoofSessions:1==f.IsWorkShop&&_vgClassSessionSelection.commonProperty.streamingStatus!=_vgClassSessionSelection.StreamingDBFilterType.LiveStream&&0!=m[0].workShopSellPrice&&0!=m[0].workShopNoofSessions?f.workShopIndividualPrice=m[0].workShopSellPrice/m[0].workShopNoofSessions:f.workShopIndividualPrice=0,f.noOfWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length,f.randomForWorkShop=u,f.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,f.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,f.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,f.PromotionID=0,f.IsAmount=!1,f.AmountValue=0,f.PerUserOne="0",f.discount=0,void 0!==l.promotiondetail&&""!=l.promotiondetail){var S=l.promotiondetail.split("-");f.PromotionID=l.promotiondetail.split("-")[0],f.IsAmount=0!=l.promotiondetail.split("-")[1],f.AmountValue=l.promotiondetail.split("-")[2],f.PerUserOne=l.promotiondetail.split("-")[3],S.length>4?f.PerTransactionOne=l.promotiondetail.split("-")[4]:f.PerTransactionOne="0",f.PromotionTitle=l.promotiondetail.split("|~~|")[1]}f.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?1:0,f.lstAddonService=_vgClassSessionSelection.CreateAddonCollection(f),l.eventEnrollment.push(f)}}else{var y;(y={}).eventID=l.eventID,y.appointmentID=0,y.eventDate=i[p],y.workshopActualDate=i[p].format("MM/dd/yyyy"),y.customerID=o,y.cFirstName=e,y.cLastName=t,y.cUserEmail=n,y.cUserCellNo=a,y.cCellcountryID=r,y.cDialingCode=c,y.teacherName=_vgClassSessionSelection.commonProperty.teacherName,y.isExNotHandle=!0,y.Remarks="This service provider is not available.",y.RemarksType=_vgClassSessionSelection.commonProperty.SPNotAvalable,y.IsWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,y.noOfWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length,y.randomForWorkShop=u,y.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,y.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,y.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,y.isWaitlist=_vgClassSessionSelection.commonProperty.isWaitlist,y.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?1:0,s.push(y)}h+=1})}else for(h=0;h<=c-1;h++){var m,g,v,f,C=_vgCal.ManageAtnd.objAtList[h];f=C.Id,m=C.fName,g=C.lName,v=C.Email;var S,y=this.commonProperty.SPID;if(null!=(S=$.grep(this.commonProperty.availabledates.eventAvailableDates,function(e){return e.strEventDate==i[p].format("yyyy-MM-dd")&&e.serviceProviderID==y}))&&S.length>0){var b={};if(0==this.model.IsOnline&&(this.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.InHouse&&S[0].eventCapacity<S[0].noOfAttendees+this.GetevenetCapacity(S[0].appointmentID,!1)+(h+1)||this.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream&&S[0].streamingEventCapacity<S[0].streamingNoOfAttendees+this.GetevenetCapacity(S[0].appointmentID,!0)+(h+1))&&0==_vgClassSessionSelection.commonProperty.isWaitlist)(w={}).eventID=l.eventID,w.appointmentID=parseInt(S[0].appointmentID),w.eventDate=i[p],w.workshopActualDate=i[p].format("MM/dd/yyyy")+" "+S[0].strStartTime,w.customerID=f,w.cFirstName=m,w.cLastName=g,w.cUserEmail=v,w.cUserCellNo="",w.cCellcountryID=0,w.cDialingCode=0,w.teacherName=this.commonProperty.teacherName,w.isExNotHandle=!0,w.Remarks="This class is full.",w.RemarksType=_vgClassSessionSelection.commonProperty.ClassFull,w.IsWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,w.noOfWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length,w.randomForWorkShop=u,w.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,w.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,w.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,w.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus,s.push(w),b.isHandleDuetoException=!0;if(0==l.eventEnrollment.length?b.autoID=1:b.autoID=Math.max.apply(Math,l.eventEnrollment.map(function(e){return e.autoID}))+1,b.eventID=l.eventID,b.appointmentID=parseInt(S[0].appointmentID),b.customerID=f,b.cFirstName=m,b.cLastName=g,b.cUserEmail=v,b.cUserCellNo="",b.cCellcountryID=0,b.cDialingCode=0,b.sPID=this.commonProperty.SPID,b.sPName=this.commonProperty.teacherName,b.eventDate=i[p],b.workshopActualDate=i[p].format("MM/dd/yyyy")+" "+S[0].strStartTime,b.startTime=S[0].strStartTime,b.endTime=S[0].strEndTime,b.duration=S[0].eventDuration,b.isTempData=!0,b.IsWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,1==b.IsWorkShop&&_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream&&0!=S[0].workShopStreamingSellPrice&&0!=S[0].workShopNoofSessions?b.workShopIndividualPrice=S[0].workShopStreamingSellPrice/S[0].workShopNoofSessions:1==b.IsWorkShop&&_vgClassSessionSelection.commonProperty.streamingStatus!=_vgClassSessionSelection.StreamingDBFilterType.LiveStream&&0!=S[0].workShopSellPrice&&0!=S[0].workShopNoofSessions?b.workShopIndividualPrice=S[0].workShopSellPrice/S[0].workShopNoofSessions:b.workShopIndividualPrice=0,b.noOfWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length,b.randomForWorkShop=u,b.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,b.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,b.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,b.PromotionID=0,b.IsAmount=!1,b.AmountValue=0,b.PerUserOne="0",b.discount=0,void 0!==l.promotiondetail&&""!=l.promotiondetail){var k=l.promotiondetail.split("-");b.PromotionID=l.promotiondetail.split("-")[0],b.IsAmount=0!=l.promotiondetail.split("-")[1],b.AmountValue=l.promotiondetail.split("-")[2],b.PerUserOne=l.promotiondetail.split("-")[3],k.length>4?b.PerTransactionOne=l.promotiondetail.split("-")[4]:b.PerTransactionOne="0",b.PromotionTitle=l.promotiondetail.split("|~~|")[1]}b.paidType=0,b.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus,b.lstAddonService=_vgClassSessionSelection.CreateClassAttendeeAddonCollection(f),l.eventEnrollment.push(b)}else{(w={}).eventID=l.eventID,w.appointmentID=0,w.eventDate=i[p],w.workshopActualDate=i[p].format("MM/dd/yyyy"),w.customerID=f,w.cFirstName=m,w.cLastName=g,w.cUserEmail=v,w.cUserCellNo="",w.cCellcountryID=0,w.cDialingCode=0,w.teacherName=this.commonProperty.teacherName,w.isExNotHandle=!0,w.Remarks="This service provider is not available.",w.RemarksType=_vgClassSessionSelection.commonProperty.SPNotAvalable,w.IsWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,w.noOfWorkShop=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length,w.randomForWorkShop=u,w.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,w.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,w.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,w.isWaitlist=_vgClassSessionSelection.commonProperty.isWaitlist,w.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus,s.push(w)}}if(1==this.model.IsOnline&&l.eventEnrollment.length>0&&1==l.eventEnrollment[0].IsWorkShop&&(ExceptionWorkShop=[],s.length>0)){var _={},D=s.filter(function(e){return!_[e.cUserEmail]&&(_[e.cUserEmail]=!0,!0)});for(p=0;p<=D.length-1;p++)var I=$.grep(l.eventEnrollment,function(e){return e.cUserEmail==D[p].cUserEmail});for(p=0;p<=I.length-1;p++){var w,P=l.eventEnrollment.indexOf(I[p]);-1!==P&&l.eventEnrollment.splice(P,1),(w={}).eventID=I[p].eventID,w.appointmentID=parseInt(I[p].appointmentID),w.eventDate=I[p].eventDate,w.workshopActualDate=I[p].workshopActualDate,w.customerID=I[p].customerID,w.cFirstName=I[p].cFirstName,w.cLastName=I[p].cLastName,w.cUserEmail=I[p].cUserEmail,w.cUserCellNo=I[p].cUserCellNo,w.cCellcountryID=I[p].cCellcountryID,w.cDialingCode=I[p].cDialingCode,w.teacherName=I[p].teacherName,w.isExNotHandle=!0,w.Remarks="This class is full.",w.RemarksType=_vgClassSessionSelection.commonProperty.ClassFull,w.IsWorkShop=I[p].IsWorkShop,w.noOfWorkShop=I[p].noOfWorkShop,w.randomForWorkShop=I[p].randomForWorkShop,w.workshopEventOn=I[p].workshopEventOn,w.workshopEventDays=I[p].workshopEventDays,w.workshopEventDate=I[p].workshopEventDate,w.StreamingStatus=_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?1:0,s.push(w)}s.keySort({eventDate:"asc"})}if(r.length>0)r=$.grep(r,function(e){return e.eventID!=l.eventID});if(l.eventEnrollment.length>0&&r.push(l),r.length>0&&this.SetIntoSessionStorage(this.model.EventStorage,r),this.ClearSessionStorage(this.model.ExceptionStorage),s.length>0){this.SetIntoSessionStorage(this.model.ExceptionStorage,s);var A=null;if(""!=this.commonProperty.otherSPavailabledates)try{A=JSON.parse(this.commonProperty.otherSPavailabledates)}catch(e){A=null}if(null!=A||_vgClassSessionSelection.commonProperty.isWaitlist)this.SessionExceptionDetail(A);else{var T={};T.eventId=l.eventID,T.businessID=this.commonProperty.businessID,T.serviceProviderID=this.commonProperty.SPID,T.startTime=this.commonProperty.startTime;var x=null;1==this.model.IsOnline?(T.type=3,x=_vgClassSessionSelection.CallFailed):(T.type=4,x=function(e){_vgCal.Common.ShowMsg("Something went wrong")}),vagaro.ajaxCall(e+n.geteventdetailandavailabledates,T,_vgClassSessionSelection.ShowExceptionDetailSuccess,x,!1,!0)}}else if(_vgClassSessionSelection.EventShowLoader(!1),1==this.model.IsOnline)if(_vgClassSessionSelection.commonProperty.isWaitlist){var F=1==_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop?l.eventEnrollment.uniqueObjects(["cUserEmail"]):l.eventEnrollment;_vgClassSessionSelection.SaveWaitlistClass(F,l.eventEnrollment)}else 2==t||5==t?this.ConfirmEventData(l.eventID,!0):this.ConfirmEventData(l.eventID),$("#lblEventCart").html(r.length),_vgClassSessionSelection.ShowHideClassPopup(!1);else{if(0==r.length)return void _vgClassSessionSelection.commonMessageAlert("Please select teacher.");if(_vgClassSessionSelection.commonProperty.isWaitlist){F=1==_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop?l.eventEnrollment.uniqueObjects(["cUserEmail"]):l.eventEnrollment;_vgClassSessionSelection.SaveWaitlistClass(F,l.eventEnrollment)}else _vgClassSessionSelection.SaveAttendeeOffline()}}},CreateEventCollection_ShowDiscount:function(e,t,i){try{_vgClassSessionSelection.EventShowLoader(!0);var n=[],o=$("#hdnAppointmentId").val(),a=$("#tr-"+o),s=$("#td-"+o),r=parseInt($("#hdnserviceProviderID").val()),l=$("#td"+o+"ClassName").data("classname");String.isNullOrUndefineOrBlank(l)||-1==l.indexOf("&lt;div class")&&-1==l.indexOf("<div class")||(-1!=l.indexOf("&lt;div class")?l=l.substr(0,l.indexOf("&lt;div")):-1!=l.indexOf("<div class")&&(l=l.substr(0,l.indexOf("<div class"))));var c,d,u,p=s.html();if(_vgClassSessionSelection.isCallFromPublic()){c={},o=(d=_publicEvent).objEventDetails.AppointmentID,r=d.objEventDetails.ServiceProviderID,l=d.objEventDetails.ServiceTitle,p=d.objEventDetails.ServiceProviderName;var h={eventDetail:[]},m={};if(m.isWorkShop=d.objEventDetails.IsWorkShop,m.tax=d.objEventDetails.Tax,h.eventDetail.push(m),1==d.objEventDetails.IsWorkShop)h.eventAvailableDates=d.lstEventAvailableDate;else{var g=[],v={},f=moment(new Date(d.objEventDetails.StrStartTime));v.appointmentID=d.objEventDetails.AppointmentID,v.endTime=d.objEventDetails.EndTime,v.eventCapacity=0,v.eventDuration=d.objEventDetails.EventDuration,v.firstName=null,v.isWorkShopStarted=!1,v.lastName=null,v.noOfAttendees=0,v.ruleDefinition=null,v.ruleType=0,v.serviceProviderID=r,v.serviceProviderName=d.objEventDetails.FirstName+d.objEventDetails.LastName.length>0?" "+d.objEventDetails.LastName.substring(0,1)+".":"",v.startTime=d.objEventDetails.StartTime,v.strAvailableDates=f.format("MMM-DD-YYYY"),v.strEventDate=f.format("YYYY-MM-DD"),v.strStartTime=f.format("hh:mm A"),v.strEndTime=f.add(d.objEventDetails.Duration,"minutes").format("hh:mm A"),v.streamingEventCapacity=d.objEventDetails.StreamingEventCapacity,v.streamingNoOfAttendees=d.objEventDetails.StreamingNoOfAttendees,v.workShopNoofSessions=0,v.workShopSellPrice=0,v.workShopStreamingSellPrice=0,g.push(v),h.eventAvailableDates=g}c=h;var C=new Date(d.objEventDetails.StrStartTime);n.push(new Date(C.getFullYear(),C.getMonth(),C.getDate()))}else c=JSON.parse(a.data("availabledates")),n=this.GetAllSessionDates(e);if(n.length>0){var S={};if(_vgClassSessionSelection.isCallFromPublic()?(S.eventID=d.objEventDetails.ServiceID,S.eventName=l,S.tax=d.objEventDetails.Tax,S.smallimage="",S.sessiondetail=d.objEventDetails.SessionDetail,S.promotiondetail=_vgClassSessionSelection.GetClassPromotionWithLastMinute(d.objEventDetails.PromotionDetail),S.PointRedeem=d.objEventDetails.PointRedeem):(S.eventID=parseInt($("#hdneventId").val()),S.eventName=l,S.tax=parseFloat(a.data("tax")),S.smallimage=a.data("smallimage"),S.sessiondetail=a.data("sessiondetail"),S.promotiondetail=_vgClassSessionSelection.GetClassPromotionWithLastMinute(a.data("promotiondetail")),S.PointRedeem=a.data("pointsredeem")),S.eventEnrollment=[],t.length>0){S.autoId=Math.max.apply(Math,t.map(function(e){return e.autoId}))+1,$.grep(t,function(e){if(e.eventEnrollment.length>0){$.grep(e.eventEnrollment,function(e){void 0===e.IsWorkShop&&(e.IsWorkShop=!1),void 0===e.customerID&&(e.customerID=0)});e.eventEnrollment.keySort({cFirstName:"asc",cLastName:"asc",eventDate:"asc"})}});var y=$.grep(t,function(e){return e.eventID==S.eventID});y.length>0&&(S.eventEnrollment=$.grep(y[0].eventEnrollment,function(e){return e.IsWorkShop=c.eventDetail.isWorkShop,1!=e.isTempData}),S.eventEnrollment.length<=0&&(S.eventEnrollment=[]))}else S.autoId=1;var b=Math.random().toString(36).substring(7);if(_vgClassSessionSelection.isCallFromPublic())for(var k=0;k<=n.length-1;k++){var _=0,D="",I="",w="",P=0,A="",T=0,x=0;_vgClassSessionSelection.model.IsOnline&&(P=UserID,D="",I="",w="",A="",T=0,x=0);var F,O=[];F=$.grep(c.eventAvailableDates,function(e){return e.strEventDate==n[k].format("yyyy-MM-dd")&&e.serviceProviderID==r}),S.eventEnrollment.length>0&&null!=F&&F.length>0&&(O=$.grep(S.eventEnrollment,function(e){return e.appointmentID==F[0].appointmentID&&e.sPID==F[0].serviceProviderID&&new Date(e.eventDate).format("yyyy-MM-dd")==F[0].strEventDate&&e.startTime==F[0].strStartTime&&e.endTime==F[0].strEndTime&&e.customerID==UserID&&e.StreamingStatus==i}));var M={};if(null!=F&&F.length>0&&0==O.length){if(0==S.eventEnrollment.length?M.autoID=1:M.autoID=Math.max.apply(Math,S.eventEnrollment.map(function(e){return e.autoID}))+1,M.IsFromHomePage=!0,M.eventID=S.eventID,M.appointmentID=parseInt(F[0].appointmentID),M.customerID=P,M.cFirstName=D,M.cLastName=I,M.cUserEmail=w,M.cUserCellNo=A,M.cCellcountryID=T,M.cDialingCode=x,M.sPID=parseInt(r),M.sPName=p,M.eventDate=moment(n[k]).toISOString(),M.workshopActualDate=n[k].format("MM/dd/yyyy")+" "+F[0].strStartTime,M.startTime=F[0].strStartTime,M.endTime=F[0].strEndTime,M.duration=F[0].eventDuration,M.isTempData=!1,M.IsWorkShop=d.objEventDetails.IsWorkShop,M.StreamingStatus=_vgClassSessionSelection.StreamingStatusEnum.LiveStream,1==M.IsWorkShop&&M.StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream&&0!=F[0].workShopStreamingSellPrice&&0!=F[0].workShopNoofSessions?M.workShopIndividualPrice=F[0].workShopStreamingSellPrice/F[0].workShopNoofSessions:1==M.IsWorkShop&&M.StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.InHouse&&0!=F[0].workShopSellPrice&&0!=F[0].workShopNoofSessions?M.workShopIndividualPrice=F[0].workShopSellPrice/F[0].workShopNoofSessions:M.workShopIndividualPrice=0,M.noOfWorkShop=c.eventAvailableDates.length,M.randomForWorkShop=b,M.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,M.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,M.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,M.PromotionID=0,M.IsAmount=!1,M.AmountValue=0,M.discount=0,void 0!==S.promotiondetail&&""!=S.promotiondetail){var B=S.promotiondetail.split("-");M.PromotionID=S.promotiondetail.split("-")[0],M.IsAmount=0!=S.promotiondetail.split("-")[1],M.AmountValue=parseFloat(S.promotiondetail.split("-")[2]),M.PerUserOne=S.promotiondetail.split("-")[3],B.length>4?M.PerTransactionOne=S.promotiondetail.split("-")[4]:M.PerTransactionOne="0",M.PromotionTitle=S.promotiondetail.split("|~~|")[1]}S.eventEnrollment.push(M)}else if(0==O.length){if(0==S.eventEnrollment.length?M.autoID=1:M.autoID=Math.max.apply(Math,S.eventEnrollment.map(function(e){return e.autoID}))+1,M.IsFromHomePage=!0,M.eventID=S.eventID,M.appointmentID=parseInt(0),M.customerID=P,M.cFirstName=D,M.cLastName=I,M.cUserEmail=w,M.cUserCellNo=A,M.cCellcountryID=T,M.cDialingCode=x,M.sPID=parseInt(r),M.sPName=p,M.eventDate=moment(n[k]).toISOString(),M.workshopActualDate=n[k].format("MM/dd/yyyy"),M.startTime="",M.endTime="",M.duration=parseInt(0),M.isTempData=!1,M.IsWorkShop=d.objEventDetails.IsWorkShop,M.workShopIndividualPrice=0,M.noOfWorkShop=c.eventAvailableDates.length,M.randomForWorkShop=b,M.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,M.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,M.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,M.PromotionID=0,M.IsAmount=!1,M.AmountValue=0,M.discount=0,void 0!==S.promotiondetail&&""!=S.promotiondetail){B=S.promotiondetail.split("-");M.PromotionID=S.promotiondetail.split("-")[0],M.IsAmount=0!=S.promotiondetail.split("-")[1],M.AmountValue=parseFloat(S.promotiondetail.split("-")[2]),M.PerUserOne=S.promotiondetail.split("-")[3],B.length>4?M.PerTransactionOne=S.promotiondetail.split("-")[4]:M.PerTransactionOne="0",M.PromotionTitle=S.promotiondetail.split("|~~|")[1]}M.StreamingStatus=i,S.eventEnrollment.push(M)}_+=1}else{"0"==$("div.clsaccordion").find(".panel-default").length&&_vgClassSessionSelection.SetDefaultattendee();for(var E=0;E<=n.length-1;E++){$("div.clsaccordion").find(".panel-default").each(function(){if(void 0!==$(this).attr("data-value")){var e="",t="",o="",a=0,s="",l=0,d="";_vgClassSessionSelection.model.IsOnline&&(a=$(this).attr("data-value"),e=$(this).attr("data-fullname").split(" ")[0],t=void 0!==$(this).attr("data-fullname").split(" ")[1]?$(this).attr("data-fullname").split(" ")[1]:"",o=$(this).attr("data-email"),s=$(this).attr("data-cell"),l=$(this).attr("data-cellcountryid"),d=void 0!==$(this).attr("data-dialingCode")&&null!=$(this).attr("data-dialingCode")&&""!=$(this).attr("data-dialingCode")?$(this).attr("data-dialingCode"):"");var u,h=[];u=$.grep(c.eventAvailableDates,function(e){return e.strEventDate==n[E].format("yyyy-MM-dd")&&e.serviceProviderID==r}),S.eventEnrollment.length>0&&null!=u&&u.length>0&&(h=$.grep(S.eventEnrollment,function(e){return e.appointmentID==u[0].appointmentID&&e.sPID==u[0].serviceProviderID&&new Date(e.eventDate).format("yyyy-MM-dd")==u[0].strEventDate&&e.startTime==u[0].strStartTime&&e.endTime==u[0].strEndTime&&e.customerID==UserID&&e.StreamingStatus==i}));var m={};if(null!=u&&u.length>0&&0==h.length){if(0==S.eventEnrollment.length?m.autoID=1:m.autoID=Math.max.apply(Math,S.eventEnrollment.map(function(e){return e.autoID}))+1,m.eventID=S.eventID,m.appointmentID=parseInt(u[0].appointmentID),m.customerID=a,m.cFirstName=e,m.cLastName=t,m.cUserEmail=o,m.cUserCellNo=s,m.cCellcountryID=l,m.cDialingCode=d,m.sPID=parseInt(r),m.sPName=p,m.eventDate=moment(n[E]).toISOString(),m.workshopActualDate=n[E].format("MM/dd/yyyy")+" "+u[0].strStartTime,m.startTime=u[0].strStartTime,m.endTime=u[0].strEndTime,m.duration=u[0].eventDuration,m.isTempData=!1,m.IsWorkShop=c.eventDetail.isWorkShop,m.StreamingStatus=void 0!==i?i:0,1==m.IsWorkShop&&m.StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream&&0!=u[0].workShopStreamingSellPrice&&0!=u[0].workShopNoofSessions?m.workShopIndividualPrice=u[0].workShopStreamingSellPrice/u[0].workShopNoofSessions:1==m.IsWorkShop&&m.StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.InHouse&&0!=u[0].workShopSellPrice&&0!=u[0].workShopNoofSessions?m.workShopIndividualPrice=u[0].workShopSellPrice/u[0].workShopNoofSessions:m.workShopIndividualPrice=0,m.noOfWorkShop=c.eventAvailableDates.length,m.randomForWorkShop=b,m.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,m.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,m.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,m.PromotionID=0,m.IsAmount=!1,m.AmountValue=0,m.discount=0,void 0!==S.promotiondetail&&""!=S.promotiondetail){var g=S.promotiondetail.split("-");m.PromotionID=S.promotiondetail.split("-")[0],m.IsAmount=0!=S.promotiondetail.split("-")[1],m.AmountValue=parseFloat(S.promotiondetail.split("-")[2]),m.PerUserOne=S.promotiondetail.split("-")[3],g.length>4?m.PerTransactionOne=S.promotiondetail.split("-")[4]:m.PerTransactionOne="0",m.PromotionTitle=S.promotiondetail.split("|~~|")[1]}S.eventEnrollment.push(m)}else if(0==h.length){if(0==S.eventEnrollment.length?m.autoID=1:m.autoID=Math.max.apply(Math,S.eventEnrollment.map(function(e){return e.autoID}))+1,m.eventID=S.eventID,m.appointmentID=parseInt(0),m.customerID=a,m.cFirstName=e,m.cLastName=t,m.cUserEmail=o,m.cUserCellNo=s,m.cCellcountryID=l,m.cDialingCode=d,m.sPID=parseInt(r),m.sPName=p,m.eventDate=moment(n[E]).toISOString(),m.workshopActualDate=n[E].format("MM/dd/yyyy"),m.startTime="",m.endTime="",m.duration=parseInt(0),m.isTempData=!1,m.IsWorkShop=c.eventDetail.isWorkShop,m.workShopIndividualPrice=0,m.noOfWorkShop=c.eventAvailableDates.length,m.randomForWorkShop=b,m.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,m.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,m.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,m.PromotionID=0,m.IsAmount=!1,m.AmountValue=0,m.discount=0,void 0!==S.promotiondetail&&""!=S.promotiondetail){g=S.promotiondetail.split("-");m.PromotionID=S.promotiondetail.split("-")[0],m.IsAmount=0!=S.promotiondetail.split("-")[1],m.AmountValue=parseFloat(S.promotiondetail.split("-")[2]),m.PerUserOne=S.promotiondetail.split("-")[3],g.length>4?m.PerTransactionOne=S.promotiondetail.split("-")[4]:m.PerTransactionOne="0",m.PromotionTitle=S.promotiondetail.split("|~~|")[1]}m.StreamingStatus=void 0!==i?i:0,S.eventEnrollment.push(m)}0}})}}}if(S.eventEnrollment.length>0)for(k=0;k<S.eventEnrollment.length;k++)for(_=0;_<n.length;_++){if(new Date(S.eventEnrollment[k].eventDate).format("yyyy-MM-dd")==n[_].format("yyyy-MM-dd")&&S.eventEnrollment[k].sPID==r){S.eventEnrollment[k].isShowDiscount=!0;break}S.eventEnrollment[k].isShowDiscount=!1}if(t.length>0)t=$.grep(t,function(e){return e.eventID!=S.eventID});if(S.eventEnrollment.length>0&&t.push(S),void 0!==u&&null!=u&&null!=u||(u={}),"Event"===_vgClassSessionSelection.model.EventStorage&&(u.Events=t,$.grep(u.Events,function(e){e.classGCUsed=0,$.grep(e.eventEnrollment,function(e){e.isPointApply=!1,e.isPresetApply=!1,e.gcId=null,e.isPackage=null,e.isMembershipApply=null,e.isPriceBaseGCApply=!1})})),String.isNullOrUndefineOrBlank(u.Events)){var L=S.sessiondetail,N=$("#txtQuantity"),U=$("#txtNoofAttendees");i==_vgClassSessionSelection.StreamingStatusEnum.InHouse?($("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+_vgClassSessionSelection.CalcSessionPrice(L,N.val(),U.val(),!0,!1)),$("#divEventPrice_Old").html($("#divEventPrice").html())):($(this.model.divStreamingEventPrice).html(_vgClassSessionSelection.GetcurrencySymbol()+_vgClassSessionSelection.CalcSessionPrice(L,N.val(),U.val(),!0,!0)),$(this.model.divStreamingEventPrice_Old).html($("#divEventPrice").html()));var R=S.promotiondetail;if(""!=R.trim()){var W=R.split("-")[3];i==_vgClassSessionSelection.StreamingStatusEnum.InHouse?$("#divEventPrice_Old").show():$(this.model.divStreamingEventPrice_Old).show();var G=_vgClassSessionSelection.CalcSessionPrice(L,N.val(),U.val(),!0,i!=_vgClassSessionSelection.StreamingStatusEnum.InHouse),V=U.val(),H=G/N.val();if(H>0){i==_vgClassSessionSelection.StreamingStatusEnum.InHouse?$("#divEventPrice_Old").show():$(this.model.divStreamingEventPrice_Old).show();var j=0,Y=0;H<(Y=0==R.split("-")[1]?H*R.split("-")[2]/100:R.split("-")[2])&&(Y=H),"1"==W?(j=H-Y,j+=(G-H)*V):j=(G-Y)*V,$("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(j,2).format("#.##"))}}else i==_vgClassSessionSelection.StreamingStatusEnum.InHouse?$("#divEventPrice_Old").hide():$(this.model.divStreamingEventPrice_Old).hide()}else{var q=parseInt(_vgClassSessionSelection.GetCommonBusinessID());_vgClassSessionSelection.isCallFromPublic()&&(q=d.objEventDetails.BusinessID),u.BusinessID=q,u.loginUserId=parseInt(UserID),onlineShoppingCart=u,onlineShoppingCartmain=u,_onlineCheckout.CalculatePriceAndTaxOnCartForClass(u.Events),_onlineCheckout.getUserGCDetail_ShowDiscount(0,!0);var z=$.grep(onlineShoppingCart.Events,function(e){return e.eventID==S.eventID});if(z[0].eventEnrollment.length>0){var X=0,Z=0,J=0,Q=!1;if(filterPkgAndMembership=$.grep(z[0].eventEnrollment,function(e){return 0==Q&&e.StreamingStatus==i&&(void 0!==e.Originalprice&&null!=e.Originalprice&&(X=e.Originalprice),Q=!0),1==e.isShowDiscount&&e.customerID>0&&UserID>0&&e.customerID==UserID}),!String.isNullOrUndefineOrBlank(filterPkgAndMembership)){var K=0,ee=0,te=0,ie=0,ne=0,oe=0,ae=[];$.each(filterPkgAndMembership,function(e,t){if(void 0!==t.isPointApply&&1==t.isPointApply){var i=++ee>1?'<span class="msgcounter">'+ee+"</span>":"";$("#divApplyisPointApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part badge-button-positive"><div class="sign-icon" aria-hidden="true">&#xf058;</div><span class="green-text">Points Applied '+i+"</span></div></div>"),$("#divApplyisPointApply").show(),J=1}if(1!=t.isPointApply&&(null==t.gcId||0==t.gcId||t.gcId>0&&0==t.isPackage)&&t.PromotionID>0){var n=++ie>1?'<span class="msgcounter">'+ie+"</span>":"",o="";void 0!==t.PromotionTitle&&null!=t.PromotionTitle&&(o=t.PromotionTitle.length>0?"("+t.PromotionTitle+")":""),$("#divApplyDailyDeal").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part badge-button-positive"><div class="sign-icon" aria-hidden="true">&#xf058;</div><span class="green-text">Daily Deal Applied '+o+" "+n+"</span></div></div>"),$("#divApplyDailyDeal").show(),J>0?J+=1:J=0}if(t.gcId>0&&0==t.isPackage||1==t.isPriceBaseGCApply){var a=++te>1?'<span class="msgcounter">'+te+"</span>":"";$("#divApplyGC").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part badge-button-positive"><div class="sign-icon" aria-hidden="true">&#xf058;</div><span class="green-text">Gift Card Applied '+a+"</span></div></div>"),$("#divApplyGC").show(),J>0?J+=1:J=0}if(void 0!==t.isPackage&&t.gcId>0&&1==t.isPackage){K=0;var s="",r="";ae.push(t.pkgName);var l=ae.filter(function(e,t,i){return t==i.indexOf(e)});if(l.length>0){for(var c="",d=0;d<l.length;d++){for(var u=0;u<ae.length;u++)ae[u]==l[d]&&(s=++K>1?'<span class="msgcounter">'+K+"</span>":"",r=l[d].length>0?"("+l[d]+")":"");c+='<div id="divApplyPkg_'+d+'" class="subclss"><div class="brand-name-checkout thm-textColor"><div class= "applied-green-part badge-button-positive"><div class="sign-icon" aria-hidden="true">&#xf058;</div><span class="green-text">Package Applied '+r+" "+s+"</span></div></div></div>",K=0}$("#divOuterApplyPkg").html(c),$("#divOuterApplyPkg").show(),J>0?J+=1:J=0}}if(void 0!==t.isMembershipApply&&1==t.isMembershipApply){var p=++ne>1?'<span class="msgcounter">'+ne+"</span>":"",h=t.membershipName.length>0?"("+t.membershipName+")":"";$("#divApplyisMembershipApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part badge-button-positive"><div class="sign-icon" aria-hidden="true">&#xf058;</div><span class="green-text">Membership Applied '+h+" "+p+"</span></div></div>"),$("#divApplyisMembershipApply").show(),J>0?J+=1:J=0}if(void 0!==t.IsWaivedApply&&1==t.IsWaivedApply){var m=++oe>1?'<span class="msgcounter">'+oe+"</span>":"",g=t.AppliedName.length>0?"("+t.AppliedName+")":"";$("#divApplyIsWaivedApplyApply").html('<div class="brand-name-checkout thm-textColor"><div class= "applied-green-part badge-button-positive"><div class="sign-icon" aria-hidden="true">&#xf058;</div><span class="green-text">Deposit is Waived '+g+" "+m+"</span></div></div>"),$("#divApplyIsWaivedApplyApply").show()}1!=_vgClassSessionSelection.isCallFromPublic()&&($(".class-msg-inn").height()>=85?$(".class-msg-ul").addClass("show-cl-more").removeClass("rm-cls-height"):$(".class-msg-ul").removeClass("show-cl-more").addClass("rm-cls-height"))})}var se="0";void 0!==z[0].promotiondetail&&""!=z[0].promotiondetail&&X>0&&(se=z[0].promotiondetail.split("-")[3],0==z[0].promotiondetail.split("-")[1]?Z=_onlineCheckout.parseTodecimal(X*z[0].promotiondetail.split("-")[2]/100,2):(Z=z[0].promotiondetail.split("-")[2])<0&&(Z=0));for(var re=0,le=0,ce=0,de=0,ue=0,pe=0;pe<filterPkgAndMembership.length;pe++)if(filterPkgAndMembership[pe].StreamingStatus==i){var he=0;if(ue=0,ce=0,OriginalAmountSession=0,void 0!==filterPkgAndMembership[pe].Originalprice&&null!=filterPkgAndMembership[pe].Originalprice&&(ce=filterPkgAndMembership[pe].Originalprice,OriginalAmountSession=filterPkgAndMembership[pe].Originalprice),1==filterPkgAndMembership[pe].isPointApply&&(0==he&&(re+=filterPkgAndMembership[pe].actualPrice),ce=filterPkgAndMembership[pe].actualPrice,ue=filterPkgAndMembership[pe].actualPrice,de=1,he=1),filterPkgAndMembership[pe].gcId>0&&1==filterPkgAndMembership[pe].isPackage&&(0==he&&(re+=filterPkgAndMembership[pe].actualPrice),ce=filterPkgAndMembership[pe].actualPrice,ue+=filterPkgAndMembership[pe].actualPrice,de=1,he=1),1!=filterPkgAndMembership[pe].isPointApply&&(null==filterPkgAndMembership[pe].gcId||0==filterPkgAndMembership[pe].gcId||filterPkgAndMembership[pe].gcId>0&&0==filterPkgAndMembership[pe].isPackage)&&filterPkgAndMembership[pe].PromotionID>0&&(0==he&&(re+=OriginalAmountSession),ue+=parseFloat(Z),de=1,he=1),1==filterPkgAndMembership[pe].isMembershipApply)0==he&&(re+=OriginalAmountSession),ue+=_onlineCheckout.parseTodecimal(OriginalAmountSession*filterPkgAndMembership[pe].membershipDiscount/100,2),de=1,he=1;if(filterPkgAndMembership[pe].gcId>0&&0==filterPkgAndMembership[pe].isPackage&&(0==he&&(re+=OriginalAmountSession),ue+=OriginalAmountSession,de=1,he=1),1==filterPkgAndMembership[pe].isPriceBaseGCApply){if(0==he&&(re+=OriginalAmountSession),filterPkgAndMembership[pe].GCDetail.length>0)for(var me=0,ge=0;ge<filterPkgAndMembership[pe].GCDetail.length;ge++)me+=filterPkgAndMembership[pe].GCDetail[ge].GCAmount;ue+=me,de=1,he=1}0==he&&(re+=OriginalAmountSession),re<0&&(re=0),ue>=ce||(0==le?le=ce-ue:le+=ce-ue)}X<parseFloat(Z)&&(Z=X);var ve=this.GetNoOfAttendees();if(ve>1){var fe=parseInt($("#txtQuantity").val());re+=X*fe*(ve-1),le+="1"==se?X*fe*(ve-1):(X-parseFloat(Z))*fe*(ve-1)}if(de>0&&1!=J&&re!=le)if(i==_vgClassSessionSelection.StreamingStatusEnum.InHouse)$("#divEventPrice_Old").html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(re,2).format("#.##")).attr("aria-label","Old price "+$("#divEventPrice_Old").html()),$("#divEventPrice_Old").show(),$("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(le,2).format("#.##")).attr("aria-label","New price "+$("#divEventPrice").html()),_siteBuilderDetail.GCVPLText(le,1);else if(_vgClassSessionSelection.isCallFromPublic()){var Ce="2"==$("#tr"+_publicEvent.objEventDetails.AppointmentID).attr("data-countryid")?"£":"$",Se=_onlineCheckout.parseTodecimal(le,2).format("#.##");0==Se?(Se="Free",$("#PopupEventPrice").attr("aria-label","Discounted Price is "+Ce+_onlineCheckout.parseTodecimal(re,2).format("#.##")+" , "+Se).attr("role","banner")):(Se=Ce+Se,$("#PopupEventPrice").attr("aria-label","Discounted Price is "+Ce+_onlineCheckout.parseTodecimal(re,2).format("#.##")+" Original Price is  "+Se).attr("role","banner")),$("#PopupEventPrice").html('<span class=\'greenbutton-line-through\' style="margin-right:5px;" aria-hidden="true">'+Ce+_onlineCheckout.parseTodecimal(re,2).format("#.##")+' </span><span aria-hidden="true">'+Se+"</span>")}else $(this.model.divStreamingEventPrice_Old).html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(re,2).format("#.##")).attr("aria-label","Old Price is "+$(this.model.divStreamingEventPrice_Old).html()),$(this.model.divStreamingEventPrice_Old).show(),$(this.model.divStreamingEventPrice).html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(le,2).format("#.##")).attr("aria-label","New Price is "+$(this.model.divStreamingEventPrice).html()),_siteBuilderDetail.isAffirmEnable,_siteBuilderDetail.GCVPLText(le,2);else i==_vgClassSessionSelection.StreamingStatusEnum.InHouse?($("#divEventPrice_Old").hide(),$("#divEventPrice_Old").html("").attr("aria-label",""),$("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(re,2).format("#.##")),_siteBuilderDetail.GCVPLText(le,1)):($(this.model.divStreamingEventPrice_Old).hide(),$(this.model.divStreamingEventPrice_Old).html(""),$(this.model.divStreamingEventPrice).html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(re,2).format("#.##")).attr("aria-label","Price is "+$(this.model.divStreamingEventPrice).html()),_siteBuilderDetail.GCVPLText(le,2));_vgClassSessionSelection.commonProperty.streamingAmount=_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(le,2).format("#.##")}}_vgClassSessionSelection.EventShowLoader(!1)}catch(e){_vgClassSessionSelection.EventShowLoader(!1),onlineShoppingCart={},onlineShoppingCartmain={}}},GetFrequencyName:function(e){return 1==e?"Daily":2==e?"Weekly":3==e?"Monthly":4==e?"Yearly":"Off"},GetFrequency:function(e,t){var i="";if(1==e)i="day";else if(2==e){var n=t.split("~");i=n.length>0?1==n[0]?"week":n[0]+" weeks":"week"}else i=3==e?"month":4==e?"year":"day";return i},GetFrequencyDays:function(e,t){var i="";if(2==e){if((s=t.split("~")).length>1)for(var n=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"),o=s[1].split(","),a=0;a<o.length;a++)i+=n[o[a]-1]+"<br />"}else if(3==e)i=t+_vgClassSessionSelection.nth(t);else if(4==e){var s;if((s=t.split("~")).length>1){i=s[1]+_vgClassSessionSelection.nth(s[1])+" "+["January","February","March","April","May","June","July","August","September","October","November","December"][s[0]-1]}}return i},nth:function(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},FormatDate:function(e){return new Date(e).format("MMM-dd-yyyy")},FormatDateCustom:function(e){return new Date(e).format("MMM DD, YYYY")},ShowExceptionDetailSuccess:function(e){if(1==_vgClassSessionSelection.model.IsOnline){var t=parseInt($("#hdnAppointmentId").val());$("#tr-"+t).data("otherSPavailabledates",JSON.stringify(e)),_vgClassSessionSelection.commonProperty.otherSPavailabledates=e}_vgClassSessionSelection.SessionExceptionDetail(e),$("#CheckoutGroupPopup").modal("hide")},SessionExceptionDetail:function(e){_vgClassSessionSelection.commonProperty.SPID;try{var t=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.ExceptionStorage);if(null!=e&&e.eventAvailableDates.length>0){s=[];for(var i=0,n=0;n<=t.length-1;n++){t[n].autoId=n+1;var o=[];if(0==this.model.IsOnline?t[n].RemarksType==this.commonProperty.SPNotAvalable&&(o=$.grep(e.eventAvailableDates,function(e){return e.strEventDate==new Date(t[n].eventDate).format("yyyy-MM-dd")})):o=$.grep(e.eventAvailableDates,function(e){return e.strEventDate==new Date(t[n].eventDate).format("yyyy-MM-dd")}),o.length>0)if(1==this.model.IsOnline&&(o=$.grep(o,function(e){return t[n].StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream?e.streamingEventCapacity>=e.streamingNoOfAttendees+_vgClassSessionSelection.GetevenetCapacity(e.appointmentID,!0)+1:e.eventCapacity>=e.noOfAttendees+_vgClassSessionSelection.GetevenetCapacity(e.appointmentID,!1)+1})),null!=o&&o.length>0){t[n].isExNotHandle=!1;var a=o.uniqueObjects(["serviceProviderID"]);if(null!=a&&a.length>1){var r=o.uniqueObjects(["serviceProviderID"]);t[n].isMultipleSP=!0,t[n].SPAvalibility=r,t[n].SPArray=[],$.each(r,function(e,i){var o=$.grep(s,function(e){return e.appointmentID==i.appointmentID&&e.SPID==i.serviceProviderID});if(null==o||0==o.length){var a={};a.appointmentID=i.appointmentID,a.SPID=i.serviceProviderID,a.eventCapacity=i.eventCapacity,a.noOfAttendees=0,a.streamingNoOfAttendees=0,t[n].StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.InHouse?a.noOfAttendees=i.noOfAttendees+_vgClassSessionSelection.GetevenetCapacity(i.appointmentID,!1):a.streamingNoOfAttendees=i.streamingNoOfAttendees+_vgClassSessionSelection.GetevenetCapacity(i.appointmentID,!0),a.streamingEventCapacity=i.streamingEventCapacity,s.push(a)}clsSPArray={},clsSPArray.SPID=i.serviceProviderID,clsSPArray.SPName=i.serviceProviderName,clsSPArray.appointmentID=i.appointmentID,t[n].SPArray.push(clsSPArray)})}else if(null!=a&&a.length>0){t[n].isExNotHandle=!1,t[n].isMultipleSP=!1,t[n].SPAvalibility=[],t[n].SPAvalibility=o,t[n].SPID=o[0].serviceProviderID,t[n].SPName=o[0].serviceProviderName,0==this.model.IsOnline&&(t[n].StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.InHouse?o[0].eventCapacity<o[0].noOfAttendees+_vgClassSessionSelection.GetevenetCapacity(o[0].appointmentID,!1)+1?t[n].isCapacityFull=!0:t[n].isCapacityFull=!1:o[0].streamingEventCapacity<o[0].streamingNoOfAttendees+_vgClassSessionSelection.GetevenetCapacity(o[0].appointmentID,!0)+1?t[n].isCapacityFull=!0:t[n].isCapacityFull=!1);var l=o[0];t[n].StreamingStatus==_vgClassSessionSelection.StreamingStatusEnum.InHouse?l.noOfAttendees+=1:l.streamingNoOfAttendees+=1;var c=$.grep(e.eventAvailableDates,function(e){return e.appointmentID!=l.appointmentID});c.push(l),e.eventAvailableDates=c}}else i+=1,t[n].SPName="--",t[n].isExNotHandle=!0,t[n].Remarks="This class is full.";else(1==this.model.IsOnline||0==this.model.IsOnline&&t[n].RemarksType==this.commonProperty.SPNotAvalable)&&(i+=1),t[n].isExNotHandle=!0,t[n].Remarks="This service provider is not available."}this.SetIntoSessionStorage(this.model.ExceptionStorage,t)}else if(0==this.model.IsOnline){var d=$.grep(t,function(e){return e.RemarksType==_vgClassSessionSelection.commonProperty.ClassFull});i=null==d||d.length<=0?t.length:0}else i=t.length;var u=!1;this.GetNoOfSessions()*this.GetNoOfAttendees()>i&&(u=!0),1==this.model.IsOnline?(0==u?$("#btnConfirm").hide():$("#btnConfirm").show(),this.DisplayStep(2)):(_vgCal.ManageAtnd.model.IsShowExceptionConfirmBtn=u,_vgCal.ManageAtnd.ShowSessionException(!0),"undefined"==typeof InHouseDeposit||null==typeof InHouseDeposit||1!=InHouseDeposit.ClassMultiAttendeeCheckoutType.IndividualCheckout&&2!=InHouseDeposit.ClassMultiAttendeeCheckoutType.IndividualCheckout?$("#btnAddAtndMulti").show():$("#btnAddAtndMulti").hide()),$("#bodyExceptionDetail1").html("");var p=[];(p=0==this.model.IsOnline?t.uniqueObjects(["customerID"]):t.uniqueObjects(["cUserEmail"])).length>1||1==_vgClassSessionSelection.model.IsOnline&&1==p.length&&p[0].customerID!=_vgClassSessionSelection.commonProperty.UserID?$.grep(t,function(e){e.isMultiUserUser=!0}):$.grep(t,function(e){e.isMultiUserUser=!1}),$(".divEventExceptionDetail").html("The following classes cannot be booked:"),$(".divEventExceptionDetail").show(),"undefined"!=typeof _shopdetail&&void 0!==_shopdetail.lastClassBookingDate&&(t=this.validateAvailabilityException(_shopdetail.lastClassBookingDate,_shopdetail.lastClassBookingLimit,t)),$("#ExceptionDetailTemplate1").tmpl(t).appendTo("#bodyExceptionDetail1"),_vgClassSessionSelection.EventShowLoader(!1)}catch(e){_vgClassSessionSelection.EventShowLoader(!1)}},validateAvailabilityException:function(e,t,i){var n=new Date(e);n.setDate(n.getDate()-1);var o=!1,a=i.filter(function(e){return e.eventDate>n});if(null!=a&&a.length>0)for(var s=0;s<i.length;s++)i[s].RemarksType=3,i[s].lastLimit=t,o=!0;return 1==o?$("#divClassDetailpopup").find("#btnConfirm").text("I Understand"):$("#divClassDetailpopup").find("#btnConfirm").text("Confirm"),i},OtherSPChangeOffline:function(e){var t=$(e).data("previousspid"),i=($(e).data("previousappid"),$(e).val()),n=parseInt($(e).find("option:selected").data("appid"));if("-1"!=i){var o=$.grep(s,function(e){return e.SPID==parseInt(i)&&e.appointmentID==n}),a=$("option[value='"+i+"']:selected",$("select[data-eventdate='"+$(e).data("eventdate")+"']")),r=$(e).data("streamingstatus");if(void 0!==r&&""!=r||(r=_vgClassSessionSelection.StreamingStatusEnum.InHouse),(r==_vgClassSessionSelection.StreamingStatusEnum.InHouse?o[0].eventCapacity:o[0].streamingEventCapacity)<(r==_vgClassSessionSelection.StreamingStatusEnum.InHouse?o[0].noOfAttendees:o[0].streamingNoOfAttendees)+a.length){if(!_vgCal.Common.ShowConfirm("By proceeding further, a system will exceed class capacity. Are you sure you want to proceed?"))return void(void 0!==t&&""!=t?$(e).val(t):$(e).val("-1"));$(e).find("option:selected").data("isspfull",!0)}else $(e).find("option:selected").data("isspfull",!1)}void 0!==t&&""!=t&&"-1"!=t&&$(e).find("option[value='"+t+"']").data("isspfull",!1),$(e).data("previousspid",i),$(e).data("previousappid",n)},OtherSPChange:function(e){var t=$(e).data("previousspid"),i=$(e).data("previousappid"),n=parseInt($(e).val()),o=parseInt($(e).find("option:selected").data("appid")),a=$(e).data("streamingstatus");void 0!==a&&""!=a||(a=_vgClassSessionSelection.StreamingStatusEnum.InHouse);var r=[];void 0!==t&&""!=t&&void 0!==i&&""!=i&&$.grep(s,function(e){e.SPID==parseInt(t)&&e.appointmentID==parseInt(i)&&(a==_vgClassSessionSelection.StreamingStatusEnum.LiveStream?e.streamingNoOfAttendees-=1:e.noOfAttendees-=1)}),-1!=n?($(e).data("previousspid",n),$(e).data("previousappid",o),$.grep(s,function(e){return e.SPID==n&&e.appointmentID==o&&(a==_vgClassSessionSelection.StreamingStatusEnum.LiveStream&&e.streamingEventCapacity>=e.streamingNoOfAttendees+1?e.streamingNoOfAttendees+=1:e.eventCapacity>=e.noOfAttendees+1&&(e.noOfAttendees+=1)),e.SPID==n&&e.appointmentID==o})):($(e).data("previousspid",""),$(e).data("previousappid","")),$.grep($("option",$(e)),function(e){if("-1"!=$(e).val()){var t=$.grep(s,function(t){return t.SPID==parseInt($(e).val())&&t.appointmentID==parseInt($(e).data("appid"))});null!=t&&t.length>0&&(r=r.concat(t))}});var l="(Not Available)";if(r.length>0)for(var c=0;c<=r.length-1;c++)$.grep($("option",$("select[data-eventdate='"+$(e).data("eventdate")+"']").not(e)),function(e){"-1"!=$(e).val()&&parseInt($(e).val())==r[c].SPID&&0==$(e).is(":selected")&&(a==_vgClassSessionSelection.StreamingStatusEnum.InHouse&&r[c].eventCapacity==r[c].noOfAttendees||a==_vgClassSessionSelection.StreamingStatusEnum.LiveStream&&r[c].streamingEventCapacity==r[c].streamingNoOfAttendees?($(e).prop("disabled",!0),$(e).html().toString().indexOf(l)<=0?$(e).html($(e).html()+l):($(e).prop("disabled",!0),$(e).html().toString().indexOf(l)<=0&&$(e).html($(e).html()+l))):($(e).prop("disabled",!1),$(e).html($(e).html().replace(l,""))))})},DisplayStep:function(e){if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&(1==_shopdetail.IsMemPkgReqToBook||1==_shopdetail.IsLimitOnlineBooking)){var t=_shopdetail.LiveStreamSignUp;if(void 0!==t&&null!=t&&1==e)return!1}var i=$("#divSessionDetail"),n=$("#divSessionFooter"),o=$("#divExceptionDetail1"),a=$("#divExceptionFooter"),s=$("#divUserDetail"),r=$("#divUserFooter");return _vgClassSessionSelection.ResetMoreButton(),1==e?(o.hide(),a.hide(),s.hide(),r.hide(),i.show(),n.show(),$("#classDetailpopup").removeClass("classstep1"),centerModal($("#divClassDetailpopup")),void 0!==setPopupPosi&&void 0!==IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&(iOS||isAndroidMobile||($("#divClassDetailpopup").addClass("wbDivClassDetailpopup"),setPopupPosi($("#divClassDetailpopup")))),$("#divEventName").show().attr("tabindex","-1").attr("role","heading").attr("aria-level","1").focus(),$("#ancHome").attr("tabindex","-1"),""!=$("#eventDescription").text().trim()&&$("#eventDescription").show(),$(".more-gradient").show(),$("#divAddFriendsToWk").hide(),$("#divWkName").hide(),$("#divWkTotalPrice").hide(),$("#divClassShowDiscount").show(),$(_vgClassSessionSelection.Controls.divHdrEventPrice).hide()):2==e?(i.hide(),n.hide(),s.hide(),r.hide(),o.show(),a.show(),$("#divClassShowDiscount").hide(),$("#classDetailpopup").addClass("classstep1"),centerModal($("#divClassDetailpopup")),void 0!==setPopupPosi&&void 0!==IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&(iOS||isAndroidMobile||($("#divClassDetailpopup").addClass("wbDivClassDetailpopup"),setPopupPosi($("#divClassDetailpopup"))))):3==e&&(i.hide(),n.hide(),o.hide(),a.hide(),s.show(),r.show(),$("#classDetailpopup").addClass("classstep1"),centerModal($("#divClassDetailpopup")),void 0!==setPopupPosi&&void 0!==IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&(iOS||isAndroidMobile||($("#divClassDetailpopup").addClass("wbDivClassDetailpopup"),setPopupPosi($("#divClassDetailpopup"))))),!1},BackToPreviousStep:function(){_vgClassSessionSelection.EventShowLoader(!0),this.DisplayStep(parseInt($("#btnBack").data("from"))),_vgClassSessionSelection.commonProperty.isWaitlist||this.ManageEventTempAndRealData(!1,!1),_vgClassSessionSelection.EventShowLoader(!1)},removegroup:function(e){$("#eventusergroup"+e).remove(),(o=jQuery.grep(o,function(t){return t!=e})).length+1>19?$("#addnew").hide():$("#addnew").show(),1==_vgClassSessionSelection.commonProperty.isWorkShop&&(_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?$("#divWkTotalPrice_sub").html(_vgClassSessionSelection.GetcurrencySymbol()+_vgClassSessionSelection.CalcSessionPrice(_vgClassSessionSelection.commonProperty.sessiondetail,_vgClassSessionSelection.GetNoOfSessions(),o.length+1,!0,!0)):$("#divWkTotalPrice_sub").html($("#divEventPrice").html()))},RemoveAttendee:function(e){var t=$(e).closest(".panel-default");$("div.clsaccordion").find(t).remove();var i=this.GetNoOfAttendees()-1;$("#txtNoofAttendees").val(i),_vgClassSessionSelection.CalculateSessionPrice(),_vgClassSessionSelection.ShowDiscountOnEvent(),_vgClassSessionSelection.BindFamilyFriendList(i)},CloseSelectiononlowendDevices:function(e){$(e).closest("div.collapse").collapse("hide"),$("#divAddonPopupSection").removeClass("scrollbackhide")},addControl:function(){var e=2;null!=o&&0==o.length?o.push(e):(o.push(o[o.length-1]+1),e=o[o.length-1]),o.length+1>19?$("#addnew").hide():$("#addnew").show(),1==_vgClassSessionSelection.commonProperty.isWorkShop&&(_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?$("#divWkTotalPrice_sub").html(_vgClassSessionSelection.GetcurrencySymbol()+_vgClassSessionSelection.CalcSessionPrice(_vgClassSessionSelection.commonProperty.sessiondetail,_vgClassSessionSelection.GetNoOfSessions(),o.length+1,!0,!0)):$("#divWkTotalPrice_sub").html($("#divEventPrice").html())),$("#grouptemplate ul").attr("id","eventusergroup"+e),$("#eventusergroup").append($("#grouptemplate").html()),$("#grouptemplate ul").removeAttr("id"),$("#eventusergroup"+e+" img").attr("id","imgid"+e),$("#eventusergroup"+e+" .clsremoveUser").attr("onclick","_vgClassSessionSelection.removegroup("+e+")"),$("#eventusergroup #txtFirstName").attr("id","txtFirstName"+e),$("#eventusergroup #txtLastName").attr("id","txtLastName"+e),$("#eventusergroup #txtEmailId").attr("id","txtEmailId"+e),$("#eventusergroup #txtCellNo").attr("id","txtCellNo"+e),$("#eventusergroup #divFirstName").attr("id","divFirstName"+e),$("#eventusergroup #divLastName").attr("id","divLastName"+e),$("#eventusergroup #divEmailId").attr("id","divEmailId"+e)},validate:function(e,t,i){if(1!=$(e).hasClass("noValidate")||1!=$(e).is(":disabled")){var n=!0;if("cell"==t)return""!=$(e).val()?/^0?\d{10}$/i.test($(e).val())?($(e).removeClass("errorInput"),$(e).siblings("div.validatemsg").hide(),!0):($(e).addClass("errorInput"),$(e).siblings("div.validatemsg").show(),$(e).siblings("div.validatemsg").html("cell should be of 10 digits."),!1):($(e).removeClass("errorInput"),$(e).siblings("div.validatemsg").hide(),!0);var o=$.trim($(e).val());if(""!=o||$(e).hasClass("select2-focusser")||$(e).hasClass("select2-input")){if("email"==t){if(/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,10}(?:\.[a-z]{2})?)$/i.test(o)){if(0==i){var a=0;if($("#eventusergroup input[data-type]").each(function(){if($.trim($(this).val()).toLowerCase()==o.toLowerCase()&&(a+=1)>1)return!1}),a>1)$(e).siblings("div.validatemsg").html("duplicate email exist"),$(e).addClass("errorInput"),$(e).siblings("div.validatemsg").show(),n=!1;else{var s=_vgClassSessionSelection.commonProperty.eventID,r=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);if(r.length>0){var l=$.grep(r,function(e){return e.eventID==s});l.length>0&&_vgClassSessionSelection.CheckUserExistance(0,$(e).val().trim(),l[0])&&($(e).siblings("div.validatemsg").html("this user is already exists in cart."),$(e).addClass("errorInput"),$(e).siblings("div.validatemsg").show(),n=!1)}}}}else $(e).addClass("errorInput"),$(e).siblings("div.validatemsg").show(),$(e).siblings("div.validatemsg").html("invalid email address"),n=!1}}else $(e).addClass("errorInput"),n=!1;return 1==n&&($(e).removeClass("errorInput"),$(e).siblings("div.validatemsg").hide()),n}},validateForUserExistance:function(e,t,i){var n=!0,o=_vgClassSessionSelection.ResponseValidateForExistance(e,$(t).val(),i);return null!=o&&($(t).siblings("div").html(o.Msg),$(t).addClass("errorInput"),$(t).siblings("div").show(),n=!1),1==n&&($(t).removeClass("errorInput"),$(t).siblings("div").hide()),n},clearcontrol:function(){$("div.clsaccordion").find(".panel-default").remove(),ZenSwipeCardDetails={},isCCChanged=!1},SetFamilyFriendListData:function(e,t,i){ShowLoader(!0);var n=1;$.each(e,function(e,t){t.Index=n,t.Tag="",t.IsDisabled=0,t.IsMemPkgReqToBook=_shopdetail.IsMemPkgReqToBook,t.IsLimitOnlineBooking=_shopdetail.IsLimitOnlineBooking,n++}),_vgClassSessionSelection.AddOnServiceBind(e,t,i),$(".clsaccordion").empty();var o=0;if($.each(e,function(t,i){o++,i.Index=o,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking&&void 0!==_shopdetail.DisplayEmpNotAccptNewClientsBadgeFnFPopUp&&1==_shopdetail.DisplayEmpNotAccptNewClientsBadgeFnFPopUp($("#hdnserviceProviderID").val(),i.UserID)&&(e[t].Tag="NOT ACCEPTING NEW CLIENTS",e[t].IsDisabled=1)}),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&null!=_shopdetail.IsMemPkgReqToBook&&1==_shopdetail.IsMemPkgReqToBook){var a=!1;if("undefined"!=typeof _shopdetail&&void 0!==_shopdetail.MembershipPackageDetails&&void 0!==_shopdetail.MembershipPackageDetails.Data&&null!=_shopdetail&&null!=_shopdetail.MembershipPackageDetails&&null!=_shopdetail.MembershipPackageDetails.Data&&null!=_shopdetail.MembershipPackageDetails.Data.UserMemberShipAndPackageInformation&&!String.isNullOrUndefineOrBlank(_shopdetail.MembershipPackageDetails.Data.UserMemberShipAndPackageInformation.RequiredServices)){var s=_shopdetail.MembershipPackageDetails.Data.UserMemberShipAndPackageInformation.RequiredServices.split(","),r=_vgClassSessionSelection.commonProperty.eventID;void 0!==r&&null!=r&&r>0&&$.each(s,function(e,t){t==r&&(a=!0)})}a&&$.each(e,function(e,t){if(""==t.Tag){var i=$.grep(_vgClassSessionSelection.FamilyFriendsMembershipPackage.Data.FamilyFriendsMembershipPackage,function(e){return e.UserID==t.UserID});i.length>0&&(0!=i[0].ItemId?t.Tag=i[0].Tag:t.UserID!=UserID||void 0!==_shopdetail.BookingDetail.fnfUserId?(t.Tag="Membership/Package Required To Book",t.IsDisabled=1):t.Tag="")}})}var l=[],c=(n=0,0),d=!1;if(null!=_vgClassSessionSelection.commonProperty.ClassPropertyData){var u=_vgClassSessionSelection.commonProperty.ClassPropertyData.serviceProviderID;_shopdetail.UserAndFnFNewOrExistingForBusinessEmployees.forEach(function(e){d=e.ServiceProviderID!=u||1!=e.Existing||e.UserID!=UserID})}if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&null!=_shopdetail.IsLimitOnlineBooking&&1==_shopdetail.IsLimitOnlineBooking&&1==d){var p=""==$("#hdnSelSPID").val()?UserID:$("#hdnSelSPID").val();e.forEach(function(e){if(e.UserID==Number(p)){var t={};1==++n&&(t.Index=n,t.UserId=e.UserID,t.FullName=e.FullName,t.Photo=e.Photo,t.Email=e.Email,t.Phone=e.Phone,t.Tag=e.Tag),l[n]=t,c=n}})}else for(;t>0;){t--;var h={};1==++n?(h.Tag=e[0].Tag,h.IsDisabled=e[0].IsDisabled,h.Index=n,h.UserId=e[0].UserID,h.FullName=e[0].FullName,h.Photo=e[0].Photo,h.Email=e[0].Email,h.Phone=e[0].Phone,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking&&(h.Tag=e[0].Tag)):(h.Index=n,h.UserId="",h.FullName="",h.Photo="",h.Email="",h.Phone="",h.Tag="",h.IsDisabled=0),l[n]=h}if($("#AttendeelistTemplate").tmpl(l).appendTo(".clsaccordion"),$("#SubAttendeelistTemplate").tmpl(e).appendTo(".clsfamilyandfriends"),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking){if(void 0!==_shopdetail.EmployeeNotAcceptingNewClientsDetails)0==$.grep(_shopdetail.EmployeeNotAcceptingNewClientsDetails,function(e,t){return e.ServiceProviderID==$("#hdnserviceProviderID").val()}).length&&$("#FamilyandFriendsbottomlinks").tmpl().appendTo(".clsfamilyandfriends");if(1==_shopdetail.IsLimitOnlineBooking&&""!=$("#hdnSelSPID").val()){var m=$("#hdnSelSPID").val();_shopdetail.FnfUserSelectionForClass($(".clsuid"+m))}else 1!=_shopdetail.IsLimitOnlineBooking&&1!=_shopdetail.IsMemPkgReqToBook&&$("#FamilyandFriendsbottomlinks").tmpl().appendTo(".clsfamilyandfriends")}else $("#FamilyandFriendsbottomlinks").tmpl().appendTo(".clsfamilyandfriends");$(".modal:visible").each(function(e,t){centerModal(t)}),ShowLoader(!1),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking&&e.length>0&&(void 0===e[0].Tag||""==e[0].Tag||c>0?($("#btnSearchAvailability").hide(),$("#btnUAddtoCart").show(),$("#btnUCheckOut").show()):($("#btnSearchAvailability").show(),$("#btnUAddtoCart").hide(),$("#btnUCheckOut").hide()))},BindFamilyFriendList:function(e){_vgClassSessionSelection.localData.AddonsList=[],_vgClassSessionSelection.commonProperty.streamingAmount.replace(_vgClassSessionSelection.GetcurrencySymbol(),"").replace(",","")>0?($(_vgClassSessionSelection.Controls.divHdrEventPrice).text(_vgClassSessionSelection.commonProperty.streamingAmount.replace(",","")),$(_vgClassSessionSelection.Controls.divHdrEventPrice).show()):($(_vgClassSessionSelection.Controls.divHdrEventPrice).text("FREE"),$(_vgClassSessionSelection.Controls.divHdrEventPrice).show()),$(_vgClassSessionSelection.Controls.AddOnList).empty(),$(_vgClassSessionSelection.Controls.divAddonPopupSection).hide(),$(".moblie-devider").hide(),$(".m-addon-text").hide(),_vgClassSessionSelection.CalculateTotalPrice();try{var t=_vgClassSessionSelection.commonProperty.lstfamilyfriendmembers;if(void 0!==t&&null!=t&&t.length>0)_vgClassSessionSelection.SetFamilyFriendListData(t,e,!1);else{var i={UserID:UserID,ServiceId:parseInt(_vgClassSessionSelection.commonProperty.eventID),BusinessID:parseInt(_vgClassSessionSelection.GetCommonBusinessID()),ServiceProviderID:parseInt($("#hdnserviceProviderID").val())},n=new vagaro.ajax;n.datamodel.Token="GetListofFamilyFriendtoBook",n.datamodel.data=[i],n.datamodel.callback=function(t){ShowLoader(!0),_vgClassSessionSelection.SetFamilyFriendListData(t,e,!1)},n.datamodel.Error=_vgClassSessionSelection.CallFailed,n.Post()}}catch(e){}},AddUser:function(){var e=this.GetNoOfAttendees();if(_vgClassSessionSelection.BindFamilyFriendList(e),e!=o.length+1)if(e>o.length+1)for(var t=o.length+1;t<=e-1;t++)this.addControl();else{var i=$.extend(!0,[],o);i=i.reverse();for(var n=1;n<=i.length+1-e;n++)_vgClassSessionSelection.removegroup(i[n])}$("#eventusergroup input").each(function(){$(this).removeClass("errorInput"),$(this).siblings("div").hide()}),$(".dynemicData input").attr("autocomplete","new-password"),1==this.model.IsOnline&&this.DisplayStep(3)},CheckLogiUserCheckExistance:function(e){if(0!=this.GetAllSessionDates(3)){a=this.GetAllSessionDates(1);var t=this.commonProperty.eventID,i=this.GetSessionStorage(this.model.EventStorage);if(i.length>0){var n=$.grep(i,function(e){return e.eventID==t});if(n.length>0&&this.CheckUserExistance(this.commonProperty.UserID,"",n[0])){_vgClassSessionSelection.EventShowLoader(!1);var o="Would you like to add a friend to this class?";1==this.model.IsOnline?"undefined"!=typeof bootbox&&_vgClassSessionSelection.AlreadyEnrolled(o):_vgCal.Common.ShowConfirm(o)&&(_vgClassSessionSelection.EventShowLoader(!0),_vgClassSessionSelection.SetDefaultUser(!1),_vgCal.ManageAtnd.ShowStep2(!0),_vgClassSessionSelection.EventShowLoader(!1))}else _vgClassSessionSelection.clearcontrol(),_vgClassSessionSelection.SetDefaultattendee(),1==this.model.IsOnline?_vgClassSessionSelection.CheckUserExistanceInEvent(e):_vgClassSessionSelection.CreateEventCollection(e)}else _vgClassSessionSelection.clearcontrol(),_vgClassSessionSelection.SetDefaultattendee(),1==this.model.IsOnline?_vgClassSessionSelection.CheckUserExistanceInEvent(e):_vgClassSessionSelection.CreateEventCollection(e)}else _vgClassSessionSelection.EventShowLoader(!1)},SetDefaultattendee:function(){var e=[],t={Index:1};t.UserId=parseInt(UserID),t.FullName=FullUserName+" (Me)",t.Photo="",t.Email="undefined"!=typeof UserEmail&&null!=UserEmail?UserEmail.trim():"",t.Phone=UserCellNo,e[1]=t,$("#AttendeelistTemplate").tmpl(e).appendTo(".clsaccordion")},CheckUserExistanceInEvent:function(t){var i=_vgClassSessionSelection,o=$("<XMLDocument/>");o.append(i.createXmlElement("appointments"));var s=[];if(a.length<=0?(s=this.GetAllSessionDates(t),a=s):s=a,s.length>0){for(var r=0;r<=s.length-1;r++){var l,c=this.commonProperty.SPID;if(null!=(l=$.grep(this.commonProperty.availabledates.eventAvailableDates,function(e){return e.strEventDate==s[r].format("yyyy-MM-dd")&&e.serviceProviderID==c}))&&l.length>0){var d=i.createXmlElement("appointment");if(d.append(i.createXmlElement("appid",l[0].appointmentID)),!_vgClassSessionSelection.model.IsSearchFromInHouseClass&&$("div.clsaccordion").find(".panel-default").length>0)$("div.clsaccordion").find(".panel-default").each(function(){EUserID=$(this).attr("data-value"),EUserEmailID=$(this).attr("data-Email");var e=i.createXmlElement("user");e.append(i.createXmlElement("email",EUserEmailID)),e.append(i.createXmlElement("userId",EUserID)),d.append(e)});else if(_vgClassSessionSelection.model.IsSearchFromInHouseClass||0!==$("div.clsaccordion").find(".panel-default").length){EUserID=_vgClassSessionSelection.getSelectedCustomer(),EUserEmailID="",(u=i.createXmlElement("user")).append(i.createXmlElement("email",EUserEmailID)),u.append(i.createXmlElement("userId",EUserID)),d.append(u)}else{var u;EUserID=_vgClassSessionSelection.commonProperty.UserID,EUserEmailID=_vgClassSessionSelection.commonProperty.UserEmail,(u=i.createXmlElement("user")).append(i.createXmlElement("email",EUserEmailID)),u.append(i.createXmlElement("userId",EUserID)),d.append(u)}o.find("appointments").append(d)}}if(o.find("appointments").find("appointment").length>0){var p={businessId:_vgClassSessionSelection.GetCommonBusinessID(),userData:o.html(),isWaitlist:_vgClassSessionSelection.commonProperty.isWaitlist};vagaro.ajaxCall(e+n.checkuserexistanceinevent,p,function(e){if(null==e||0==e.length){if(1==t||2==t||4==t||5==t)i.CreateEventCollection(t);else if(3==t)i.SetDefaultUser(!0),i.AddUser(),i.EventShowLoader(!1);else if(6==t){var n=_vgCal.ManageAtnd.model.modalAttendee;$("#"+_vgCal.ManageAtnd.model.btnBack).hide(),$("#"+n).show(),_vgClassSessionSelection.CalcAndDisplayPriceClassLocation(),$("#dvClassInfo").show(),void 0!==_vgClassSessionSelection.commonProperty.isWorkShop&&1==_vgClassSessionSelection.commonProperty.isWorkShop?$("#dvClsLocationTitle").html(_vgCal.ManageAtnd.TextValues.WorkshopKeyword+" Location:"):$("#dvClsLocationTitle").html(_vgCal.Common.model.ClassKeyWord+" Location:"),$("#dvClassLiveOrAtBusiness").show(),_vgClassSessionSelection.EventShowLoader(!1),SetTopLeft(".calendar-popups-center")}}else if(1==t||2==t||3==t){if(i.EventShowLoader(!1),"undefined"!=typeof bootbox)if(1==isCheckInApp){var o=_vgClassSessionSelection.ResponseValidateForExistance(i.commonProperty.UserID,"",e);bootbox.alert(o.Title),_vgClassSessionSelection.ShowHideClassPopup(!1)}else{o=_vgClassSessionSelection.ResponseValidateForExistance(i.commonProperty.UserID,"",e);bootbox.confirm({title:o.Title,message:o.Message,buttons:{confirm:{label:"Add a Friend"}},callback:function(e){e&&(i.EventShowLoader(!0),i.SetDefaultUser(!1),1==t||2==t?i.DisplayStep(3):3==t&&i.AddUser(),i.EventShowLoader(!1))}})}}else if(4==t||5==t){var s=0;$("#eventusergroup input[data-type]").each(function(){0==i.validateForUserExistance(1==$(this).is(":disabled")?i.commonProperty.UserID:0,$(this),e)&&1==(s+=1)&&$(this).focus()}),0==s?i.CreateEventCollection(t):i.EventShowLoader(!1)}else if(6==t){o=_vgClassSessionSelection.ResponseValidateForExistance(_vgClassSessionSelection.getSelectedCustomer(),"",e);return window.parent.ShowHideWarningMessageCommon(o.Title),_vgCal.ManageAtnd.objAtList=[],a=[],_vgCal.ManageAtnd.Reset(),_vgClassSessionSelection.EventShowLoader(!1),!1}},_vgClassSessionSelection.CallFailed,!1,!0)}else 1==t||2==t||4==t||5==t?i.CreateEventCollection(t):3==t&&(i.SetDefaultUser(!0),i.AddUser(),i.EventShowLoader(!1))}else i.EventShowLoader(!1)},ResponseValidateForExistance:function(e,t,i){responseClass=[],responseWaitlist=[];var n={};$.grep(i,function(i){(e>0&&i.userId==e||0==e&&i.emailId==t)&&(1==i.type?responseClass.push(i):2==i.type&&responseWaitlist.push(i))});if(_vgClassSessionSelection.model.IsSearchFromInHouseClass){cache_glbData="object"==typeof localStorage&&void 0!==localStorage[cache_custlist]&&localStorage[cache_custlist].length>0?JSON.parse(localStorage[cache_custlist]||[]):[];var o=_vgClassSessionSelection.getSelectedCustomer(),a=cache_glbData.filter(function(e){return e.ID==o?e:null});if((isFromRebook||isFromReschedual)&&(null==a||null!=a&&0==a.length)&&void 0!==$("#txtCustomerSearchClass").attr("custDetail")&&null!=$("#txtCustomerSearchClass").attr("custDetail")&&""!=$("#txtCustomerSearchClass").attr("custDetail")){a=[];var s=JSON.parse($("#txtCustomerSearchClass").attr("custDetail"));a.push(s)}responseClass.length>0&&responseWaitlist.length>0?(n.Title=a[0].FN+" is already enrolled in this class and waitlist",n.Message="You are already enrolled in this class and waitlist. Would you like to add a friend to the class and waitlist?",n.Msg="this user is already enrolled class and waitlist."):responseClass.length>0?(n.Title=a[0].FN+" is already enrolled in this class",n.Message="You are already enrolled in this class. Would you like to add a friend to the class?",n.Msg="this user is exists in waitlist."):responseWaitlist.length>0&&(n.Title=a[0].FN+" is already enrolled in this waitlist",n.Message="You are already enrolled in this waitlist. Would you like to add a friend to the waitlist?",n.Msg="this user is exists in waitlist.")}else responseClass.length>0&&responseWaitlist.length>0?(n.Title="You are Already Enrolled Class and Waitlist",n.Message="You are already enrolled in this class and waitlist. Would you like to add a friend to the class and waitlist?",n.Msg="this user is already enrolled class and waitlist."):responseClass.length>0?(n.Title="You are Already Enrolled in Class",n.Message="You are already enrolled in this class. Would you like to add a friend to the class?",n.Msg="this user is exists in waitlist."):responseWaitlist.length>0&&(n.Title="You are Already Enrolled in Waitlist",n.Message="You are already enrolled in this waitlist. Would you like to add a friend to the waitlist?",n.Msg="this user is exists in waitlist.");return 1==$.isEmptyObject(n)?null:n},AddUserWithCheckExistance:function(e){if(0!=this.GetAllSessionDates(e)){a=this.GetAllSessionDates(1);var t=this.commonProperty.eventID,i=this.GetSessionStorage(this.model.EventStorage);if(i.length>0){var n=$.grep(i,function(e){return e.eventID==t});if(n.length>0&&this.CheckUserExistance(this.commonProperty.UserID,"",n[0])){_vgClassSessionSelection.EventShowLoader(!1);var o="Would you like to add a friend to this class?";1==this.model.IsOnline?"undefined"!=typeof bootbox&&bootbox.confirm({title:"This Class is Already in Your Cart",message:o,buttons:{confirm:{label:"Add a Friend"}},callback:function(e){e&&(_vgClassSessionSelection.EventShowLoader(!0),_vgClassSessionSelection.SetDefaultUser(!1),_vgClassSessionSelection.AddUser(),_vgClassSessionSelection.EventShowLoader(!1))}}):_vgCal.Common.ShowConfirm(o)&&(_vgClassSessionSelection.EventShowLoader(!0),_vgClassSessionSelection.SetDefaultUser(!1),_vgClassSessionSelection.AddUser(),_vgClassSessionSelection.EventShowLoader(!1))}else this.SetDefaultUser(!0),1==this.model.IsOnline?_vgClassSessionSelection.CheckUserExistanceInEvent(e):(this.AddUser(),_vgClassSessionSelection.EventShowLoader(!1))}else this.SetDefaultUser(!0),1==this.model.IsOnline?_vgClassSessionSelection.CheckUserExistanceInEvent(e):(this.AddUser(),_vgClassSessionSelection.EventShowLoader(!1))}else _vgClassSessionSelection.EventShowLoader(!1)},UserValidate:function(e){var t=_vgClassSessionSelection;t.EventShowLoader(!0);var i=0;$("div.clsaccordion").find(".panel-default").each(function(){void 0===$(this).attr("data-value")&&(i+=1)});var n=_vgClassSessionSelection.AddonValidate();if(0==i&&n){var o=0,a=$("div.clsaccordion").find(".panel-default").attr("data-value"),s=$("div.clsaccordion").find(".panel-default").attr("data-email"),r=_vgClassSessionSelection.commonProperty.eventID,l=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);if(l.length>0){var c=$.grep(l,function(e){return e.eventID==r});c.length>0&&_vgClassSessionSelection.CheckUserExistance(a,s,c[0])&&(_vgClassSessionSelection.commonMessageAlert("This user is already exists in cart."),o+=1,t.EventShowLoader(!1))}0==o&&(t.CheckUserExistanceInEvent(e),_onlineCheckout.Clear_ShowDiscount())}else 0!=i&&_vgClassSessionSelection.commonMessageAlert("Select All Attendees."),t.EventShowLoader(!1);return!1},SetDefaultUser:function(e){var t=$(".staticData #txtFirstName1"),i=$(".staticData #txtLastName1"),n=$(".staticData #txtEmailId1"),o=$(".staticData #txtCellNo1");if(e)t.val(this.commonProperty.FullUserName.split(" ")[0]),void 0!==this.commonProperty.FullUserName.split(" ")[1]?i.val(this.commonProperty.FullUserName.split(" ")[1]):i.val(""),n.val(this.commonProperty.UserEmail),o.val(this.commonProperty.UserCellNo),t.attr("disabled",!0),i.attr("disabled",!0),n.attr("disabled",!0),o.attr("disabled",!0),t.data("isdefaultuser",!0),$("#divClassShowDiscount").show();else{t.attr("disabled",!1),i.attr("disabled",!1),n.attr("disabled",!1),o.attr("disabled",!1),t.val(""),i.val(""),n.val(""),o.val("");var a=$("#otherUserPreviousDetail"),s=a.data("fname"),r=a.data("lname"),l=a.data("email"),c=a.data("cell");void 0!==s&&null!=s&&void 0!==r&&null!=r&&void 0!==l&&null!=l&&void 0!==c&&null!=c&&(t.val(s),i.val(r),n.val(l),o.val(c)),t.data("isdefaultuser",!1),$("#divClassShowDiscount").hide()}1==_vgClassSessionSelection.commonProperty.isWorkShop?($("#divEventName").hide(),$("#eventDescription").hide(),$(".more-gradient").hide(),_vgClassSessionSelection.commonProperty.isWaitlist?$("#divAddFriendsToWk").html("<span>Add Friends to Waitlist</span>"):$("#divAddFriendsToWk").html("<span>Add Friends to Workshop</span>"),$("#divAddFriendsToWk").show(),$("#divWkName").html(_vgClassSessionSelection.commonProperty.eventName),$("#divWkName").show(),_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?$("#divWkTotalPrice_sub").html($(this.model.divStreamingEventPrice).html()):$("#divWkTotalPrice_sub").html($("#divEventPrice").html()),$("#divWkTotalPrice").show()):($("#divEventName").show(),$("#divEventName").focus(),""!=$("#eventDescription").val().trim()&&$("#eventDescription").show(),$(".more-gradient").show())},CheckUserExistance:function(e,t,i){var n=!1;if(a.length>0)for(var o=0;o<=a.length-1;o++){if($.grep(i.eventEnrollment,function(i){return new Date(i.eventDate).format("yyyy-MM-dd")==new Date(a[o]).format("yyyy-MM-dd")&&(1==i.hasOwnProperty("isTempData")&&1!=i.isTempData||0==i.hasOwnProperty("isTempData"))&&i.startTime==_vgClassSessionSelection.commonProperty.shortStartTime&&i.eventID==_vgClassSessionSelection.commonProperty.eventID&&i.sPID==_vgClassSessionSelection.commonProperty.SPID&&(e>0&&i.customerID==e||e<=0&&void 0!==i.cUserEmail&&null!=i.cUserEmail&&i.cUserEmail.toLowerCase()==t.toLowerCase())}).length>0){n=!0;break}}return n},GetUserShortDetail:function(e,t){return e+" "+(t.length>1?t.substring(0,1):t)+"."},EventShowLoader:function(e){1==_vgClassSessionSelection.model.IsOnline?ShowLoader(e):_vgCal.Common.model.IsNewAPI?_vgClassSessionSelection.model.IsSearchFromInHouseClass?ShowLoadingPanel(e):ChangeAppStatus.ShowLoadingPanel(e):_vgCal.Common.ShowLoader(e)},GetTaxTotalForService:function(e,t){var i=0;if(void 0!==e&&null!=e&&""!=e)return $.each(e,function(e,n){null!=t&&t.length>0&&t.split(",").indexOf(""+n.BusinessTaxID)>-1&&(i=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(i+_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(n.Tax,!1,3),!1,3))}),i},GetTaxesForService:function(e,t){return null!=e?$.grep(e,function(e){if(null!=t&&t.length>0&&t.split(",").indexOf(""+e.BusinessTaxID)>-1)return e.IsRemoveTax=!1,e.CalculatedTax=0,!0}):null},AddFeesToDepositPopupForException:function(e,t){var i=[],n={};n.Price=e,n.paidType=1==t?1:4,i.push(n),InHouseDeposit.AddFeesForAppointments(i,!1,t);var o=0;return $.each(InHouseDeposit.model.CalculatedFees,function(e,t){o+=t.Price}),_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(o,!1,2)},AddFeesToDepositPopup:function(e,t,i){var n=[];if(8==t)for(var o=1==i?1:_vgClassSessionSelection.GetNoOfSessions(),a=0;a<o;a++){(s={}).Price=1==i?e:e/_vgClassSessionSelection.GetNoOfSessions(),s.paidType=4,n.push(s)}else if(1==t){var s;(s={}).Price=e,s.paidType=1,n.push(s)}InHouseDeposit.AddFeesForAppointments(n,!1,t);var r=0;return $.each(InHouseDeposit.model.CalculatedFees,function(e,t){r+=t.Price}),_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(r,!1,2)},CalculateTaxForFees:function(e){var t=0;return $.each(InHouseDeposit.model.CalculatedFees,function(i,n){var o=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(_vgClassSessionSelection.GetTaxTotalForService(e,n.BusinessTaxIDs),!1,2),a=_vgAddEditApp.AddEditApp.ConvertDecimalWithFixed(n.Price*parseFloat(o)/100,!1,3);t+=a}),t},EnableDatesOffline:function(t,i,o,a,s,r){var l=new Date(a);setdatepickervalue({divid:_EnddivsessionDatePickerID,textid:_EndtextsessionDatePickerID,flagVgMultiMonthDatePicker:!0},l);var c={};c.eventId=t,c.businessID=i,c.serviceProviderID=o,c.startTime=_vgCal.Common.GetFormattedDateStr(l,_vgCal.Common.model.DateTimeOldFormat),c.type=2,this.commonProperty.eventID=t,this.commonProperty.businessID=i,this.commonProperty.SPID=o,this.commonProperty.teacherName=s,this.commonProperty.eventName=r,this.commonProperty.startTime=_vgCal.Common.GetFormattedDateStr(l,_vgCal.Common.model.DateTimeOldFormat);var d=l.format("ddd");$("#rptAt"+d).addClass("active").removeClass("disabled"),$("#rptAt"+d).attr("data-disable","0"),vagaro.ajaxCall(e+n.geteventdetailandavailabledates,c,function(e){if(null!=e){_vgClassSessionSelection.commonProperty.enableSessionDate=[];for(var t=e.eventAvailableDates,i=0;i<t.length;i++){var n=new Date(moment(t[i].strEventDate)._d);_vgClassSessionSelection.commonProperty.enableSessionDate.push(n.format("MMM dd,yyyy"))}destroydatepicker({divid:_EnddivsessionDatePickerID,textid:_EndtextsessionDatePickerID,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),parentID:_EnddivsessionDatePickerID,isMobileFriendly:!1,arrValidDates:_vgClassSessionSelection.commonProperty.enableSessionDate}),setdatepickervalue({divid:_EnddivsessionDatePickerID,textid:_EndtextsessionDatePickerID,flagVgMultiMonthDatePicker:!0},l),_vgClassSessionSelection.commonProperty.availabledates=e;var o=0;if(_vgClassSessionSelection.commonProperty.CalculatedTaxTypeWise=[],"undefined"!=typeof CalendarConfiguration&&void 0!==CalendarConfiguration.CommonDetails&&void 0!==CalendarConfiguration.CommonDetails.BusinessTaxes&&null!=e.eventDetail.TaxesValues&&e.eventDetail.TaxesValues.length>0){var a=JSON.parse(e.eventDetail.TaxesValues).Taxes,s=$.map(a,function(e){return e.BusinessTaxID}).join();o=_vgClassSessionSelection.GetTaxTotalForService(CalendarConfiguration.CommonDetails.BusinessTaxes,s),_vgClassSessionSelection.commonProperty.CalculatedTaxTypeWise=_vgClassSessionSelection.GetTaxesForService(CalendarConfiguration.CommonDetails.BusinessTaxes,s)}if(_vgClassSessionSelection.commonProperty.tax=o,_vgClassSessionSelection.commonProperty.sessiondetail=e.eventDetail.sessionDetail,_vgClassSessionSelection.commonProperty.pointRedeem=e.eventAvailableDates[0].pointRedeem,_vgClassSessionSelection.model.IsSearchFromInHouseClass&&(_vgCal.ManageAtnd.btnAtNext_click(),"undefined"!=typeof isFromReschedual&&"true"==isFromReschedual.toLowerCase())){$("#txtSessionFrequency").attr("disabled","disabled"),$("#divSessionFrequencyActive a").css("pointer-events","none"),$("#classSelectionRepeat a").addClass("disabled"),$("#classSelectionRepeat a").css("pointer-events","none"),$("#rptDayClassSession a").addClass("disabled"),$("#rptDayClassSession a").css("pointer-events","none"),$("#txtSessionWksFrequency").attr("disabled","disabled"),$("#divSessionWksFrequencyActive a").css("pointer-events","none"),$("#txtsessionEndDate").attr("disabled","disabled");var r=$("#"+_vgCal.ManageAtnd.model.btnAddAtnd),c=$("#"+_vgCal.ManageAtnd.model.btnAddAtndCheckOut);r.val("Reschedule Attendee"),"undefined"!=typeof isReschedulePaidAppt&&isReschedulePaidAppt&&(txtDepositCls.value=0,$("#ddAppDepositCls").hide(),void 0!==_vgClassSessionSelection.commonProperty.DepositPaid&&null!=_vgClassSessionSelection.commonProperty.DepositPaid&&_vgClassSessionSelection.commonProperty.DepositPaid>0?($("#lblDepositDueEdit").text(CurrencySymbol+" "+InHouseDeposit.ConvertDecimalWithFixed(_vgClassSessionSelection.commonProperty.DepositPaid,!0,2)),void 0!==_vgClassSessionSelection.commonProperty.DepositsPaidDate&&null!=_vgClassSessionSelection.commonProperty.DepositsPaidDate&&""!=_vgClassSessionSelection.commonProperty.DepositsPaidDate&&$("#lblDepositPaidDate").text("Deposit paid on "+moment(new Date(_vgClassSessionSelection.commonProperty.DepositsPaidDate)).format("MMM DD, YYYY")+"."),$("#ddAppDepositEdit").show()):$("#ddAppDepositEdit").hide(),r.css("display","inline-block")),(0==_vgCal.ManageAtnd.model.IsAskForDeposit||"undefined"!=typeof isReschedulePaidAppt&&isReschedulePaidAppt)&&c.hide()}}else _vgCal.Common.ShowMsg("Something went wrong."),_vgClassSessionSelection.commonProperty.enableSessionDate=[],_vgClassSessionSelection.commonProperty.availabledates=null,_vgClassSessionSelection.commonProperty.tax=0,_vgClassSessionSelection.commonProperty.sessiondetail=null,_vgClassSessionSelection.commonProperty.workShopSellPrice=0,_vgClassSessionSelection.commonProperty.workShopNoofSessions=0},function(e){_vgCal.Common.ShowMsg("Something went wrong.")},!1,!0)},IsValidForOffline:function(){var e=!0;if(_vgClassSessionSelection.commonProperty.isWaitlist&&this.commonProperty.availabledates.eventAvailableDates[0].streamingEventCapacity>0&&0==this.commonProperty.availabledates.eventAvailableDates[0].eventCapacity){var t="Waitlist not available for online streaming.";_vgCal.Common.ShowMsg(t),e=!1}var i=getdatepickervalue(_EndtextsessionDatePickerID,null,!0,null,!0);null!=i&&""!=i||($("#divsessionEndDate").addClass("errorInput"),e=!1);var n=this.GetRecurringType(),o=[];if("2"==n){if($("#rptDayClassSession").find("a").each(function(e,t){$(this).hasClass("active")&&o.push(parseInt($(this).attr("data-dayid")))}),0==o.length){t="Please select at least one day.";_vgClassSessionSelection.model.IsSearchFromInHouseClass?vagaro.alertsmall(t):_vgCal.Common.ShowMsg(t),e=!1}if(o.length>0){var a=this.GetNoOfSessions();o.length>a&&(this.commonMessageAlert(this.model.strSessionCountmsg,1),e=!1)}if(""==$("#txtSessionWksFrequency").val()){t="Please enter Weekly Frequency";_vgCal.Common.ShowMsg(t),e=!1}}return e},ResetOffline:function(){$("#txtSessionFrequency").val("1"),$("#txtSessionWksFrequency").val("1"),$("#txtSessionClassMntDate").val("1"),$("#rptDayClassSession").find("a").each(function(e,t){$(this).hasClass("active")&&$(this).removeClass("active")}),$("#rptAtSun").attr("data-disable","1").addClass("disabled"),$("#rptAtMon").attr("data-disable","1").addClass("disabled"),$("#rptAtTue").attr("data-disable","1").addClass("disabled"),$("#rptAtWed").attr("data-disable","1").addClass("disabled"),$("#rptAtThu").attr("data-disable","1").addClass("disabled"),$("#rptAtFri").attr("data-disable","1").addClass("disabled"),$("#rptAtSat").attr("data-disable","1").addClass("disabled"),$("#classSelectionRepeat").find("a").each(function(e,t){$(this).hasClass("active")&&$(this).removeClass("active")}),$("#classSelectionRepeat").find("a").eq(0).addClass("active"),this.HideShowWeekOrMonth(),$("#divsessionEndDate").removeClass(_vgCal.SPopup.errorClass),a.splice(0,a.length)},txtAtStartDt_OnDayRenderOffline:function(e,t){var i=new Date(t.get_date()[0],t.get_date()[1]-1,t.get_date()[2]),n=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates;0==$.grep(n,function(e){return e.strEventDate==i.format("yyyy-MM-dd")}).length&&(t.get_cell().innerHTML="<div style='color:#999; margin-right:4px;'>"+i.getDate()+"</div>",t.get_cell().className="rcOtherMonth",t.get_cell().DayId="")},txtAtStartDt_popupOpeningOffline:function(e,t){},CalcAndDisplayPriceOffline:function(){if(null!=this.commonProperty.sessiondetail&&void 0!==this.commonProperty.sessiondetail){var e=0;e=null!=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length>0?(_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop,this.CalcSessionPrice(this.commonProperty.sessiondetail,this.GetNoOfSessions(),this.GetNoOfAttendees(),!0,this.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream)):this.CalcSessionPrice(this.commonProperty.sessiondetail,this.GetNoOfSessions(),this.GetNoOfAttendees(),!0,this.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream);var t=parseFloat(e)+parseFloat(0);_vgCal.ManageAtnd.SetSessionPriceData(e,0,t.toFixed(2)),_vgClassSessionSelection.model.IsSearchFromInHouseClass&&_vgClassSessionSelection.CalcAndDisplayPriceClassLocation(),0==_vgClassSessionSelection.commonProperty.IsPaid&&_vgCal.ManageAtnd.setDepositeTextCls(_vgCal.Common.DepositOpType.AddEdit)}},SetCustomerInfoOffline:function(e,t,i){this.commonProperty.FullUserName=e,this.commonProperty.UserEmail=t,this.commonProperty.UserID=i},SaveAttendeeOffline:function(){if(1==_vgCal.ManageAtnd.objAtList.length&&txtDepositCls.value>0&&1!=txtDepositCls.disabled){InHouseDeposit.ShowhideCommonLoadingPanel(!0);var e=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);InHouseDeposit.ShowInHouseDepositPopup(e,InHouseDeposit.AppClassType.ClassFormCalendar,!0)}else this.validateClassDataOnAddAttendee(_vgCal.Common.model.logInUId,3,"Calendar")},StringToDate:function(e,t){var i=e.split(t);return new Date(parseInt(i[0],10),parseInt(i[1],10)-1,parseInt(i[2],10))},CalcSessionPrice:function(e,t,i,n,o,a){var s=0,r=0;null!=typeof o&&""!=o&&null!=o||(o=!1);var l,c=e.split(",");if("true"==_vgClassSessionSelection.commonProperty.isWorkShop){for(var d=0;d<=c.length-1&&parseInt(t)<=parseInt(c[d].split("-")[1]);d++)s=parseInt(c[d].split("-")[1]),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.IsIncludeTaxInOnlinePricing&&null!=_shopdetail.IsIncludeTaxInOnlinePricing&&1==_shopdetail.IsIncludeTaxInOnlinePricing||"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value&&1!=a?(r=c[d].split("-").length>4?1==o?parseFloat(c[d].split("-")[5]):parseFloat(c[d].split("-")[4]):1==o?parseFloat(c[d].split("-")[3]):parseFloat(c[d].split("-")[2]),r=_vgClassSessionSelection.ConvertTodecimal(r,2,!1)):r=1==o?parseFloat(c[d].split("-")[3]):parseFloat(c[d].split("-")[2]);"undefined"!=typeof _vgAddon&&("undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?_vgAddon.Model.ClassPrice=_vgClassSessionSelection.CalculateSessionPriceAddOn(t,c,o):_vgAddon.Model.ClassPrice=r),l=parseInt(t)*r/s*parseInt(i)}else{for(d=0;d<=c.length-1&&parseInt(t)>=parseInt(c[d].split("-")[1]);d++)s=parseInt(c[d].split("-")[1]),r=("undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.IsIncludeTaxInOnlinePricing&&null!=_shopdetail.IsIncludeTaxInOnlinePricing&&1==_shopdetail.IsIncludeTaxInOnlinePricing||"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value&&1!=a)&&c[d].split("-").length>4?1==o?parseFloat(c[d].split("-")[5]):parseFloat(c[d].split("-")[4]):1==o?parseFloat(c[d].split("-")[3]):parseFloat(c[d].split("-")[2]),r=_vgClassSessionSelection.ConvertTodecimal(r,2,!1);"undefined"!=typeof _vgAddon&&("undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?_vgAddon.Model.ClassPrice=_vgClassSessionSelection.CalculateSessionPriceAddOn(t,c,o):_vgAddon.Model.ClassPrice=r),l=parseInt(t)*r/s*parseInt(i)}return 0==n?l:_vgClassSessionSelection.ConvertTodecimal(l,2,!1)},CalculateSessionPriceAddOn:function(e,t,i){var n=0;if(void 0!==t&&null!=t&&t.length>0)for(var o=0;o<=t.length-1&&parseInt(e)>=parseInt(t[o].split("-")[1]);o++)n=t[o].split("-").length>4?1==i?parseFloat(t[o].split("-")[5]):parseFloat(t[o].split("-")[4]):1==i?parseFloat(t[o].split("-")[3]):parseFloat(t[o].split("-")[2]);return n},CalcSessionPriceForOnlineWorkShop:function(e){for(var t=0,i=0;i<=e.length-1;i++)t+=e[i].workShopIndividualPrice;return _vgClassSessionSelection.ConvertTodecimal(t,2,!1)},CalcSessionPriceForWorkShop:function(e,t,i,n){var o=e*parseInt(i);return"undefined"!=typeof _vgAddon&&(_vgAddon.Model.ClassPrice=parseFloat(e).toFixed(2)),0==n?o:_vgClassSessionSelection.ConvertTodecimal(o,2,!1)},ConvertTodecimal:function(e,t,i){return 1==i?parseFloat(Number(Math.round(e+"e"+t)+"e-"+t).toFixed(t)):Number(Math.round(e+"e"+t)+"e-"+t).toFixed(t)},GetDepositPercentage:function(e){var t=0,i=[];if($.grep(_vgCal.ManageAtnd.objAtList,function(t){t.Id==e&&1==t.IsAllowDeposit&&i.push(t)}),i.length>=1)if(_vgCal.ManageAtnd.model.IsClsDepositAmtType)if("undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value){var n=0,o=CalendarConfiguration.CommonDetails.BusinessTaxes;if(null!=o&&o.length>0&&!String.isNullOrUndefineOrBlank(_vgCal.ManageAtnd.model.Taxation)){var a=_vgCal.ManageAtnd.model.Taxation.split(",");if(null!=a&&a.length>0)for(var s=0;s<a.length;s++)for(var r=0;r<o.length;r++)o[r].BusinessTaxID==parseInt(a[s])&&(n+=o[r].Tax)}if(n>0){var l=_vgClassSessionSelection.ConvertTodecimal(_vgClassSessionSelection.ConvertTodecimal(_vgCal.ManageAtnd.objAtList[0].Price.replace('"',"").replace("$","").replace("£",""),2,!1)/(1+n/100),2,!1);t=_vgClassSessionSelection.ConvertTodecimal(100*_vgCal.ManageAtnd.model.ClsDepositsPercentage/l,2,!1)}else t=_vgClassSessionSelection.ConvertTodecimal(100*_vgCal.ManageAtnd.model.ClsDepositsPercentage/_vgClassSessionSelection.ConvertTodecimal(_vgCal.ManageAtnd.objAtList[0].Price.replace('"',"").replace("$","").replace("£",""),2,!1),2,!1)}else t=_vgClassSessionSelection.ConvertTodecimal(100*_vgCal.ManageAtnd.model.ClsDepositsPercentage/_vgClassSessionSelection.ConvertTodecimal(_vgCal.ManageAtnd.objAtList[0].Price.replace('"',"").replace("$","").replace("£",""),2,!1),2,!1);else t=_vgCal.ManageAtnd.model.ClsDepositsPercentage;return t},validateClassDataOnAddAttendee:function(e,t,i,n){var o=this.commonProperty.businessID,a=0,s=[];this.model.IsOnline?(a=_shopdetail.countryId,o=parseInt(_vgClassSessionSelection.GetCommonBusinessID()),s=_vgClassSessionSelection.GetCartUserDetail()):a=_vgCal.Common.model.BusinessCountryId;var r=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage),l=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.FeeStorage),c="";if(l.length>0){var d=$("<XMLDocument/>");d.append(_vgClassSessionSelection.createXmlElement("FeeXMLList")),$.each(l,function(e,t){var i=_vgClassSessionSelection.createXmlElement("FeeXMLData");if(i.append(_vgClassSessionSelection.createXmlElement("appointmentId",t.appointmentId)),i.append(_vgClassSessionSelection.createXmlElement("serviceProviderId",t.serviceProviderId)),i.append(_vgClassSessionSelection.createXmlElement("userid",t.userid)),i.append(_vgClassSessionSelection.createXmlElement("price",t.price)),i.append(_vgClassSessionSelection.createXmlElement("tax",t.tax)),i.append(_vgClassSessionSelection.createXmlElement("itemId",t.itemId)),i.append(_vgClassSessionSelection.createXmlElement("discountGCPrice",t.discountGCPrice)),i.append(_vgClassSessionSelection.createXmlElement("ispointapply",t.ispointapply)),i.append(_vgClassSessionSelection.createXmlElement("pointsredeem",t.pointsredeem)),i.append(_vgClassSessionSelection.createXmlElement("ismembershipapply",t.ismembershipapply)),i.append(_vgClassSessionSelection.createXmlElement("membershipdiscountprice",t.membershipdiscountprice)),i.append(_vgClassSessionSelection.createXmlElement("membershipRedeemedDetails",t.membershipRedeemedDetails)),i.append(_vgClassSessionSelection.createXmlElement("isWorkShop",t.isWorkShop)),i.append(_vgClassSessionSelection.createXmlElement("redeemServiceId",t.redeemServiceId)),i.append(_vgClassSessionSelection.createXmlElement("ispresetapply",t.ispresetapply)),i.append(_vgClassSessionSelection.createXmlElement("presetDiscount",t.presetDiscount)),i.append(_vgClassSessionSelection.createXmlElement("discountID",t.discountID)),i.append(_vgClassSessionSelection.createXmlElement("amountValue",t.amountValue)),i.append(_vgClassSessionSelection.createXmlElement("isAmount",t.isAmount)),i.append(_vgClassSessionSelection.createXmlElement("promotionID",t.promotionID)),i.append(_vgClassSessionSelection.createXmlElement("isNewCustomer",t.isNewCustomer)),i.append(_vgClassSessionSelection.createXmlElement("paidtype",t.paidtype)),i.append(_vgClassSessionSelection.createXmlElement("payableamount",t.payableamount)),i.append(_vgClassSessionSelection.createXmlElement("depositspaid",t.depositspaid)),i.append(_vgClassSessionSelection.createXmlElement("depositsremaining",t.depositsremaining)),i.append(_vgClassSessionSelection.createXmlElement("depositspercentage",t.depositspercentage)),i.append(_vgClassSessionSelection.createXmlElement("redeemAmount",t.redeemAmount)),i.append(_vgClassSessionSelection.createXmlElement("redeemTax",t.redeemTax)),i.append(_vgClassSessionSelection.createXmlElement("taxes",t.taxes)),i.append(_vgClassSessionSelection.createXmlElement("calculatedtaxtypewise",void 0!==t.calculatedtaxtypewise&&null!=t.calculatedtaxtypewise&&""!=t.calculatedtaxtypewise&&"null"!=t.calculatedtaxtypewise?t.calculatedtaxtypewise:"[]")),i.append(_vgClassSessionSelection.createXmlElement("itemName",t.itemName)),i.append(_vgClassSessionSelection.createXmlElement("quantity",t.quantity)),i.append(_vgClassSessionSelection.createXmlElement("eventType",t.eventType)),i.append(_vgClassSessionSelection.createXmlElement("AmountType",t.AmountType)),i.append(_vgClassSessionSelection.createXmlElement("discount",t.discount)),1==t.isPriceBaseGCApply){var n=[],o=[];1==t.isPriceBaseGCApply?i.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!0)):i.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!1)),1==t.isPriceBaseGCApply&&$.each(t.GCDetailPriceBase,function(e,t){n.push(t.GCId),o.push(t.GCAmount)}),i.append(_vgClassSessionSelection.createXmlElement("gcid",void 0===t.gcId||null==t.gcId?0:t.gcId)),i.append(_vgClassSessionSelection.createXmlElement("gcids",0==n.length?0:n.join(","))),i.append(_vgClassSessionSelection.createXmlElement("gcamount",0==o.length?0:o.join(",")))}d.find("FeeXMLList").append(i)}),c=d.html()}if("undefined"!=typeof InHouseDeposit&&null!=InHouseDeposit&&void 0!==r&&null!=r&&""!=r&&r.length>0&&(InHouseDeposit.model.ObjGlobalChangeStatus=r[0].eventEnrollment),1==this.model.IsOnline&&r.length<=0)return $("#lblEventCart").html("0"),void _vgClassSessionSelection.commonMessageAlert("Something went wrong. Please search again.");var u=0,p=0;if("undefined"!=typeof InHouseDeposit&&null!=InHouseDeposit&&InHouseDeposit.model.Tip>0){var h=0;$.grep(r,function(e){$.grep(e.eventEnrollment,function(e){e.paidType==InHouseDeposit.arrpaidType.PaidClass&&(u+=1,h=1==e.isPackage||1==e.isPointApply?InHouseDeposit.ConvertDecimalWithFixed(h+e.Originalprice,!1,2):InHouseDeposit.ConvertDecimalWithFixed(h+e.Price,!1,2))})}),h>0&&0==InHouseDeposit.model.TipPer&&(InHouseDeposit.model.TipPer=InHouseDeposit.ConvertDecimalWithFixed(100*InHouseDeposit.model.Tip/h,!1,2))}var m=0,g=0,v=$("<XMLDocument/>"),f="",C="";v.append(_vgClassSessionSelection.createXmlElement("EventList"));var S=null,y=!1;_vgClassSessionSelection.model.IsSearchFromInHouseClass||(isFromRebook=!1),$.each(r,function(e,i){var n=_vgClassSessionSelection.createXmlElement("event");n.append(_vgClassSessionSelection.createXmlElement("eventId",i.eventID)),n.append(_vgClassSessionSelection.createXmlElement("eventname",i.eventName)),n.append(_vgClassSessionSelection.createXmlElement("eventimage",i.smallimage)),$.each(i.eventEnrollment,function(e,o){if(null==(S=null)||null==S){S=_vgClassSessionSelection.createXmlElement("appointment");var a=!1;if(a=void 0===o.isHandleDuetoException?_vgClassSessionSelection.IsHandledExceptionOffline(o.appointmentID):o.isHandleDuetoException,S.append(_vgClassSessionSelection.createXmlElement("isHandleDuetoException",1==a?"1":"0")),S.append(_vgClassSessionSelection.createXmlElement("appId",o.appointmentID)),S.append(_vgClassSessionSelection.createXmlElement("spid",o.sPID)),S.append(_vgClassSessionSelection.createXmlElement("appstarttime",new Date(o.eventDate).format("yyyy-MM-dd")+" "+o.startTime)),5!=t&&null!=txtDepositCls&&null!=txtDepositCls&&""!=txtDepositCls&&null!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls&&null!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls&&""!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls)if(0!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls&&0!=txtDepositCls.value)if("undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value&&_vgCal.ManageAtnd.objAtList.length<=1){if(void 0!==InHouseDeposit.model.AppObj[0].eventEnrollment&&null!=InHouseDeposit.model.AppObj[0].eventEnrollment&&InHouseDeposit.model.AppObj[0].eventEnrollment.length>0){var r,l=0;$.grep(InHouseDeposit.model.AppObj[0].eventEnrollment,function(e,t){if(e.depositsPercentage<100){l+=e.Price;var i=parseFloat(InHouseDeposit.ConvertDecimalWithFixed(100*parseFloat(e.depositsPaid)/e.Price,!0,2));if(e.depositsPercentage=i,e.lstAddonService.length>0)for(var n=0;n<e.lstAddonService.length;n++)l+=e.lstAddonService[n].Price,e.lstAddonService[n].depositsPercentage<100&&(e.lstAddonService[n].depositsPercentage=parseFloat(InHouseDeposit.ConvertDecimalWithFixed(100*parseFloat(e.lstAddonService[n].depositsPaid)/e.lstAddonService[n].Price,!0,2)))}}),1*(r=100*txtDepositCls.value/l)>100&&(r=100),S.append(_vgClassSessionSelection.createXmlElement("DepositsPercentage",r))}}else if(_vgCal.ManageAtnd.objAtList.length>1)S.append(_vgClassSessionSelection.createXmlElement("DepositsPercentage",_vgClassSessionSelection.GetDepositPercentage(o.customerID)));else 1*(r=100*txtDepositCls.value/_vgCal.ManageAtnd.model.NewApp_txtPriceCls)>100&&(r=100),S.append(_vgClassSessionSelection.createXmlElement("DepositsPercentage",r));if(100==o.depositsPercentage){if("undefined"!=o.CalculatedTaxTypeWise&&null!=o.CalculatedTaxTypeWise&&o.CalculatedTaxTypeWise.length>0){S.append(_vgClassSessionSelection.createXmlElement("calculatedtaxtypewise",JSON.stringify(o.CalculatedTaxTypeWise)));var c=$.map(o.CalculatedTaxTypeWise,function(e){return e.BusinessTaxID}).join();S.append(_vgClassSessionSelection.createXmlElement("taxes",c))}}else if("undefined"!=typeof hdnPriceWithTaxSwitch&&null!=hdnPriceWithTaxSwitch&&null!=hdnPriceWithTaxSwitch&&!String.isNullOrUndefineOrBlank(hdnPriceWithTaxSwitch.value)&&"1"==hdnPriceWithTaxSwitch.value&&"undefined"!=o.CalculatedTaxTypeWise&&null!=o.CalculatedTaxTypeWise&&o.CalculatedTaxTypeWise.length>0){S.append(_vgClassSessionSelection.createXmlElement("calculatedtaxtypewise",JSON.stringify(o.CalculatedTaxTypeWise)));c=$.map(o.CalculatedTaxTypeWise,function(e){return e.BusinessTaxID}).join()}n.append(S)}else S=S.parent();if(S.append(_vgClassSessionSelection.createXmlElement("fname",o.cFirstName)),S.append(_vgClassSessionSelection.createXmlElement("lname",o.cLastName)),S.append(_vgClassSessionSelection.createXmlElement("email",o.cUserEmail)),S.append(_vgClassSessionSelection.createXmlElement("cellno",o.cUserCellNo)),S.append(_vgClassSessionSelection.createXmlElement("cellcountryid",o.cCellcountryID)),S.append(_vgClassSessionSelection.createXmlElement("dialingCode",o.cDialingCode)),S.append(_vgClassSessionSelection.createXmlElement("isWorkShop",o.IsWorkShop)),S.append(_vgClassSessionSelection.createXmlElement("streamingstatus",o.StreamingStatus)),f=o.cUserEmail,C=o.cFirstName+o.cLastName,1==_vgClassSessionSelection.model.IsOnline){if(0==o.customerID)null!=(_=$.grep(s,function(e){return 0==o.customerID&&e.emailId==o.cUserEmail}))&&_.length>0?S.append(_vgClassSessionSelection.createXmlElement("userid",_[0].userId)):S.append(_vgClassSessionSelection.createXmlElement("userid",o.customerID));else S.append(_vgClassSessionSelection.createXmlElement("userid",o.customerID));1==t&&(1==o.isPackage||0==o.isPackage)&&o.gcId>0&&(S.append(_vgClassSessionSelection.createXmlElement("ispackage",o.isPackage)),S.append(_vgClassSessionSelection.createXmlElement("gcid",o.gcId)))}else S.append(_vgClassSessionSelection.createXmlElement("userid",o.customerID));if(p=o.customerID,5==t){if(S.append(_vgClassSessionSelection.createXmlElement("paidtype",o.paidType)),o.paidType!=InHouseDeposit.arrpaidType.DepositsClass&&o.paidType!=InHouseDeposit.arrpaidType.PartiallyPaidClass||void 0!==o.depositsPaid&&(S.append(_vgClassSessionSelection.createXmlElement("depositspercentage",o.depositsPercentage)),S.append(_vgClassSessionSelection.createXmlElement("depositspaid",o.depositsPaid)),S.append(_vgClassSessionSelection.createXmlElement("payableamount",o.Price)),S.append(_vgClassSessionSelection.createXmlElement("depositsremaining",_vgClassSessionSelection.ConvertTodecimal(o.Price-o.depositsPaid,2,!1)))),InHouseDeposit.model.TipPer>0&&o.paidType==InHouseDeposit.arrpaidType.PaidClass){var d=InHouseDeposit.ConvertDecimalWithFixed(o.Price,!1,2);1!=o.isPackage&&1!=o.isPointApply||(d=InHouseDeposit.ConvertDecimalWithFixed(o.Originalprice,!1,2));var h=0;h=(g+=1)==u?InHouseDeposit.ConvertDecimalWithFixed(InHouseDeposit.model.Tip-m,!1,2):InHouseDeposit.ConvertDecimalWithFixed(d*InHouseDeposit.model.TipPer/100,!1,2),S.append(_vgClassSessionSelection.createXmlElement("tipAmount",h)),m+=h}if(S.append(_vgClassSessionSelection.createXmlElement("promotionid",0)),(1==o.isPackage||0==o.isPackage)&&o.gcId>0||1==o.isPriceBaseGCApply){var v=[],b=[];1==o.isPriceBaseGCApply?S.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!0)):S.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!1)),S.append(_vgClassSessionSelection.createXmlElement("ispackage",o.isPackage)),1==o.isPriceBaseGCApply&&$.each(o.GCDetailPriceBase,function(e,t){v.push(t.GCId),b.push(t.GCAmount)}),S.append(_vgClassSessionSelection.createXmlElement("gcid",void 0===o.gcId||null==o.gcId?0:o.gcId)),S.append(_vgClassSessionSelection.createXmlElement("gcids",0==v.length?0:v.join(","))),S.append(_vgClassSessionSelection.createXmlElement("gcamount",0==b.length?0:b.join(","))),o.RedeemServiceId>0&&S.append(_vgClassSessionSelection.createXmlElement("redeemserviceid",o.RedeemServiceId))}if(1==o.isPointApply){var k=0;1==o.IsPartialPointApply&&(k=o.PartialServicePrice),S.append(_vgClassSessionSelection.createXmlElement("ispointapply",o.isPointApply)),S.append(_vgClassSessionSelection.createXmlElement("ispartialpointapply",o.IsPartialPointApply)),S.append(_vgClassSessionSelection.createXmlElement("partialserviceprice",k)),S.append(_vgClassSessionSelection.createXmlElement("pointsredeem",o.pointsRedeem))}if(1==o.isMembershipApply&&null!=o.membershipUniqueID&&null!=o.membershipUniqueID&&""!=o.membershipUniqueID){S.append(_vgClassSessionSelection.createXmlElement("ismembershipapply",o.isMembershipApply)),S.append(_vgClassSessionSelection.createXmlElement("membershipdiscountpercentage",o.membershipDiscount)),S.append(_vgClassSessionSelection.createXmlElement("membershipuserid",o.membershipuserid)),S.append(_vgClassSessionSelection.createXmlElement("membershipuniqueid",o.membershipUniqueID));var _,D=null;if((D=_vgClassSessionSelection.createXmlElement("membershipredeemeddetails")).append(_vgClassSessionSelection.createXmlElement("businessid",o.BusinessID)),D.append(_vgClassSessionSelection.createXmlElement("redeembusinessid",o.RedeemBusinessId)),0==o.customerID)null!=(_=$.grep(s,function(e){return 0==o.customerID&&e.emailId==o.cUserEmail}))&&_.length>0?D.append(_vgClassSessionSelection.createXmlElement("userid",_[0].userId)):D.append(_vgClassSessionSelection.createXmlElement("userid",o.customerID));else D.append(_vgClassSessionSelection.createXmlElement("userid",o.customerID));D.append(_vgClassSessionSelection.createXmlElement("membershipuserid",o.membershipuserid)),D.append(_vgClassSessionSelection.createXmlElement("membershipid",o.MembershipID)),D.append(_vgClassSessionSelection.createXmlElement("membershipitemid",o.MembershipItemId)),D.append(_vgClassSessionSelection.createXmlElement("groupid",o.GroupId)),D.append(_vgClassSessionSelection.createXmlElement("isunlimitedvisit",-1==o.VisitRemaining)),D.append(_vgClassSessionSelection.createXmlElement("serviceproductname",i.eventName.trim())),S.append(D)}_vgCal.ManageAtnd.model.IsCheckout=!1}if(S.append(_vgClassSessionSelection.createXmlElement("userclassdetail",$("#p-cart-"+o.eventID+"-"+o.autoID).text())),_vgClassSessionSelection.model.IsOnline||"undefined"!=typeof isFromReschedual&&null!=isFromReschedual&&"true"==isFromReschedual.toLowerCase()&&_vgClassSessionSelection.model.IsSearchFromInHouseClass){var I=_vgClassSessionSelection.GetRescheduleDetail();null!=I&&(y=!0,S.append(_vgClassSessionSelection.createXmlElement("eventsessionattendeeid",I.EventSessionAttendeesId)))}S.append(_vgClassSessionSelection.createXmlElement("isAddon",!1)),S.append(_vgClassSessionSelection.createXmlElement("uniqueAddonID","addon"+o.appointmentID+o.autoID)),null!=o.lstAddonService&&o.lstAddonService.length>0&&_vgClassSessionSelection.CreateClassAttendeeAddonXMl(o.lstAddonService,o,n,t)}),v.find("EventList").append(n)});this.EventShowLoader(!0);var b="",k={},_={};if(_.businessId=o,_.loggedInUserId=e,_.countryId=a,_.classXmlData=v.html().replace(new RegExp("&nbsp;","g")," "),_.FeeXMLData=c,_.operationType=t,_.device=i,"undefined"!=typeof isFromCheckout&&isFromCheckout&&(_.device="Checkout"),_.isCardOnFile=!1,_.isReschedule=y,_.IsRebook=isFromRebook,"undefined"!=typeof SearchIsWaitingtoReal&&"true"==SearchIsWaitingtoReal.toLowerCase()&&_vgClassSessionSelection.model.IsSearchFromInHouseClass&&(_.IsWaitingtoReal="true"==SearchIsWaitingtoReal.toLowerCase(),_.WaitlistID=SearchWaitlistID),_.TrackingId=void 0!==n?n:"",this.model.IsOnline){_.userFullName=FullUserName,_.userEmail=UserEmail,_.currencySymbol=_vgClassSessionSelection.GetcurrencySymbol();var D="",I="",w="",P="",A="",T="",x="";if(1==_shopdetail.IsCCDetailEnable()){if("block"==$(".divcreditCardWrapper").css("display").toLowerCase()&&0==isCCChanged){_.isCardOnFile=!0;var F=$("#txEventCCNo");D=$("#cboEventCardType").val(),I=$(F).val(),w=$("#txtEventSecurityCode").val(),P=$("#txtEventFName").val(),A=$("#txtEventMName").val(),T=$("#txtEventLName").val(),x=$("#hdnCCTokenID").val()}else 1==isCCChanged&&null!=ZenSwipeCardDetails.cc_no&&(D=ZenSwipeCardDetails.cc_type,I=ZenSwipeCardDetails.cc_no,w=ZenSwipeCardDetails.cvv,P=ZenSwipeCardDetails.first_name,A=ZenSwipeCardDetails.middle_name,T=ZenSwipeCardDetails.last_name,x=ZenSwipeCardDetails.card_token);b="<root>",b+="<UserCCDetail><UCCType>"+D+"</UCCType>",b+="<UCCNo>"+I.substr(I.length-4)+"</UCCNo>",b+="<UCCSecurityCode>"+w+"</UCCSecurityCode>",b+="<UCCFirstName>"+P.escapeHtml()+"</UCCFirstName>",b+="<UCCMiddleName>"+A.escapeHtml()+"</UCCMiddleName>",b+="<UCCLastName>"+T.escapeHtml()+"</UCCLastName>",b+="<UCCTokenID>"+x+"</UCCTokenID>",b+="</UserCCDetail></root>",k.UCCNo=I,k.UCCType=D,k.UCCSecurityCode=w,k.UCCFirstName=P,k.UCCMiddleName=A,k.UCCLastName=T,k.CardTokenId=x}_.objUserCCDetails=k,_.strUserCCXML=b,_.bookText=$("#hdnClassBookText").val();var O=_vgClassSessionSelection.GetRescheduleDetail();1==y&&null!=O&&(_.OldSPID=O.providerID,_.OldAppDate=$("#hdnDate").val()+" "+BookingTime)}else{_.currencyCode=_vgClassSessionSelection.GetCurrencyCode();var M=0;if(5==t){M=1,_.userFullName=C,_.userEmail=f,_.currencySymbol=CurrencySymbol,_.isCardOnFile=InHouseDeposit.model.IsCCNewApply&&null!=InHouseDeposit.model.zenSwipeCardDetails&&"undefined"!=InHouseDeposit.model.zenSwipeCardDetails.save_card&&InHouseDeposit.model.zenSwipeCardDetails.save_card;D="",I="",w="",P="",A="",T="",x="";var B="",E="";if(InHouseDeposit.model.IsCCApply){var L={},N=0,U=0;InHouseDeposit.model.SelectedCCId.toString().length>=5?(N=InHouseDeposit.model.SelectedCCId.toString().substring(0,4),U=parseInt(InHouseDeposit.model.SelectedCCId.toString().substring(4,5))-1):(N=InHouseDeposit.model.SelectedCCId.toString().substring(0,4),U=0),$.each(InHouseDeposit.model.PopupData.DepositPaymentOption.lstUserCCDetailsWithFF,function(e,t){InHouseDeposit.model.PopupData.DepositPaymentOption.lstUserCCDetailsWithFF[e].CreditCardNumber==parseInt(N)&&e==U&&(L=InHouseDeposit.model.PopupData.DepositPaymentOption.lstUserCCDetailsWithFF[e])}),D=L.CreditCardType,I=L.CreditCardNumber,w=L.SecurityCode,P=null==L.CCFirstName?"":L.CCFirstName,A=null==L.CCMiddleName?"":L.CCMiddleName,T=null==L.CCLastName?"":L.CCLastName,x=L.CardTokenId,b="<root>",b+="<UserCCDetail><UCCType>"+D+"</UCCType>",b+="<UCCNo>"+I.substr(I.length-4)+"</UCCNo>",b+="<UCCSecurityCode>"+w+"</UCCSecurityCode>",b+="<UCCFirstName>"+P.escapeHtml()+"</UCCFirstName>",b+="<UCCMiddleName>"+A.escapeHtml()+"</UCCMiddleName>",b+="<UCCLastName>"+T.escapeHtml()+"</UCCLastName>",b+="<UCCTokenID>"+x+"</UCCTokenID>",b+="</UserCCDetail></root>",k.UCCNo=I,k.UCCType=D,k.UCCSecurityCode=w,k.UCCFirstName=P,k.UCCMiddleName=A,k.UCCLastName=T,k.CardTokenId=x}else if(InHouseDeposit.model.IsCCNewApply){D=(L=InHouseDeposit.model.zenSwipeCardDetails).cc_type,I=L.cc_no,w=L.cvv,P=null==L.first_name?"":L.first_name,A=null==L.middle_name?"":L.middle_name,T=null==L.last_name?"":L.last_name,B=null==L.expire_month?"":L.expire_month,E=null==L.expire_year?"":L.expire_year,x=L.card_token,b="<root>",b+="<UserCCDetail><UCCType>"+D+"</UCCType>",b+="<UCCNo>"+I.substr(I.length-4)+"</UCCNo>",b+="<UCCSecurityCode>"+w+"</UCCSecurityCode>",b+="<UCCExpMonth>"+B+"</UCCExpMonth>",b+="<UCCExpYear>"+E+"</UCCExpYear>",b+="<UCCFirstName>"+P.escapeHtml()+"</UCCFirstName>",b+="<UCCMiddleName>"+A.escapeHtml()+"</UCCMiddleName>",b+="<UCCLastName>"+T.escapeHtml()+"</UCCLastName>",b+="<UCCTokenID>"+x+"</UCCTokenID>",b+="</UserCCDetail></root>",k.UCCNo=I,k.UCCType=D,k.UCCSecurityCode=w,k.UCCExpMonth=B,k.UCCExpYear=E,k.UCCFirstName=P,k.UCCMiddleName=A,k.UCCLastName=T,k.CardTokenId=x,k.UserID=p}_.objUserCCDetails=k,_.strUserCCXML=b}else _.objUserCCDetails=k,_.strUserCCXML=b;if("undefined"!=typeof isFromReschedual&&"true"==isFromReschedual.toLowerCase()&&_vgClassSessionSelection.model.IsSearchFromInHouseClass){O=_vgClassSessionSelection.GetRescheduleDetail();1==y&&null!=O&&(_.OldSPID=O.providerID,_.OldAppDate=$("#hdnDate").val()+" "+BookingTime)}"undefined"==typeof InHouseDeposit||null==InHouseDeposit||void 0===InHouseDeposit.model.SelectpaymentMethodType||InHouseDeposit.model.SelectpaymentMethodType!=InHouseDeposit.paymentMethodType.Checkout&&InHouseDeposit.model.SelectpaymentMethodType!=InHouseDeposit.paymentMethodType.Invoice||(M=2),"undefined"!=typeof InHouseDeposit&&null!=InHouseDeposit&&void 0!==InHouseDeposit.model.ClassMultiAttendeeCheckoutType&&InHouseDeposit.model.ClassMultiAttendeeCheckoutType==InHouseDeposit.ClassMultiAttendeeCheckoutType.IndividualCheckout&&(M=3),_.DepositType=M}0==this.model.IsOnline?(_vgClassSessionSelection.model.ClassFullExceptionData=null,this.IsClassBookingFullOffline(_,function(e){if(null!=e){var t=$.grep(e,function(e,t){return 1==e.isFull});t.length>0?(_vgClassSessionSelection.model.ClassFullExceptionData=t,_vgClassSessionSelection.ShowClassFullMsgOffline(t)):(_vgClassSessionSelection.EventShowLoader(!0),_vgClassSessionSelection.validateClassData(_,v))}else _vgClassSessionSelection.EventShowLoader(!0),_vgClassSessionSelection.validateClassData(_,v)})):this.validateClassData(_,v)},validateClassData:function(e,t){"undefined"!=typeof vui&&(e.StripeRadarSession=vui.stripeRadarSession);var i=new vagaro.ajax;i.datamodel.Token="ValidateClassBookingData",i.datamodel.data=[e],i.datamodel.callback=this.validateClassDataOnAddAttendeeSuccess,i.datamodel.Error=function(e){_vgClassSessionSelection.commonMessageAlert(errorMessage),_vgClassSessionSelection.EventShowLoader(!1)},_vgClassSessionSelection.localData.rootXmlData=t,i.Post()},validateClassDataOnAddAttendeeSuccess:function(e){_vgClassSessionSelection.EventShowLoader(!1);var t="";if(0==_vgClassSessionSelection.model.IsOnline){var i=getdatepickervalue(_EndtextsessionDatePickerID,null,!0,null,!0);""!=i&&(t=i.format("MM/dd/yyyy"))}_vgClassSessionSelection.localData.rootXmlData;_vgClassSessionSelection.localData.rootXmlData="";var n,o=0,a=0;if(null!=e&&void 0!==e[0])if(o=e[0].ClsGrpID,a=e[0].DepositGroupID,1==e[0].type)$.each(e,function(e,t){n=_vgClassSessionSelection.findClassObjByAppId(t.appointmentId),t.className=n.className,t.sessionTime=n.startTime,t.spName=n.sPName,t.eventDate=_vgClassSessionSelection.FormatDate(n.eventDate),t.isVacancyFull=t.vacancy<=0}),$("#tBodyClassValidationTemp").html(""),$("#classValidationCheckoutTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"),_vgClassSessionSelection.model.IsOnline?($("#validationpopup").html($("#divClassValidationTemp").html()),$("#divClassValidationpopup").modal("show")):(_vgClassSessionSelection.RemoveAddedEnrollmentOffline(),_vgClassSessionSelection.commonMessageAlert($("#divClassValidationTemp").html()));else if(2==e[0].type)$.each(e,function(e,t){if(n=_vgClassSessionSelection.findClassObjByAppId(t.appointmentId),t.className=n.className,t.sessionTime=n.startTime,t.spName=n.sPName,t.eventDate=_vgClassSessionSelection.FormatDate(n.eventDate),""!=t.userDataXml){var i=t.userDataXml.split(" ")[0],o="";void 0!==t.userDataXml.split(" ")[1]&&(o=t.userDataXml.split(" ")[1]),t.username=""!=o?_vgClassSessionSelection.GetUserShortDetail(i,o):i+"."}else t.username=""}),$("#tBodyClassValidationTemp").html(""),$("#UserAlreadyEnrolledTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"),_vgClassSessionSelection.model.IsOnline?($("#validationpopup").html($("#divClassValidationTemp").html()),$("#divClassValidationpopup").modal("show")):(_vgClassSessionSelection.RemoveAddedEnrollmentOffline(),_objMessagePopup.SetWidth(650).Show("Alert",$("#divClassValidationTemp").html(),"OK","","",function(){_objMessagePopup.Hide()},function(){_objMessagePopup.Hide()},null));else if(7==e[0].type)$.each(e,function(e,t){n=_vgClassSessionSelection.findClassObjByAppId(t.appointmentId),t.className=n.className,t.sessionTime=n.startTime,t.spName=n.sPName,t.eventDate=_vgClassSessionSelection.FormatDate(n.eventDate)}),$("#tBodyClassValidationTemp").html(""),$("#ClassDeleteTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"),_vgClassSessionSelection.model.IsOnline?($("#validationpopup").html($("#divClassValidationTemp").html()),$("#divClassValidationpopup").modal("show")):(_vgClassSessionSelection.RemoveAddedEnrollmentOffline(),_vgClassSessionSelection.commonMessageAlert($("#divClassValidationTemp").html()));else if(8==e[0].type)_vgClassSessionSelection.commonMessageAlert("Your order is not free of cost. It requires credit card information. Please go back and search again.",2);else if(9!=e[0].type&&10!=e[0].type&&11!=e[0].type&&12!=e[0].type&&13!=e[0].type||1!=_vgClassSessionSelection.model.IsOnline)if(3==e[0].type){if(isCCChanged=!1,0==_vgClassSessionSelection.model.IsOnline){if(_vgCal.ManageAtnd.model.IsCheckout){if("undefined"!=typeof InHouseDeposit&&null!=typeof InHouseDeposit&&void 0!==InHouseDeposit.model.SelectpaymentMethodType&&InHouseDeposit.model.SelectpaymentMethodType>0&&InHouseDeposit.model.SelectpaymentMethodType==InHouseDeposit.paymentMethodType.Invoice)return void InHouseDeposit.SaveClassInvoiceDetails(e[0].lstEventSessionAttendee,a);_vgCal.Common.model.IsNewAPI?ChangeAppStatus.RedirectToCheckout(o,t,a):_vgCal.Common.RedirectToCheckout(o,t)}else _vgCal.Common.model.IsNewAPI?ManageClasses.RetrieveAttendeeData():_vgCal.SPopup.RetrieveAttendeeData(),_vgClassSessionSelection.ShowClassProgressOffline();"undefined"!=typeof InHouseDeposit&&null!=typeof InHouseDeposit&&void 0!==InHouseDeposit.model.SelectpaymentMethodType&&InHouseDeposit.model.SelectpaymentMethodType>0&&InHouseDeposit.model.SelectpaymentMethodType!=InHouseDeposit.paymentMethodType.Checkout?InHouseDeposit.ShowHideSuccessFailedPopup(!0,!0):(_vgCal.ManageAtnd.ShowPopup(!1),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.ExceptionStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage))}}else if(4==e[0].type)if(0==_vgClassSessionSelection.model.IsOnline){if(_vgCal.ManageAtnd.model.IsCheckout){if("undefined"!=typeof InHouseDeposit&&null!=typeof InHouseDeposit&&void 0!==InHouseDeposit.model.SelectpaymentMethodType&&InHouseDeposit.model.SelectpaymentMethodType>0&&InHouseDeposit.model.SelectpaymentMethodType==InHouseDeposit.paymentMethodType.Invoice)return void InHouseDeposit.SaveClassInvoiceDetails(e[0].lstEventSessionAttendee,a);_vgCal.Common.model.IsNewAPI?ChangeAppStatus.RedirectToCheckout(o,t,a,e[0].lstEventSessionAttendee[0].userId):_vgCal.Common.RedirectToCheckout(o,t)}else _vgClassSessionSelection.model.IsSearchFromInHouseClass||(_vgCal.Common.model.IsNewAPI?ManageClasses.RetrieveAttendeeData():_vgCal.SPopup.RetrieveAttendeeData(),_vgClassSessionSelection.ShowClassProgressOffline());if("undefined"!=typeof InHouseDeposit&&null!=typeof InHouseDeposit&&void 0!==InHouseDeposit.model.SelectpaymentMethodType&&InHouseDeposit.model.SelectpaymentMethodType>0&&InHouseDeposit.model.SelectpaymentMethodType!=InHouseDeposit.paymentMethodType.Checkout)InHouseDeposit.ShowHideSuccessFailedPopup(!0,!0),InHouseDeposit.model.IsChangeStatus=e[0].IsChangeStatus;else if(_vgClassSessionSelection.model.IsSearchFromInHouseClass&&0==_vgCal.ManageAtnd.model.IsCheckout){_vgCal.ManageAtnd.ShowPopup(!1),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.ExceptionStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage);var s="Class";isWorkShopOrClass&&(s="Workshop");var r=s+_vgClassSessionSelection.model.ClassBookSuccess;_vgClassSessionSelection.IsSearchFromInHouseClass()&&("undefined"!=typeof SearchIsWaitingtoReal&&"true"==SearchIsWaitingtoReal.toLowerCase()?r=_vgClassSessionSelection.model.WaitlistBookSuccess.replace("{0}",s.toLowerCase()):"undefined"!=typeof isFromReschedual&&"true"==isFromReschedual.toLowerCase()&&(r=_vgClassSessionSelection.model.RescheduleBookSuccess.replace("{0}",s.toLowerCase()))),void 0!==window.parent.Webflow&&void 0!==window.parent.SetErrorDisplayMessage?window.parent.SetErrorDisplayMessage("1",r,null):void 0!==window.parent.ShowHideDoneMessageCommon&&window.parent.ShowHideDoneMessageCommon(r,2e3),"undefined"!=typeof isFromCheckout&&1==isFromCheckout?CloseRebook():CloseWindowAndRedirect(SelectedSP,SelectedDate)}else _vgCal.ManageAtnd.ShowPopup(!1),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.ExceptionStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage),1==e[0].IsChangeStatus?_vgCal.Common.model.IsNewAPI?Scheduler.RefreshCalendar():_vgCal.Common.RefreshCalendar():"undefined"!=typeof InHouseDeposit&&null!=typeof InHouseDeposit&&InHouseDeposit.CloseInhousePopup()}else _vgClassSessionSelection.commonProperty.gCOrPackageDetail="",_vgClassSessionSelection.commonProperty.cartUserList="",_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.ExceptionStorage),$("#btnCloseWidgetGCMessageTop").data("CallFrom","Class"),ThankYouPopup_lblThankYou().innerHTML="Thank you for your enrollment!",ThankYouPopup_lblRequestMsg().innerHTML="",ShowWidgetGCMessage();else if(5==e[0].type)0==_vgClassSessionSelection.model.IsOnline?_vgClassSessionSelection.commonMessageAlert("Something went wrong. Please search again."):(_vgClassSessionSelection.commonMessageAlert("Something went wrong. Please search again."),1==isCCChanged&&LoadCCFrame());else if(6==e[0].type)if(1==_vgClassSessionSelection.model.IsOnline){var l="";if(1==isCCChanged&&LoadCCFrame(),""!=e[0].successSPlist)for(var c=e[0].successSPlist.split(","),d=0;d<=c.length-1;d++)c.length>1&&d==c.length-2?l+=_vgClassSessionSelection.findSPnameByspid(parseInt(c[d]))+" and ":l+=_vgClassSessionSelection.findSPnameByspid(parseInt(c[d]))+",";if(null!=e[0].failSPlistAndReason&&e[0].failSPlistAndReason.length>0){var u=e[0].failSPlistAndReason,p=[];for(d=0;d<=u.length-1;d++)$.grep(u[d].spID,function(e){var t={};t.spID=parseInt(e),t.spName=_vgClassSessionSelection.findSPnameByspid(parseInt(e)),t.failReason=u[d].failReason,p.push(t)});if(""!=e[0].successSPlist&&""!=l){var h=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);if(h.length>0)for(var m=0;m<=h.length-1;m++){var g=[];for(d=0;d<=p.length-1;d++){var v=$.grep(h[m].eventEnrollment,function(e){return e.sPID==p[d].spID});v.length>0&&(g=g.concat(v))}g.length>0?h[m].eventEnrollment=g:h.splice(m,1)}h.length>0&&_vgClassSessionSelection.SetIntoSessionStorage(_vgClassSessionSelection.model.EventStorage,h)}}if(""!=e[0].successSPlist&&""!=l){C=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);$("#cartSummaryDectail").html(""),$("#NewEvenetCartDetail123").tmpl(_shopdetail.CalculatePriceAndTaxOnCart(C,null,null,!0)).appendTo("#newCartSummaryDectail123"),$.grep(C,function(e){1==e.eventEnrollment.length&&$("#deleteitem-"+e.eventID).hide()}),_vgClassSessionSelection.commonProperty.gCOrPackageDetail="",_vgClassSessionSelection.commonProperty.cartUserList="",$("#spnSceessSPS").html(l.escapeHtml().slice(0,-1)),$("#dvSucessProviders").show(),$("#EventPaymentheadermsg").text("Enrollment is patially done"),$("#btnPaymentFailClse").data("failtype","1")}else $("#dvSucessProviders").hide(),$("#EventPaymentheadermsg").text("Enrollment didn't go through"),$("#btnPaymentFailClse").data("failtype","2");$("#tblPartialPayment tr").not(":first").remove(),$("#classPaymentFailTemplate").tmpl(p).insertAfter("#trPartialPayment"),$("#partialPaymentValidationpopup").html($("#divClassPaymentFailTemp").html()),_shopdetail.ShowHideClassPaymentPopup(!0)}else"undefined"!=typeof InHouseDeposit&&null!=typeof InHouseDeposit&&InHouseDeposit.ShowHideSuccessFailedPopup(!1,!0);else _vgClassSessionSelection.commonMessageAlert("Something went wrong. Please search again.");else{var f=_vgClassSessionSelection.GetGCorPackage();$.each(e,function(t,i){var n=_vgClassSessionSelection.findClassObjByGcId(i.gcId);n.length>0&&(i.className=n[0].className,i.username=_vgClassSessionSelection.GetUserShortDetail(n[0].cFirstName,n[0].cLastName),1==n[0].isPackage?i.giftcertificate="package":0==n[0].isPackage?i.giftcertificate="gift card":i.giftcertificate="",$.grep(f,function(t){if(t.giftCertificateID==i.gcId)if(9==e[0].type||10==e[0].type||11==e[0].type||13==e[0].type)t.quantity=0,t.currentBalance=0;else if(12==e[0].type){var n=Math.floor(parseFloat((t.currentBalance/t.quantity*100).toFixed(2)))/100;t.currentBalance=Math.floor(parseFloat((n*i.vacancy*100).toFixed(2)))/100,t.quantity=i.vacancy}}))}),$("#tBodyClassValidationTemp").html(""),9==e[0].type?$("#GCNotAvalableTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"):10==e[0].type?$("#GCExpiredTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"):11==e[0].type?$("#GCVoidedTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"):12==e[0].type?$("#GCNotServiceBalTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"):13==e[0].type&&$("#GCNotPriceBalTemplate").tmpl(e).appendTo("#tBodyClassValidationTemp"),_vgClassSessionSelection.commonProperty.gCOrPackageDetail=JSON.stringify(f);var C=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);$("#cartSummaryDectail").html(""),$("#EvenetCartDetail").tmpl(_shopdetail.CalculatePriceAndTaxOnCart(C,null,null,!0)).appendTo("#cartSummaryDectail"),$.grep(C,function(e){1==e.eventEnrollment.length&&$("#deleteitem-"+e.eventID).hide()}),$("#validationpopup").html($("#divClassValidationTemp").html()),$("#divClassValidationpopup").modal("show")}else _vgClassSessionSelection.commonMessageAlert("Something went wrong. Please search again.")},commonMessageAlert:function(e,t){1!=this.model.IsOnline&&!_vgClassSessionSelection.model.IsSearchFromInHouseClass||2!=t?1!=this.model.IsOnline&&!_vgClassSessionSelection.model.IsSearchFromInHouseClass||1!=t&&void 0!==t?_vgCal.Common.ShowMsg(e):vagaro.alertsmall(e):vagaro.alert(e)},createXmlElement:function(e,t,i){var n;if(n="Edge"==_vgClassSessionSelection.get_browser().name?$("<"+e.toLowerCase()+" />"):$("<"+e+" />"),void 0!==i&&null!=i&&1==i){if(void 0===t)return n;var o=n.text(t);return 1==o.length&&(o[0].innerHTML=o[0].innerHTML.replace(/&nbsp;/g," ")),o}return null==t?n:n.text(t)},get_browser:function(){var e,t=navigator.userAgent,i=t.match(/(opera|chrome|safari|firefox|msie|trident|edge(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(i[1]))return{name:"IE",version:(e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""};if("Chrome"===i[1]){if(null!=(e=t.match(/\bOPR\/(\d+)/)))return{name:"Opera",version:e[1]};if(null!=(e=t.match(/\bEdge\/(\d+)/)))return{name:"Edge",version:e[1]}}return i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&i.splice(1,1,e[1]),{name:i[0],version:i[1]}},findXmlNodeByVal:function(e,t,i){var n=null;return $.each(e.find(t),function(e,t){$(t).html()!=i.toString()||(n=$(t))}),n},findClassObjByAppId:function(e){var t=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage),i=null;return $.each(t,function(t,n){$.each(n.eventEnrollment,function(t,o){if(o.appointmentID==e)return(i=o).className=n.eventName,i})}),i},findClassObjByGcId:function(e){var t=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage),i=[];e:for(var n=0;n<=t.length-1;n++)for(var o=0;o<=t[n].eventEnrollment.length-1;o++)if(t[n].eventEnrollment[o].gcId==e){t[n].eventEnrollment[o].className=t[n].eventName,i=i.concat(t[n].eventEnrollment[o]);break e}return i},findClassObjByGcIdAndEventId:function(e,t){var i=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage),n=[];e:for(var o=0;o<=i.length-1;o++)for(var a=0;a<=i[o].eventEnrollment.length-1;a++)if(i[o].eventEnrollment[a].gcId==e&&i[o].eventEnrollment[a].eventID==t){i[o].eventEnrollment[a].className=i[o].eventName,n=n.concat(i[o].eventEnrollment[a]);break e}return n},findSPnameByspid:function(e){var t=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage),i="";return t.length>0&&$.each(t,function(t,n){var o=$.grep(n.eventEnrollment,function(t){return t.sPID==e});if(void 0!==o&&null!=o&&o.length>0)return i=o[0].sPName,!1}),i},WeekdayCheckbox_Change:function(e){},IsClassBookingFullOffline:function(e,t){var i=new vagaro.ajax;i.datamodel.Token="IsClassBookingFull",i.datamodel.data=[e],i.datamodel.callback=function(e){_vgClassSessionSelection.IsClassBookingFullOffline_Success(e,t)},i.datamodel.Error=function(e){_vgClassSessionSelection.commonMessageAlert("Some error has occured"),_vgClassSessionSelection.EventShowLoader(!1)},i.Post()},IsClassBookingFullOffline_Success:function(e,t){_vgClassSessionSelection.EventShowLoader(!1),null!=e&&"function"==typeof t&&t(e)},ShowClassFullMsgOffline:function(e){var t=_vgClassSessionSelection.GetClassFullMsgOffline(e);_objMessagePopup.SetWidth(615).SetHeight(466).SetHideCallback(function(){_vgClassSessionSelection.RemoveAddedEnrollmentOffline(),_vgClassSessionSelection.model.ClassFullExceptionData=null}).Show("Confirm",t,"Cancel","Proceed","",function(){_vgClassSessionSelection.RemoveAddedEnrollmentOffline(),_vgClassSessionSelection.model.ClassFullExceptionData=null,_objMessagePopup.Hide()},function(){_vgClassSessionSelection.SaveAttendeeOffline(),_objMessagePopup.SetHideCallback(null).Hide()},null)},GetClassFullMsgOffline:function(e){var t="";t='<div id="divExceptionDetailFull" style="padding-right: 15px;">',t+='<table id="tblExceptionDetailFull" class="fixed_headers">',t+="<thead>",t+="<tr>",t+="<th>Date</th>",t+='<th style="border-right:0">Remarks</th>',t+="</tr>",t+="</thead>",t+='<tbody id="bodyExceptionDetailFull">';for(var i=0;i<e.length;i++){var n=this.GetEventDetailByApptId(e[i].apptId);t+="<tr>",t+="<td>"+n.eventDate+"</td>",t+='<td>The class that You want to book with teacher "'+n.teacherName+'" is full.<br><div class="ExRedAlert">PLEASE READ: By proceeding further, a system will exceed class capacity.</div></td>',t+="</tr>"}return t+=" </tbody>",t+=" </table>",t+="</div>"},GetEventDetailByApptId:function(e){var t=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage),i={};return $.each(t,function(t,n){$.each(n.eventEnrollment,function(t,o){o.appointmentID==e&&(i.eventID=n.eventID,i.eventName=n.eventName,i.eventDate=new Date(o.eventDate).format("MMM-dd-yyyy"),i.eventTime=o.startTime,i.teacherName=o.sPName,!0)})}),i},IsHandledExceptionOffline:function(e){var t=!1;return null==this.model.ClassFullExceptionData||void 0===this.model.ClassFullExceptionData||$.each(this.model.ClassFullExceptionData,function(i,n){n.apptId==e&&1==n.isFull&&(t=!0)}),t},ShowClassProgressOffline:function(){for(var e=this.GetEnrollmentUserDataFromStorage(),t=new Array,i=0,n=0;n<e.length;n++)t.push(e[n].appId),0==i&&(i=e[n].users.length);_vgCal.Common.model.IsNewAPI?Scheduler.ShowClassProgressBar(t,i,_vgClassSessionSelection.commonProperty.streamingStatus):_vgCal.Common.ShowClassProgressBar(t,i,_vgClassSessionSelection.commonProperty.streamingStatus)},GetEnrollmentUserDataFromStorage:function(){var e=new Array,t=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);return $.each(t,function(t,i){$.each(i.eventEnrollment,function(t,i){var n=i.appointmentID,o=$.grep(e,function(e){return e.appId==n});if(o.length>0)o[0].users.push(i.customerID);else{var a={};a.appId=n,a.users=new Array,a.users.push(i.customerID),e.push(a)}})}),e},LoadEventsDataFailCallback:function(e){0==isCheckInApp&&_shopdetail.CloseClassSearchProgress(),vagaro.alert("Some Error occured")},getSunday:function(e){var t=(e=new Date(e)).getDay(),i=e.getDate()-t;return new Date(e.setDate(i))},LoadEventsDataCallback:function(e){if(1!=isCheckInApp||("none"==$("#checkInClassList").css("display")&&(null==e||null!=e&&0==e.length)&&(setTimeout(function(){$("#divEmptyScreen").show()},500),Webflow.destroy(),Webflow.ready()),"none"==$("#checkInClassList").css("display")&&null==e||$("#divDoneButton").show(),null!=e)){0==isCheckInApp&&bkEvent.addResponseToCache(e);var t,i,n=null,o=null;if(0==isCheckInApp)t=getdatepickervalue("#txtdivSearchDate",null,!0,!0),i=getdatepickervalue("#txtdivClassSearchDateEnd",null,!0,!0);else if(null!=e&&e.length>0){var a=new Date(moment(new Date(e[0].strStartTime.replace(new RegExp("-","g")," "))).format("MMM DD,YYYY")),s=new Date(a.getFullYear(),a.getMonth(),a.getDate());t=new Date(s),i=new Date(s)}else t=null,i=null;n=null!=t?t:new Date,o=null!=i?i:new Date;new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");var r=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"),l=null;if(null!=e&&e.length>0){var c=_vgClassSessionSelection.getSunday(n),d=new Date(c);d=new Date(d.setDate(c.getDate()+6)),0==isCheckInApp&&_vgClassSessionSelection.setClassSliderDate(c,d),l=_vgClassSessionSelection.StringToDate(e[0].strbusinessDate,"-"),$("#hdnBusinessDate").val(l.format("yyyy-MM-dd"))}for(var u=[],p=0,h=n;h<=o;h.setDate(h.getDate()+1))if(!(h<l)){p+=1;var m={};m.dayName=r[h.getDay()];m.dateName=["January","February","March","April","May","June","July","August","September","October","November","December"][h.getMonth()]+" "+h.getDate(),m.fullFormatedDate=h.format("MMM dd,yyyy"),m.rowNo=p;var g=e.filter(function(e){return h.getDay()==e.dayNo?e:null});if(m.eventDetail=[],null!=g&&g.length>0)for(var v=0;v<=g.length-1;v++){var f={};if(f.eventDate=new Date(h),f.isFrom=_vgClassSessionSelection.model.IsSearchFromInHouseClass?_vgClassSessionSelection.SearchClassFrom.Search:0,f.strsessionDetail=g[v].sessionDetail,f.availableTime=g[v].availableTime,f.availableEndTime=g[v].availableEndTime,f.className=g[v].className,f.serviceDesc=g[v].serviceDesc,f.teacherName=g[v].teacherName,f.eventDuration=g[v].eventDuration,f.appointmentID=g[v].appointmentID,f.eventType=g[v].eventType,f.totalNoOfAttendees=g[v].noOfAttendees,f.eventCapacity=g[v].eventCapacity,f.strpromotionDetail=g[v].promotionDetail,f.pointsredeem=g[v].PointRedeem,f.totalStreamingNoOfAttendees=g[v].StreamingNoOfAttendees,f.streamingEventCapacity=g[v].StreamingEventCapacity,g[v].noOfAttendees<g[v].eventCapacity?f.remainingCapacity=g[v].eventCapacity-g[v].noOfAttendees:f.remainingCapacity=0,g[v].StreamingNoOfAttendees<g[v].StreamingEventCapacity?f.streamingRemainingCapacity=g[v].StreamingEventCapacity-g[v].StreamingNoOfAttendees:f.streamingRemainingCapacity=0,f.streamingType=g[v].StreamingType,f.isZoomIntegrated=g[v].IsZoomIntegrated,0==isCheckInApp){var C=_vgClassSessionSelection.GetRescheduleDetail();f.EventSessionAttendeesId=null!=C?C.EventSessionAttendeesId:0}else f.fullFormatedDate=f.eventDate.format("MMM dd, yyyy");"undefined"!=typeof isBrandedAppForApproval&&null!=isBrandedAppForApproval?f.isBrandedAppForApproval=isBrandedAppForApproval:f.isBrandedAppForApproval=!1,f.sessionDetail=[];for(var S=g[v].sessionDetail.split(","),y=0;y<=S.length-1;y++){var b={};b.appointmentID=g[v].appointmentID,b.eventId=g[v].eventId,b.serviceProviderID=g[v].serviceProviderID,b.strStartTime=g[v].strStartTime,b.session=S[y].split("-")[1],b.streamingAmount=0,b.streamingType=g[v].StreamingType,g[v].StreamingType==_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream?(b.amount=S[y].split("-")[2],b.streamingAmount=S[y].split("-")[3]):g[v].StreamingType==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?b.amount=S[y].split("-")[3]:b.amount=S[y].split("-")[2],b.currencySymbol=_vgClassSessionSelection.GetcurrencySymbol(),f.sessionDetail.push(b)}m.eventDetail.push(f)}m.eventDetail.length>0&&u.push(m)}if(0==isCheckInApp&&_shopdetail.CloseClassSearchProgress(),$("#tblEventDetail").html(""),u.length>0&&($("#EventHeaderTemplate").tmpl(u).appendTo("#tblEventDetail"),Webflow.destroy(),Webflow.ready()),0==isCheckInApp){$("#divEventDetail").show(),$(".book-wrapper").addClass("searched-appointment"),$("body").addClass("searched-appointment-body");$("#hdnMonthName").html();$("#divClassAppResult").show()}}},LoadEventsDataCallbackForClassTab:function(e){_vgClassSessionSelection.commonProperty.IsFromClass=!0;try{if("undefined"!=typeof _shopdetail&&void 0!==_shopdetail.BusinessStartTime&&"undefined"!=_shopdetail.clsTimeZoneData&&null!=_shopdetail.clsTimeZoneData&&_shopdetail.BusinessStartTime(_shopdetail.clsTimeZoneData.TIME_ZONE,_shopdetail.clsTimeZoneData.CountryID,_shopdetail.clsTimeZoneData.CUSTOM_DAY_LIGHT_SAVING,e),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&(String.isNullOrUndefineOrBlank(_shopdetail.WidgetServicesDetail)&&_shopdetail.GetWidgetServicesDetail(),!String.isNullOrUndefineOrBlank(_shopdetail.WidgetServicesDetail)&&!String.isNullOrUndefineOrBlank(_shopdetail.WidgetServicesDetail.ServiceIds))){var t=_shopdetail.WidgetServicesDetail.ServiceIds.split("|"),n="";if(t.length>1&&!String.isNullOrUndefineOrBlank(t[1])?n=t[1]:1==t.length&&(n=_shopdetail.WidgetServicesDetail.ServiceIds),!String.isNullOrUndefineOrBlank(n)&&null!=e&&e.length>0){var o=0,a=$.extend(!0,[],e);e=$.map(e,function(e){if(1==_onlineCheckout.CheckFileType(e.eventId.toString(),n))return o=1,e}),0==o&&0==IsFromMultiLocation&&0==isWidget&&(e=a)}}if(1==isCheckInApp){if("none"==$("#checkInClassList").css("display")&&(null==e||null!=e&&0==e.length)&&(Webflow.destroy(),Webflow.ready()),null==e)return}else{var s="undefined"!=typeof _common&&1==_common.isCreateLinkPreserve(!0,!0)?_common.isCreateLinkPreserve(!1):null;if(null!=s&&s.length>0){var r=[];$.grep(s,function(t){"-1"!=t&&$.grep(e,function(e){e.serviceProviderID==parseInt(t)&&r.push(e)})}),"-1"!=s[0]&&(e=r)}if(void 0===e||null==e||""==e){$("#AppProgressModalForClass").modal("hide"),$("#date-class-slider-containerForClass .selected").removeClass("selected"),$("#date-class-slider-containerForClass div.enabled").removeClass("enabled").addClass("inactive"),$("body").addClass("searched-appointment-body"),$("#tblEventDetailForClass").html(""),$("#dvNoClasses").css("display",""),$("#divEventDetailForClass").css("display","none"),$("#dvtimezone").hide(),_vgClassSessionSelection.CloseClassSearchProgressForClassTab();var l={confirmButtonText:"Class Not Scheduled"};if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking){var c=$("#hdnInstructorIDForClass").val();if(""==_shopdetail.getFilteredServiceProviderId(c))if(1==$("select[id=cboServiceProviderWaitlist_Search] :selected").length){var d=$("select[id=cboServiceProviderWaitlist_Search] :selected").text();l.swalTextMessage="Sorry, "+d+" is Not Accepting New Customers"}else l.swalTextMessage="Sorry, the Selected Employees are Not Accepting New Customers";else l.swalTextMessage="There are no dates scheduled for the selected class and instructor."}else l.swalTextMessage="There are no dates scheduled for the selected class and instructor.";return _common.Openswalpopup(l),void setTimeout(function(){$(".gencutom-title").html(l.confirmButtonText)},100)}$("#dvNoClasses").css("display","none"),$("#divEventDetailForClass").css("display",""),bkEvent.addResponseToCache(e)}var u,p,h=null,m=null;if(0==isCheckInApp)u=new Date($("#hdnStartDateForClass").val()),p=new Date($("#hdnEndDateForClass").val());else if(null!=e&&e.length>0){var g=new Date(moment(new Date(e[0].strStartTime.replace(new RegExp("-","g")," "))).format("MMM DD,YYYY")),v=new Date(g.getFullYear(),g.getMonth(),g.getDate());u=new Date(v),p=new Date(v)}else u=null,p=null;h=null!=u?u:new Date,m=null!=p?p:new Date;var f=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"),C=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"),S=null;if(null!=e&&e.length>0){var y=_vgClassSessionSelection.getSunday(h),b=new Date(y);b=new Date(b.setDate(y.getDate()+6)),0==isCheckInApp&&_vgClassSessionSelection.setClassSliderDate(y,b),S=_vgClassSessionSelection.StringToDate(e[0].strbusinessDate,"-"),$("#hdnBusinessDate").val(S.format("yyyy-MM-dd"))}for(var k=[],_=0,D=h;D<=m;D.setDate(D.getDate()+1))if(!(D<S)){_+=1;var I={};I.dayName=C[D.getDay()],I.dayNameFull=f[D.getDay()];var w=["January","February","March","April","May","June","July","August","September","October","November","December"];I.dateName=w[D.getMonth()].substring(0,3)+" "+D.getDate(),I.fullFormatedDate=countryDateFormat(D,VagaroCountryDateFormat.LargeDate),I.fullFormatedDateLabel=I.dayNameFull+" - "+w[D.getMonth()]+" "+D.getDate()+", "+D.getFullYear(),I.rowNo=_;var P=e.filter(function(e){return D.getDay()==e.dayNo?e:null});if(null!=P&&P.length>0)for(var A=0;A<=P.length-1;A++)"1"!=bkClassAvailableDates.model.csvFilterType&&"3"!=bkClassAvailableDates.model.csvFilterType||String.isNullOrUndefineOrBlank(P[A].IsLivestreamAvl)||1!=P[A].IsLivestreamAvl||String.isNullOrUndefineOrBlank(P[A].availableDisplayTime)||String.isNullOrUndefineOrBlank(P[A].availableDisplayEndTime)||(P[A].availableTime=P[A].availableDisplayTime.split("|")[1],P[A].availableEndTime=P[A].availableDisplayEndTime.split("|")[1]);I.eventDetail=[];if(null!=P&&P.length>0)for(A=0;A<=P.length-1;A++){var T={};if(T.eventDate=new Date(D),T.isFrom=_vgClassSessionSelection.model.IsSearchFromInHouseClass?_vgClassSessionSelection.SearchClassFrom.Search:0,T.strsessionDetail=P[A].sessionDetail,T.availableTime=P[A].availableTime,T.availableEndTime=P[A].availableEndTime,T.availableTimeWithFormat=P[A].availableTime.replace(/^0+/,""),T.availableEndTimeWithFormat=P[A].availableEndTime.replace(/^0+/,""),T.className=P[A].className,T.photo=P[A].photo,T.serviceDesc=P[A].serviceDesc,T.teacherName=P[A].teacherName,T.eventDuration=P[A].eventDuration,T.appointmentID=P[A].appointmentID,T.eventType=P[A].eventType,T.totalNoOfAttendees=P[A].noOfAttendees,T.eventCapacity=P[A].eventCapacity,T.isDisplayClassSeat=P[A].isDisplayClassSeat,T.IsWaitlistAvailable=IsOnlineCustomerWaitlist,T.isWorkShop=P[A].isWorkShop,T.strpromotionDetail=P[A].promotionDetail,T.pointsredeem=P[A].PointRedeem,T.totalStreamingNoOfAttendees=P[A].StreamingNoOfAttendees,T.streamingEventCapacity=P[A].StreamingEventCapacity,P[A].noOfAttendees<P[A].eventCapacity?T.remainingCapacity=P[A].eventCapacity-P[A].noOfAttendees:T.remainingCapacity=0,P[A].StreamingNoOfAttendees<P[A].StreamingEventCapacity?T.streamingRemainingCapacity=P[A].StreamingEventCapacity-P[A].StreamingNoOfAttendees:T.streamingRemainingCapacity=0,T.streamingType=P[A].StreamingType,T.isZoomIntegrated=P[A].IsZoomIntegrated,1==T.isZoomIntegrated&&T.streamingEventCapacity>0&&!0,T.IsAttendeeEnrolled=P[A].IsAttendeeEnrolled,0==isCheckInApp){var x=_vgClassSessionSelection.GetRescheduleDetail();null!=x?(T.EventSessionAttendeesId=x.EventSessionAttendeesId,T.IsWaitlistAvailable=!1):T.EventSessionAttendeesId=0}else T.fullFormatedDate=T.eventDate.format("MMM dd, yyyy");"undefined"!=typeof isBrandedAppForApproval&&null!=isBrandedAppForApproval?T.isBrandedAppForApproval=isBrandedAppForApproval:T.isBrandedAppForApproval=!1,T.sessionDetail=[];for(var F=P[A].sessionDetail.split(","),O=0;O<=F.length-1;O++){var M={};M.appointmentID=P[A].appointmentID,M.eventId=P[A].eventId,M.serviceProviderID=P[A].serviceProviderID,M.strStartTime=P[A].strStartTime,M.session=F[O].split("-")[1],M.streamingAmount=0,M.streamingType=P[A].StreamingType,P[A].StreamingType==_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream?"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?(M.amount=F[O].split("-")[4],M.streamingAmount=F[O].split("-")[5]):(M.amount=F[O].split("-")[2],M.streamingAmount=F[O].split("-")[3]):P[A].StreamingType==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?M.amount=F[O].split("-")[5]:M.amount=F[O].split("-")[3]:"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?M.amount=F[O].split("-")[4]:M.amount=F[O].split("-")[2],M.currencySymbol=_vgClassSessionSelection.GetcurrencySymbol(),T.sessionDetail.push(M),0==O&&("undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?T.firstSessionPrice=M.currencySymbol+F[O].split("-")[4]:T.firstSessionPrice=M.currencySymbol+F[O].split("-")[2],P[A].StreamingType==_vgClassSessionSelection.StreamingDBFilterType.LiveStream||P[A].StreamingType==_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream?"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?T.firstStreamingSessionPrice=M.currencySymbol+F[O].split("-")[5]:T.firstStreamingSessionPrice=M.currencySymbol+F[O].split("-")[3]:T.firstStreamingSessionPrice=M.currencySymbol+M.streamingAmount)}I.eventDetail.push(T)}if(i=e,"undefined"!=e&&"undefined"!=_shopdetail.timeZone&&null!=e&&null!=_shopdetail.timeZone)for(A=0;A<=e.length-1;A++)if(1==e[A].isZoomIntegrated&&e[A].StreamingEventCapacity>0){$("#dvtimezone").show(),$("#timezone").text("All times are in "+_shopdetail.timeZone);break}I.eventDetail.length>0&&k.push(I)}if(0==isCheckInApp){_vgClassSessionSelection.CloseClassSearchProgressForClassTab(),$("#tblEventDetailForClass").html(""),k.length>0&&($("#EventHeaderTemplate").tmpl(k).appendTo("#tblEventDetailForClass"),Webflow.destroy(),Webflow.ready(),setTimeout(function(){$("div.tooltip-container > .idescicone").bind("click",function(){_vgClassSessionSelection.ShowClassDescPopup($(this).attr("data-servicedesc"),$(this).attr("data-className"),$(this).attr("data-eventDuration"),$(this).attr("data-photo"),$(this).attr("data-price"),$(this).attr("data-isworkshop"),$(this).attr("data-appid"),$(this).attr("data-eventid"),$(this).attr("data-spid"),$(this).attr("data-strtime"),$(this).attr("data-zoomintegrated"),$(this).attr("data-streamingtype"),$(this).attr("data-streamingamount"))})},500)),$("#divEventDetailForClass").show(),$(".book-wrapper").addClass("searched-appointment"),$("body").addClass("searched-appointment-body");$("#hdnMonthNameForClass").html();$("#divClassAppResultForClass").show()}else $("#tblEventDetail").html(""),k.length>0&&($("#EventHeaderTemplate").tmpl(k).appendTo("#tblEventDetail"),Webflow.destroy(),Webflow.ready(),setTimeout(function(){$("div.tooltip-container > .idescicone").bind("touchstart",function(){_vgClassSessionSelection.ShowClassDescPopup($(this).attr("data-servicedesc"),$(this).attr("data-className"),$(this).attr("data-eventDuration"),$(this).attr("data-photo"),$(this).attr("data-price"),$(this).attr("data-isworkshop"),$(this).attr("data-appid"),$(this).attr("data-eventid"),$(this).attr("data-spid"),$(this).attr("data-strtime"),$(this).attr("data-zoomintegrated"),$(this).attr("data-streamingtype"),$(this).attr("data-streamingamount"))})},500)),ShowLoader(!1);if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&(1==_shopdetail.IsMemPkgReqToBook||1==_shopdetail.IsLimitOnlineBooking)){var B=_shopdetail.LiveStreamSignUp;void 0!==B&&null!=B&&(_vgClassSessionSelection.DisplayStep(3),_vgClassSessionSelection.ShowEventDetailPopup(B.AppointmentID,B.Session,B.Amount,B.ServiceID,B.ServiceProviderID,B.StrStartTime))}if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking){var E=_shopdetail.DisplayEmpNotAccptNewClientsBadge(Number(_vgClassSessionSelection.commonProperty.spIdClass));""!=_vgClassSessionSelection.commonProperty.spNameClass&&null!=_vgClassSessionSelection.commonProperty.spNameClass&&E&&($("#employeefnfHeader").html('<div class="web-display-small membership-modal-heading">'+_vgClassSessionSelection.commonProperty.spNameClass+' Not Accepting New Clients</div> <div class="web-body-font">'+_vgClassSessionSelection.commonProperty.spNameClass+" is currently not accepting clients at this time. Please try your search again.</div>"),$("#btnfnfBook").hide(),$(".familycktfrndlistPopup").hide(),$(".familycktbook").hide(),$("#btnfnfNotAcceptClose").html("Search Availability").removeClass("btn btn-default secondary-button back-btn-hide").addClass("btn thm-contentButton green-primary-button"),$("#employeefnfpopup").modal("show"))}}catch(e){1==isCheckInApp?(Webflow.destroy(),Webflow.ready()):($("#dvNoClasses").css("display",""),$("#divEventDetailForClass").css("display","none"),_vgClassSessionSelection.CloseClassSearchProgressForClassTab()),ShowLoader(!1)}$(".signup-disabled").parent(".book-class-btn").addClass("full")},ResetEventPopupDetail:function(e){$("#txtNoofAttendees").val("1"),$("#ddlRecurringType").val("2"),_vgClassSessionSelection.HideShowWeekOrMonth(),_vgClassSessionSelection.DisplayStep(1),0==isCheckInApp&&$("#btnEventAddtoCart").hide(),e?($("#btnCheckOut").html("Add to Waitlist"),$("#btnUCheckOut").html("Add to Waitlist")):($("#btnCheckOut").html("Checkout"),$("#btnUCheckOut").html("Checkout")),0==isCheckInApp?($("#btnCheckOut").hide(),$("#btnNext").show()):($("#btnCheckOut").show(),$("#btnNext").hide()),$("#txtNoofWeeks").val("1"),$("#txtNoofDays").val("1"),$(".dayselection :input").removeAttr("checked"),$(".dayselection :input").attr("disabled",!0),$(".dayselection :input").attr("data-disable","1"),$(".dayselection input").each(function(){var e=$(this);e.off("change"),e.on("change",function(){_vgClassSessionSelection.WeekdayCheckbox_Change(e)})})},ResetCalendarControl:function(e,t){for(var i=[],n=0;n<=e.eventAvailableDates.length-1;n++){i.push(moment(new Date(e.eventAvailableDates[n].strAvailableDates.replace(new RegExp("-","g")," "))).format("MMM DD,YYYY"));var o=_vgClassSessionSelection.StringToDate(e.eventAvailableDates[n].strEventDate,"-");$("#day-"+o.getDay()).prop("disabled",!1),$("#day-"+o.getDay()).attr("data-disable","0")}destroydatepicker({divid:"#divEventFromDate",textid:"#txtEventFromDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),preset:"date",arrValidDates:i,contentWindow:datePicker_contentWindow}),setdatepickervalue({divid:"#divEventFromDate",textid:"#txtEventFromDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate)},new Date($("#hdnEventTime-"+t).val()))},SetCalendarControlForWorkshop:function(e,t){for(var i=[],n=0;n<=e.eventAvailableDates.length-1;n++){i.push(moment(new Date(e.eventAvailableDates[n].strAvailableDates.replace(new RegExp("-","g")," "))).format("MMM DD,YYYY"));var o=_vgClassSessionSelection.StringToDate(e.eventAvailableDates[n].strEventDate,"-");$("#day-"+o.getDay()).prop("disabled",!0),$("#day-"+o.getDay()).attr("data-disable","0"),$("#day-"+o.getDay()).prop("checked",!0)}destroydatepicker({divid:"#divEventFromDate",textid:"#txtEventFromDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),preset:"date",arrValidDates:i,contentWindow:datePicker_contentWindow}),setdatepickervalue({divid:"#divEventFromDate",textid:"#txtEventFromDate",dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate)},new Date($("#hdnEventTime-"+t).val())),$("#txtEventFromDate").attr("aria-label",$("#txtEventFromDate").val().replaceAll("-"," "))},ValidateMembershipPackageForClass:function(e,t){var i="",n="";if(1==_shopdetail.IsMemPkgReqToBook&&null!=MembershipPackageDetails&&1e3==MembershipPackageDetails.ResponseCode&&null!=MembershipPackageDetails.Data.UserMemberShipAndPackageInformation&&null!=MembershipPackageDetails.Data.MembershipOrPackageRequiredToBookResponse&&MembershipPackageDetails.Data.MembershipOrPackageRequiredToBookResponse.length>0){var o=MembershipPackageDetails.Data.UserMemberShipAndPackageInformation;if(o.IsMemPkgReqToBook&&null!=o.RequiredServices&&""!=o.RequiredServices){var a=o.RequiredServices.split(","),s=e.split(","),r=t.split("||~||"),l=[],c=!1;$.each(s,function(e,t){-1!=jQuery.inArray(t,a)&&(c=!0,l.push(r[e]))}),c&&(n=l.join(", "))}!o.IsMemPkgReqToBook||o.IsUserHasRequiredMembership||o.IsUserHasRequiredPackage||null==o.RequiredServices||""==o.RequiredServices||(i="no",o.UserHasFamilyFriend)}return{UserHasReqMemPack:i,FnfHasReqMemPack:"",ReqServicesNames:n}},OpenAlertForNotAceeptNewClient:function(){},ShowEventDetailPopup:function(t,o,a,s,r,l,c,d){var u=!1;if(_vgClassSessionSelection.model.IsSearchFromInHouseClass)_vgClassSessionSelection.handleEventCartDetails(t,o,a,s,r,l,c,d,u);else if(UserID<=0){$.grep(i,function(e){e.serviceProviderID==r&&(_vgClassSessionSelection.commonProperty.spNameClass=e.teacherName,_vgClassSessionSelection.commonProperty.spIdClass=e.serviceProviderID)});var p=readAlexaCookie("_vgamzn");String.isNullOrUndefineOrBlank(p)?showCommonLoginPopup("ClassSignup"):(void 0!==sFromPage&&(sFromPage="ClassSignup"),signin(null,null,null,p,"","","",8,!1,!0,EncPV(""),getek(),getei(),""))}else if(1!=bkEvent.IsSelectedFromPopUp)if(1==_shopdetail.IsMemPkgReqToBook){var h=null==bkEvent.ServiceProviderID?r:bkEvent.ServiceProviderID,m={businessID:_vgClassSessionSelection.GetCommonBusinessID(),customerId:UserID,isCheckinApp:isCheckInApp};vagaro.ajaxCall(e+n.geteventcartdetail,m,function(e){null!=(e=JSON.parse(e)).Memberships&&e.Memberships.length>0?(u=!0,bkEvent.SelectedMembership=null):u=!1,_vgClassSessionSelection.handleEventCartDetails(t,o,a,s,r,l,c,d,u)},function(e){},!1,!0)}else if(1==_shopdetail.IsLimitOnlineBooking){h=null==bkEvent.ServiceProviderID?r:bkEvent.ServiceProviderID;if(void 0!==bkEvent.ServiceProviderID)$.grep(_shopdetail.UserAndFnFNewOrExistingForBusinessEmployees,function(e){return e.ServiceProviderID==h&&e.UserID==UserID&&1==e.Existing}).length>0&&_vgClassSessionSelection.handleEventCartDetails(t,o,a,s,h,l,c,d,u);else _vgClassSessionSelection.handleEventCartDetails(t,o,a,s,r,l,c,d,u)}else 0==_shopdetail.IsMemPkgReqToBook&&0==_shopdetail.IsLimitOnlineBooking&&_vgClassSessionSelection.handleEventCartDetails(t,o,a,s,r,l,c,d,u);else _vgClassSessionSelection.handleEventCartDetails(t,o,a,s,r,l,c,d,u)},ClearEventCartObj:function(){bkEvent.AppointmentID=void 0,bkEvent.Session=void 0,bkEvent.Amount=void 0,bkEvent.EventId=void 0,bkEvent.ServiceProviderID=void 0,bkEvent.StrStartTime=void 0,bkEvent.IsWorkShop=void 0,bkEvent.IsWaitlist=void 0},handleEventCartDetails:function(t,o,a,s,r,l,c,d,u){var p="";null==s&&(t=bkEvent.AppointmentID,o=bkEvent.Session,a=bkEvent.Amount,s=bkEvent.EventId,r=bkEvent.ServiceProviderID,l=bkEvent.StrStartTime,c=bkEvent.IsWorkShop,d=bkEvent.IsWaitlist),i.forEach(function(e){e.eventId===s&&(p=e.className)});var h="";i.forEach(function(e){e.serviceProviderID==r&&(h=e.teacherName)});var m=!1;if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.DisplayEmpNotAccptNewClientsBadge&&void 0!==_shopdetail.OpenNotAcceptingNewClientsFnFPopupForClass){if(m=_shopdetail.DisplayEmpNotAccptNewClientsBadge(r),1==_shopdetail.IsLimitOnlineBooking&&1==m&&1!=bkEvent.IsSelectedFromPopUp)return void _shopdetail.OpenNotAcceptingNewClientsFnFPopupForClass(h,t,o,a,s,r,l,c,d,u,p);if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsMemPkgReqToBook&&!u&&1!=bkEvent.IsSelectedFromPopUp){var g=_vgClassSessionSelection.ValidateMembershipPackageForClass(s.toString(),p);if(""!=g.ReqServicesNames&&"no"==g.UserHasReqMemPack)return bkEvent.AppointmentID=t,bkEvent.Session=o,bkEvent.Amount=a,bkEvent.EventId=s,bkEvent.ServiceProviderID=r,bkEvent.StrStartTime=l,bkEvent.IsWorkShop=c,bkEvent.IsWaitlist=d,void _shopdetail.OpenMembershipPopup(g.ReqServicesNames)}}$("#employeefnfpopup").modal("hide"),SelectedSP=r,SelectedDate=l,isWorkShopOrClass=c,objectArgument={},objectArgument.appointmentID=t,objectArgument.session=o,objectArgument.amount=a,objectArgument.eventId=s,objectArgument.serviceProviderID=r,objectArgument.strStartTime=l,objectArgument.isWorkShop=c,objectArgument.IsWaitlist=d,_vgClassSessionSelection.commonProperty.isWorkShop=void 0!==c&&c;m=!1;if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.DisplayEmpNotAccptNewClientsBadge&&(m=_shopdetail.DisplayEmpNotAccptNewClientsBadge(r),1==_shopdetail.IsLimitOnlineBooking&&1==m&&(_vgClassSessionSelection.commonProperty.ClassPropertyData=objectArgument)),_vgClassSessionSelection.model.IsSearchFromInHouseClass){if(null==_vgAddon.Model.GlobalAddonServiceData&&(_vgAddon.BindAllAddonDataByBusiness_New(CalendarConfiguration.model.CalenderDetails.BusinessID,lLogedInUserID),_vgAddon.GetOnlineServiceDetail()),$("#hdnaddonids").val().length>0&&""!=$("#hdnaddonids").val()){var v=$("#hdnaddonids").val().split("~");if(v.length>0)for(var f=0;f<v.length;f++){var C=_vgAddon.FilterAddonServiceBySPId(v[f],s,r);C.length>0&&_vgClassSessionSelection.model.AttendeeAddonDetails.push(C[0])}}if(businessID=BusinessID,UserID=iLoggedinUserID,_vgClassSessionSelection.EventShowLoader(!0),_vgClassSessionSelection.getSelectedCustomer()>0){$("#hdnAppointmentId").val(t);var S=bkEvent.getResponseFromCache();if(null!=S)var y=S.filter(function(e){return e.appointmentID==t?e:null});if(null!=y&&y.length>0){var b=void 0===y[0].StreamingEventCapacity?0:y[0].StreamingEventCapacity;b>0?$(this.model.aLiveStream).show():$(this.model.aLiveStream).hide(),y[0].eventCapacity>0?$(this.model.aAtBusinessStream).show():$(this.model.aAtBusinessStream).hide(),"false"==isFromReschedual?(y[0].eventCapacity>0&&(_vgClassSessionSelection.commonProperty.streamingStatus=_vgClassSessionSelection.StreamingStatusEnum.InHouse,$(this.model.aAtBusinessStream).click()),0==y[0].eventCapacity&&b>0&&(_vgClassSessionSelection.commonProperty.streamingStatus=_vgClassSessionSelection.StreamingStatusEnum.LiveStream,$(this.model.aLiveStream).click())):b>0&&_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream?($(this.model.aLiveStream).show(),$(this.model.aAtBusinessStream).hide(),$(this.model.aLiveStream).click()):($(this.model.aLiveStream).hide(),$(this.model.aAtBusinessStream).show(),$(this.model.aAtBusinessStream).click()),_vgCal.ManageAtnd.SetPopupDataAndShow(t,r,moment(l.replace(/-/g,"/")).toDate(),s.toString(),y[0].teacherName,y[0].eventCapacity,b,!0,y[0].className),$("#txtSessionFrequency").val(o),$("#spnClassDateTime").text(countryDateFormat(l,VagaroCountryDateFormat.SmallDateWithTime)),$("#spnClassNameSpName").text(y[0].className+" with "+y[0].teacherName)}}else vagaro.alertsmall("Please select customer to book a class"),_vgClassSessionSelection.EventShowLoader(!1)}else{_vgClassSessionSelection.DisplayStep(1),_vgClassSessionSelection.commonProperty.isWaitlist=void 0!==d&&d,$("#eventDescription").html("").removeClass("height60").removeAttr("style"),$("#eventimage").css("background-image","url()"),$("#divEventName").html(""),$("#divClassDetailpopup").modal("show"),$("body").addClass("widgetpopupOpen"),$("#divApplyisPointApply").hide(),$("#divApplyDailyDeal").hide(),$("#divApplyGC").hide(),$("#divOuterApplyPkg").hide(),$("#divApplyisMembershipApply").hide(),void 0!==setPopupPosi&&void 0!==IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&(iOS||isAndroidMobile||($("#divClassDetailpopup").addClass("wbDivClassDetailpopup"),setPopupPosi($("#divClassDetailpopup")))),ShowLoader(!0);var k=$("#tr-"+t);$("#hdnAppointmentId").val(t);var _=k.data("sessiondetail"),D=_vgClassSessionSelection.CalcSessionPrice(_,o,1,!0,!1);$("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+D).attr("aria-label","Price is "+$("#divEventPrice").html()),_vgClassSessionSelection.commonProperty.streamingAmount=_vgClassSessionSelection.GetcurrencySymbol()+D,_siteBuilderDetail.GCVPLText(D,1),_vgClassSessionSelection.ResetStreamingStatus(k.data("streamingtype"),k.data("hasstreamcapacity")),_vgClassSessionSelection.setStreamingClassType(1==_vgClassSessionSelection.commonProperty.isWaitlist?_vgClassSessionSelection.StreamingDBFilterType.InHouse:k.data("streamingtype"),k.data("hasstreamcapacity"));var I;I=_vgClassSessionSelection.CalcSessionPrice(_,o,1,!0,!0),$(this.model.divStreamingEventPrice).html(_vgClassSessionSelection.GetcurrencySymbol()+I),_siteBuilderDetail.GCVPLText(I,2);var w=_vgClassSessionSelection.GetClassPromotionWithLastMinute(k.data("promotiondetail"));if(_vgClassSessionSelection.UpdateClassDealDiscountBadge(w,D),""!=w.trim()){var P;if(D>0)void 0===(P=getCookie("Referral"))||""==P||null==P||null==P?null!=w&&null!=w&&null!=w.split("|~~|")[2]&&null!=w.split("|~~|")[2]&&"0"==w.split("|~~|")[2]?($("#divEventPrice_Old").html($("#divEventPrice").html()).attr("aria-label","Old price "+$("#divEventPrice").html()),_vgClassSessionSelection.CalculatePromotionPriceDetail("#divEventPrice_Old","#divEventPrice",D,w)):$("#divEventPrice_Old").html(""):($("#divEventPrice_Old").html($("#divEventPrice").html()).attr("aria-label","Old price "+$("#divEventPrice").html()),_vgClassSessionSelection.CalculatePromotionPriceDetail("#divEventPrice_Old","#divEventPrice",D,w)),_siteBuilderDetail.GCVPLText(_vgClassSessionSelection.promotionamt,1);else $("#divEventPrice_Old").hide();if(I>0)void 0===(P=getCookie("Referral"))||""==P||null==P||null==P?null!=w&&null!=w&&null!=w.split("|~~|")[2]&&null!=w.split("|~~|")[2]&&"0"==w.split("|~~|")[2]?($(this.model.divStreamingEventPrice_Old).html($(this.model.divStreamingEventPrice).html()).attr("aria-label","Old Price "+$(this.model.divStreamingEventPrice).html()),_vgClassSessionSelection.CalculatePromotionPriceDetail(this.model.divStreamingEventPrice_Old,this.model.divStreamingEventPrice,I,w)):$(this.model.divStreamingEventPrice_Old).html(""):($(this.model.divStreamingEventPrice_Old).html($(this.model.divStreamingEventPrice).html()).attr("aria-label","Old Price "+$(this.model.divStreamingEventPrice).html()),_vgClassSessionSelection.CalculatePromotionPriceDetail(this.model.divStreamingEventPrice_Old,this.model.divStreamingEventPrice,I,w)),_siteBuilderDetail.GCVPLText(_vgClassSessionSelection.promotionamt,2);else $(this.model.divStreamingEventPrice_Old).hide()}else $("#divEventPrice_Old").hide(),$(this.model.divStreamingEventPrice_Old).hide(),$("#divEventPrice_Old").html("").attr("aria-label",""),$(this.model.divStreamingEventPrice_Old).html("").attr("aria-label","");if($("#hdneventId").val(s),$("#hdnserviceProviderID").val(r),$("#hdnStartTime").val(l),$("#txtQuantity").val(o),_vgClassSessionSelection.clearcontrol(),_vgClassSessionSelection.ResetEventPopupDetail(_vgClassSessionSelection.commonProperty.isWaitlist),_vgClassSessionSelection.PreviousClassRow!=t+"_"+$("#td"+t+"ClassName").data("classname")&&(_vgClassSessionSelection.PreviousClassRow=t+"_"+$("#td"+t+"ClassName").data("classname"),_onlineCheckout.Clear_ShowDiscount()),1==isCheckInApp)$("#btnEventAddtoCart").hide(),$("#btnUAddtoCart").hide(),parseInt($("#txtQuantity").val())>1?$(".signupweek-day").show():$(".signupweek-day").hide(),$("html").addClass("stopscroll");_vgClassSessionSelection.commonProperty.isWaitlist?($("#hdnAppointmentId").data("iswaitlist",_vgClassSessionSelection.commonProperty.isWaitlist),$("#btnEventAddtoCart").hide(),$("#btnUAddtoCart").hide(),$("#btnCheckOut").html("Add to Waitlist"),$("#btnUCheckOut").html("Add to Waitlist")):$("#hdnAppointmentId").data("iswaitlist",!1);var A=$("#tr-"+t),T=null;if(""!=A.data("availabledates"))try{T=JSON.parse(A.data("availabledates"))}catch(e){T=null}if(A.length>0&&""!=A.data("image")&&null!=T){if(""!=A.data("description").escapeHtml().getTextFromHtml()?$("#eventDescription").html(A.data("description").escapeHtml().getTextFromHtml()):$("#eventDescription").hide(),$("#eventDescription")[0].scrollHeight<=80?($(".classevent-desc .more-div").hide(),$("#eventDescription").removeClass("height60")):($("#eventDescription").addClass("height60"),$(".classevent-desc .more-div").show()),$("#eventimage").css("background-image","url("+A.data("image")+")"),$("#divEventName").html($("#td"+t+"ClassName").html()),void 0!==c&&1==c){var x=_vgClassSessionSelection.GetWorkshopDates(T.eventAvailableDates);T.eventAvailableDates.length!=o&&(D=_vgClassSessionSelection.ConvertTodecimal(T.eventAvailableDates.length*D/o,2,!1),$("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+D).attr("aria-label","Price is "+$("#divEventPrice").html())),$("#divEventAllDates").html(x),$("#divClassDetailpopup").addClass("workshop-class"),$(".signupweek-day").hide(),$("#divWorkshopDetail").show(),$("#depositClassFooterSecPrice").show(),_vgClassSessionSelection.SetCalendarControlForWorkshop(T,t);var F=A.data("ruleType");$("#ddlRecurringType").val(F),3==F?($("#txtNoofDays").val(A.data("ruleDefinition")),_vgClassSessionSelection.commonProperty.isYearlySelection=!1):2==F?($("#txtNoofWeeks").val(A.data("ruleDefinition")),_vgClassSessionSelection.commonProperty.isYearlySelection=!1):1==F?($("#ddlRecurringType").val(2),_vgClassSessionSelection.commonProperty.isYearlySelection=!1):4==F&&($("#txtNoofDays").val(A.data("ruleDefinition")),$("#ddlRecurringType").val(3),_vgClassSessionSelection.commonProperty.isYearlySelection=!0),_vgClassSessionSelection.HideShowWeekOrMonth()}else $(".signupweek-day").show(),$("#divWorkshopDetail").hide(),$("#divClassDetailpopup").removeClass("workshop-class"),_vgClassSessionSelection.ResetCalendarControl(T,t),$("#day-"+_vgClassSessionSelection.GetStartDate().getDay()).prop("checked",!0);_vgClassSessionSelection.ShowDiscountOnEvent(),$("#divEventName").focus(),ShowLoader(!1)}else{var O={};O.eventId=s,0==isCheckInApp?_vgClassSessionSelection.model.IsSearchFromInHouseClass?O.businessID=BusinessID:O.businessID=_shopdetail.businessID:(O.businessID=glbDataCheckIn.businessID,O.userID=UserID),O.serviceProviderID=r,O.startTime=l,O.type=1,vagaro.ajaxCall(e+n.geteventdetailandavailabledates,O,_vgClassSessionSelection.ShowEventDetailSuccess,0==isCheckInApp?_common.CallFailed:{},!1,!0),$("#divEventName").focus()}_vgClassSessionSelection.ClearEventCartObj()}},CalculatePromotionMultipleSessionDetail:function(e,t,i,n,o,a){$(e).show();var s=0;0==n.split("-")[1]?(s=i-i*n.split("-")[2]/100,_vgClassSessionSelection.promotionamt=s):(s=i-n.split("-")[2]*o.val()*a.val())<0&&(s=0),$(t).html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(s,2))},CalculatePromotionPriceDetail:function(e,t,i,n){$(e).show();var o=i,a=0;0==n.split("-")[1]?(a=_onlineCheckout.parseTodecimal(o-o*n.split("-")[2]/100,2),_vgClassSessionSelection.promotionamt=a):(a=o-n.split("-")[2])<0&&(a=0),$(t).html(_vgClassSessionSelection.GetcurrencySymbol()+_onlineCheckout.parseTodecimal(a,2)).attr("aria-label","New Price "+$(t).html())},ShowEventDetailSuccess:function(e){ShowLoader(!1);var t=$("#hdnAppointmentId").val(),i=$("#tr-"+t);if(e.eventDetail.isWorkShop){$("#divClassDetailpopup").addClass("workshop-class"),$(".signupweek-day").hide(),$("#divWorkshopDetail").show(),$("#depositClassFooterSecPrice").show(),$("#divSPName").html(FullUserName+" With "+e.eventAvailableDates[0].serviceProviderName);var n=e.eventAvailableDates[0].workShopNoofSessions+" sessions every "+_vgClassSessionSelection.GetFrequency(e.eventAvailableDates[0].ruleType,e.eventAvailableDates[0].ruleDefinition);1!=e.eventAvailableDates[0].ruleType?n+=" on:":n+=" :",i.data("EventOn",n);var o=_vgClassSessionSelection.GetFrequencyDays(e.eventAvailableDates[0].ruleType,e.eventAvailableDates[0].ruleDefinition);i.data("EventDays",o);var a="Starting on "+new Date(moment(e.eventAvailableDates[0].strEventDate).toISOString()).format("MMM dd, yyyy").replace(/ 0+/g," ");i.data("EventDate",a);var s=_vgClassSessionSelection.GetWorkshopDates(e.eventAvailableDates);e.eventAvailableDates.length!=e.eventAvailableDates[0].workShopNoofSessions&&(sessionoldamt=_vgClassSessionSelection.ConvertTodecimal(e.eventAvailableDates.length*e.eventAvailableDates[0].workShopSellPrice/e.eventAvailableDates[0].workShopNoofSessions,2,!1),$("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+sessionoldamt).attr("aria-label","Price is "+$("#divEventPrice").html())),$("#divEventAllDates").html(s),_vgClassSessionSelection.commonProperty.workshopEventOn=n,2==e.eventAvailableDates[0].ruleType?_vgClassSessionSelection.commonProperty.workshopEventDays=o.replace(/<br\s*\/?>/gi,", ").slice(0,-2):_vgClassSessionSelection.commonProperty.workshopEventDays=o,_vgClassSessionSelection.commonProperty.workshopEventDate=a,_vgClassSessionSelection.SetCalendarControlForWorkshop(e,t)}else $("#divWorkshopDetail").hide(),$(".signupweek-day").show(),$("#divClassDetailpopup").removeClass("workshop-class"),_vgClassSessionSelection.ResetCalendarControl(e,t),$("#day-"+_vgClassSessionSelection.GetStartDate().getDay()).prop("checked",!0);var r=e.eventDetail;if($("#divEventName").html($("#td"+t+"ClassName").html()),i.data("image",r.photo),i.data("smallimage",r.smallphoto),i.data("tax",r.tax),i.data("description",r.eventDesc.escapeHtml()),i.data("availabledates",JSON.stringify(e)),""!=r.eventDesc.escapeHtml().getTextFromHtml()?$("#eventDescription").html(r.eventDesc.escapeHtml().getTextFromHtml()):$("#eventDescription").hide(),$("#eventDescription")[0].scrollHeight<=80?($(".classevent-desc .more-div").hide(),$("#eventDescription").removeClass("height60")):($("#eventDescription").addClass("height60"),$(".classevent-desc .more-div").show()),-1!=r.photo.toLowerCase().indexOf("no-shop-image-big")?$("#eventimage").parent(".event-ph-description").addClass("no-eventimg"):($("#eventimage").parent(".event-ph-description").removeClass("no-eventimg"),$("#eventimage").css("background-image","url("+r.photo+")")),""!=r.businessImage&&$("#imgebusinessimage").attr("src",r.businessImage),e.eventDetail.isWorkShop&&null!=e.eventAvailableDates&&e.eventAvailableDates.length>0){var l=e.eventAvailableDates[0].ruleType,c=e.eventAvailableDates[0].ruleDefinition;if(null!=c&&""!=c||(c=1),3==l)$("#txtNoofDays").val(c),$("#ddlRecurringType").val(l),_vgClassSessionSelection.commonProperty.isYearlySelection=!1;else if(2==l){$("#ddlRecurringType").val(l),(d=c.split("~")).length>0&&(c=d[0],$("#txtNoofWeeks").val(c)),_vgClassSessionSelection.commonProperty.isYearlySelection=!1}else if(1==l)$("#ddlRecurringType").val(2),_vgClassSessionSelection.commonProperty.isYearlySelection=!1;else if(4==l){var d;$("#ddlRecurringType").val(3),(d=c.split("~")).length>1&&(c=d[1],$("#txtNoofDays").val(c)),_vgClassSessionSelection.commonProperty.isYearlySelection=!0}_vgClassSessionSelection.HideShowWeekOrMonth(),i.data("ruleType",l),i.data("ruleDefinition",c)}if(1==isCheckInApp&&($("#divClassDetailpopup").show(),$("#txtNoofAttendees").prop("disabled",!0),$("#divNoofAttendees").css("display","none"),$("html").addClass("stopscroll")),_vgClassSessionSelection.ShowDiscountOnEvent(),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&(1==_shopdetail.IsMemPkgReqToBook||1==_shopdetail.IsLimitOnlineBooking)){var u=_shopdetail.LiveStreamSignUp;void 0!==u&&null!=u&&(_vgClassSessionSelection.AddToEventCart(3),clearCookie("LiveStreamSignUp"),$("#btnBackSecondPopup").hide(),$("#btnCancelSecondPopup").show())}},ResetStreamingStatus:function(e,t){$(this.model.aLiveStream).show(),$(this.model.aAtBusinessStream).show(),_vgClassSessionSelection.commonProperty.streamingStatus=1,1==e&&0==t?$("#dvStreamingStatus").find("a").addClass("active"):($("#dvStreamingStatus").find("a").removeClass("active"),$("#dvStreamingStatus").find("a#aLiveStream").addClass("active"),$("#aLiveStream").click())},setStreamingClassType:function(e,t){void 0!==e&&""!=e?e==_vgClassSessionSelection.StreamingDBFilterType.InHouse?($(this.model.aLiveStream).hide(),$(this.model.aAtBusinessStream).show(),$(this.model.aAtBusinessStream).click()):e==_vgClassSessionSelection.StreamingDBFilterType.LiveStream?($(this.model.aAtBusinessStream).hide(),"undefined"!=typeof isBrandedAppForApproval&&null!=isBrandedAppForApproval&&1==isBrandedAppForApproval?$(this.model.aLiveStream).hide():($(this.model.aLiveStream).show(),$(this.model.aLiveStream).click())):(1==t?"undefined"!=typeof isBrandedAppForApproval&&null!=isBrandedAppForApproval&&1==isBrandedAppForApproval?$(this.model.aLiveStream).hide():$(this.model.aLiveStream).show():$(this.model.aLiveStream).hide(),$(this.model.aAtBusinessStream).show()):(1==t?"undefined"!=typeof isBrandedAppForApproval&&null!=isBrandedAppForApproval&&1==isBrandedAppForApproval?$(this.model.aLiveStream).hide():$(this.model.aLiveStream).show():$(this.model.aLiveStream).hide(),$(this.model.aAtBusinessStream).show())},SetStreamingStatus:function(e,t){if($("#dvStreamingStatus").find("a").removeClass("active").attr("aria-checked",!1),_vgClassSessionSelection.model.IsSearchFromInHouseClass)txtDepositCls.value=0,_vgClassSessionSelection.commonProperty.streamingStatus=e,_vgClassSessionSelection.CalcAndDisplayPriceOffline();else if(e==_vgClassSessionSelection.StreamingDBFilterType.InHouse){var i=$("#hdnAppointmentId").val();if(0==$("#tr-"+i).data("hasinhousecapacity")&&1!=objectArgument.IsWaitlist)return 1==IsOnlineCustomerWaitlist?void bootbox.confirm({title:"Confirmation",message:"A class can't take any new enrollment in At Businesss as it is full, Would you like to add Waitlist?",buttons:{confirm:{label:"Add to Waitlist"}},callback:function(e){e&&_vgClassSessionSelection.ShowEventDetailPopup(objectArgument.appointmentID,objectArgument.session,objectArgument.amount,objectArgument.eventId,objectArgument.serviceProviderID,objectArgument.strStartTime,objectArgument.isWorkShop,!0)}}):void vagaro.alertsmall("A class can't take any new enrollment in At Businesss as it is full.")}$(t).addClass("active").attr("aria-checked",!0),_vgClassSessionSelection.commonProperty.streamingStatus=e,"undefined"==typeof _shopdetail||null==_shopdetail||1!=_shopdetail.IsMemPkgReqToBook&&1!=_shopdetail.IsLimitOnlineBooking||void 0===_shopdetail.LiveStreamSignUp||null==_shopdetail.LiveStreamSignUp?_vgClassSessionSelection.commonProperty.streamingAmount=$(t).find("span.new").text():_vgClassSessionSelection.commonProperty.streamingAmount=_vgClassSessionSelection.GetcurrencySymbol()+_shopdetail.LiveStreamSignUp.Amount},CalculateSessionPrice:function(){var e=$("#hdnAppointmentId").val(),t=$("#tr-"+e),i=t.data("sessiondetail"),n=$("#txtQuantity");(""==n.val()||parseInt(n.val())<=0)&&n.val("1");var o=$("#txtNoofAttendees");(""==o.val()||parseInt(o.val())<=0)&&o.val("1"),parseInt(o.val())>1&&($("#btnEventAddtoCart").hide(),$("#btnUAddtoCart").hide(),$("#btnCheckOut").hide(),$("#btnNext").show());var a=_vgClassSessionSelection.CalcSessionPrice(i,n.val(),o.val(),!0,!1);$("#divEventPrice").html(_vgClassSessionSelection.GetcurrencySymbol()+a).attr("aria-label","new price is "+$("#divEventPrice").html()),$("#divEventPrice_Old").html($("#divEventPrice").html()).attr("aria-label","old price is "+$("#divEventPrice_Old").html());parseInt($("#divEventPrice_Old").text().replace("$"," "));_siteBuilderDetail.GCVPLText(a,1);var s;s=_vgClassSessionSelection.CalcSessionPrice(i,n.val(),o.val(),!0,!0),$(this.model.divStreamingEventPrice).html(_vgClassSessionSelection.GetcurrencySymbol()+s),$(this.model.divStreamingEventPrice_Old).html($(this.model.divStreamingEventPrice).html()),_siteBuilderDetail.GCVPLText(s,2);var r=_vgClassSessionSelection.GetClassPromotionWithLastMinute(t.data("promotiondetail"));_vgClassSessionSelection.UpdateClassDealDiscountBadge(r,a),""!=r.trim()?(a>0?(_vgClassSessionSelection.CalculatePromotionMultipleSessionDetail("#divEventPrice_Old","#divEventPrice",a,r,n,o),_siteBuilderDetail.GCVPLText(_vgClassSessionSelection.promotionamt,1)):$("#divEventPrice_Old").hide(),s>0?(_vgClassSessionSelection.CalculatePromotionMultipleSessionDetail(this.model.divStreamingEventPrice_Old,this.model.divStreamingEventPrice,s,r,n,o),_siteBuilderDetail.GCVPLText(s,2)):$(this.model.divStreamingEventPrice_Old).hide()):($("#divEventPrice_Old").hide(),$("#divEventPrice_Old").html("").attr("aria-label",""),$(this.model.divStreamingEventPrice_Old).hide()),1==isCheckInApp&&(n.val()>=1?$(".signupweek-day").show():$(".signupweek-day").hide())},CloseDateControl:function(){HideShowdatepicker(!1,{divid:"#divEventFromDate",textid:"#txtEventFromDate"})},ShowHideClassPopup:function(e){1==e?($("#divClassDetailpopup").modal("show"),$("body").addClass("widgetpopupOpen"),1==isCheckInApp&&$("html").addClass("stopscroll")):(_vgClassSessionSelection.CloseDateControl(),$("#divClassDetailpopup").modal("hide"),$("body").removeClass("widgetpopupOpen"),1==isCheckInApp&&$("html").removeClass("stopscroll"),onlineShoppingCart={},onlineShoppingCartmain={},$("#btnBackSecondPopup").show(),$("#btnCancelSecondPopup").hide(),bkEvent.IsSelectedFromPopUp=!1),_vgClassSessionSelection.commonProperty.ClassPropertyData=null,$("#tr-"+$("#hdnAppointmentId").val()).find(".dropdown-toggle").attr("tabindex","-1").focus()},ShowHideClassTooltipPopup:function(e){1==e?($("#divClassDetailTooltippopup").modal("show"),void 0!==setPopupPosi&&void 0!==IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&(iOS||isAndroidMobile||setPopupPosi($("#divClassDetailTooltippopup"))),1==isCheckInApp&&$("html").addClass("stopscroll")):(_vgClassSessionSelection.CloseDateControl(),$("#divClassDetailTooltippopup").modal("hide"),1==isCheckInApp&&$("html").removeClass("stopscroll"))},GetNextWorkShop:function(t,i,o,a,s,r,l,c){if(l){var d={businessID:glbDataCheckIn.businessID,startDate:i,eventID:o,appointmentId:t};vagaro.ajaxCall(e+n.getnextavailabledateworkshop,d,function(e){null==e?vagaro.alert({message:"This workshop started. Workshops are a series of sessions that must be attended from the beginning.",title:"Workshop in Progress"}):e.IsFirstDate?_vgClassSessionSelection.ShowEventDetailPopup(t,a,s,o,r,i,!0,c):null==e.FutureStartDate?vagaro.alert({message:"This workshop started on "+countryDateFormat(moment(new Date(e.strCurrentStartDate.replace(new RegExp("-","g")," "))),VagaroCountryDateFormat.SmallDate)+". Workshops are a series of sessions that must be attended from the beginning.",title:"Workshop in Progress"}):"undefined"!=typeof bootbox&&bootbox.confirm({title:"Workshop in Progress",message:"This workshop started on "+countryDateFormat(moment(new Date(e.strCurrentStartDate.replace(new RegExp("-","g")," "))),VagaroCountryDateFormat.SmallDate)+". Workshops are a series of sessions that must be attended from the beginning. Would you like to join the next workshop on "+countryDateFormat(moment(new Date(e.strFutureStartDate.replace(new RegExp("-","g")," "))),VagaroCountryDateFormat.SmallDate)+"?",buttons:{cancel:{label:"Cancel"},confirm:{label:"Continue"}},callback:function(t){if(t){var i=e.strFutureStartDate,o=$("<XMLDocument/>");o.append(_vgClassSessionSelection.createXmlElement("searchDetails"));var a=_vgClassSessionSelection.createXmlElement("searchDetail");a.append(_vgClassSessionSelection.createXmlElement("serviceId","-3")),a.append(_vgClassSessionSelection.createXmlElement("spId","-3")),o.find("searchDetails").append(a);var s={};s.businessID=glbDataCheckIn.businessID,s.sSatrtDate=i,s.sEndDate=i,s.searchdetails=o.html(),s.userID=glbDataCheckIn.scanUserID,s.promotionID=0,ajaxapi(n.getavailablemultievents,s,_vgClassSessionSelection.LoadEventsDataCallbackForClassTab,_vgClassSessionSelection.LoadEventsDataFailCallback,!1),ShowLoader(!1)}}})},function(e){},!1,!0)}else{var u={businessID:_shopdetail.businessID,startDate:i,eventID:o,appointmentId:t};vagaro.ajaxCall(e+n.getnextavailabledateworkshop,u,function(e){null==e?vagaro.alert({message:"This workshop started. Workshops are a series of sessions that must be attended from the beginning.",title:"Workshop in Progress"}):e.IsFirstDate||_vgClassSessionSelection.model.IsSearchFromInHouseClass?_vgClassSessionSelection.ShowEventDetailPopup(t,a,s,o,r,i,!0,c):null==e.FutureStartDate?vagaro.alert({message:"This workshop started on "+countryDateFormat(moment(new Date(e.strCurrentStartDate.replace(new RegExp("-","g")," "))),VagaroCountryDateFormat.SmallDate)+". Workshops are a series of sessions that must be attended from the beginning.",title:"Workshop in Progress"}):"undefined"!=typeof bootbox&&bootbox.confirm({title:"Workshop in Progress",message:"This workshop started on "+countryDateFormat(moment(new Date(e.strCurrentStartDate.replace(new RegExp("-","g")," "))),VagaroCountryDateFormat.SmallDate)+". Workshops are a series of sessions that must be attended from the beginning. Would you like to join the next workshop on "+countryDateFormat(moment(new Date(e.strFutureStartDate.replace(new RegExp("-","g")," "))),VagaroCountryDateFormat.SmallDate)+"?",buttons:{cancel:{label:"Cancel"},confirm:{label:"Continue"}},callback:function(t){if(t){var i=_common.GetChoiceForSeleect2($("#txtSP5"));void 0!==i.id&&null!=i.id&&""!=i.id&&($("#txtSP5").select2("data",{id:"",text:""}),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#txtSP5Mobile").val(""),_common.SetDefaultForSeleect2($("#txtSP5")),$("#hdnInstructorIDForClass").val(""),_shopdetail.FillClassDatesForClass());var n=moment(e.strFutureStartDate)._d;$("#hdnStartDateForClass").val(n);try{var o=_shopdetail.getSunday(n),a=new Date(o);a=new Date(a.setDate(o.getDate()+6)),_shopdetail.setClassSliderDateForClass(o,a)}catch(e){}LoadClassDataOnline(n),ShowLoader(!1)}}})},function(e){},!1,!0)}},VisibleControlLength:function(e){return $(e).filter(function(){return"none"!==$(this).css("display")}).length},ShowClassDescPopup:function(t,i,o,a,s,r,l,c,d,u,p,h,m){if($(".clstip-name").html(i),$("#clstip-minlabel").html(o),$(".clstip-min").attr("aria-label",o.replace("hr","Hour")),$(".clstip-description").html(t),""!=a?($(".clstip-img").css("background-image","url("+a+")"),$(".clstip-img-name").removeClass("no-cls-img")):$(".clstip-img-name").addClass("no-cls-img"),void 0===s||""==s||null==s||h!=_vgClassSessionSelection.StreamingDBFilterType.InHouse&&h!=_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream)$("#clstip-price").html(""),$("#clstip-price").hide();else{var g=s;if(h==_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream)g='<div class="vg-service-video clstip-livestream"><em aria-label="In House Logo" role="img">&#xf54e;</em><span>At Business - </span>&nbsp;'+s+" </div> ";$("#clstip-price").html(g),$("#clstip-price").show()}if(void 0===p||"true"!=p||h!=_vgClassSessionSelection.StreamingDBFilterType.LiveStream&&h!=_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream||void 0===m||""==m||null==m)$("#clsstreamtip-price").html(""),$("#clsstreamtip-price").hide();else if("undefined"!=typeof isBrandedAppForApproval&&null!=isBrandedAppForApproval&&1==isBrandedAppForApproval)$("#clsstreamtip-price").html(""),$("#clsstreamtip-price").hide();else{g=m;if(h==_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream)g='<div class="vg-service-video clstip-livestream"><em aria-label="Live Stream Logo" role="img">&#xf03d;</em><span>Live Stream - </span>&nbsp;'+m+" </div>";$("#clsstreamtip-price").html(g),$("#clsstreamtip-price").show()}if(null!=r&&"true"==r){$("#divClassDetailTooltippopup .modal-dialog").addClass("workshop-show"),$("#hdnAppointmentId").val(l);var v=$("#tr-"+l),f=null;if(""!=v.data("availabledates"))try{f=JSON.parse(v.data("availabledates"))}catch(e){f=null}if(null!=f){var C=_vgClassSessionSelection.GetWorkshopDates(f.eventAvailableDates);$(".clstip-workshopdates").html(C),$("#divworkshopdetails").show(),$("#depositClassFooterSecPrice").show(),$("#divClassDetailTooltippopup").on("show.bs.modal",function(){centerModal($("#divClassDetailTooltippopup"))}).modal("show")}else{var S={};S.eventId=parseInt(c),0==isCheckInApp?_vgClassSessionSelection.model.IsSearchFromInHouseClass?S.businessID=BusinessID:S.businessID=_shopdetail.businessID:(S.businessID=glbDataCheckIn.businessID,S.userID=UserID),S.serviceProviderID=parseInt(d),S.startTime=u,S.type=1,vagaro.ajaxCall(e+n.geteventdetailandavailabledates,S,_vgClassSessionSelection.GetEventDetailAndAvailableDatesSuccess,0==isCheckInApp?_vgClassSessionSelection.CallFailed2:{},!1,!0)}}else $("#divClassDetailTooltippopup .modal-dialog").removeClass("workshop-show"),$("#divworkshopdetails").hide(),$("#divClassDetailTooltippopup").on("show.bs.modal",function(){centerModal($("#divClassDetailTooltippopup")),$(".clstip-name").focus()}).modal("show")},AddToEventCart:function(e){if("undefined"!=typeof divEventPrice&&null!=divEventPrice&&(_vgClassSessionSelection.commonProperty.streamingAmount=divEventPrice.textContent),"undefined"!=typeof onlineShoppingCart&&(onlineShoppingCart={}),"undefined"!=typeof onlineShoppingCartmain&&(onlineShoppingCartmain={}),void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&_siteBuilderDetail&&_siteBuilderDetail.ComponentResponse&&_siteBuilderDetail.ComponentResponse.lstBusinessDetail&&!1===_siteBuilderDetail.ComponentResponse.lstBusinessDetail.IsShoppingTabCartEnable&&$("#btnUAddtoCart").hide(),1==isCheckInApp&&($("body").removeClass("future-appointment-show"),$(".book-future-appt").removeClass("show")),null==getdatepickervalue("#txtEventFromDate"))return vagaro.alertsmall("Please select today's date."),!1;if(_vgClassSessionSelection.commonProperty.streamingStatus<=0)return vagaro.alertsmall("Please select where would you like to take this class?"),!1;ShowLoader(!0);var t=$("#hdnAppointmentId").val(),i=$("#tr-"+t),n=$("#td-"+t),o=parseInt($("#hdnserviceProviderID").val()),a=$("#td"+t+"ClassName").data("classname");-1==a.indexOf("&lt;div class")&&-1==a.indexOf("<div class")||(-1!=a.indexOf("&lt;div class")?a=a.substr(0,a.indexOf("&lt;div")):-1!=a.indexOf("<div class")&&(a=a.substr(0,a.indexOf("<div class")))),_vgClassSessionSelection.commonProperty.appointmentId=parseInt(t),_vgClassSessionSelection.commonProperty.availabledates=JSON.parse(i.data("availabledates"));for(var s=0;s<_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length;s++)"11:59 PM"==_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates[s].strEndTime&&(_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates[s].strEndTime="12:00 AM");_vgClassSessionSelection.commonProperty.otherSPavailabledates="",_vgClassSessionSelection.commonProperty.businessID=parseInt(_vgClassSessionSelection.GetCommonBusinessID()),_vgClassSessionSelection.commonProperty.SPID=parseInt(o),_vgClassSessionSelection.commonProperty.UserID=parseInt(UserID),null!=UserCellNo?_vgClassSessionSelection.commonProperty.UserCellNo=UserCellNo:_vgClassSessionSelection.commonProperty.UserCellNo="",_vgClassSessionSelection.commonProperty.FullUserName=FullUserName,_vgClassSessionSelection.commonProperty.teacherName=n.html(),_vgClassSessionSelection.commonProperty.UserEmail="undefined"!=typeof UserEmail&&null!=UserEmail?UserEmail.trim():"",_vgClassSessionSelection.commonProperty.eventID=parseInt($("#hdneventId").val()),_vgClassSessionSelection.commonProperty.tax=parseFloat(i.data("tax")),_vgClassSessionSelection.commonProperty.smallImage=i.data("smallimage"),_vgClassSessionSelection.commonProperty.startTime=$("#hdnStartTime").val(),_vgClassSessionSelection.commonProperty.shortStartTime=i.data("availabletime"),_vgClassSessionSelection.commonProperty.sessiondetail=i.data("sessiondetail"),_vgClassSessionSelection.commonProperty.promotiondetail=i.data("promotiondetail"),_vgClassSessionSelection.commonProperty.isWaitlist=$("#hdnAppointmentId").data("iswaitlist"),_vgClassSessionSelection.commonProperty.eventName=a,_vgClassSessionSelection.GetEventCartDetail(e)},GetEventCartDetail:function(t){if(_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage).length<=0){var i={businessID:_vgClassSessionSelection.GetCommonBusinessID(),customerId:UserID,isCheckinApp:isCheckInApp};vagaro.ajaxCall(e+n.geteventcartdetail,i,function(e){null!=(e=JSON.parse(e)).Events&&null!=e.Events&&e.Events.length>0?($.each(e.Events,function(e,t){null!=t.tax?t.tax=parseFloat(t.tax):t.tax=0,$.each(t.eventEnrollment,function(e,t){t.eventDate=moment(t.eventDate).toISOString()})}),onlineShoppingCartmain=e):onlineShoppingCartmain={},3!=t?_vgClassSessionSelection.CheckLogiUserCheckExistance(t):_vgClassSessionSelection.AddUserWithCheckExistance(t)},function(e){},!1,!0)}else 3!=t?_vgClassSessionSelection.CheckLogiUserCheckExistance(t):_vgClassSessionSelection.AddUserWithCheckExistance(t)},ShowDiscountOnEvent:function(){UserID>0&&_vgClassSessionSelection.GetEventCartDetail_ShowDiscount()},UpdateAttendeeSelection:function(e){if(_vgClassSessionSelection.VerifyAttendeeSelection(e)&&_vgClassSessionSelection.VerifyAttendeeSelectionincart(e)&&($(e).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").html($(e).find("div.ffshipping-bg").html()),$(e).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-value",$(e).find("div.ffshipping-bg").data("value")),$(e).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-email",$(e).find("div.ffshipping-bg").data("email")),$(e).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-cell",$(e).find("div.ffshipping-bg").data("cell")),$(e).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-cellcountryid",$(e).find("div.ffshipping-bg").data("cellcountryid")),$(e).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-fullname",$(e).find("div.ffshipping-bg").data("fullname")),$(e).closest("div.panel-default").find("div.panel-heading").find("div.ffshipping-bg").attr("data-cellcountryid",$(e).find("div.ffshipping-bg").data("cellcountryid")),$(e).closest("div.panel-default").attr("data-value",$(e).find("div.ffshipping-bg").data("value")),$(e).closest("div.panel-default").attr("data-email",$(e).find("div.ffshipping-bg").data("email")),$(e).closest("div.panel-default").attr("data-cell",$(e).find("div.ffshipping-bg").data("cell")),$(e).closest("div.panel-default").attr("data-cellcountryid",$(e).find("div.ffshipping-bg").data("cellcountryid")),$(e).closest("div.panel-default").attr("data-fullname",$(e).find("div.ffshipping-bg").data("fullname")),$(e).closest("div.collapse").collapse("hide"),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking)){$(e).closest("div.panel-default").attr("data-tag","");var t=$("div.clsaccordion").find(".panel-default")[0].dataset.tag;void 0!==t&&""!=t?($("#btnSearchAvailability").show(),$("#btnUAddtoCart").hide(),$("#btnUCheckOut").hide()):($("#btnSearchAvailability").hide(),$("#btnUAddtoCart").show(),$("#btnUCheckOut").show())}},VerifyAttendeeSelection:function(e){var t=$(e).closest("div.panel-default").attr("data-value"),i=$(e).find("div.ffshipping-bg").attr("data-value");if(t==i)return!0;var n=$("div.clsaccordion").find(".panel-default").map(function(){return $(this).attr("data-value")}).get();return!(jQuery.inArray(i.toString(),n)>-1)||(swal({title:"Attendee Already Added",text:"This attendee is already added.",type:"warning",customClass:"swal-white-greenbtn"}),$(e).closest("div.collapse").collapse("hide"),!1)},VerifyAttendeeSelectionincart:function(e){try{var t=$(e).find("div.ffshipping-bg").attr("data-value"),i=$(e).find("div.ffshipping-bg").attr("data-email"),n=_vgClassSessionSelection.commonProperty.eventID,o=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);if(o.length>0){var a=$.grep(o,function(e){return e.eventID==n});return!(a.length>0&&_vgClassSessionSelection.CheckUserExistance(t,i,a[0])&&0==_vgClassSessionSelection.commonProperty.isAddonPopup)||(_vgClassSessionSelection.commonMessageAlert("this user is already exists in cart."),$(e).closest("div.collapse").collapse("hide"),!1)}return!0}catch(e){}},AddGuestUsertoSelection:function(){var e=$("#txtFFGuestfirstName").val().trim(),t=$("#txtFFGuestlastName").val().trim(),i=$("#txtFFGuestEmail").val().trim(),n=$("#txtFFGuestPhone").val(),o=0,a=1,s={};if(!guestcellPhone.validatePhoneNumber(!0)){var r=guestcellPhone.getValidateMessage();return 3==r.WarningType?($("#divCellNo").html("cell should be of 10 digits."),$("#divCellNo").show()):1==r.WarningType?($("#divCellNo").html("required"),$("#divCellNo").show()):($("#divCellNo").html(r.WarningMessage),$("#divCellNo").show()),!1}$("#divCellNo").hide(),n=(s=guestcellPhone.getPhoneData()).phoneNo,o=s.countryId,a=s.dialingCode;var l=0;if($("#ffguestdetail input").each(function(){0==_vgClassSessionSelection.validate($(this),$(this).attr("data-type"),0)&&1==(l+=1)&&$(this).focus()}),0==l){var c=$("#ffguestmodel").attr("data-value"),d=$("div.clsaccordion").find(".panel-default").map(function(){if(void 0!==$(this).attr("data-email"))return $(this).attr("data-email").trim().toLowerCase()}).get();if(jQuery.inArray(i.toLowerCase(),d)>-1)return _vgClassSessionSelection.commonMessageAlert("Duplicate Guest, Already added this Guest in selection"),$("#ffguestmodel").modal("toggle"),$(".bootbox-alert").addClass("ffonlineclassbootbox"),void $("#"+c).siblings("div.attendeelist").collapse("hide");var u=e+" "+t,p='<div class="ffshipping-bg" data-value="0" data-email="'+i+'" data-cell="'+n+'" data-cellcountryid="'+o+'" data-fullname="'+u+'" data-dialingCode="'+a+'"><div class="avtar">'+FindInitials(u,"SP")+'</div><divclass="w-clearfix"><div class="avtar-name">'+e+" "+t+'</div><div class="avtar-subtitle">Guest</div></div></div>';$("#"+c).find(".ffshipping-bg").html(p),$("#ffguestmodel").modal("toggle"),$("#"+c).siblings("div.collapse").collapse("hide");var h='<li class="mid-tabs familycktfrndlistdetails" data-value="0" onclick="_vgClassSessionSelection.UpdateAttendeeSelection(this)">'+p+"</li>";$("#"+c).siblings("div.attendeelist").find("#lstoffamilyandfriends").find(" > li:nth-last-child(2)").before(h),$("#"+c).closest("div.panel-default").attr("data-value","0"),$("#"+c).closest("div.panel-default").attr("data-email",i),$("#"+c).closest("div.panel-default").attr("data-cell",n),$("#"+c).closest("div.panel-default").attr("data-cellcountryid",o),$("#"+c).closest("div.panel-default").attr("data-fullname",u),$("#"+c).closest("div.panel-default").attr("data-dialingCode",a),setTimeout(function(){$("#divUserDetail").attr("aria-label","").attr("tabindex",-1).focus()},1e3),void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&void 0!==$("#divClassDetailpopup")&&null!=$("#divClassDetailpopup")&&null!=$("#divClassDetailpopup")&&$("#divClassDetailpopup").css({"overflow-x":"hidden","overflow-y":"auto"})}},GetEventCartDetail_ShowDiscount:function(){var t=$("#tr-"+$("#hdnAppointmentId").val()),i=void 0!==t.data("streamingtype")?t.data("streamingtype"):_vgClassSessionSelection.StreamingDBFilterType.InHouse,o=1;i==_vgClassSessionSelection.StreamingDBFilterType.InHouseAndLiveStream&&(o=2),$("#divApplyisPointApply").hide(),$("#divApplyDailyDeal").hide(),$("#divApplyGC").hide(),$("#divOuterApplyPkg").hide(),$("#divApplyisMembershipApply").hide(),$("#divApplyIsWaivedApplyApply").hide(),$("#liWeekDays .dayselection label").attr("aria-checked",!1),$("#liWeekDays input[type=checkbox]:checked").next("label").attr("aria-checked",!0);var a=[];if(null!=r&&(a=$.extend(!0,[],r.Events)),null==a||a.length<=0){var s={businessID:_vgClassSessionSelection.GetCommonBusinessID(),customerId:UserID,isCheckinApp:isCheckInApp};vagaro.ajaxCall(e+n.geteventcartdetail,s,function(e){var t;if(null!=(e=JSON.parse(e)).Events&&null!=e.Events&&e.Events.length>0?($.each(e.Events,function(e,t){null!=t.tax?t.tax=parseFloat(t.tax):t.tax=0,$.each(t.eventEnrollment,function(e,t){t.eventDate=moment(t.eventDate).toISOString()})}),onlineShoppingCartmain=e):onlineShoppingCartmain=null,null!=onlineShoppingCartmain){r=$.extend(!0,[],onlineShoppingCartmain);var n=1;$.grep(r.Events,function(e){e.autoId=n,n+=1}),t=$.extend(!0,[],r.Events)}else t=[];for(var a=1;a<=o;a++){var s=[];t.length>0&&(s=$.extend(!0,[],t)),1==a&&3==i||1==i?_vgClassSessionSelection.CreateEventCollection_ShowDiscount(1,s,_vgClassSessionSelection.StreamingStatusEnum.InHouse):_vgClassSessionSelection.CreateEventCollection_ShowDiscount(1,s,_vgClassSessionSelection.StreamingStatusEnum.LiveStream)}},function(e){},!1,!0)}else for(var l=1;l<=o;l++){var c=[];a.length>0&&(c=$.extend(!0,[],a)),1==l&&3==i||1==i?_vgClassSessionSelection.CreateEventCollection_ShowDiscount(1,c,_vgClassSessionSelection.StreamingStatusEnum.InHouse):_vgClassSessionSelection.CreateEventCollection_ShowDiscount(1,c,_vgClassSessionSelection.StreamingStatusEnum.LiveStream)}},getFilterEnrollmentDataByStreamStatus:function(e,t){var i=[];e.length>0&&(i=$.extend(!0,[],e),i=$.grep(i,function(e){if(e.eventEnrollment.length>0){var i=$.grep(e.eventEnrollment,function(e){return e.StreamingStatus==t});e.eventEnrollment=i}}));return i},SetButtonValue:function(e,t){$("#btnBack").data("from",e),$("#btnConfirm").data("to",t)},GetCommonBusinessID:function(){return 0==isCheckInApp?_vgClassSessionSelection.model.IsSearchFromInHouseClass?BusinessID:_shopdetail.businessID:null!=glbDataCheckIn.businessID?glbDataCheckIn.businessID:0},GetcurrencySymbol:function(){var e=0;return 0==isCheckInApp?e=_vgClassSessionSelection.model.IsSearchFromInHouseClass?_vgCal.Common.model.CurrencySymbol:_shopdetail.currencySymbol:(glbDataCheckIn.currency,e=null!=glbDataCheckIn.currency?glbDataCheckIn.currency:""),e},GetCurrencyCode:function(){return String.isNullOrUndefineOrBlank(currencyCode)?"":currencyCode},AlreadyEnrolled:function(e){1==isCheckInApp?(_vgClassSessionSelection.ShowHideClassPopup(!1),$("#licartIcon a").attr("data-isbypass","true"),$("#licartIcon a").click()):bootbox.confirm({title:"This Class is Already in Your Cart",message:e,buttons:{confirm:{label:"Add a Friend"}},callback:function(e){e&&(_vgClassSessionSelection.EventShowLoader(!0),_vgClassSessionSelection.SetDefaultUser(!1),_vgClassSessionSelection.AddUser(),_vgClassSessionSelection.EventShowLoader(!1))}})},CallFailed:function(e){1==isCheckInApp||_common.CallFailed()},Convert2digitFormat:function(e){return parseFloat(Math.round(100*e)/100).toFixed(2)},EventFullMessageCheckIn:function(){vagaro.alertsmall("A class can't take any new enrollment as it is full.")},GetEventDetailAndAvailableDatesSuccess:function(e){if(null!=e&&e.eventDetail.isWorkShop){var t=parseInt($("#hdnAppointmentId").val());$("#tr-"+t).data("availabledates",JSON.stringify(e));var i=_vgClassSessionSelection.GetWorkshopDates(e.eventAvailableDates);$(".clstip-workshopdates").html(i),$("#divworkshopdetails").show(),$("#depositClassFooterSecPrice").show(),$("#divClassDetailTooltippopup").on("show.bs.modal",function(){centerModal($("#divClassDetailTooltippopup"))}).modal("show")}},GetWorkshopDates:function(e){for(var t=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat"),i="",n="",o=0;o<e.length;o++){var a=e[o],s=new Date(moment(a.strEventDate).toISOString());t[s.getDay()];"11:59 PM"==a.strEndTime&&(a.strEndTime="12:00 AM"),n=void 0!==e[o].CleanupTime&&null!=typeof e[o].CleanupTime&&e[o].CleanupTime>0?moment(a.strEndTime,"hh:mm A").subtract(e[o].CleanupTime,"minutes").format("hh:mm A"):a.strEndTime,i=i+countryDateFormat(s,VagaroCountryDateFormat.LargeDate)+" ("+a.strStartTime.replace(/^0+/,"")+" - "+n.replace(/^0+/,"")+")<br/>"}return i},SetSelectionRepeatVal:function(e){$("#classSelectionRepeat").find("a").each(function(e,t){$(this).hasClass("active")&&$(this).removeClass("active")}),$("#classSelectionRepeat").find("a").eq(e).addClass("active")},SetDayClassSession:function(e){0==$(e).attr("data-disable")&&($(e).hasClass("active")?$(e).removeClass("active"):$(e).addClass("active"))},isCalNumberKey:function(e){var t=e.which?e.which:event.keyCode;return!(t>31&&(t<48||t>57))},CheckIsMinNum:function(e){var t=parseInt(e.value);e.value=t>0?t>12?"12":t.toString():"1"},upWksNumber:function(){$("#divSessionFrequencyActive").removeClass("active"),$("#divSessionWksFrequencyActive").addClass("active");var e=document.getElementById("txtSessionWksFrequency").value;if(""==e||null==e||NaN==e)document.getElementById("txtSessionWksFrequency").value="1";else if((e=parseInt(e))>12)document.getElementById("txtSessionWksFrequency").value="1";else{var t=e+1;t<13&&(document.getElementById("txtSessionWksFrequency").value=t.toString())}},downWksNumber:function(){$("#divSessionFrequencyActive").removeClass("active"),$("#divSessionWksFrequencyActive").addClass("active");var e=document.getElementById("txtSessionWksFrequency").value;if(""==e||null==e||"NaN"==e)document.getElementById("txtSessionWksFrequency").value="1";else if((e=parseInt(e))>0){var t=e-1;t>0&&(document.getElementById("txtSessionWksFrequency").value=t.toString())}else document.getElementById("txtSessionWksFrequency").value="1"},isCalMinDateNumber:function(e){var t=parseInt(e.value);e.value=t>0?t>31?"31":t.toString():""},downClassDateNumber:function(){$("#divSessionFrequencyActive").removeClass("active"),$("#divSessionClassMntDateActive").addClass("active");var e=document.getElementById("txtSessionClassMntDate").value;if(""==e||null==e||"NaN"==e)document.getElementById("txtSessionClassMntDate").value="1";else if((e=parseInt(e))>0){var t=e-1;t>0&&(document.getElementById("txtSessionClassMntDate").value=t.toString())}else document.getElementById("txtSessionClassMntDate").value="1"},upClassDateNumber:function(){$("#divSessionFrequencyActive").removeClass("active"),$("#divSessionClassMntDateActive").addClass("active");var e=document.getElementById("txtSessionClassMntDate").value;if(""==e||null==e||NaN==e)document.getElementById("txtSessionClassMntDate").value="1";else if((e=parseInt(e))>31)document.getElementById("txtSessionClassMntDate").value="1";else{var t=e+1;t<32&&(document.getElementById("txtSessionClassMntDate").value=t.toString())}},CheckSessionMinNum:function(e){var t=parseInt(e.value);e.value=t>0?t>20?"20":t.toString():"1",_vgCal.ManageAtnd.ShowHideAtCount(),_vgClassSessionSelection.CalcAndDisplayPriceOffline()},upSessionNumber:function(){$("#divSessionWksFrequencyActive").removeClass("active"),$("#divSessionClassMntDateActive").removeClass("active"),$("#divSessionFrequencyActive").addClass("active");var e=document.getElementById("txtSessionFrequency").value;if(""==e||null==e||NaN==e)document.getElementById("txtSessionFrequency").value="1";else if((e=parseInt(e))>20)document.getElementById("txtSessionFrequency").value="1";else{var t=e+1;t<21&&(document.getElementById("txtSessionFrequency").value=t.toString())}_vgCal.ManageAtnd.ShowHideAtCount(),_vgClassSessionSelection.CalcAndDisplayPriceOffline()},downSessionNumber:function(){$("#divSessionWksFrequencyActive").removeClass("active"),$("#divSessionClassMntDateActive").removeClass("active"),$("#divSessionFrequencyActive").addClass("active");var e=document.getElementById("txtSessionFrequency").value;if(""==e||null==e||"NaN"==e)document.getElementById("txtSessionFrequency").value="1";else if((e=parseInt(e))>0){var t=e-1;t>0&&(document.getElementById("txtSessionFrequency").value=t.toString())}else document.getElementById("txtSessionFrequency").value="1";_vgCal.ManageAtnd.ShowHideAtCount(),_vgClassSessionSelection.CalcAndDisplayPriceOffline()},WaitlistSuccessMessage:function(e,t){1==t&&($("#ancCheckoutSuccessClass").removeAttr("onclick"),$("#ancCheckoutSuccessClass").attr("onclick","_onlineCheckout.SuccessCheckinAPP();")),Webflow.destroy(),Webflow.ready(),1==e?("undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,"22|~|1"),$("#divCheckInAppDetails").hide(),$("#dvCheckoutSuccessClass").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;"),$("#dvCheckoutSuccessMSGClass").html("You're on the waitlist"),$("#dvCheckoutSuccessMSG1Class").hide()):($("#divCheckInAppDetails").hide(),$("#dvCheckoutSuccessClass").show().attr("style","display:-webkit-box; display:-webkit-flex; display: -ms-flexbox; display:flex;"),$("#dvCheckoutSuccessMSGClass").html("You're on the waitlist"),$("#dvCheckoutSuccessMSG1Class").show().css("display","flex")),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&CallbackforMobileApp(0,0,"","",0,29)},SaveWaitlistClass:function(t,i){for(var o=[],a=0;a<=t.length-1;a++){var s=t[a],r={};if(r.UserId=parseInt(s.customerID),r.EmailId=s.cUserEmail,r.CountryId=1,1==this.model.IsOnline&&0==isCheckInApp&&(r.CountryId=parseInt(_shopdetail.countryId)),r.FirstName=s.cFirstName.toString(),r.LastName=s.cLastName.toString(),r.Cell=s.cUserCellNo,r.CellCountryID=s.cCellcountryID,r.DialingCode=s.cDialingCode,r.ServiceId=parseInt(s.eventID),r.ServiceProviderId=parseInt(s.sPID),r.ServiceProviderName=s.sPName,r.EventName=_vgClassSessionSelection.commonProperty.eventName,r.AddOnIDs="",null!=s.lstAddonService&&s.lstAddonService.length>0)for(var l=0;l<s.lstAddonService.length;l++)r.AddOnIDs+=s.lstAddonService[l].ServiceId.toString()+",";r.AddOnIDs=r.AddOnIDs.replace(/,s*$/,"");var c=[];1==_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop?$.each(i,function(e,t){t.cUserEmail==s.cUserEmail&&(objChildWaitlistDetail={},objChildWaitlistDetail.ReqStartTime=t.workshopActualDate,objChildWaitlistDetail.AppointmentId=t.appointmentID,c.push(objChildWaitlistDetail))}):(objChildWaitlistDetail={},objChildWaitlistDetail.ReqStartTime=s.workshopActualDate,objChildWaitlistDetail.AppointmentId=s.appointmentID,c.push(objChildWaitlistDetail)),r.lstChildWaitlistDetail=c,o.push(r)}var d={Device:"Website",Calledfrom:"Calendar"};if(1==this.model.IsOnline&&0==isCheckInApp){if("true"==isFacebook?d.Calledfrom="FacebookWidget":"true"==isWidget?d.Calledfrom="Widget":"true"==isGoogle?d.Calledfrom="Google":d.Calledfrom="Shopdetail","undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.isFBExtensions&&1==vagaroFBExtensions.isFBExtensions?d.Device="Insta":void 0!==_shopdetail.IsBookFromFacebook&&"true"==_shopdetail.IsBookFromFacebook.toLowerCase()&&(d.Device="Facebook"),"undefined"!=typeof isWindowsApp&&1==isWindowsApp)d.Device="Windows";else if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){d.Device="CustomerApp";var u=null!=navigator.userAgent?navigator.userAgent:"";u.toLowerCase().indexOf("customerios")>-1?d.Device="iOS":u.toLowerCase().indexOf("customerandroid amazon")>-1?d.Device="Amazon":u.toLowerCase().indexOf("customerandroid")>-1&&(d.Device="Android"),"undefined"!=typeof IsBrandedApp&&null!=IsBrandedApp&&""!==IsBrandedApp&&null!=IsBrandedApp&&1==IsBrandedApp&&(d.Device=d.Device+" Branded")}else if(vgAppicationType==objApplicationType.CheckinApp)d.Device="CheckIn";else if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.VisibleControlLength&&_shopdetail.VisibleControlLength("#mobile-check")>0){d.Device="MobileWeb","undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.isFBExtensions&&1==vagaroFBExtensions.isFBExtensions?d.Device="Insta":void 0!==_shopdetail.IsBookFromFacebook&&"true"==_shopdetail.IsBookFromFacebook.toLowerCase()&&(d.Device="Facebook");var p=navigator.userAgent;OpenedFrom={iphone:p.match(/(iPhone|iPod)/),blackberry:p.match(/BlackBerry/),kindle:p.match(/Silk/),android:p.match(/Android/),windows:p.match(/Windows/),ipad:p.match(/iPad/)},OpenedFrom.windows?d.Device=d.Device+" Windows Phone":OpenedFrom.iphone?d.Device=d.Device+" iPhone":OpenedFrom.android?d.Device=d.Device+" Android":OpenedFrom.blackberry?d.Device=d.Device+" Blackberry":OpenedFrom.ipad?d.Device=d.Device+" iPad":OpenedFrom.kindle&&(d.Device=d.Device+" kindle")}}else 1==this.model.IsOnline&&1==isCheckInApp&&(d.Calledfrom="Shopdetail",d.Device="CheckIn");d.BusinessID=_vgClassSessionSelection.commonProperty.businessID;var h=0;h=1==this.model.IsOnline?UserID:_vgCal.Common.model.logInUId,d.LoginUserID=h,d.UserID=h,d.IsOnline=_vgClassSessionSelection.model.IsOnline,d.AppointmentType=1==_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop?3:2,d.MasterWaitlistDetails=o,_vgClassSessionSelection.EventShowLoader(!0);var m=new vagaro.ajax;m.datamodel.Token=e+n.savewaitlist,m.datamodel.data=d,m.datamodel.IsNewVagaroAPI=!0,m.datamodel.callback=_vgClassSessionSelection.SuccessSaveWaitlist,m.datamodel.Error=_vgClassSessionSelection.CallFailed,m.Post()},SuccessSaveWaitlist:function(e){if(null!=e){if(null!=e.ErrorSummary&&e.ErrorSummary.length>0){if(7==e.ErrorSummary[0].type)$.each(e.ErrorSummary,function(e,t){t.className=t.eventName,t.sessionTime=moment(t.reqStartTime).format("hh:mm A"),t.spName=t.serviceProviderName,t.eventDate=new Date(moment(t.reqStartTime)).format("MMM-dd-yyyy")}),$("#tBodyClassValidationTemp").html(""),$("#ClassDeleteTemplate").tmpl(e.ErrorSummary).appendTo("#tBodyClassValidationTemp"),_vgClassSessionSelection.model.IsOnline?($("#validationpopup").html($("#divClassValidationTemp").html()),$("#divClassValidationpopup").modal("show")):(_vgClassSessionSelection.RemoveAddedEnrollmentOffline(),_vgClassSessionSelection.commonMessageAlert($("#divClassValidationTemp").html()));else if(16==e.ErrorSummary[0].type){var t="";$.grep(e.ErrorSummary,function(e){t+=e.firstName+" "+e.lastName+", "}),e.ErrorSummary[0].userDataXml=t.trimRight().slice(0,-1);var i=[];i.push(e.ErrorSummary[0]),$("#tBodyClassValidationTemp").html(""),$("#ClassOnlineBookBlockTemplate").tmpl(i).appendTo("#tBodyClassValidationTemp"),$("#validationpopup").html($("#divClassValidationTemp").html()),$("#divClassValidationpopup").modal("show")}else 2==e.ErrorSummary[0].type&&0==_vgClassSessionSelection.model.IsOnline&&($.each(e.ErrorSummary,function(e,t){t.className=t.eventName,t.sessionTime=moment(t.reqStartTime).format("hh:mm A"),t.spName=t.serviceProviderName,t.eventDate=new Date(moment(t.reqStartTime)).format("MMM-dd-yyyy"),t.apptId=t.appointmentId,t.status=1==t.status?"enrolled":"waitlisted",""!=t.firstName||""!=t.lastName?t.username=""!=t.lastName?_vgClassSessionSelection.GetUserShortDetail(t.firstName,t.lastName):t.firstName+".":t.username=""}),$("#tBodyClassValidationTemp").html(""),$("#UserAlreadyWaitlistTemplate").tmpl(e.ErrorSummary).appendTo("#tBodyClassValidationTemp"),_vgClassSessionSelection.RemoveAddedEnrollmentOffline(),_objMessagePopup.SetWidth(650).Show("Alert",$("#divClassValidationTemp").html(),"OK","","",function(){_objMessagePopup.Hide()},function(){_objMessagePopup.Hide()},null));return void _vgClassSessionSelection.EventShowLoader(!1)}1==_vgClassSessionSelection.model.IsOnline?(_vgClassSessionSelection.ShowHideClassPopup(!1),_vgClassSessionSelection.WaitlistSuccessfullBooked(e)):_vgClassSessionSelection.WaitlistOfflineMessage(!0,e.WaitlistMasters.length)}else 1==_vgClassSessionSelection.model.IsOnline?($("#divClassDetailpopup").modal("hide"),_vgWaitlist.ShowFailMessage("Some error occured.Please try again later")):_vgClassSessionSelection.WaitlistOfflineMessage(!1,0);_vgClassSessionSelection.EventShowLoader(!1)},WaitlistOfflineMessage:function(e,t){if(e)if(SetErrorDisplayMessage("1","Waitlist has been saved.",""),0==$("#spanFeature").hasClass("available-show")||""==$("#lblFeatureCount").text())$("#spanFeature").addClass("available-show"),$("#lblFeatureCount").html(t);else try{var i=parseInt($("#lblFeatureCount").text());i+=t,$("#lblFeatureCount").text(i)}catch(e){}else SetErrorDisplayMessage("0","Some error occured.Please try again later","");_vgCal.ManageAtnd.ShowPopup(!1),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.ExceptionStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.EventStorage),_vgClassSessionSelection.ClearSessionStorage(_vgClassSessionSelection.model.WaitlistEventStorage)},WaitlistSuccessfullBooked:function(e){if(1!=isCheckInApp){_shopdetail.RemoveAllControls(!0,!0),_shopdetail.SetControls(null),$("#no-appointment-found").hide();var t={},i=e.WaitlistDetails,n=e.WaitlistProviders,o=e.WaitlistDetails,a=[];$.grep(o,function(e){var i={};i.date=_vgWaitlist.GetDateTimeForDisplay(e.strReqStartTime,1),i.time=_vgWaitlist.GetDateTimeForDisplay(e.strReqStartTime,2),a.push(i),t.TimeSlots=a});var s=[],r={},l=_vgWaitlist.GetServiceProvidersDetail(i[0].ServiceProviderID,n),c={};c.servicename=i[0].ServiceTitle,c.image=l[0].image,c.spname=l[0].spname,c.spinit=l[0].spinit;var d=[];if(null!=i[0].AddOnIDs&&null!=i[0].AddOnIDs&&""!=i[0].AddOnIDs)for(var u=i[0].AddOnIDs.split("|~|"),p=0;p<u.length;p++)d.push({AddonName:u[p]});c.lstAddonService=d,r.typeService=_vgWaitlist.localData.TypeService.Single,r.serviceList=[],r.serviceList.push(c),s.push(r),t.lstWaitlistServices=s,_vgWaitlist.localData.ThankYouResponse=[],_vgWaitlist.localData.ThankYouResponse.push(t),_vgWaitlist.Waitlist_ThankyouScreen()}else _vgClassSessionSelection.WaitlistSuccessMessage(!0,isCheckInApp)},SearchAvailabilityClick:function(){_vgClassSessionSelection.ClearEventCartObj(),$("#employeefnfpopup").modal("hide"),$("#hdnSearchAvailabilityBtn").val("1"),bkClassAvailableDates.removeCacheByCurKey(),bkClassAvailableDates.timeSlotsCache={},bkClassAvailableDates.model={},void 0!==bkEvent.model.searchFromDate&&(bkEvent.removeCacheByCurKey(),bkEvent.timeSlotsCache={},bkEvent.model={}),_vgClassSessionSelection.ShowHideClassPopup(!1),_vgClassSessionSelection.FillClassDatesForClass(),_vgClassSessionSelection.commonProperty.spNameClass="",_vgClassSessionSelection.commonProperty.spIdClass=""},isCallFromPublic:function(){return"undefined"!=typeof BasePage&&"Home"==BasePage},GetEventCartDetail_ShowDiscountPublic:function(){_onlineCheckout.Clear_ShowDiscount();var e=[],t=[];e.length>0&&(t=$.extend(!0,[],e)),_vgClassSessionSelection.CreateEventCollection_ShowDiscount(1,t,_vgClassSessionSelection.StreamingStatusEnum.LiveStream)},AddEventFromPublic:function(t){"undefined"!=typeof onlineShoppingCart&&(onlineShoppingCart={}),"undefined"!=typeof onlineShoppingCartmain&&(onlineShoppingCartmain={});var i=!1;void 0!==t&&null!=t&&(i=t);var o=[];if(null!=r&&(o=$.extend(!0,[],r.Events)),null==o||o.length<=0){var a={businessID:_publicEvent.objEventDetails.BusinessID,customerId:UserID,isCheckinApp:isCheckInApp,IsLiveStream:!0};vagaro.ajaxCall(e+n.geteventcartdetail,a,function(e){var t;if(null!=(e=JSON.parse(e)).Events&&null!=e.Events&&e.Events.length>0?($.each(e.Events,function(e,t){null!=t.tax?t.tax=parseFloat(t.tax):t.tax=0,$.each(t.eventEnrollment,function(e,t){t.eventDate=moment(t.eventDate).toISOString()})}),onlineShoppingCartmain=e):onlineShoppingCartmain=null,null!=onlineShoppingCartmain){r=$.extend(!0,[],onlineShoppingCartmain);var n=1;$.grep(r.Events,function(e){e.autoId=n,n+=1}),t=$.extend(!0,[],r.Events)}else t=[];var o=[];t.length>0&&(o=$.extend(!0,[],t)),_vgClassSessionSelection.ClassAddToCartPublic(o,i)},function(e){},!1,!0)}else{var s=[];o.length>0&&(s=$.extend(!0,[],o)),_vgClassSessionSelection.ClassAddToCartPublic(s,i)}},ClassAddToCartPublic:function(e){var t=[],i=_publicEvent,n=i.objEventDetails,o=moment(new Date(n.StrStartTime)),a=n.ServiceProviderID,s=n.FirstName+(n.LastName.length>0?" "+n.LastName.substring(0,1)+".":""),r={},l=[];if(1==n.IsWorkShop)r.eventAvailableDates=i.lstEventAvailableDate,$.grep(_publicEvent.lstEventAvailableDate,function(e){var t=new Date(e.strAvailableDates);l.push(new Date(t.getFullYear(),t.getMonth(),t.getDate()))});else{var c=[],d={};d.appointmentID=n.AppointmentID,d.endTime=n.EndTime,d.eventCapacity=0,d.eventDuration=n.EventDuration,d.firstName=null,d.isWorkShopStarted=!1,d.lastName=null,d.noOfAttendees=0,d.ruleDefinition=null,d.ruleType=0,d.serviceProviderID=a,d.serviceProviderName=s,d.startTime=n.StartTime,d.strAvailableDates=o.format("MMM-DD-YYYY"),d.strEventDate=o.format("YYYY-MM-DD"),d.strStartTime=o.format("hh:mm A"),d.strEndTime=o.add(n.Duration,"minutes").format("hh:mm A"),d.streamingEventCapacity=n.StreamingEventCapacity,d.streamingNoOfAttendees=n.StreamingNoOfAttendees,d.workShopNoofSessions=0,d.workShopSellPrice=0,d.workShopStreamingSellPrice=0,c.push(d),r.eventAvailableDates=c;var u=new Date(n.StrStartTime);l.push(new Date(u.getFullYear(),u.getMonth(),u.getDate()))}var p={};if(p.eventID=n.ServiceID,p.eventName=n.ServiceTitle,p.tax=0,p.smallimage=n.ServicePhoto,p.sessiondetail=n.SessionDetail,p.promotiondetail=n.PromotionDetail,p.eventEnrollment=[],t.length>0){var h=$.grep(t,function(e){return e.eventID==p.eventID});h.length>0&&(p.eventEnrollment=$.grep(h[0].eventEnrollment,function(e){return 1!=e.isTempData}),p.eventEnrollment.length<=0&&(p.eventEnrollment=[]))}var m=Math.random().toString(36).substring(7),g="",v="",f=UserID,C="";"undefined"!=typeof FullUserName&&(g=FullUserName.split(" ")[0],"undefined"!=FullUserName.split(" ")[1]&&(v=FullUserName.split(" ")[1])),C=void 0!==$(this).attr("data-dialingCode")&&null!=$(this).attr("data-dialingCode")&&""!=$(this).attr("data-dialingCode")?$(this).attr("data-dialingCode"):"";for(var S=0;S<=l.length-1;S++){var y;if(null!=(y=$.grep(r.eventAvailableDates,function(e){return e.strEventDate==l[S].format("yyyy-MM-dd")&&e.serviceProviderID==a}))&&y.length>0){var b={};if(0==p.eventEnrollment.length?b.autoID=1:b.autoID=Math.max.apply(Math,p.eventEnrollment.map(function(e){return e.autoID}))+1,b.IsFromHomePage=!0,b.eventID=p.eventID,b.appointmentID=parseInt(y[0].appointmentID),b.customerID=f,b.cFirstName=g,b.cLastName=v,b.cUserEmail="",b.cUserCellNo="",b.cCellcountryID=0,b.cDialingCode=C,b.sPID=a,b.sPName=s,b.eventDate=l[S],b.workshopActualDate=l[S].format("MM/dd/yyyy")+" "+y[0].strStartTime,b.startTime=y[0].strStartTime,b.endTime=y[0].strEndTime,b.duration=y[0].eventDuration,b.isTempData=!1,b.IsWorkShop=n.IsWorkShop,1==b.IsWorkShop&&0!=y[0].workShopStreamingSellPrice&&0!=y[0].workShopNoofSessions?b.workShopIndividualPrice=y[0].workShopStreamingSellPrice/y[0].workShopNoofSessions:b.workShopIndividualPrice=0,b.noOfWorkShop=r.eventAvailableDates.length,b.randomForWorkShop=m,b.workshopEventOn=_vgClassSessionSelection.commonProperty.workshopEventOn,b.workshopEventDays=_vgClassSessionSelection.commonProperty.workshopEventDays,b.workshopEventDate=_vgClassSessionSelection.commonProperty.workshopEventDate,b.PromotionID=0,b.IsAmount=!1,b.AmountValue=0,b.PerUserOne="0",b.discount=0,void 0!==p.promotiondetail&&""!=p.promotiondetail){var k=p.promotiondetail.split("-");b.PromotionID=p.promotiondetail.split("-")[0],b.IsAmount=0!=p.promotiondetail.split("-")[1],b.AmountValue=p.promotiondetail.split("-")[2],b.PerUserOne=p.promotiondetail.split("-")[3],k.length>4?b.PerTransactionOne=p.promotiondetail.split("-")[4]:b.PerTransactionOne="0",b.PromotionTitle=p.promotiondetail.split("|~~|")[1]}b.StreamingStatus=_vgClassSessionSelection.StreamingStatusEnum.LiveStream,p.eventEnrollment.push(b)}}try{if(void 0!==e&&null!=e&&1==e){var _={};null!=$("#PopupBtnSignUp")&&null!=$("#PopupBtnSignUp").text()&&(_.Action=$("#PopupBtnSignUp").text()),_.Category="Live Stream",_.PageName="Live Stream",null!=$("#PopupBusinessName")&&null!=$("#PopupBusinessName").text()&&(_.BusinessName=$("#PopupBusinessName").text()),_.TypeofService="Live Stream","Live Stream"==_.TypeofService&&(_.isLiveStream=!0,_.isInHouse=!1,_.isSignupFree=!0),_vgLogEvent.LogData(_)}}catch(e){}if(t.length>0)t=$.grep(t,function(e){return e.eventID!=p.eventID});p.eventEnrollment.length>0&&t.push(p),this.SetIntoSessionStorage(this.model.EventStorage,t,!0)},LoadClassUserControl:function(){if($(_vgClassSessionSelection.Controls.ClassSectionStencil).length>0&&$(_vgClassSessionSelection.Controls.ClassesMainDiv).html($(_vgClassSessionSelection.Controls.ClassSectionStencil).html()),ShowLoader(!0),null!=_vgClassSessionSelection.ComponentResponse.lstClass)_vgClassSessionSelection.CallSuccess_LoadUserControl(_vgClassSessionSelection.ComponentResponse.lstClass);else{var e={UserControlPath:"~/UserControls/ucDetailClass.ascx",isRemoveFormTag:!0,Parameters:{}};1==_vgClassSessionSelection.model.IsOnline?(e.PageNamePath="~/detail.aspx",e.Parameters.BusinessID=businessID):(e.PageNamePath="~/SearchClassFromCalendar.aspx",e.Parameters.BusinessID=BusinessID);var t=new vagaro.ajax;t.datamodel.Token=n.LoadUserControl,t.datamodel.data=e,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.callback=_vgClassSessionSelection.CallSuccess_LoadUserControl,t.datamodel.Error=_vgClassSessionSelection.LoadUserControlFailed,t.Post(),"undefined"!=typeof _shopdetail&&void 0!==_shopdetail.GetPromotionsByBusinessID&&_shopdetail.GetPromotionsByBusinessID(),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking&&(void 0!==_shopdetail.LoadEmpNotAcceptingNewClients&&_shopdetail.LoadEmpNotAcceptingNewClients(),null!=UserID&&"0"!=UserID&&void 0!==_shopdetail.LoadUserAndFnFNewOrExistingForBusinessEmployees&&_shopdetail.LoadUserAndFnFNewOrExistingForBusinessEmployees())}},CallSuccess_LoadUserControl:function(e){var t;1==_vgClassSessionSelection.model.IsOnline?(DisplayFullView(!1),ShowLoader(!1),(t=$(_vgClassSessionSelection.Controls.ClassesMainDiv)).length>0&&(t.html(""),!1===_siteBuilderDetail.isCallFromPublicSide()&&_common.DisableComponent(13,t),t.append(e),_vgClassSessionSelection.ComponentResponse.lstClass=e,_vgClassSessionSelection.ChangeStreamingFilterDropDown(),t.show(),"undefined"!=typeof isBotCrawler&&0==isBotCrawler&&("undefined"!=typeof _siteBuilderDetail&&_siteBuilderDetail.IsCustomerAppORMobileViewWithoutWidget()&&$("#covidbadgeblock").is(":visible")&&($("#covidbadgeblock").data("ismanuallyhide",!0),$("#covidbadgeblock").hide()),_vgClassSessionSelection.LoadEventForClassControl(),_vgClassSessionSelection.LoadClassTab(null)))):(t=$(_vgClassSessionSelection.Controls.ClassesMainDiv)).length>0&&(t.html(""),t.append(e),_vgClassSessionSelection.ComponentResponse.lstClass=e,_vgClassSessionSelection.ChangeStreamingFilterDropDown(),t.show(),_vgClassSessionSelection.LoadEventForClassControl(),_vgClassSessionSelection.LoadClassTab(null))},LoadUserControlFailed:function(){ShowLoader(!1),vagaro.alert({message:"An Error Has Occurred",title:"Oops!"})},ChangeStreamingFilterDropDown:function(){1==_vgClassSessionSelection.model.IsOnline&&null!=typeof _shopdetail.IsZoomIntegrated&&1==_shopdetail.IsZoomIntegrated&&"undefined"!=typeof isBrandedAppForApproval&&0==isBrandedAppForApproval||0==_vgClassSessionSelection.model.IsOnline&&null!=typeof window.parent.CalendarConfiguration&&null!=typeof window.parent.CalendarConfiguration.model&&void 0!==window.parent.CalendarConfiguration.model.CalenderDetails&&void 0!==window.parent.CalendarConfiguration.model.CalenderDetails.IsZoomIntegreted&&1==window.parent.CalendarConfiguration.model.CalenderDetails.IsZoomIntegreted?($(_vgClassSessionSelection.Controls.ddlFilterTypes).val(_vgClassSessionSelection.StreamingFilterType.InHouseAndLiveStream),$(_vgClassSessionSelection.Controls.dvStreamType).show(),$("#divSearchForClass").removeClass("no-StreamType")):($(_vgClassSessionSelection.Controls.ddlFilterTypes).val(_vgClassSessionSelection.StreamingFilterType.InHouse),$(_vgClassSessionSelection.Controls.dvStreamType).hide(),$("#divSearchForClass").addClass("no-StreamType"))},LoadEventForClassControl:function(){$("#txtQuantity, #txtNoofAttendees").blur(function(){_vgClassSessionSelection.CalculateSessionPrice(),_vgClassSessionSelection.ShowDiscountOnEvent()}),$("#txtQuantity, #txtNoofAttendees").change(function(){_vgClassSessionSelection.CalculateSessionPrice(),_vgClassSessionSelection.ShowDiscountOnEvent()}),$("#txtAddtocartQuantity").applyupdown();var e=iPadAndroid?"touchstart":"click";$("#txtQuantity").applyupdown(!0,e),$("#txtNoofAttendees").applyupdown(!0,e),$(".cancel-select-service").on("touchstart click",function(e){e.preventDefault(),e.stopPropagation(),$("#select2-drop-mask").click()}),$("#accordion").on("show.bs.collapse",function(e){$(".panel-collapse").removeClass("show");var t=0-$(".familyclassheight").scrollTop(),i=$(window).height();$(e.target).css("top",t+"px");var n=$(".panel-heading").width();$(".ffattendeelist-bg").attr("style","Width:"+n+"px");var o=$(e.target).attr("style");$(e.target).css({visibility:"hidden",display:"block"});var a=$(e.target).find(".ffattendeelist-bg").height(),s=$(e.target).find(".ffattendeelist-bg").position().top+t;$(e.target).attr("style",o||""),a+s+10>i&&$(e.target).css("top",t-(a+54)+"px")}),$("div#divClassDetailpopup div#classDetailpopup div.modal-content.familyclassheight").on("scroll",function(e){var t=$("div.panel-collapse.attendeelist.collapse.show",e.target);void 0!==t&&null!=t&&t.length>0&&($(t).css("height","0px"),$("#divAddonPopupSection").addClass("scrollbackhide"),$(t).parent().find("a.tocollapse").click())})},SetPriceTaxSwitch:function(e){e.lstOnlineServiceDetail.length>0&&1==e.lstOnlineServiceDetail[0].IsIncludeTaxInOnlinePricing&&displayPriceWithTaxRegion.includes(groupID)?hdnPriceWithTaxSwitch.value="1":hdnPriceWithTaxSwitch.value="0"},LoadClassTab:function(e){if(1==_vgClassSessionSelection.model.IsOnline){if("undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&_shopdetail.WidgetMenuRedirect("classes"),_common.backtoTopHide(),_common.ScrollToToZero(),"true"==IsBlockBook.toLowerCase())return void _vgClassSessionSelection.HideShowDisableBookMessageForClass(!0);_vgClassSessionSelection.HideShowDisableBookMessageForClass(!1),"undefined"!=typeof _common&&_common.isCreateLinkPreserve(!0,!0)&&(_shopdetail.providerID=_common.isCreateLinkPreserve(!1),_shopdetail.serviceID="undefined"!=getCookie("ServiceID")?getCookie("ServiceID"):"")}else _shopdetail.providerID="undefined"!=getCookie("ProviderID")?getCookie("ProviderID"):"",_shopdetail.serviceID="undefined"!=getCookie("ServiceID")?getCookie("ServiceID"):"";if($(".scrollme").removeClass("scrollme"),$("#hdnClassIDForClass").val(""),$("#hdnInstructorIDForClass").val(""),_shopdetail.LiveStreamSignUp="undefined"!=getCookie("LiveStreamSignUp")?getCookie("LiveStreamSignUp"):"",null!=c)isFromReschedual="false",$("#hdnRescheduleDetail").val(""),_vgClassSessionSelection.RemoveAllControlsForClass(),_vgClassSessionSelection.BindDropDownForClass(),_shopdetail.providerID>0&&_vgClassSessionSelection.SetOnlIneBookingDetailForClass(),_vgClassSessionSelection.FillClassDatesForClass(),"undefined"!=typeof _shopdetail&&void 0!==_shopdetail.BusinessStartTime&&"undefined"!=c.clsTimeZone&&null!=c.clsTimeZone&&_shopdetail.BusinessStartTime(c.clsTimeZone.TIME_ZONE,c.clsTimeZone.CountryID,c.clsTimeZone.CUSTOM_DAY_LIGHT_SAVING);else{bkEvent.init(),bkEvent.IsSelectedFromPopUp=!1,bkClassAvailableDates.init();var t=new vagaro.ajax;t.datamodel.IsNewVagaroAPI=!0,t.datamodel.Token=n.getonlinebookingtabdetail,t.datamodel.Error=_vgClassSessionSelection.CallFailed2;var i={businessID:1==_vgClassSessionSelection.model.IsOnline?businessID:BusinessID,shouldIncludePakcage:!1,loadClasses_Service_Both:!0,isFromOffline:0==_vgClassSessionSelection.model.IsOnline};"undefined"!=typeof _common&&_common.isCreateLinkPreserve(!0,!0)&&(i.ServiceID=$.isNumeric(_shopdetail.serviceID)?_shopdetail.serviceID:""),_vgClassSessionSelection.GetWBTypeQuerySting()&&_vgClassSessionSelection.GetWBEventQuerySting()?(i.IsNewWebsiteBuilder=!0,i.IncludededClassId=_vgClassSessionSelection.getWBClassIdsData("IncludedIds"),i.ExcludededClassId=_vgClassSessionSelection.getWBClassIdsData("ExcludedIds"),i.IsAllowAllLocation=_vgClassSessionSelection.getWBIsAllowAlllocation()):(i.IsNewWebsiteBuilder=!1,i.IncludededClassId="",i.ExcludededClassId="",i.IsAllowAllLocation=!1),i.Referral=!!getCookie("Referral"),t.datamodel.data=i,t.datamodel.callback=function(e){if(null!=e){if(_vgClassSessionSelection.SetPriceTaxSwitch(e),"undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()&&(_shopdetail.GetWidgetServicesDetail(),!String.isNullOrUndefineOrBlank(_shopdetail.WidgetServicesDetail)&&!String.isNullOrUndefineOrBlank(_shopdetail.WidgetServicesDetail.ServiceIds))){var t=_shopdetail.WidgetServicesDetail.ServiceIds.split("|"),i="";if(t.length>1&&!String.isNullOrUndefineOrBlank(t[1])?i=t[1]:1==t.length&&(i=_shopdetail.WidgetServicesDetail.ServiceIds),!String.isNullOrUndefineOrBlank(i)){if(null!=e.lstOnlineServiceDetail&&e.lstOnlineServiceDetail.length>0){var n=0,o=$.extend(!0,[],e.lstOnlineServiceDetail);e.lstOnlineServiceDetail=$.map(e.lstOnlineServiceDetail,function(e){if(1==_onlineCheckout.CheckFileType(e.serviceID.toString(),i))return n=1,e}),0==n&&0==IsFromMultiLocation&&(e.lstOnlineServiceDetail=o)}if(null!=e.lstOnlineServiceParent&&e.lstOnlineServiceParent.length>0){n=0;var a=0,s=$.extend(!0,[],e.lstOnlineServiceParent);e.lstOnlineServiceParent=$.map(e.lstOnlineServiceParent,function(e){if(1==_onlineCheckout.CheckFileType(e.id.toString(),i)&&(e.children=$.map(e.children,function(e){if(1==_onlineCheckout.CheckFileType(e.id.toString(),i))return n=1,e}),e.children.length>0))return a=1,e}),0==n&&0==a&&0==IsFromMultiLocation&&(e.lstOnlineServiceParent=s)}}}var r=!1,l=null;if(1==_vgClassSessionSelection.model.IsOnline)r=_siteBuilderDetail.ComponentResponse.lstBusinessDetail.IsDisplayPhoneNumber,l=_siteBuilderDetail.ComponentResponse.lstBusinessDetail.Telephone;if(e.lstOnlineServiceParent.length<=0)1==r&&(null!=l||l.length>=10)?(_vgClassSessionSelection.ShowCalltoBook(l),$("#divEmptystate").hide()):(1==_vgClassSessionSelection.model.IsOnline?$("#divEmptystate").show():($("#divSearchCustCls").hide(),$("#divEmptystate").css("display","flex"),$("#divClsEmpty").html("There are no classes available.")),$("#divcalltobook").hide());else if(e.lstOnlineServiceProviderDetail.length<=0||"undefined"!=typeof _common&&1==_common.IsInActiveOnlineBooking(e.lstOnlineServiceProviderDetail))$("#hdnServiceProviderExists").val(!1),1==r&&(null!=l||l.length>=10)?(_vgClassSessionSelection.ShowCalltoBook(l),$("#divEmptystate").hide()):(1==_vgClassSessionSelection.model.IsOnline?$("#divEmptystate").show():($("#divSearchCustCls").hide(),$("#divEmptystate").css("display","flex"),$("#divClsEmpty").html("There are no classes available.")),$("#divcalltobook").hide());else{if($("#divSearchCustCls").show(),$("#hdnServiceProviderExists").val(!0),_vgClassSessionSelection.RemoveAllControlsForClass(),(c=e).lstOnlineServiceParent=$.grep(c.lstOnlineServiceParent,function(e){return 2==e.eventType&&(e.children=$.grep(e.children,function(e){return 1==e.isOnlineService})),e}),_vgClassSessionSelection.BindDropDownForClass(),"undefined"!=typeof isFromReschedual&&"true"==isFromReschedual.toLowerCase()||"true"==isFromRebook.toLowerCase()||_shopdetail.providerID>0||"undefined"!=typeof _common&&_common.isCreateLinkPreserve(!0,!0)||"undefined"!=typeof isGoogle&&"true"==isGoogle.toLowerCase())_vgClassSessionSelection.SetOnlIneBookingDetailForClass(),"undefined"!=typeof isFromReschedual&&"true"==isFromReschedual.toLowerCase()&&0==_vgClassSessionSelection.model.IsOnline&&$("#txtService5").select2("disable");else if("undefined"!=typeof isWaitingtoreal&&"undefined"!=typeof waitlistID&&"undefined"!=typeof WaitlistMain&&"undefined"!=typeof WaitlistEventType&&1==isWaitingtoreal&&0!=waitlistID&&null!=WaitlistMain&&WaitlistEventType==m){null!=WaitlistMain.lstServiceSPForRealAppointment&&WaitlistMain.lstServiceSPForRealAppointment.length>0&&_vgClassSessionSelection.SetClassDataForClass(WaitlistMain.lstServiceSPForRealAppointment[0].ServiceID,WaitlistMain.lstServiceSPForRealAppointment[0].ActualProviderID);var d;d=moment(new Date(WaitlistMain.StartTime)).format("MMM DD,YYYY"),_shopdetail.bookingDateTime=d,WaitlistMain=null}"undefined"!=typeof _shopdetail&&void 0!==_shopdetail.BusinessStartTime&&"undefined"!=e.clsTimeZone&&null!=e.clsTimeZone&&_shopdetail.BusinessStartTime(e.clsTimeZone.TIME_ZONE,e.clsTimeZone.CountryID,e.clsTimeZone.CUSTOM_DAY_LIGHT_SAVING),_vgClassSessionSelection.FillClassDatesForClass()}e.lstOnlineServiceDetail[0]}},t.Post()}1==_vgClassSessionSelection.model.IsOnline&&(redirecttodevicetabname=ClassTabName)},HideShowDisableBookMessageForClass:function(e){e?($("#divBlockBookMessageForClass").show(),$("#divClassAppResultForClass").hide(),$("#divEmptystate").hide()):($("#divBlockBookMessageForClass").hide(),$("#divClassAppResultForClass").show())},RemoveAllControlsForClass:function(){$("#txtService5").select2("data",{id:"",text:""}),_vgClassSessionSelection.SetDefaultForSeleect2($("#txtService5")),$("#txtService5").select2("enable"),$("#divSearchForClass").removeClass("no-serviceselection"),$("#txtSP5").select2("data",{id:"",text:""}),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#txtSP5Mobile").val(""),_vgClassSessionSelection.SetDefaultForSeleect2($("#txtSP5"))},BindDropDownForClass:function(){if(null!=c){var e={dropdownCssClass:"service-what-dropdown service-commondrop service-book-drop classAppSelectNew",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Any Class"};e.collapasable=_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0,e.selectAllText=$("#mobile-check").is(":visible"),e.scrollTop=$("#mobile-check").is(":visible");var t=$("#cboServiceProviderWaitlist_Search");if(c.lstOnlineServiceParent.length>0&&(e.data=c.lstOnlineServiceParent,window.location.href.toLowerCase().indexOf("businesswidget.aspx")>0)){var i=c.lstOnlineServiceParent;try{if(null!=i&&1===i.length&&"undefined"!==i[0].children&&null!=i[0].children&&1===i[0].children.length){var n=i[0].children[0];if($("#hdnClassIDForClass").val(n.id),$("#txtService5").val(n.id).trigger("change"),_vgClassSessionSelection.SetChoiceForSeleect2($("#txtService5"),n),$(".service-namepromo","#divdd-select-search5").html(n.text),n.promotext&&""!==n.promotext){var o=n.isCurrencySymbol?currencySymbol+n.promotext:n.promotext;$(".promo-digit","#divdd-select-search5").html('<div class="vg-service-video"><em></em><span>'+o+"</span></div>"),$("#divdd-select-search5").show()}else $(".promo-digit","#divdd-select-search5").html(""),$(".promo-digit").hide(),$("#divdd-select-search5").show()}}catch(e){}}$("#txtService5").length>0&&new _vgClassSessionSelection.ApplySelect2Controls($("#txtService5"),e);var a=!0;if(null!=_shopdetail.serviceID&&""!=_shopdetail.serviceID){var s=$.extend(!0,[],c.lstOnlineServiceParent),r=_vgClassSessionSelection.GetSelectedServiceDetail(s,_shopdetail.serviceID);t.data("selecteddetail",JSON.stringify(r)),null!=r&&(_vgClassSessionSelection.SetChoiceForSeleect2(t,r),t.select2("data",{id:r.id,text:r.text}),$("#hdnClassIDForClass").val(r.id),_vgClassSessionSelection.bindMobilefilterdata(t,r.id),1==r.hasOwnProperty("eventType")&&void 0!==r.promotext&&""!=r.promotext&&1==(a=_vgClassSessionSelection.ClassPromotionForNewCustomer(r))&&($(".service-namepromo","#divdd-select-search5").html(r.text),$(".promo-digit","#divdd-select-search5").html('<div class="vg-service-video"><em></em><span>'+(1==r.isCurrencySymbol?currencySymbol+r.promotext:r.promotext)+"</span></div>"),$("#divdd-select-search5").show()))}var l={dropdownCssClass:"service-providerdrop classAppSelectNew",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Any Instructor"};if(l.data=c.lstOnlineServiceProviderDetail,l.collapasable=!1,$("#cboServiceProviderWaitlist_Search").length>0&&new _vgClassSessionSelection.ApplySelect2Controls($("#txtSP5"),l),_vgClassSessionSelection.BindServiceProvideReInit("cboServiceProviderWaitlist_Search"),selectedValues=0,"undefined"!=typeof _common&&_common.isCreateLinkPreserve(!0,!0)&&(String.isNullOrUndefineOrBlank(_shopdetail.providerID)||0==_shopdetail.providerID?(_shopdetail.providerID=_common.isCreateLinkPreserve(!1),selectedValues=_shopdetail.providerID):selectedValues=_shopdetail.providerID,(String.isNullOrUndefineOrBlank(_shopdetail.serviceID)||0==_shopdetail.serviceID)&&(_shopdetail.serviceID=getCookie("ServiceID"))),_vgClassSessionSelection.GetWBTypeQuerySting()&&_vgClassSessionSelection.GetWBEventQuerySting()){var d=_vgClassSessionSelection.GetClassIDForWB();void 0!==d&&null!=d&&""!=d&&(_shopdetail.serviceID=parseInt(d))}0==selectedValues&&null!=_shopdetail.PromotionProviderID&&null!=_shopdetail.serviceID&&""!=_shopdetail.serviceID?(selectedValues=_shopdetail.PromotionProviderID.split(","),_vgClassSessionSelection.SetClassDataForClass(_shopdetail.serviceID,selectedValues),a&&($("#hdnInstructorIDForClass").val(_shopdetail.PromotionProviderID),$("#cboServiceProviderWaitlist_Search").data("ClassPromotionProviderID",_shopdetail.PromotionProviderID)),$("#cboServiceProviderWaitlist_Search").val(selectedValues).trigger("change")):_vgClassSessionSelection.BindServiceProviderWaitlist_Serachpopup("cboServiceProviderWaitlist_Search",selectedValues),"undefined"!=typeof _common&&_common.isCreateLinkPreserve(!0,!0)&&$("#cboServiceProviderWaitlist_Search").attr("disabled","disabled")}$(".service-searchinput input").attr("autocomplete","off")},SetOnlIneBookingDetailForClass:function(){if(_vgClassSessionSelection.model.IsSearchFromInHouseClass||"true"==isGoogle&&(microServiceID=_shopdetail.serviceID),"undefined"!=typeof isFromReschedual&&"true"==isFromReschedual.toLowerCase()){var e={};e.EventSessionAttendeesId=parseInt(EventSessionAttendeesId),e.serviceID=parseInt(_shopdetail.serviceID),e.providerID=parseInt(_shopdetail.providerID),$("#hdnRescheduleDetail").val(JSON.stringify(e))}(null!=_shopdetail.serviceID&&""!=_shopdetail.serviceID||null!=_shopdetail.providerID&&""!=_shopdetail.providerID)&&1!=_shopdetail.isClassCalenderFilled?(ShowLoader(!0),0!=$("#hdnServiceProviderExists").val()?_vgClassSessionSelection.SetClassDataForClass(_shopdetail.serviceID,_shopdetail.providerID):ShowLoader(!1)):ShowLoader(!1)},SetClassDataForClass:function(e,t){var i=new Array;""!=t&&0!=t&&null!=t||("undefined"!=typeof _common&&void 0!==_common.IsWidgetForServiceProvider&&1==_common.IsWidgetForServiceProvider(!0)?t=_common.IsWidgetForServiceProvider(!1):"true"==isGoogle&&(t="-1")),Array.isArray(t)?i=t:$.grep(t.toString().split(","),function(e){i.push(e)}),"undefined"!=typeof _common&&_common.isCreateLinkPreserve(!0,!0)&&(String.isNullOrUndefineOrBlank(_shopdetail.providerID)&&0==_shopdetail.providerID||Array.isArray(_shopdetail.providerID)?(_shopdetail.providerID=_common.isCreateLinkPreserve(!1),i=_shopdetail.providerID):i=_shopdetail.providerID.split(","),(String.isNullOrUndefineOrBlank(_shopdetail.serviceID)||0==_shopdetail.serviceID)&&(_shopdetail.serviceID=getCookie("ServiceID"))),_vgClassSessionSelection.BindServiceProviderWaitlist_Serachpopup("cboServiceProviderWaitlist_Search",i);var n="undefined"!=typeof _common?_common.isCreateLinkPreserve(!1):"";if("undefined"==typeof _common||!_common.isCreateLinkPreserve(!0,!0)||Array.isArray(n)&&"-1"==n.join(",")||$("#cboServiceProviderWaitlist_Search").attr("disabled","disabled"),null!=t&&""!=t&&t>0&&null!=c){var o=$.extend(!0,[],c.lstOnlineServiceProviderDetail);if(null!=(s=_vgClassSessionSelection.GetSelectedSPDetail(o,t))){var a=$("#txtSP5");a.data("selecteddetail",JSON.stringify(s)),void 0!==a.data("choice")&&_vgClassSessionSelection.SetChoiceForSeleect2(a,s),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#txtSP5Mobile").val(s.id),a.select2("data",{id:s.id,text:s.text})}$("#hdnInstructorIDForClass").val(t)}else $("#hdnInstructorIDForClass").val("");if(null!=e&&""!=e&&parseInt(e)>0&&null!=c){var s;o=$.extend(!0,[],c.lstOnlineServiceParent);if(null!=(s=_vgClassSessionSelection.GetSelectedServiceDetail(o,e))){var r=$("#txtService5");_vgClassSessionSelection.SetControls(s.eventType),r.data("selecteddetail",JSON.stringify(s)),void 0!==r.data("choice")&&_vgClassSessionSelection.SetChoiceForSeleect2(r,s),r.select2("data",{id:s.id,text:s.text})}$("#hdnClassIDForClass").val(e)}else $("#hdnClassIDForClass").val("");var l=new Array;l.push(t),"undefined"!=typeof _common&&_common.isCreateLinkPreserve(!0,!0)&&(String.isNullOrUndefineOrBlank(_shopdetail.providerID)&&0==_shopdetail.providerID||Array.isArray(_shopdetail.providerID)?_shopdetail.providerID=_common.isCreateLinkPreserve(!1):l=_shopdetail.providerID.split(","),(String.isNullOrUndefineOrBlank(_shopdetail.serviceID)||0==_shopdetail.serviceID)&&(_shopdetail.serviceID=getCookie("ServiceID"))),_vgClassSessionSelection.BindServiceProviderWaitlist_Serachpopup("cboServiceProviderWaitlist_Search",l);var d="undefined"!=typeof _common?_common.isCreateLinkPreserve(!1):"";"undefined"==typeof _common||!_common.isCreateLinkPreserve(!0,!0)||Array.isArray(d)&&"-1"==d.join(",")||$("#cboServiceProviderWaitlist_Search").attr("disabled","disabled")},IsWidgetForServiceProvider:function(e){return!String.isNullOrUndefineOrBlank(_shopdetail.isWidget)&&"true"==_shopdetail.isWidget&&!String.isNullOrUndefineOrBlank(_shopdetail.WidgetSpId)&&_shopdetail.WidgetSpId>0&&(1==e||_shopdetail.WidgetSpId)},BindServiceProviderWaitlistSetValue_Serachpopup:function(e,t){$("#"+e).val(t);$("#"+e+" option:selected").val();var i="Select Professional";"undefined"!=typeof lServiceID&&null!=lServiceID&&""!=lServiceID&&"-1"!=lServiceID?(i=$("#"+e+" option:selected").text(),$("#select2-"+e+"-container").attr("title",i),$("#select2-"+e+"-container").html(i)):($("#select2-"+e+"-container").attr("title",i),$("#select2-"+e+"-container").html(i))},BindServiceProvideReInit:function(e){$("#"+e).pumselect2().on("select2:open",function(e){$("span.select2-container.select2-container--default.select2-container--open").addClass("fullServiceAjax-dropdownList"),$("span.select2-container.select2-container--default.select2-container--open").addClass("presetdiscount-dropdownMultiCustom"),$("span.select2-container.select2-container--default.select2-container--open").addClass("vagaro-dropdown-multiselect"),$("span.select2-container.select2-container--default.select2-container--open").addClass("serviceProviderCust"),$("span.select2-container.select2-container--default.select2-container--open").addClass("dd-service-dropdown"),$("span.select2-container.select2-container--default.select2-container--open").addClass("deal-service-dropdown"),$("span.select2-container.select2-container--default.select2-container--open").addClass("dd-class-dropdown-css"),$("span.select2-container.select2-container--default.select2-container--open").addClass("inMobileFullscreeen"),$("span.select2-container.select2-container--default.select2-container--open").addClass("multi-serarchbox-design")})},BindServiceProviderWaitlist_Serachpopup:function(e,t){var i;""!=t&&0!=t&&null!=t||"undefined"!=typeof _common&&void 0!==_common.IsWidgetForServiceProvider&&1==_common.IsWidgetForServiceProvider(!0)&&(t=_common.IsWidgetForServiceProvider(!1),$("#cboServiceProviderWaitlist_Search").attr("disabled","disabled"),$("#hdnInstructorIDForClass").val(t));var n=$("#"+e);void 0!==n.data("select2")&&n.pumselect2("destroy"),n.pumselect2({placeholder:"Service Provider",closeOnSelect:!1,templateResult:function(e){if(!e.id)return e.text;var t=n.data("ClassPromotionProviderID");if(void 0!==n.data("ClassPromotionProviderID")&&null!=n.data("ClassPromotionProviderID")||(t=""),""!==t&&t.split(",").includes(e.id)&&0==e.disabled){var o=getCookie("Referral");if(void 0===o||""==o||null==o||null==o){if(void 0!==i&&null!=i&&!i.IsDailyDealApply)var a=$('<span class="multicheck-checkbox"></span><label class="labelpadd">'+e.text+'<div class="promo-digit percent-off-text w-inline-block badge-button-positive ml-2 srv-badge-title-promo srv-drp-bedge"><div class="vg-service-video"><em>&#xf02b</em><span>Daily Deal</span></div></div></label')}else a=$('<span class="multicheck-checkbox"></span><label class="labelpadd">'+e.text+'<div class="promo-digit percent-off-text w-inline-block badge-button-positive ml-2 srv-badge-title-promo srv-drp-bedge"><div class="vg-service-video"><em>&#xf02b</em><span>Daily Deal</span></div></div></label')}else a=$('<span class="multicheck-checkbox"></span><label class="labelpadd">'+e.text+"</label>");return a}}).on("select2:open",function(e){$("span.select2-container.select2-container--default.select2-container--open").addClass("fullServiceAjax-dropdownList"),$("span.select2-container.select2-container--default.select2-container--open").addClass("presetdiscount-dropdownMultiCustom"),$("span.select2-container.select2-container--default.select2-container--open").addClass("serviceProviderCust"),$("span.select2-container.select2-container--default.select2-container--open").addClass("dd-service-dropdown"),$("span.select2-container.select2-container--default.select2-container--open").addClass("deal-service-dropdown"),$("span.select2-container.select2-container--default.select2-container--open").addClass("dd-class-dropdown-css"),$("span.select2-container.select2-container--default.select2-container--open").addClass("inMobileFullscreeen"),$("span.select2-container.select2-container--default.select2-container--open").addClass("multi-serarchbox-design");var t=$("#cboServiceProviderWaitlist_Search > option").length+1!=$("#cboServiceProviderWaitlist_Search  :selected").length&&0!=$("#cboServiceProviderWaitlist_Search  :selected").length?$("#cboServiceProviderWaitlist_Search").val().join(","):"";(t=t.split(","),_vgClassSessionSelection.commonProperty.MultiSPIdOpen=t,_vgClassSessionSelection.commonProperty.MultiSPIsClose=!1,$("#mobile-check").is(":visible")&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof IsSupportNewDialogApp&&IsSupportNewDialogApp)?CallbackforMobileApp(0,0,"","",0,"50|~|"+('{\\"returnObject\\": {\\"ControlId\\": \\"'+("#"+e.currentTarget.id)+'\\"}}')):$(".dd-employee-btn").show();$(".select2-search__field",".inMobileFullscreeen").attr("placeholder","Search Instructors"),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.VisibleControlLength&&_shopdetail.VisibleControlLength("#mobile-check")>0&&($(".dd-mobile-emp-heading").text("Instructor"),$(".dd-mobile-emp-heading").show()),setTimeout(function(){$("html, body").scrollTop(0)},20)}).on("select2:close",function(e){if(!_vgClassSessionSelection.commonProperty.MultiSPIsClose){var t=$("#cboServiceProviderWaitlist_Search > option").length+1!=$("#cboServiceProviderWaitlist_Search  :selected").length&&0!=$("#cboServiceProviderWaitlist_Search  :selected").length?$("#cboServiceProviderWaitlist_Search").val().join(","):"";$("#hdnInstructorIDForClass").val(t),t=t.split(","),_vgClassSessionSelection.CompareTwoArray(t,_vgClassSessionSelection.commonProperty.MultiSPIdOpen)||_vgClassSessionSelection.FillClassDatesForClass()}_vgClassSessionSelection.commonProperty.MultiSPIsClose=!0,$("#mobile-check").is(":visible")&&"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&"undefined"!=typeof IsSupportNewDialogApp&&IsSupportNewDialogApp&&CallbackforMobileApp(0,0,"","",0,"50|~|2"),$(".dd-employee-btn").hide(),$(".dd-mobile-emp-heading").hide()}),n.empty(),$('input[type="search"]').attr("readonly",!0),$('input[type="search"]').css("cursor","pointer");var o=JSON.parse($("#hdnStrSpList").val()),a=$.extend(!0,[],o),s=$.extend(!0,[],o);"GCPromo"==$("#txtService5").data("type")&&$("#txtService5").data("GCPromoList",s);var r=$("#txtService5").data("choice");if(""!=r)try{var l=JSON.parse(r);l.hasOwnProperty("id")&&""!=l.id&&(a=_vgClassSessionSelection.FilterSPOffline(s,l)),i=l}catch(e){}$.grep(a,function(e){0==e.isServiceProvide?(void 0!==t&&null!=t&&""!=t&&(t=jQuery.grep(t,function(t){return t!=e.ServiceProviderID})),n.append($("<option disabled></option>").val(e.ServiceProviderID).html(e.ServiceProviderName))):n.append($("<option></option>").val(e.ServiceProviderID).html(e.ServiceProviderName))}),n.data("isSkipChangeEvent",!0);try{var d="#"+e;if(1==$(d+" > option").length){var u=new Array;u.push($(d+" > option").val()),n.val(u).trigger("change"),$(d).attr("disabled","disabled")}else window.location.href.toLowerCase().indexOf("businesswidget.aspx")>0&&void 0!==c.lstOnlineServiceParent&&null!=c.lstOnlineServiceParent&&c.lstOnlineServiceParent.length>0&&1===c.lstOnlineServiceParent[0].children.length&&(t=_common.IsWidgetForServiceProvider(!1)),void 0!==t&&null!=t&&""!=t?n.val(t).trigger("change"):n.val("").trigger("change")}catch(e){n.val("").trigger("change")}},CompareTwoArray:function(e,t){if(e.length!=t.length)return!1;var i=jQuery.extend(!0,[],e),n=jQuery.extend(!0,[],t);i.sort(),n.sort();for(var o=0,a=i.length;o<a;o++)if(i[o]!==n[o])return!1;return!0},GetSelectedSPDetail:function(e,t){var i=$.grep(e,function(e){return e.id==t});return i.length>0?i[0]:null},GetSelectedServiceDetail:function(e,t){var i=$.grep(e,function(e){var i=$.grep(e.children,function(e){return e.id==t});return null!=i&&i.length>0&&(e.children=i,!0)});return i.length>0&&i[0].children.length>0?i[0].children[0]:null},ApplySelect2Controls:function(e,t){void 0!==t.placeholder&&""!=t||((t={}).dropdownCssClass="",t.isSearchRequire=!1,t.selectOnClick=!0,t.placeholder="",t.maxInputLen=100),void 0===t.maxInputLen&&(t.maxInputLen=100),"2"==e.data("type")&&void 0!==t.data&&_vgClassSessionSelection.bindMobileOptions(t.data,e.attr("id"),""),e.select2("destroy"),e.off("selected"),e.off("select2-close"),e.select2({searchInputPlaceholder:void 0!==t.placeholder&&""!=t.placeholder?t.placeholder:"",combobox:t.isSearchRequire,collapasable:_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&t.collapasable,selectOnClick:!0,minimumInputLength:0,maximumInputLength:100,dropdownCssClass:t.dropdownCssClass,formContainer:"#page-wrapper",data:function(){if(void 0!==t.data){var i=$.extend(!0,[],t.data),n=$.extend(!0,[],t.data);if("GCPromo"==e.data("type")&&e.data("GCPromoList",n),"2"==e.data("type")){var o=$("#txtService"+e.data("section")).data("choice");if(""!=o)try{var a=JSON.parse(o);a.hasOwnProperty("id")&&""!=a.id&&(i=_vgClassSessionSelection.FilterSP(n,a))}catch(e){}var s={id:"-1"};0==_vgClassSessionSelection.model.IsOnline||1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName==ClassTabName?s.text="Select Any Instructor":s.text="Select Any Provider",s.cssClass="currentlocation-icon",s.type="Any",i.splice(0,0,s)}else if("1"==e.data("type")){var r=$("#txtSP"+e.data("section")).data("choice");if(""!=r)try{var l=JSON.parse(r);if(l.hasOwnProperty("id")&&""!=l.id&&(i=_vgClassSessionSelection.FilterService(n,l)),0==_vgClassSessionSelection.model.IsOnline||1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName==ClassTabName){s={id:"-1",text:"Select Any Class",cssClass:"currentlocation-icon",type:"Any"};i.splice(0,0,s)}}catch(e){}}return{results:i}}return null},initSelection:function(e,t){},formatResult:function(t){var i=_vgClassSessionSelection.ClassPromotionForNewCustomer(t),n=getCookie("Referral");return(void 0===n||""==n||null==n||null==n)&&t.IsDailyDealApply?1==t.hasOwnProperty("eventType")&&void 0!==t.IsZoomIntegrated&&1==t.IsZoomIntegrated?markup='<div class="promodigittextrow"><div class="service-namepromo w-inline-block">'+t.text+'</div> <div class="w-inline-block font-awesome solid sm-booknow-video">&#xf03d;<div></div>':1==t.hasOwnProperty("eventType")&&void 0!==t.isOutCallService&&1==t.isOutCallService?markup='<div class="promodigittextrow"><div class="service-namepromo w-inline-block">'+t.text+'</div> <div class="w-inline-block font-awesome solid sm-car-icon">&#xf1b9;<div></div>':markup=t.text:"GCPromo"!=e.data("type")||void 0===t.promotext||""==t.promotext||_vgClassSessionSelection.model.IsSearchFromInHouseClass?1!=t.hasOwnProperty("eventType")||void 0===t.promotext||""==t.promotext||_vgClassSessionSelection.model.IsSearchFromInHouseClass?1==t.hasOwnProperty("eventType")&&void 0!==t.IsZoomIntegrated&&1==t.IsZoomIntegrated?markup='<div class="promodigittextrow"><div class="service-namepromo w-inline-block">'+t.text+'</div> <div class="w-inline-block font-awesome solid sm-booknow-video">&#xf03d;<div></div>':1==t.hasOwnProperty("eventType")&&void 0!==t.isOutCallService&&1==t.isOutCallService?markup='<div class="promodigittextrow"><div class="service-namepromo w-inline-block">'+t.text+'</div> <div class="w-inline-block font-awesome solid sm-car-icon">&#xf1b9;<div></div>':markup=t.text:void 0!==t.IsZoomIntegrated&&1==t.IsZoomIntegrated?markup='<div class="promodigittextrow"> <div class="service-namepromo w-inline-block">'+t.text+'</div><div><div class="promo-digit percent-off-text w-inline-block badge-button-alert">'+(1==t.isCurrencySymbol?currencySymbol+t.promotext:t.promotext)+' </div> <div class="w-inline-block font-awesome solid sm-booknow-video">&#xf03d;<div></div> </div>':1==t.hasOwnProperty("eventType")&&void 0!==t.isOutCallService&&1==t.isOutCallService?markup='<div class="promodigittextrow"> <div class="service-namepromo w-inline-block">'+t.text+'</div><div><div class="promo-digit percent-off-text w-inline-block badge-button-alert">'+(1==t.isCurrencySymbol?currencySymbol+t.promotext:t.promotext)+' </div> <div class="w-inline-block font-awesome solid sm-car-icon">&#xf1b9;<div></div> </div>':markup=1==i?'<div class="promodigittextrow srv-drp-bedge class-text-para"> <div class="service-namepromo w-inline-block">'+t.text+'</div><div><div class="promo-digit percent-off-text w-inline-block badge-button-positive srv-drp-bedge"><div class="vg-service-video"><em>&#xf02b</em><span>'+(1==t.isCurrencySymbol?currencySymbol+t.promotext:t.promotext)+"</span></div></div></div></div></div>":'<div class="promodigittextrow"><div class="service-namepromo w-inline-block">'+t.text+"</div>":markup='<div class="promodigittextrow"> <div class="w-inline-block">'+t.text+' <span class="promo-bold">('+(1==t.isCurrencySymbol?currencySymbol+t.promotext:t.promotext)+")</span></div></div>",markup},matcher:function(t,i,n){var o=/\s\s+/g,a=/[^0-9a-zA-Z\" \"]+/gi,s=/[^0-9a-zA-Z\"\. \"]+/gi;if("1"==e.data("type")){var r=t.lastIndexOf("(");-1!=r&&(t=t.substring(0,r-1))}else if("2"==e.data("type")&&("Select Any Provider"==i||"Select Any Instructor"==i))return!0;for(var l=t.replace(o," "),c=(l="GCPromo"==e.data("type")?l.toLowerCase().replace(s,""):l.toLowerCase().replace(a,"")).split(" "),d="",u=c.length,p=0,h=0;h<=c.length-1;h++){var m=i.replace(o," ");if(((m="GCPromo"==e.data("type")?m.toLowerCase().replace(s,""):m.toLowerCase().replace(a,"")).match("^"+c[h])||-1!=m.indexOf(" "+c[h]))&&((""==d||c[h].indexOf(d)<0)&&(p+=1),d=" "+m,p>=u))break}return p>=u&&("#txtGCPromoAmount"==e.selector&&$("#select2-drop").show(),n.isShow=!0,!0)},formatNoMatches:function(){if("#txtGCPromoAmount"!=e.selector)return $(".select2-results .select2-no-results").remove(),"No matches found";$("#select2-drop").hide()}}).on("selected",function(t){if(_vgClassSessionSelection.closeServiceSelection(),"txtService5"==t.currentTarget.id||"txtSP5"==t.currentTarget.id){"txtService5"==t.currentTarget.id?-1==t.choice.id?$("#hdnClassIDForClass").val(""):$("#hdnClassIDForClass").val(t.choice.id):"txtSP5"==t.currentTarget.id&&(-1==t.choice.id?$("#hdnInstructorIDForClass").val(""):$("#hdnInstructorIDForClass").val(t.choice.id)),_vgClassSessionSelection.FillClassDatesForClass(),_vgClassSessionSelection.bindMobilefilterdata(e,t.choice),$(t.target).data("selecteddetail",JSON.stringify(t.choice)),void 0!==e.data("choice")&&_vgClassSessionSelection.SetChoiceForSeleect2(e,t.choice);var i=$("#cboServiceProviderWaitlist_Search > option").length+1!=$("#cboServiceProviderWaitlist_Search  :selected").length&&0!=$("#cboServiceProviderWaitlist_Search  :selected").length?$("#cboServiceProviderWaitlist_Search").val().join(","):"";return i=i.split(","),_vgClassSessionSelection.BindServiceProviderWaitlist_Serachpopup("cboServiceProviderWaitlist_Search",i),void(_vgClassSessionSelection.ClassPromotionForNewCustomer(t.choice)?$("#cboServiceProviderWaitlist_Search").data("ClassPromotionProviderID",t.choice.PromotionProviders):$("#cboServiceProviderWaitlist_Search").data("ClassPromotionProviderID",null))}if("GCPromo"==e.data("type")&&(_vgClassSessionSelection.bindMobilefilterdata(e,t.choice),$(t.target).data("selecteddetail",JSON.stringify(t.choice)),void 0!==e.data("choice")&&_vgClassSessionSelection.SetChoiceForSeleect2(e,t.choice)),"1"==e.data("type")){$("#hdnStyleID").val(""),_shopdetail.PromotionID="",_vgClassSessionSelection.clearCookie("PromotionID"),$("#hdnPromotionID").val("");var n=!1;if(void 0!==e.data("isstatic")){var o=null,a=$("#txtService1").data("selecteddetail");if(""!=a)try{o=JSON.parse(a).eventType}catch(t){o=null}(null!=o&&t.choice.eventType!=o||t.choice.eventType==p)&&(_vgClassSessionSelection.RemoveAllControls(),t.choice.eventType==h&&_vgClassSessionSelection.GetAvailibilityForService(!1,!1),1==_shopdetail.isClassCalenderFilled&&t.choice.eventType==m&&(n=!0)),null==o||(o!=p&&o!=h||t.choice.eventType!=m)&&(o!=m||t.choice.eventType!=p&&t.choice.eventType!=h)||t.choice.eventType!=p&&t.choice.eventType!=h||HideShowClassServiceAndClearControl(!1)}_vgClassSessionSelection.SetControls(t.choice.eventType),HideShowWaitlistButton(!1),t.choice.eventType==p?($("#divSearch").addClass("no-serviceselection"),$("#mobile-appointments").prop("checked",!1),$("#dvOutCallSection").hide(),$("#Book24Container").hide(),$("#ucServiceCombo_hidEventType").val(""),_vgClassSessionSelection.SetServiceBundle(t.choice.id),_vgClassSessionSelection.GetAvailibilityForService(!0,!1)):(_vgClassSessionSelection.bindMobilefilterdata(e,t.choice),$("#divSearch").removeClass("no-serviceselection"),$("#ucServiceCombo_hidEventType").val(t.choice.eventType.toString()),_vgClassSessionSelection.AddServiceButtonDisplay(),$("#Book24Container").hide()),t.choice.eventType==h?1==_vgClassSessionSelection.OutCallCalculation(e.data("section"),t.choice)&&($(t.target).data("selecteddetail",JSON.stringify(t.choice)),void 0!==e.data("choice")&&(_vgClassSessionSelection.SetChoiceForSeleect2(e,t.choice),$("#txtSP"+e.data("section")).select2("enable"),1==l.lstOnlineServiceProviderDetail.length&&($("#txtSP"+e.data("section")).select2("disable"),$("#txtSP"+e.data("section")).select2("data",{id:l.lstOnlineServiceProviderDetail[0].id,text:l.lstOnlineServiceProviderDetail[0].text})))):($(t.target).data("selecteddetail",JSON.stringify(t.choice)),void 0!==e.data("choice")&&_vgClassSessionSelection.SetChoiceForSeleect2(e,t.choice)),t.choice.eventType==m&&($("#dvOutCallSection").hide(),HideShowClassServiceAndClearControl(!0),1==n||(_shopdetail.isClassCalenderFilled=!1))}else"2"==e.data("type")&&"-1"!=t.val&&_vgClassSessionSelection.onProviderSelect($(t.target),t.choice)}).on("select2-opening",function(t){e.select2("data",{id:"",text:""}),"txtGCPromoAmount"==t.currentTarget.id&&$("#"+t.currentTarget.id).data("selecteddetail",""),$("#cboServiceProviderWaitlist_Search").select2("close"),$("#cboServiceProviderWaitlist_Search1").select2("close"),$("#cboServiceProviderWaitlist_Search2").select2("close")}).on("select2-open",function(i){var n=_vgClassSessionSelection.GetChoiceForSeleect2(e);void 0!==n.id&&"txtGCPromoAmount"!=i.currentTarget.id&&e.select2("data",{id:n.id,text:n.text}),(void 0===t.selectAllText||t.selectAllText)&&setTimeout(function(){$(i.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)},100),($(i.target).attr("id").indexOf("txtService")>=0||"GCPromo"==e.data("type"))&&("GCPromo"==e.data("type")&&($("#dvInnerGCContainer").length&&$("#dvInnerGCContainer").addClass("gc-transformnone"),$(i.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common")),$(i.target).closest(".service-book-what").addClass("book-service-open"),setTimeout(function(){$("html, body").addClass("moboverflow-hide")},200),$("#select2-drop-mask").addClass("hidemask"),(void 0===t.scrollTop||t.scrollTop)&&setTimeout(function(){$("html, body").scrollTop(0)},50),(void 0===t.selectAllText||t.selectAllText)&&setTimeout(function(){$(i.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)},100))}).on("change",function(t){if(void 0!==e.data("choice")&&"2"==e.data("type")&&!e.data("select2").opened()){var i=e.data("select2").getVal().toString(),n=_vgClassSessionSelection.GetChoiceForSeleect2(e);""!=i&&void 0!==n.id&&""!=n.id||"txtSP5"!=t.currentTarget.id&&_vgClassSessionSelection.GetAvailibilityForService(!1,!0)}}).on("select2-close",function(t){if(_vgClassSessionSelection.closeServiceSelection(),$("#select2-drop-mask").removeClass("hidemask"),setTimeout(function(){$("#select2-drop-mask").off("touchstart.custom")},500),void 0!==e.data("choice")){var i=e.data("select2").getVal().toString(),n=_vgClassSessionSelection.GetChoiceForSeleect2(e);if(""!=i&&"Select Any Provider"!=i&&"Select Any Instructor"!=i&&"Select Any Class"!=i&&void 0!==n.id){var o=getCookie("Referral");if(void 0===o||""==o||null==o||null==o)if(n.IsDailyDealApply)"GCPromo"==e.data("type")?($(".txtAmounterrortext").hide(),$("#txtGCPromoAmount").removeClass("errorInput"),i==n.text?(e.select2("data",{id:n.id,text:n.text+" ("+n.promotext+")"}),"txtGCPromoAmount"==t.currentTarget.id&&$("#div_amount").html("$"+n.Price.toFixed(2).replace(".00",""))):_vgClassSessionSelection.BindGCpromoPrice(e,i)):e.select2("data",{id:n.id,text:n.text}),""==n.id&&_vgClassSessionSelection.bindMobilefilterdata($("#txtSP"+e.data("section")),null);else{if("1"!=e.data("type")||1!=n.hasOwnProperty("eventType")||void 0===n.promotext||""==n.promotext||_vgClassSessionSelection.model.IsSearchFromInHouseClass)"GCPromo"==e.data("type")?($(".txtAmounterrortext").hide(),$("#txtGCPromoAmount").removeClass("errorInput"),i==n.text?(e.select2("data",{id:n.id,text:n.text+" ("+n.promotext+")"}),"txtGCPromoAmount"==t.currentTarget.id&&$("#div_amount").html("$"+n.Price.toFixed(2).replace(".00",""))):_vgClassSessionSelection.BindGCpromoPrice(e,i)):e.select2("data",{id:n.id,text:n.text});else if(1==_vgClassSessionSelection.ClassPromotionForNewCustomer(n))e.select2("data",{id:n.id,text:n.text+" ("+(1==n.isCurrencySymbol?currencySymbol+n.promotext:n.promotext)+")"}),a=(a=e.selector).replace("txtService","divdd-select-search"),$(".service-namepromo",a).html(n.text),$(".promo-digit",a).html('<div class="vg-service-video"><em></em><span>'+(1==n.isCurrencySymbol?currencySymbol+n.promotext:n.promotext)+"</span></div>"),$(a).show();else e.select2("data",{id:n.id,text:n.text});""==n.id&&_vgClassSessionSelection.bindMobilefilterdata($("#txtSP"+e.data("section")),null)}else{var a;if("1"!=e.data("type")||1!=n.hasOwnProperty("eventType")||void 0===n.promotext||""==n.promotext||_vgClassSessionSelection.model.IsSearchFromInHouseClass)"GCPromo"==e.data("type")?($(".txtAmounterrortext").hide(),$("#txtGCPromoAmount").removeClass("errorInput"),i==n.text?(e.select2("data",{id:n.id,text:n.text+" ("+n.promotext+")"}),"txtGCPromoAmount"==t.currentTarget.id&&$("#div_amount").html("$"+n.Price.toFixed(2).replace(".00",""))):_vgClassSessionSelection.BindGCpromoPrice(e,i)):e.select2("data",{id:n.id,text:n.text});else if(1==_vgClassSessionSelection.ClassPromotionForNewCustomer(n))e.select2("data",{id:n.id,text:n.text+" ("+(1==n.isCurrencySymbol?currencySymbol+n.promotext:n.promotext)+")"}),a=(a=e.selector).replace("txtService","divdd-select-search"),$(".service-namepromo",a).html(n.text),$(".promo-digit",a).html('<div class="vg-service-video"><em></em><span>'+(1==n.isCurrencySymbol?currencySymbol+n.promotext:n.promotext)+"</span></div>"),$(a).show();else e.select2("data",{id:n.id,text:n.text});""==n.id&&_vgClassSessionSelection.bindMobilefilterdata($("#txtSP"+e.data("section")),null)}}else"GCPromo"==e.data("type")?_vgClassSessionSelection.BindGCpromoPrice(e,i):e.select2("data",{id:"",text:""}),_vgClassSessionSelection.bindMobilefilterdata($("#txtSP"+e.data("section")),null),_vgClassSessionSelection.SetDefaultForSeleect2(e)}(iPadAndroid||isWindowsPhone)&&(1==("undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase())?document.activeElement.blur():$("#ancSearchbook:visible").focus())}),(e.attr("id").indexOf("txtService")>=0||"GCPromo"==e.data("type"))&&e.on("select2-focus",function(i){setTimeout(function(){"GCPromo"==e.data("type")&&($("#dvInnerGCContainer").length&&$("#dvInnerGCContainer").addClass("gc-transformnone"),$(i.target).closest("div:not(.service-mob-commoninput)").addClass("book-service-open-common")),$(i.target).closest(".service-book-what").addClass("book-service-open"),$("#select2-drop-mask").addClass("hidemask"),setTimeout(function(){$("html, body").addClass("moboverflow-hide")},200),(void 0===t.scrollTop||t.scrollTop)&&$("html, body").scrollTop(0)},200)}),1==_vgClassSessionSelection.model.IsOnline&&applyJqueryScroll(".select2-results")},FillClassDatesForClass:function(){var e=_vgClassSessionSelection.GetSessionStorage(_vgClassSessionSelection.model.EventStorage);$("#lblEventCart").html(e.length);var t;if(bkClassAvailableDates.model.csvServiceID=$("#hdnClassIDForClass").val(),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking&&($("#cboServiceProviderWaitlist_Search")[0],null!=$("#cboServiceProviderWaitlist_Search")[0]&&null!=$("#cboServiceProviderWaitlist_Search")[0]&&($("#cboServiceProviderWaitlist_Search")[0].options,1)&&null!=$("#cboServiceProviderWaitlist_Search")[0].options&&null!=$("#cboServiceProviderWaitlist_Search")[0].options)){var i=[];if($.each($("#cboServiceProviderWaitlist_Search")[0].options,function(e,t){t.selected&&i.push(t)}),0==i.length){var o=Array.from($("#cboServiceProviderWaitlist_Search")[0].options).map(function(e){return e.value});$("#hdnInstructorIDForClass").val(o.join(","))}}if(bkClassAvailableDates.model.csvSPID=$("#hdnInstructorIDForClass").val(),1==_vgClassSessionSelection.model.IsOnline){var a=getCookie("IsFilterClassCookieName");void 0!==a&&1==a&&($(_vgClassSessionSelection.Controls.ddlFilterTypes).val(_vgClassSessionSelection.StreamingFilterType.LiveStream),clearCookie("IsFilterClassCookieName"))}if(bkClassAvailableDates.model.csvFilterType=$(_vgClassSessionSelection.Controls.ddlFilterTypes).val(),null!=(t=bkClassAvailableDates.getResponseFromCache()))_vgClassSessionSelection.FillClassDatesCallbackForClass(t);else{var s=bkClassAvailableDates.model.csvServiceID,r=bkClassAvailableDates.model.csvSPID,l=bkClassAvailableDates.model.csvFilterType;void 0!==_shopdetail.lastClassBookingDateConfigured&&(_shopdetail.lastClassBookingDateConfigured=!1);var c=new vagaro.ajax;c.datamodel.Token=n.getavailabledatesforevents,c.datamodel.IsNewVagaroAPI=!0,c.datamodel.Error=_vgClassSessionSelection.CallFailed2;var d={};d.businessID=1==_vgClassSessionSelection.model.IsOnline?businessID:BusinessID,"undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.getFilteredServiceProviderId&&1==_shopdetail.IsLimitOnlineBooking&&(r=_shopdetail.getFilteredServiceProviderId(r)),d.sPIDs=r,d.eventIds=s,d.isFromOffline=0==_vgClassSessionSelection.model.IsOnline,d.streamingStatus=l,"undefined"==typeof _siteBuilderDetail||String.isNullOrUndefineOrBlank(_siteBuilderDetail)||String.isNullOrUndefineOrBlank(_siteBuilderDetail.UserLocationInfo)||String.isNullOrUndefineOrBlank(_siteBuilderDetail.UserLocationInfo.objUserCustomData)?d.widgetServiceId=0:d.widgetServiceId=parseInt(_siteBuilderDetail.UserLocationInfo.objUserCustomData.WidgetServiceId),_vgClassSessionSelection.GetWBTypeQuerySting()&&_vgClassSessionSelection.GetWBEventQuerySting()?(d.IsNewWebsiteBuilder=!0,d.IncludededClassId=_vgClassSessionSelection.getWBClassIdsData("IncludedIds"),d.ExcludededClassId=_vgClassSessionSelection.getWBClassIdsData("ExcludedIds"),d.IsAllowAllLocation=_vgClassSessionSelection.getWBIsAllowAlllocation()):(d.IsNewWebsiteBuilder=!1,d.IncludededClassId="",d.ExcludededClassId="",d.IsAllowAllLocation=!1),c.datamodel.data=d,ShowLoader(!0),c.datamodel.callback=_vgClassSessionSelection.FillClassDatesCallbackForClass,c.Post()}},ShowCalltoBook:function(e){var t;10==e.length&&11==e.length||(t=e.replace(/\D/g,""),e=t);var i=null;10!=e.length&&11!=e.length||(i=_vgClassSessionSelection.FormatPhone(e)),$("#divcalltobook").show(),10==e.length||11==e.length?$(".dang-description").html("Call the business to book a class: <a class='text-link-primary' style='cursor: pointer;text-decoration: underline;' href='tel:"+e+"' > "+i+"</a>."):$(".dang-description").html("Call the business to book a class: <a class='text-link-primary' style='cursor: pointer;text-decoration: underline;' href='#' > "+e+"</a>.")},FormatPhone:function(e){var t;11==e.length?t={0:"(",4:") ",7:"-"}:10==e.length&&(t={0:"(",3:") ",6:"-"});for(var i=e.replace(/\D/g,""),n=(e="",0);n<i.length;n++)e+=(t[n]||"")+i[n];return e},FilterSP:function(e,t){return $.grep(e,function(e){var i=null;if(null!=c&&(0==_vgClassSessionSelection.model.IsOnline||1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName==ClassTabName)){if(-1==t.id)return!0;i=$.grep(c.lstOnlineServiceAndProviderMapping,function(i){return i.serviceProviderID==(void 0===e.id?e.ServiceProviderID:e.id)&&i.serviceID==t.id})}else 0;return null!=i&&i.length>0})},FilterSPOffline:function(e,t){return $.grep(e,function(e){var i=null;if(null!=c&&(0==_vgClassSessionSelection.model.IsOnline||1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName==ClassTabName)){if(-1==t.id)return e.isServiceProvide=!0,!0;i=$.grep(c.lstOnlineServiceAndProviderMapping,function(i){return i.serviceProviderID==(void 0===e.id?e.ServiceProviderID:e.id)&&i.serviceID==t.id})}else 0;return null!=i&&i.length>0?(e.isServiceProvide=!0,!0):(e.isServiceProvide=!1,!0)})},bindMobilefilterdata:function(e,t){if(_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0){var i="";null!=c&&(0==_vgClassSessionSelection.model.IsOnline||1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName==ClassTabName)&&(i=$.extend(!0,[],c.lstOnlineServiceProviderDetail));var n=null;n=null==t?i:_vgClassSessionSelection.FilterSP(i,t);var o=$("#txtSP"+e.data("section")+"Mobile").val();_vgClassSessionSelection.bindMobileOptions(n,"txtSP"+e.data("section"),o)}},bindMobileOptions:function(e,t,i){for(var n="",o=0;o<e.length;o++)n+="<option selected value="+e[o].id+">"+e[o].text+"</option>";0==_vgClassSessionSelection.model.IsOnline||1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName==ClassTabName?n="<option selected value='' selected='selected'>Any Instructor</option>"+n:e.length>1&&(n="<option selected value='' selected='selected'>Any Service Provider</option>"+n),1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName!=ClassTabName&&1==e.length?($("#"+t+"Mobile").empty().append(n),$("#"+t+"Mobile").prop("disabled",!0)):($("#"+t+"Mobile").empty().append(n).val(i),$("#"+t+"Mobile").prop("disabled",!1))},SetControls:function(e){null==e?(_vgClassSessionSelection.IsBusinessHaveOnlyClass()||_vgClassSessionSelection.IsClassSelected()?($("#dvServiceClassText").text(u+" (required)"),$("#spnAddService").text("Add "+d)):($("#dvServiceClassText").text("Service (required)"),$("#spnAddService").text("Add Service")),$("#dvAddService").hide()):0==e?$("#dvServiceClassText").text(BusinessPackageKeyWord+" (required)"):1==e?($("#dvServiceClassText").text("Service (required)"),$("#spnAddService").text("Add Service")):2==e&&($("#dvServiceClassText").text(u+" (required)"),$("#spnAddService").text("Add "+d)),null!=e&&$("#dvAddService").show()},IsBusinessHaveOnlyClass:function(){return!1},IsClassSelected:function(){return $("#ucServiceCombo_hidEventType").length>0&&"2"==$("#ucServiceCombo_hidEventType").val()},FilterService:function(e,t){return null!=c&&(0==_vgClassSessionSelection.model.IsOnline||1==_vgClassSessionSelection.model.IsOnline&&"undefined"!=typeof _shopdetail&&"undefined"!=typeof ClassTabName&&_shopdetail.activeTabName==ClassTabName)?$.grep(e,function(e){if(-1==t.id)return!0;var i=$.grep(c.lstOnlineServiceAndProviderMapping,function(i){return i.serviceProviderID==t.id&&i.serviceID==e.id});return null!=i&&i.length>0}):$.grep(e,function(e){if(e.eventType!=p){var i=$.grep(e.children,function(e){var i=$.grep(l.lstOnlineServiceAndProviderMapping,function(i){return i.serviceProviderID==t.id&&i.serviceID==e.id});return null!=i&&i.length>0});return null!=i&&i.length>0&&(e.children=i,!0)}return!0})},RemoveAllControls:function(e,t){$(".dvSectionDynamic").hide();for(var i=1;i<=4;i++)1==i&&1!=e||($("#txtService"+i).select2("data",{id:"",text:""}),_vgClassSessionSelection.SetDefaultForSeleect2($("#txtService"+i)),$("#txtService"+i).select2("enable"),1==e&&($("#divSearch").removeClass("no-serviceselection"),$("#mobile-appointments").prop("checked",!1),$("#dvOutCallSection").hide(),0==_vgClassSessionSelection.IsClassSelected()&&$("#ucServiceCombo_hidEventType").val(""))),$("#txtSP"+i).select2("data",{id:"",text:""}),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#txtSP"+i+"Mobile").val(""),_vgClassSessionSelection.SetDefaultForSeleect2($("#txtSP"+i));if(1==t){var n=null;if("undefined"!=typeof txtdateId&&(n=$find(txtdateId)),"undefined"==typeof isClearDate&&(isClearDate=!0),null!=n&&1==isClearDate&&$("#date-slider-container div.enabled:first").length>0){var o=new Date($("#date-slider-container div.enabled:first").data().availdate),a=void 0!==$("#date-slider-container div.selected:first").data()&&null!=$("#date-slider-container div.selected:first").data()?new Date($("#date-slider-container div.selected:first").data().availdate):new Date;setdatepickervalue({divid:"#divSearchDate",textid:"#txtdivSearchDate",flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isApplyInWidget:!0},o<a?o:a)}isClearDate=!0,$("#Book24Container").html(""),$("#hdnPromotionID").val(""),$("#hdnStyleID").val("")}},GetAvailibilityForService:function(t,i){var o=1;if(1==t&&(o=2),1==i){var a=$("#txtService1").data("choice");if(""!=a)try{var s=JSON.parse(a);s.hasOwnProperty("id")&&""!=s.id&&s.eventType==p&&(o=2)}catch(e){}}for(var r=_vgClassSessionSelection.VisibleControlLength("#dvSections .dvSectionDynamic")+1,l=[],c=o;c<=r;c++){var d=$("#txtSP"+c).data("choice");if(""!=d)try{var u=JSON.parse(d);u.hasOwnProperty("id")&&""!=u.id&&$.inArray(u.id,l)<=-1&&l.push(u.id)}catch(e){}}ShowLoader(!0),Data={},Data.businessID=1==_vgClassSessionSelection.model.IsOnline?businessID:BusinessID,Data.spID=l.length>0?l.join():"",vagaro.ajaxCall(e+n.getavailabledates,Data,CheckDates_CallSuccess,CallFailed1,!1,!0)},SetServiceBundle:function(e){if(null!=l.lstOnlineServiceBundleDetail){var t=$.grep(l.lstOnlineServiceBundleDetail,function(t){return t.businessPackageID==e});if(null!=t&&t.length>0){for(var i=0;i<=t.length-1;i++){var n=i+2;$("#dvSection"+n).show(),_vgClassSessionSelection.BindDropDown(n);var o={id:t[i].serviceId,text:t[i].serviceTitle};$("#txtService"+n).select2("data",o),$("#txtService"+n).select2("disable"),$("#txtService"+n).data("selecteddetail",o),void 0!==$("#txtService"+n).data("choice")&&_vgClassSessionSelection.SetChoiceForSeleect2($("#txtService"+n),o);var a={};a.id=o.id,a.text=o.text,_vgClassSessionSelection.bindMobilefilterdata($("#txtSP"+n),a)}$("#dvAddService").hide()}}},BindDropDown:function(e,t){var i={dropdownCssClass:"service-what-dropdown service-commondrop service-book-drop classAppSelectNew",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Select Service"};if(i.collapasable=_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0,i.selectAllText=$("#mobile-check").is(":visible"),i.scrollTop=$("#mobile-check").is(":visible"),"undefined"!=typeof isFromReschedual&&"true"==isFromReschedual.toLowerCase()&&void 0!==getCookie("AppointmentID")&&""!=getCookie("AppointmentID")&&(t=h),1!=e){t==m&&(i.placeholder="Select "+d);var n=$.extend(!0,[],l.lstOnlineServiceParent);n=$.grep(n,function(e){return e.eventType==t&&(e.children=$.grep(e.children,function(e){return e.eventType==t})),e.eventType==t}),i.data=n}else _vgClassSessionSelection.IsBusinessHaveOnlyClass()&&(i.placeholder="Select "+d),void 0!==_shopdetail.serviceID&&""==_shopdetail.serviceID&&"2"==$("#ucServiceCombo_hidEventType").val()&&$("#ucServiceCombo_hidEventType").val(""),i.data=l.lstOnlineServiceParent;$("#txtService"+e).length>0&&(1!=l.lstOnlineServiceProviderDetail.length||null!=_shopdetail.serviceID&&""!=_shopdetail.serviceID||_vgClassSessionSelection.onProviderSelect($("#txtSP"+e),{id:l.lstOnlineServiceProviderDetail[0].id,text:l.lstOnlineServiceProviderDetail[0].text}),new _vgClassSessionSelection.ApplySelect2Controls($("#txtService"+e),i));var o={dropdownCssClass:"service-providerdrop",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Any Service Provider"};o.data=l.lstOnlineServiceProviderDetail,o.collapasable=!1,$("#txtSP"+e).length>0&&(new _vgClassSessionSelection.ApplySelect2Controls($("#txtSP"+e),o),$("#txtSP"+e).select2("enable"),1==l.lstOnlineServiceProviderDetail.length&&($("#txtSP"+e).select2("disable"),$("#txtSP"+e).select2("data",{id:l.lstOnlineServiceProviderDetail[0].id,text:l.lstOnlineServiceProviderDetail[0].text})))},onProviderSelect:function(e,t){e.data("selecteddetail",JSON.stringify(t)),void 0!==e.data("choice")&&_vgClassSessionSelection.SetChoiceForSeleect2(e,t),_vgClassSessionSelection.isExistsServiceProviderForSameTime(e),_vgClassSessionSelection.GetAvailibilityForService(!1,!0)},isExistsServiceProviderForSameTime:function(e){var t=$("#txtService1").data("choice"),i=!1;if(""!=t){try{var n=[],o=JSON.parse(t);if(o.hasOwnProperty("id")&&""!=o.id&&o.eventType==p){if(null!=o.lstServiceBundleDetail&&o.lstServiceBundleDetail.length>0&&(i=2==o.lstServiceBundleDetail[0].isServicePerformAtSameTime),1==i)for(var a=_vgClassSessionSelection.VisibleControlLength("#dvSections .dvSectionDynamic")+1,s=2;s<=a;s++){var r=$("#txtSP"+s).data("choice");if(""!=r)try{var l=JSON.parse(r);l.hasOwnProperty("id")&&""!=l.id&&n.push(l.id)}catch(e){}}}if(1==i)for(s=0;s<=n.length;++s)for(var c=s+1;c<=n.length;++c)if(""!=n[c]&&""!=n[s]&&n[s]==n[c])return vagaro.alert("Services in this service bundle could not be booked with same provider.Please select different Provider for All Services."),e.select2("data",{id:"",text:""}),$(e.selector+"Mobile").val(""),_vgClassSessionSelection.SetDefaultForSeleect2(e),!1}catch(e){return!0}return!0}},AddServiceButtonDisplay:function(){_vgClassSessionSelection.VisibleControlLength("#dvSections .dvSectionDynamic")>=2||"true"==IsRescheduleAppointment.toLowerCase()&&""!=lAppID||_vgClassSessionSelection.IsClassSelected()&&null!=_vgClassSessionSelection.GetRescheduleDetail()?$("#dvAddService").hide():$("#dvAddService").show()},GetRescheduleDetail:function(){var e=$("#hdnRescheduleDetail");if(""==e.val())return null;try{return JSON.parse(e.val())}catch(e){return null}},OutCallCalculation:function(e,t){if($("#mobile-appointments").prop("checked",!1),0!=IsMobileServiceMandatoryInBusiness){1==e&&1==t.isOutCallService&&$("#dvAddService").hide();var i=!1;if(_vgClassSessionSelection.VisibleControlLength("#dvSections .dvSectionDynamic")>0){for(var n=1;n<=3;n++)if(n!=e){var o=$("#txtService"+n).data("selecteddetail");if(""!=o)try{1==JSON.parse(o).isOutCallService&&(i=!0)}catch(e){}}if(1==i&&0==t.isOutCallService||0==i&&1==t.isOutCallService)return vagaro.alertsmall({message:"You cannot combine Mobile Services with non-Mobile Services.",title:"Alert",callback:function(){}}),$("#txtService"+e).select2("data",{id:"",text:""}),_vgClassSessionSelection.SetDefaultForSeleect2($("#txtService"+e)),$("#txtService"+e).data("selecteddetail",""),!1}1==t.isOutCallService?($("#dvOutCallSection").show(),$("#hrfChangeBusinessCall").hide(),$("#hrfChangeHouseCall").hide(),$("#dvAtBusiness").hide(),$("#mobile-appointments").prop("checked",!0)):$("#dvOutCallSection").hide()}else _vgClassSessionSelection.VisibleControlLength("#dvSections .dvSectionDynamic")>0||0==t.isOutCallService?$("#dvOutCallSection").hide():1==t.isOutCallService&&(void 0!==t.directFromService&&""!=t.directFromService&&1==t.directFromService&&($("#dvHouseCall").removeClass("active"),$("#dvBussiness").addClass("active")),$("#dvOutCallSection").show(),$("#hrfChangeBusinessCall").show(),$("#hrfChangeHouseCall").show(),$("#dvAtHouse").hide());return!0},BindGCpromoPrice:function(e,t){var i=e.data("GCPromoList"),n=$.grep(i,function(e){return parseFloat(t)==parseFloat(e.Price)});n.length>0?(t=n[0].Price,e.select2("data",{id:n[0].id,text:n[0].text+" ("+n[0].promotext+")"}),$("#div_amount").html("$"+t.toFixed(2).replace(".00",""))):1==$.isNumeric(t)&&parseFloat(t)>0?parseFloat(t)>999999?(e.select2("data",{id:"",text:""}),$("#div_amount").html("")):(t.indexOf(".")>0&&(t=parseFloat(t).toFixed(2)),$("#div_amount").html("$"+t.replace(".00","")),e.select2("data",{id:t,text:t})):(e.select2("data",{id:"",text:""}),$("#div_amount").html(""))},FillClassDatesCallbackForClass:function(e){if(e.length>0&&void 0!==_shopdetail.lastClassBookingDateConfigured&&0==_shopdetail.lastClassBookingDateConfigured){_shopdetail.lastClassBookingLimit=e[e.length-1];var i=new Date;i.setDate(i.getDate()+(Number(_shopdetail.lastClassBookingLimit)-1)),_shopdetail.lastClassBookingDate=i,e.pop(),_shopdetail.lastClassBookingDateConfigured=!0}if(bkClassAvailableDates.addResponseToCache(e),e.length<=0&&t){if(_vgClassSessionSelection.VisibleControlLength("#divmainEventdetailForClass")<=0){$("#divmainEventdetailForClass").show();try{_vgClassSessionSelection.LoadClassSliderDatePickerForClass(new Date)}catch(e){}}_vgClassSessionSelection.ClearBook24()}else _vgClassSessionSelection.LoadClassSliderDatePickerForClass(e);if(t=!1,ShowLoader(!1),void 0===e!=null&&e.length>0){if(""!=_shopdetail.bookingDateTime&&null!=_shopdetail.bookingDateTime&&null!=_shopdetail.bookingDateTime){var n=new Date(moment(new Date(_shopdetail.bookingDateTime.replace(new RegExp(",","g")," "))).format("MMM DD,YYYY")),o=new Date(moment(new Date(e[0].replace(new RegExp(",","g")," "))).format("MMM DD,YYYY"));n<o&&(n=o),$("#hdnStartDateForClass").val(n)}else $("#hdnStartDateForClass").val(e[0]);_vgClassSessionSelection.LoadClassDataOnline(e),_vgClassSessionSelection.GetQueryStringData("device","myaccount")||_vgClassSessionSelection.ClearBook24()}else{if(_vgClassSessionSelection.VisibleControlLength("#divmainEventdetailForClass")<=0){$("#divmainEventdetailForClass").show();try{_vgClassSessionSelection.LoadClassSliderDatePickerForClass(new Date)}catch(e){}}$("#date-class-slider-containerForClass .selected").removeClass("selected"),$("#date-class-slider-containerForClass div.enabled").removeClass("enabled").addClass("inactive"),$("body").addClass("searched-appointment-body"),$("#divEventDetailForClass").hide(),$("#tblEventDetailForClass").html(""),$("#dvtimezone").hide();var a={confirmButtonText:"Class Not Scheduled"};if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&1==_shopdetail.IsLimitOnlineBooking){var s=$("#hdnInstructorIDForClass").val();if(""==_shopdetail.getFilteredServiceProviderId(s))if(1==$("select[id=cboServiceProviderWaitlist_Search] :selected").length){var r=$("select[id=cboServiceProviderWaitlist_Search] :selected").text();a.swalTextMessage="Sorry, "+r+" is Not Accepting New Customers"}else a.swalTextMessage="Sorry, the Selected Employees are Not Accepting New Customers";else a.swalTextMessage="There are no dates scheduled for the selected class and instructor."}else a.swalTextMessage="There are no dates scheduled for the selected class and instructor.";_common.Openswalpopup(a),setTimeout(function(){$(".gencutom-title").html(a.confirmButtonText)},100)}},LoadClassSliderDatePickerForClass:function(e){$("#divmainEventdetailForClass").data("availabedates",JSON.stringify(e)),$("#divClassAppResultForClass").show();var t=$("#slider-class-dataForClass");t.html(""),t.unslick();var i="",n=_vgClassSessionSelection.getSunday(new Date),o=new Date(_shopdetail.lastClassBookingDate);o.setDate(o.getDate()-1),o=_vgClassSessionSelection.getSunday(o),o=new Date(o.setDate(o.getDate()+6));var a=Math.floor((o.getTime()-n.getTime())/864e5);a<50&&o.setDate(o.getDate()+(42-a));var s=$("#DateTemplatesForClass").html();AvailableMinDateForClass=e.length>0?new Date(e[0]):new Date,AvailableMaxDateForClass=new Date(e[e.length-1]);var r=new Date(e[0]).format("MMM dd,yyyy");new Date(r)<AvailableMinDateForClass&&(r=new Date(AvailableMinDateForClass)),new Date(r)>AvailableMaxDateForClass&&(r=new Date(AvailableMaxDateForClass));for(;n<=o;){var l=new Date(n);l=new Date(l.setDate(n.getDate()+6));var c=s;c=(c=(c=(c=(c=(c=(c=(c=(c=c.replace("{{availableStartDate}}",n.format("MMM dd,yyyy"))).replace("{{availableEndDate}}",l.format("MMM dd,yyyy"))).replace("{{startDate}}",n.format("yyyy-MM-dd"))).replace("{{WeekNo}}",g[new Date(n).getMonth()])).replace("{{WeekNoLabel}}",v[new Date(n).getMonth()])).replace("{{WeekStart}}",new Date(n).getDate())).replace("{{WeekStartLabel}}",new Date(n).getDate())).replace("{{WeekEnd}}",new Date(l).getDate())).replace("{{WeekEndLable}}",new Date(l).getDate());for(var d=0,u=0,p=n;p<=l;p.setDate(p.getDate()+1))$.inArray(p.format("MMM dd,yyyy"),e)<0&&(d+=1),u+=1;i+=c=d!=u?(c=c.replace("{{selectedClass}}","enabled")).replace("{{onclickcall}}","_vgClassSessionSelection.SetClassStartDateForClass(this);"):(c=c.replace("{{selectedClass}}","inactive")).replace("{{onclickcall}}","return false;")}$("#slider-class-dataForClass").append(i),$("#slider-class-dataForClass .inactive").attr("aria-hidden",!0);var h=new Date(AvailableMinDateForClass);$("#slider-class-dataForClass").slick({infinite:!1,slidesToShow:7,speed:800,prevArrow:'<div tabindex="0" data-role="none" class="owl-prev font-awesome-light " onclick="_vgClassSessionSelection.bounceClassDateControl(this,0);" role="button" aria-label="Prevous">&#xF104;</div>',nextArrow:'<div tabindex="0" data-role="none" class="owl-next font-awesome-light " onclick="_vgClassSessionSelection.bounceClassDateControl(this,1);" role="button" aria-label="Next">&#xF105;</div>',onAfterChange:function(e,t){"Next"!=e.CurrentSlideDirection&&"Prev"!=e.CurrentSlideDirection||_vgClassSessionSelection.ChangeClassWeekForClass(e,t)},slidesToScroll:7,responsive:[{breakpoint:768,settings:{arrows:!1}}]});var m=_vgClassSessionSelection.getSunday(h),f=new Date(m);f=new Date(f.setDate(m.getDate()+6)),_vgClassSessionSelection.setClassSliderDateForClass(m,f)},ChangeClassWeekForClass:function(e,t){for(var i,n,o=$("#date-class-slider-containerForClass .slick-active"),a=0;a<=o.length-1;a++){var s=$(o[a]),r=s.attr("index");if(null!=r&&void 0!==r&&Number(r)%7==0){i=new Date(s.eq(0).data().availdatestart),n=new Date(s.eq(0).data().availdateend);break}}_vgClassSessionSelection.setClassSliderDateForClass(i,n)},setClassSliderDateForClass:function(e,t){var i=e.format("MMM dd,yyyy"),n=t.format("MMM dd,yyyy"),o=$("#date-class-slider-containerForClass").find("[data-availdatestart='"+i+"'][data-availdateend='"+n+"']").closest("div").attr("index");if(null!=o&&void 0!==o){Number(o)%7&&(o-=Number(o)%7),$("#slider-class-dataForClass").slickGoTo(o);var a=$("#date-class-slider-containerForClass").find("[index='"+o+"']");if(a.length>0){var s=$("#date-class-slider-containerForClass div.slick-active.selected:first");if(s.length>0){var r=_vgClassSessionSelection.StringToDate(s.data().startdate,"-");$("#hdnMonthNameForClass").html(_vgClassSessionSelection.weeks_between(r,!0))}else{var l=_vgClassSessionSelection.StringToDate(a.eq(0).data().startdate,"-");$("#hdnMonthNameForClass").html(_vgClassSessionSelection.weeks_between(l,!0))}}}},weeks_between:function(e,t){var i=_vgClassSessionSelection.getSunday(new Date);i=new Date(i.setDate(i.getDate()-1));var n=e.getTime(),o=i.getTime(),a=Math.abs(n-o),s=Math.floor(a/6048e5);return 1==s?"Next Week":s>1?"In "+s+" Weeks":"This Week"},ClearBook24:function(){_shopdetail.serviceID="",_shopdetail.providerID="",_shopdetail.styleID="",_shopdetail.styleName="",_shopdetail.bookingDateTime="",_shopdetail.EventType=null,_vgClassSessionSelection.clearCookie("ProviderID"),_vgClassSessionSelection.clearCookie("StyleID"),_vgClassSessionSelection.clearCookie("StyleName"),_vgClassSessionSelection.clearCookie("BookingDate"),_vgClassSessionSelection.clearCookie("BookingTime"),_vgClassSessionSelection.clearCookie("BusinessPackageID"),_vgClassSessionSelection.clearCookie("AppointmentID"),_vgClassSessionSelection.clearCookie("IsFromReschedual"),_vgClassSessionSelection.clearCookie("IsClassSelected"),_vgClassSessionSelection.clearCookie("IsFromRebook"),_vgClassSessionSelection.clearCookie("PromotionPIds"),"undefined"==typeof _common||_common.isCreateLinkPreserve(!0)||(_vgClassSessionSelection.clearCookie("ServiceID"),_vgClassSessionSelection.clearCookie("LiveStreamSignUp"),_vgClassSessionSelection.clearCookie("MultiProviderID"),_vgClassSessionSelection.clearCookie("UniqueCreateLink"),_vgClassSessionSelection.clearCookie("EventType")),"undefined"!=typeof isClassSelected&&(isClassSelected="false"),"undefined"!=typeof isFromReschedual&&(isFromReschedual="false"),_vgClassSessionSelection.clearCookie("EventSessionAttendeesId"),ShowLoader(!1)},LoadClassDataOnline:function(e){var t=new Date;if(void 0!==$("#hdnStartDateForClass")&&""!=$("#hdnStartDateForClass").val()&&(t=new Date($("#hdnStartDateForClass").val())),document.getElementById("apgSearchProgressForClass").style.display="",void 0!==e&&null!=e&&_vgClassSessionSelection.VisibleControlLength("#divmainEventdetailForClass")<=0){$("#divmainEventdetailForClass").show();try{_vgClassSessionSelection.LoadClassSliderDatePickerForClass(e)}catch(e){}}bkEvent.model.csvServiceID=$("#hdnClassIDForClass").val(),bkEvent.model.csvSPID=$("#hdnInstructorIDForClass").val(),bkEvent.model.csvSPID=""==bkEvent.model.csvSPID?"0":bkEvent.model.csvSPID,bkEvent.model.csvFilterType=$(_vgClassSessionSelection.Controls.ddlFilterTypes).val();var i=_vgClassSessionSelection.getSunday(new Date(t));t.format("MMM dd,yyyy")!=i.format("MMM dd,yyyy")&&(t=new Date(i));var n=new Date(t),o=new Date(_shopdetail.lastClassBookingDate);n.setDate(t.getDate()+6),n>o&&(n=o);var a=$("#date-class-slider-containerForClass").find("[data-availdatestart='"+t.format("MMM dd,yyyy")+"'],[data-availdateend='"+n.format("MMM dd,yyyy")+"']");a.length>0&&($("#date-class-slider-containerForClass .selected").removeClass("selected"),$("#date-class-slider-containerForClass").addClass(""),$(a).removeClass("filter-button"),$(a).addClass("selected"),$("#hdnStartDateForClass").val(new Date(t)),$("#hdnEndDateForClass").val(new Date(n)),_vgClassSessionSelection.LoadClassDataForClassTab())},LoadClassDataForClassTab:function(){"undefined"==typeof _shopdetail||null==_shopdetail||1!=_shopdetail.IsLimitOnlineBooking&&1!=_shopdetail.IsMemPkgReqToBook||(_shopdetail.LoadMembershipPackageData(),_vgClassSessionSelection.commonProperty.MembershipPackageDetailsForClass=_shopdetail.MembershipPackageDetails);var e=null,t=null,i=new Date($("#hdnStartDateForClass").val()),o=new Date($("#hdnEndDateForClass").val());e=null!=i?i.format("ddd MMM-dd-yyyy"):(new Date).format("ddd MMM-dd-yyyy"),t=null!=o?o.format("ddd MMM-dd-yyyy"):(new Date).format("ddd MMM-dd-yyyy"),$("#spnSearchTypeForClass").html("Classes"),$("#divDateForClass").html(e+" to "+t),$("#AppProgressModalForClass").modal("show");var a,s=0,r=0,l=_vgClassSessionSelection.StreamingFilterType.InHouseAndLiveStream;if(bkEvent.model.searchFromDate=e,bkEvent.model.searchToDate=t,null==(a=bkEvent.getResponseFromCache())||"SearchClass"==$("#hdnSearchClass").val()){s=bkEvent.model.csvServiceID,r=bkEvent.model.csvSPID,l=bkEvent.model.csvFilterType;var d=$("<XMLDocument/>");if(d.append(_vgClassSessionSelection.createXmlElement("searchDetails")),""==s&&""!=$("#hdnClassIDForClass").val()&&(s=$("#hdnClassIDForClass").val()),"0"!=r&&""!=$("#hdnInstructorIDForClass").val()){if(r=$("#hdnInstructorIDForClass").val(),"undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.getFilteredServiceProviderId&&1==_shopdetail.IsLimitOnlineBooking&&(r=_shopdetail.getFilteredServiceProviderId(r),$("#hdnSearchAvailabilityBtn").val(""),""==r))return _vgClassSessionSelection.FillClassDatesCallbackForClass([]),_vgClassSessionSelection.LoadEventsDataCallbackForClassTab([]),void _vgClassSessionSelection.EventShowLoader(!1);if(0!=s||0!=r){r=r.split(",");for(var u=0;u<r.length;u++){(h=_vgClassSessionSelection.createXmlElement("searchDetail")).append(_vgClassSessionSelection.createXmlElement("serviceId",s)),h.append(_vgClassSessionSelection.createXmlElement("spId",r[u])),h.append(_vgClassSessionSelection.createXmlElement("streamingstatus",l)),d.find("searchDetails").append(h)}}}else if("0"==r&&""!=$("#hdnStrSpList").val()){var p=$("#hdnStrSpList").val();if(r="",p=JSON.parse(p),0!=s||0!=r)for(u=0;u<p.length;u++){var h;(h=_vgClassSessionSelection.createXmlElement("searchDetail")).append(_vgClassSessionSelection.createXmlElement("serviceId",s)),h.append(_vgClassSessionSelection.createXmlElement("spId",p[u].ServiceProviderID)),h.append(_vgClassSessionSelection.createXmlElement("streamingstatus",l)),d.find("searchDetails").append(h)}}var m=_vgClassSessionSelection.createXmlElement("searchDetail");m.append(_vgClassSessionSelection.createXmlElement("serviceId",-2)),m.append(_vgClassSessionSelection.createXmlElement("spId",-2)),m.append(_vgClassSessionSelection.createXmlElement("streamingstatus",l)),d.find("searchDetails").append(m);var g=0;void 0!==getCookie("PromotionID")&&(g=getCookie("PromotionID"),setCookie("PromotionID",0));var v=new vagaro.ajax;v.datamodel.Token=n.getavailablemultievents,v.datamodel.IsNewVagaroAPI=!0;var f={};if(f.businessID=1==_vgClassSessionSelection.model.IsOnline?businessID:BusinessID,f.sSatrtDate=e,f.sEndDate=t,!String.isNullOrUndefineOrBlank(c.clsTimeZone)){f.Bus_TimeZone=c.clsTimeZone.TIME_ZONE,f.Bus_CountryID=c.clsTimeZone.CountryID,f.Bus_DayLightSaving=c.clsTimeZone.CUSTOM_DAY_LIGHT_SAVING,f.DAY_LIGHT_SAVING=c.clsTimeZone.DAY_LIGHT_SAVING;var C=getCookie("proximitystate_v3");String.isNullOrUndefineOrBlank(C)||(f.Cust_Timezone=C.timeZoneOffSet,f.Cust_CountryID=C.countryid,f.Cust_IsDayLightSaving=C.isSupportDayLight)}if(f.searchdetails=d.html(),_vgClassSessionSelection.model.IsSearchFromInHouseClass){var S=getSelectedCustomer();!_vgClassSessionSelection.model.IsSearchFromInHouseClass||""!=S&&0!=S||(S=UserID)}f.userID=_vgClassSessionSelection.model.IsSearchFromInHouseClass?S:UserID,f.promotionID=g,f.isFromOffline=0==_vgClassSessionSelection.model.IsOnline,_vgClassSessionSelection.GetWBTypeQuerySting()&&_vgClassSessionSelection.GetWBEventQuerySting()?(f.IsNewWebsiteBuilder=!0,f.IncludededClassId=_vgClassSessionSelection.getWBClassIdsData("IncludedIds"),f.ExcludededClassId=_vgClassSessionSelection.getWBClassIdsData("ExcludedIds"),f.IsAllowAllLocation=_vgClassSessionSelection.getWBIsAllowAlllocation()):(f.IsNewWebsiteBuilder=!1,f.IncludededClassId="",f.ExcludededClassId="",f.IsAllowAllLocation=!1),v.datamodel.data=f,v.datamodel.callback=_vgClassSessionSelection.LoadEventsDataCallbackForClassTab,v.datamodel.Error=_vgClassSessionSelection.LoadEventsDataFailCallback,v.Post(),$("#hdnSearchClass").val("")}else _vgClassSessionSelection.LoadEventsDataCallbackForClassTab(a)},GetWBTypeQuerySting:function(){var e=window.document.URL;if(void 0!==e&&null!=e&&""!=e){var t=e.slice(e.indexOf("?")+1).split("&");if(t.length>0)for(var i=0;i<t.length;i+=1){var n=t[i];if(sParameterName=(n||"").split("="),2==sParameterName.length&&"Type"===sParameterName[0]&&"Builder"===sParameterName[1])return!0}}return!1},GetQueryStringData:function(e,t){var i=window.document.URL;if(void 0!==i&&null!=i&&""!=i){var n=i.slice(i.indexOf("?")+1).split("&");if(n.length>0)for(var o=0;o<n.length;o+=1){var a=n[o];if(sParameterName=(a||"").split("="),2==sParameterName.length&&sParameterName[0]===e&&sParameterName[1]===t)return!0}}return!1},GetWBEventQuerySting:function(){var e=window.document.URL;if(void 0!==e&&null!=e&&""!=e){var t=e.slice(e.indexOf("?")+1).split("&");if(t.length>0)for(var i=0;i<t.length;i+=1){var n=t[i];if(sParameterName=(n||"").split("="),2==sParameterName.length&&"Event"===sParameterName[0]&&"WBBusinessClasses"===sParameterName[1])return!0}}return!1},getWBIsAllowAlllocation:function(){var e=window.document.URL;if(void 0!==e&&null!=e&&""!=e){var t=e.slice(e.indexOf("?")+1).split("&");if(t.length>0)for(var i=0;i<t.length;i+=1){var n=t[i];if(sParameterName=(n||"").split("="),2==sParameterName.length&&"AllowLocation"===sParameterName[0]&&"true"===sParameterName[1])return!0}}return!1},GetClassIDForWB:function(){var e=window.document.URL;if(void 0!==e&&null!=e&&""!=e){var t=e.slice(e.indexOf("?")+1).split("&");if(t.length>0)for(var i=0;i<t.length;i+=1){var n=t[i];if(sParameterName=(n||"").split("="),2==sParameterName.length&&"ClassID"===sParameterName[0]&&void 0!==sParameterName[1]&&null!=sParameterName[1]&&""!=sParameterName[1])return sParameterName[1]}}return""},getWBClassIdsData:function(e){var t=window.document.URL;if(void 0!==t&&null!=t&&""!=t){var i=t.slice(t.indexOf("?")+1).split("&");if(i.length>0)for(var n=0;n<i.length;n+=1){var o=i[n];if(sParameterName=(o||"").split("="),2==sParameterName.length&&sParameterName[0]===e)return void 0!==sParameterName[1]&&null!=sParameterName[1]&&""!=sParameterName[1]?sParameterName[1]:""}}return""},SetClassStartDateForClass:function(e){0==_vgClassSessionSelection.VisibleControlLength("#mobile-check")&&($(e).attr("tabindex",0).focus(),$("#txtService5").select2("focus")),$("#hdnStartDateForClass").val(_vgClassSessionSelection.StringToDate($(e).data().startdate,"-")),$("#hdnMonthNameForClass").html(_vgClassSessionSelection.weeks_between(_vgClassSessionSelection.StringToDate($(e).data().startdate,"-"),!0)),_vgClassSessionSelection.LoadClassDataOnline()},bounceClassDateControl:function(e,t){1==$(e).hasClass("slick-disabled")&&(0==t?$("#slider-class-data").animate({left:"+=50px"},400,"easeOutSine",function(){$("#slider-class-data").animate({left:0},600,"easeOutBounce")}):$("#slider-class-data").animate({right:"+=50px"},400,"easeOutSine",function(){$("#slider-class-data").animate({right:0},600,"easeOutBounce")}))},CloseClassSearchProgressForClassTab:function(){setTimeout(function(){$("#AppProgressModalForClass").modal("hide")},800)},setClassSliderDate:function(e,t){var i=e.format("MMM DD,YYYY"),n=t.format("MMM DD,YYYY"),o=$("#date-class-slider-container").find("[data-availdatestart='"+i+"'][data-availdateend='"+n+"']").closest("div").attr("index");if(null!=o&&void 0!==o){Number(o)%7&&(o-=Number(o)%7),$("#slider-class-data").slickGoTo(o);var a=$("#date-class-slider-container").find("[index='"+o+"']");if(a.length>0){var s=$("#date-class-slider-container div.slick-active.selected:first");if(s.length>0){var r=_vgClassSessionSelection.StringToDate(s.data().startdate,"-");$("#hdnMonthName").html(_vgClassSessionSelection.weeks_between(r,!0))}else{var l=_vgClassSessionSelection.StringToDate(a.eq(0).data().startdate,"-");$("#hdnMonthName").html(_vgClassSessionSelection.weeks_between(l,!0))}}}},SetDefaultForSeleect2:function(e){e.data("choice",JSON.stringify({id:"",text:""}))},SetChoiceForSeleect2:function(e,t){e.data("choice",JSON.stringify(t))},clearCookie:function(e){return cookieManager.removeCookie(e,cookieManager.defaultPath,cookieManager.defaultDomain)},GetChoiceForSeleect2:function(e){try{return JSON.parse(e.data("choice"))}catch(e){return{}}},closeServiceSelection:function(){$(".book-service-open").removeClass("book-service-open"),$(".book-service-open-common").removeClass("book-service-open-common"),$(".gc-transformnone").removeClass("gc-transformnone"),$("html, body").removeClass("moboverflow-hide"),setTimeout(function(){"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&$("html, body").hasClass("moboverflow-hide")&&$("html, body").removeClass("moboverflow-hide")},200)},CallFailed2:function(){vagaro.alert("Some Error occured")},SearchAssignVariables:function(){var e={},t=_vgClassSessionSelection.Controls.PageName;null!=glbPageName&&null!=cache_PageType&&cache_PageType[t]!=glbPageName&&(e.liSelectedClassName=_vgClassSessionSelection.Controls.liSelectedClassName,e.isFromiPadAndroid="true"=="<%=IsFromIpad %>".toLowerCase(),e.isLoadCustFromDB="true"=="<%= Vagaro.Config.AppSettingManager.AppSettingValues.IsLoadCustFromDB %>".toLowerCase(),e.syncDuration=parseInt("<%= Vagaro.Config.AppSettingManager.AppSettingValues.custListSyncDuration %>"),e.HasCustomerRight=!0,e.BusinessId=BusinessID),InitializecomponentWrapper(t,e)},SelectCustomerClass:function(e){if(null!=e){var t=$(e);_vgClassSessionSelection.model.hdnUserIDAppointment=_vgClassSessionSelection.GethdnUserIDAppointmentControl(),t.data("custid")!=_vgClassSessionSelection.model.hdnUserIDAppointment.val()&&(_vgClassSessionSelection.SelectCustomer(t.data("custid"),t.data("fullname")),_vgClassSessionSelection.model.hdnUserIDAppointment.val(t.data("custid")))}},GethdnUserIDAppointmentControl:function(){return null==_vgClassSessionSelection.model.hdnUserIDAppointment&&(_vgClassSessionSelection.model.hdnUserIDAppointment=$(_vgClassSessionSelection.Controls.hdnUserIDAppointment)),_vgClassSessionSelection.model.hdnUserIDAppointment},SelectCustomer:function(e,t){""!=e&&""!=e?("true"==$("#hdnHasCustomerViewRight").val().toLowerCase()?$(_vgClassSessionSelection.Controls.dvBtSearchHistory).show():"true"==$("#hdnHasCustomerRight").val().toLowerCase()&&($(_vgClassSessionSelection.Controls.dvBtSearchEdit).show(),$(_vgClassSessionSelection.Controls.dvBtSearchHistory).show()),Ajax_BussinessID=BusinessID,"undefined"!=typeof isFormsEnable&&""!=isFormsEnable&&"true"==isFormsEnable.toLowerCase()?NeedToFillFormsForNewCustomer(e,function(t){null!=t&&null!=t.d&&t.d.length>0?NewCustomerFormStatus="1":NewCustomerFormStatus="","undefined"!=typeof canViewNotes&&""!=canViewNotes&&"true"==canViewNotes.toLowerCase()&&ShowPopupNotesModal(e,null)},function(){window.parent.ShowHideWarningMessageCommon(_vgClassSessionSelection.model.Somethingwentwrong)}):"undefined"!=typeof canViewNotes&&""!=canViewNotes&&"true"==canViewNotes.toLowerCase()&&ShowPopupNotesModal(e,null),UserID=e,null!=bkEvent.model.cacheLen&&null!=bkEvent.model.cacheLen&&_vgClassSessionSelection.IsSearchFromInHouseClass()&&(bkEvent.timeSlotsCache={},_vgClassSessionSelection.LoadClassDataForClassTab())):($(_vgClassSessionSelection.Controls.dvBtSearchEdit).hide(),$(_vgClassSessionSelection.Controls.dvBtSearchHistory).hide())},AddCustomerInSearchAppointmentPage:function(e,t){var i=_vgClassSessionSelection.GetCustomerSearchClassControl(),n=_vgClassSessionSelection.GethdnUserIDAppointmentControl();i.val(e),n.val(t),_vgClassSessionSelection.SelectCustomer(t,e)},GetCustomerSearchClassControl:function(){return null==_vgClassSessionSelection.model.txtCustomerSearchClass&&(_vgClassSessionSelection.model.txtCustomerSearchClass=$(_vgClassSessionSelection.Controls.txtCustomerSearchAppointment)),_vgClassSessionSelection.model.txtCustomerSearchClass},showNewEditCustomerPopup:function(e){1==e?openCustomerPopup("0",_vgClassSessionSelection.Controls.SearchClassFromCalendar):(ShowLoader(!0),openCustomerPopup(_vgClassSessionSelection.getSelectedCustomer(),_vgClassSessionSelection.Controls.SearchClassFromCalendar))},getSelectedCustomer:function(){return void 0===_vgClassSessionSelection.GethdnUserIDAppointmentControl()||null==_vgClassSessionSelection.GethdnUserIDAppointmentControl().val()?0:_vgClassSessionSelection.GethdnUserIDAppointmentControl().val()},setSearchCustomer:function(e){var t=e;(t.length<=0||null==t||""==t)&&($(_vgClassSessionSelection.Controls.txtCustomerSearchAppointment).val(""),$(_vgClassSessionSelection.Controls.dvBtSearchEdit).hide(),$(_vgClassSessionSelection.Controls.dvBtSearchHistory).hide(),null==_vgClassSessionSelection.model.hdnUserIDAppointment&&(_vgClassSessionSelection.model.hdnUserIDAppointment=$(_vgClassSessionSelection.Controls.hdnUserIDAppointment)),_vgClassSessionSelection.model.hdnUserIDAppointment.val(0))},CallHistoryAppointment:function(){_vgClassSessionSelection.CallCustomerHistoryMain(_vgClassSessionSelection.getSelectedCustomer(),1,0,BusinessID,0,"",!1,!1,!1,!1,0,"")},CallCustomerHistoryMain:function(e,t,i,n,o,a,s,r,l,c,d,u){var p="CustomerHistoryPopUp.aspx";try{void 0!==window.parent.location.href&&null!=window.parent.location.href&&window.parent.location.href.includes("/merchants/calendar")&&(p="CustomerHistoryPopUp.aspx?cal=1")}catch(e){console.log(e)}ShowDynamicPopupForShopOwner(p,510,970,"DivCustomerHistoryPopUp","Customer Details",null,null,"cust-history- reponsive");var h=$("#iFrame_DivCustomerHistoryPopUp"),m=h[0].contentWindow,g="0",v=$("#hdnHasCustomerRight").val();"true"==v.toString().toLowerCase()?g="2":"false"==v.toString().toLowerCase()&&"true"==viewCustomer_app.toString().toLowerCase()&&(g="1"),h.load(function(){this.contentWindow.FillCustomerInfoFromCustomerID(e,t,i,n,o,a,s,r,l,c,d,u,g)}),null!=m.FillCustomerInfoFromCustomerID&&m.FillCustomerInfoFromCustomerID(e,t,i,n,o,a,s,r,l,c,d,u,g)},IsSearchFromInHouseClass:function(){return window.location.toString().indexOf("SearchClassFromCalendar.aspx")>-1},CalcAndDisplayPriceClassLocation:function(){if(""!=_vgClassSessionSelection.commonProperty.availabledates){var e=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.filter(function(e){return e.appointmentID==$("#hdnAppointmentId").val()?e:null}),t=0,i=_vgCal.Common.model.CurrencySymbol;null!=e&&e.length>0&&null!=_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates&&_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length>0&&(_vgClassSessionSelection.commonProperty.availabledates.eventDetail.isWorkShop?(e[0].streamingEventCapacity>0&&(t=0,t=(t=_vgClassSessionSelection.CalcSessionPrice(_vgClassSessionSelection.commonProperty.sessiondetail,_vgClassSessionSelection.GetNoOfSessions(),_vgClassSessionSelection.GetNoOfAttendees(),!1,!0,!1))*_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length/parseFloat(_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates[0].workShopNoofSessions),$("#divStreamingEventPrice").text(i+_vgClassSessionSelection.ConvertTodecimal(t,2,!1))),e[0].eventCapacity>0&&(t=0,t=(t=_vgClassSessionSelection.CalcSessionPrice(_vgClassSessionSelection.commonProperty.sessiondetail,_vgClassSessionSelection.GetNoOfSessions(),_vgClassSessionSelection.GetNoOfAttendees(),!1,!1,!1))*_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates.length/parseFloat(_vgClassSessionSelection.commonProperty.availabledates.eventAvailableDates[0].workShopNoofSessions),$("#divEventPrice").text(i+_vgClassSessionSelection.ConvertTodecimal(t,2,!1)))):(e[0].streamingEventCapacity>0&&(t=0,t=_vgClassSessionSelection.CalcSessionPrice(_vgClassSessionSelection.commonProperty.sessiondetail,_vgClassSessionSelection.GetNoOfSessions(),_vgClassSessionSelection.GetNoOfAttendees(),!0,!0),$("#divStreamingEventPrice").text(i+_vgClassSessionSelection.ConvertTodecimal(t,2,!1)),_vgClassSessionSelection.model.IsSearchFromInHouseClass&&1==_vgClassSessionSelection.commonProperty.streamingStatus&&(_vgAddon.Model.ClassPrice=parseFloat(t))),e[0].eventCapacity>0&&(t=0,t=_vgClassSessionSelection.CalcSessionPrice(_vgClassSessionSelection.commonProperty.sessiondetail,_vgClassSessionSelection.GetNoOfSessions(),_vgClassSessionSelection.GetNoOfAttendees(),!0,!1),$("#divEventPrice").text(i+_vgClassSessionSelection.ConvertTodecimal(t,2,!1)))))}},GetCalendarDepositSettingAndCCDetails:function(e,t,i){InHouseDeposit.AjaxPostCall(n.GetCalendarDepositSettingAndCCDetails,e,t,i,!1,!0)},RescheduleClass:function(e,t){"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?($("#lblPriceSessionEnrollment").hide(),$("#lblPriceWithTaxSessionEnrollment").show()):($("#lblPriceSessionEnrollment").show(),$("#lblPriceWithTaxSessionEnrollment").hide()),_vgClassSessionSelection.model.RescheduleAppointmentID=t;var i={};i.appointmentId=t,i.eventSessionAttendeesId=e,i.businessID=parseInt(_vgClassSessionSelection.GetCommonBusinessID()),_vgClassSessionSelection.model.IsSearchFromInHouseClass?i.loginUserID=parseInt(_vgClassSessionSelection.getSelectedCustomer()):i.loginUserID=parseInt(_shopdetail.GetRescheduleUserID());var o=new vagaro.ajax;o.datamodel.Token=n.geteventdetailforreschedule,o.datamodel.IsNewVagaroAPI=!0,o.datamodel.Error=_vgClassSessionSelection.CallFailed,o.datamodel.data=i,o.datamodel.callback=_vgClassSessionSelection.RescheduleClassSuccessCallback,o.Post()},RescheduleClassSuccessCallback:function(e){if(null!=e)if(void 0!==e.AddOnDetails&&null!=e.AddOnDetails&&(_vgClassSessionSelection.model.AttendeeAddonDetails=JSON.parse(e.AddOnDetails)),0==e.isUserExists&&(0==e.isClassFull&&!_vgClassSessionSelection.model.IsSearchFromInHouseClass||_vgClassSessionSelection.model.IsSearchFromInHouseClass)){if(1!=e.IsReschedule)return null!=_vgClassSessionSelection.model.IsOnline&&null!=_vgClassSessionSelection.model.IsOnline&&_vgClassSessionSelection.model.IsOnline?(vagaro.alert({message:"Rescheduling cannot be done. Please call "+businessName+" at "+_vgClassSessionSelection.FormatPhone(_shopdetail.Telephone)+" to reschedule.",title:"Reschedule Class"}),!1):(vagaro.alert({message:'A deposit was taken upon initial booking with a different merchant account. This can only be rescheduled with an employee using "'+e.MerchantAccountName+'" Merchant Account.',title:"Unable to Reschedule"}),!1);if(_vgClassSessionSelection.model.IsSearchFromInHouseClass){e.StreamingStatus>0?_vgClassSessionSelection.commonProperty.streamingStatus=_vgClassSessionSelection.StreamingStatusEnum.LiveStream:_vgClassSessionSelection.commonProperty.streamingStatus=_vgClassSessionSelection.StreamingStatusEnum.InHouse;var t=_vgClassSessionSelection.CheckRescheduleLocation(_vgClassSessionSelection.model.RescheduleAppointmentID);1==t?vagaro.alertsmall("You can not reschedule In-House class to Live Stream."):2==t?vagaro.alertsmall("You can not reschedule Live Stream class to In-House."):(isFromReschedual="true",_vgCal.ManageAtnd.objAtList=[],_vgClassSessionSelection.commonProperty.DepositPaid=e.DepositPaid,_vgClassSessionSelection.commonProperty.DepositsPaidDate=e.DepositsPaidDateFormated,_vgClassSessionSelection.commonProperty.IsPaid=e.isPaid,_vgClassSessionSelection.ShowEventDetailPopup(e.appointmentID,1,e.oldPrice,e.eventID,e.serviceProviderID,e.strEventDate+" "+e.strStartTime,!1,!1))}else{if(null!=_vgClassSessionSelection.model.IsOnline&&null!=_vgClassSessionSelection.model.IsOnline&&_vgClassSessionSelection.model.IsOnline){if(e.IsPriceChange)return vagaro.alert({message:"This class is a different price than the original. Please call "+businessName+" at "+_vgClassSessionSelection.FormatPhone(_shopdetail.Telephone)+" to reschedule.",title:"Reschedule Class"}),!1;if(e.IsClassWorkshopCrossBooking)return vagaro.alert({message:"The rescheduling must be done between classes. Please call "+businessName+" at "+_vgClassSessionSelection.FormatPhone(_shopdetail.Telephone)+" to reschedule.",title:"Reschedule Class"}),!1}var i;i=void 0!==e.CleanupTime&&null!=typeof e.CleanupTime&&e.CleanupTime>0?moment(e.strEndTime,"hh:mm A").subtract(e.CleanupTime,"minutes").format("hh:mm A"):e.strEndTime;var n=[],o={autoId:1};o.eventID=e.eventID,o.eventName=e.title,o.tax=e.tax,o.smallimage=e.photo,o.sessiondetail=null,o.PointRedeem=e.pointRedeem,o.PointGiven=e.pointGiven,o.eventEnrollment=[];var a={autoID:1};if(a.eventID=o.eventID,a.appointmentID=parseInt(e.appointmentID),a.customerID=_shopdetail.GetRescheduleUserID(),a.cFirstName=_shopdetail.GetRescheduleUserName(0),a.cLastName=_shopdetail.GetRescheduleUserName(1),a.cUserEmail=_shopdetail.GetRescheduleUserEmailId(),a.cUserCellNo=_shopdetail.GetRescheduleCellNo(),a.sPID=e.serviceProviderID,a.sPName=e.serviceProviderName,a.eventDate=_shopdetail.StringToDate(e.strEventDate,"-"),a.startTime=e.strStartTime,a.endTime=i,a.duration=e.eventDuration,a.isTempData=!1,a.oldPrice=e.oldPrice,a.IsWorkShop=!1,a.workshopEventOn="",a.workshopEventDays="",a.workshopEventDate="",a.paidType=0,a.StreamingStatus=e.StreamingStatus,a.CustomerStartTime=null,a.CustomerEndTime=null,a.CustomerTimeZone="",a.UtcStartTime=null,a.DurationValue=0,void 0!==e.AddOnDetails&&null!=e.AddOnDetails&&""!=e.AddOnDetails?(a.lstAddonService=JSON.parse(e.AddOnDetails),$.each(a.lstAddonService,function(e,t){t.isPointApply=!1,t.isPresetApply=!1,t.gcId=null,t.isPackage=null,t.isMembershipApply=null,t.isPriceBaseGCApply=!1,t.ServiceId=t.ServiceID,t.paidType=t.PaidType,t.price=t.Price,t.Originalprice=t.Price,t.discount=0,t.IsShowPriceOnline=!0})):a.lstAddonService=null,null!=_vgClassSessionSelection.model.IsOnline&&null!=_vgClassSessionSelection.model.IsOnline&&_vgClassSessionSelection.model.IsOnline&&null!=e.isPaid&&null!=e.isPaid&&0==e.isPaid&&null!=e.newPrice&&null!=e.newPrice&&(a.oldPrice=e.newPrice),0==e.isPaid){if(o.promotiondetail=$("#tr-"+e.appointmentID).data("promotiondetail"),void 0!==o.promotiondetail&&""!=o.promotiondetail){o.promotiondetail=o.promotiondetail.trim();var s=o.promotiondetail.split("-");a.PromotionID=o.promotiondetail.split("-")[0],a.IsAmount=0!=o.promotiondetail.split("-")[1],a.AmountValue=o.promotiondetail.split("-")[2],a.PerUserOne=o.promotiondetail.split("-")[3],s.length>4?a.PerTransactionOne=o.promotiondetail.split("-")[4]:a.PerTransactionOne="0",a.PromotionTitle=o.promotiondetail.split("|~~|")[1]}}else o.classGCUsed=0,o.calssdiscountprice=0,a.isPointApply=!1,a.isPresetApply=!1,a.gcId=null,a.isPackage=null,a.isMembershipApply=null,a.isPriceBaseGCApply=!1;if(o.eventEnrollment.push(a),n.push(o),n.length>0)if(1==e.StreamingStatus)_shopdetail.GetEventTimeZoneReschedule(n,e.StreamingStatus,e.isPaid);else{var r={};r.isPaid=1==e.isPaid,r.EventDetail=n,$("#ancShoppingCartIcon").data("classreshedule",JSON.stringify(r)),$("#ancShoppingCartIcon").attr("data-isbypass","true"),$("#ancShoppingCartIcon").click()}}}else if(1==e.isUserExists&&0==e.isClassFull||1==e.isUserExists&&1==e.isClassFull)if(_vgClassSessionSelection.model.IsSearchFromInHouseClass){var l=_vgClassSessionSelection.getSelectedCustomer(),c=cache_glbData.filter(function(e){return e.ID==l?e:null});if((null==c||null!=c&&0==c.length)&&void 0!==$("#txtCustomerSearchClass").attr("custDetail")&&null!=$("#txtCustomerSearchClass").attr("custDetail")&&""!=$("#txtCustomerSearchClass").attr("custDetail")){c=[];var d=JSON.parse($("#txtCustomerSearchClass").attr("custDetail"));c.push(d)}var u=c[0].FN.split(" "),p=u[0]+" "+u[1];vagaro.alertsmall(p+" is already enrolled in this class.")}else vagaro.alertsmall("You are already enrolled in this class.");else 0==e.isUserExists&&1==e.isClassFull&&vagaro.alertsmall("A class can't take any new enrollment as it is full.");ShowLoader(!1),"undefined"!=typeof IsRescheduleAppointment&&"true"==IsRescheduleAppointment.toLowerCase()&&($("#apgSearchProgress").hide(),$("#apgProgress").hide())},RescheduleClassForWorkShop:function(e,t){"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?($("#lblPriceSessionEnrollment").hide(),$("#lblPriceWithTaxSessionEnrollment").show()):($("#lblPriceSessionEnrollment").show(),$("#lblPriceWithTaxSessionEnrollment").hide()),_vgClassSessionSelection.model.RescheduleAppointmentID=t;var i={};i.appointmentId=t,i.eventSessionAttendeesId=e,i.businessID=parseInt(_vgClassSessionSelection.GetCommonBusinessID()),_vgClassSessionSelection.model.IsSearchFromInHouseClass?i.loginUserID=parseInt(_vgClassSessionSelection.getSelectedCustomer()):i.loginUserID=parseInt(_shopdetail.GetRescheduleUserID());var o=new vagaro.ajax;o.datamodel.IsNewVagaroAPI=!0,o.datamodel.Token=n.geteventdetailforrescheduleforworkshop,o.datamodel.Error=_vgClassSessionSelection.CallFailed,o.datamodel.data=i,o.datamodel.callback=_vgClassSessionSelection.RescheduleClassSuccessCallbackForWorkShop,o.Post()},RescheduleClassSuccessCallbackForWorkShop:function(e){if(null!=e&&e.length>0)if(0==e[0].isUserExists&&(0==e[0].isClassFull&&!_vgClassSessionSelection.model.IsSearchFromInHouseClass||_vgClassSessionSelection.model.IsSearchFromInHouseClass)){if(1!=e[0].IsReschedule)return null!=_vgClassSessionSelection.model.IsOnline&&null!=_vgClassSessionSelection.model.IsOnline&&_vgClassSessionSelection.model.IsOnline?(vagaro.alert({message:"Rescheduling cannot be done. Please call "+businessName+" at "+_vgClassSessionSelection.FormatPhone(_shopdetail.Telephone)+" to reschedule.",title:"Reschedule Workshop"}),!1):(vagaro.alert({message:'A deposit was taken upon initial booking with a different merchant account. This can only be rescheduled with an employee using "'+e[0].MerchantAccountName+'" Merchant Account.',title:"Unable to Reschedule"}),!1);if(_vgClassSessionSelection.model.IsSearchFromInHouseClass){e[0].StreamingStatus>0?_vgClassSessionSelection.commonProperty.streamingStatus=_vgClassSessionSelection.StreamingStatusEnum.LiveStream:_vgClassSessionSelection.commonProperty.streamingStatus=_vgClassSessionSelection.StreamingStatusEnum.InHouse;var t=_vgClassSessionSelection.CheckRescheduleLocation(_vgClassSessionSelection.model.RescheduleAppointmentID);1==t?vagaro.alertsmall("You can not reschedule In-House class to Live Stream."):2==t?vagaro.alertsmall("You can not reschedule Live Stream class to In-House."):(isFromReschedual="true",_vgClassSessionSelection.commonProperty.DepositPaid=e[0].DepositPaid,_vgClassSessionSelection.commonProperty.DepositsPaidDate=e[0].DepositsPaidDateFormated,_vgClassSessionSelection.commonProperty.IsPaid=e[0].isPaid,_vgClassSessionSelection.ShowEventDetailPopup(e[0].appointmentID,1,e[0].oldPrice,e[0].eventID,e[0].serviceProviderID,e[0].strEventDate+" "+e[0].strStartTime,!1,!1))}else{if(null!=_vgClassSessionSelection.model.IsOnline&&null!=_vgClassSessionSelection.model.IsOnline&&_vgClassSessionSelection.model.IsOnline){if(e[0].IsPriceChange)return vagaro.alert({message:"This workshop is a different price than the original. Please call "+businessName+" at "+_vgClassSessionSelection.FormatPhone(_shopdetail.Telephone)+" to reschedule.",title:"Reschedule Workshop"}),!1;if(e[0].IsClassWorkshopCrossBooking)return vagaro.alert({message:"The rescheduling must be done between workshop. Please call "+businessName+" at "+_vgClassSessionSelection.FormatPhone(_shopdetail.Telephone)+" to reschedule.",title:"Reschedule Workshop"}),!1}var i=[],n={autoId:1};n.eventID=e[0].eventID,n.eventName=e[0].title,n.tax=e[0].tax,n.smallimage=e[0].photo,n.sessiondetail=null,n.PointRedeem=e[0].pointRedeem,n.PointGiven=e[0].pointGiven;var o=e[0].workShopNoofSessions+" sessions every "+_vgClassSessionSelection.GetFrequency(e[0].ruleType,e[0].ruleDefinition);1!=e[0].ruleType&&(o+=" on: ");var a=_vgClassSessionSelection.GetFrequencyDays(e[0].ruleType,e[0].ruleDefinition),s="Starting on "+new Date(e[0].strEventDate).format("MMM dd, yyyy").replace(/ 0+/g," ");2==e[0].ruleType&&(a=a.replace(/<br\s*\/?>/gi,", ").slice(0,-2));var r=e.length;if(n.eventEnrollment=[],$.each(e,function(t,i){var l;l=void 0!==i.CleanupTime&&null!=typeof i.CleanupTime&&i.CleanupTime>0?moment(i.strEndTime,"hh:mm A").subtract(i.CleanupTime,"minutes").format("hh:mm A"):i.strEndTime;var c={};if(c.autoID=t+1,c.eventID=i.eventID,c.appointmentID=parseInt(i.appointmentID),c.customerID=_shopdetail.GetRescheduleUserID(),c.cFirstName=_shopdetail.GetRescheduleUserName(0),c.cLastName=_shopdetail.GetRescheduleUserName(1),c.cUserEmail=_shopdetail.GetRescheduleUserEmailId(),c.cUserCellNo=_shopdetail.GetRescheduleCellNo(),c.sPID=i.serviceProviderID,c.sPName=i.serviceProviderName,c.eventDate=_shopdetail.StringToDate(i.strEventDate,"-"),c.startTime=i.strStartTime,c.endTime=l,c.duration=i.eventDuration,c.isTempData=!1,c.oldPrice=i.oldPrice*r,c.IsWorkShop=!0,c.workshopEventOn=o,c.workshopEventDays=a,c.workshopEventDate=s,c.paidType=0,c.StreamingStatus=i.StreamingStatus,c.CustomerStartTime=null,c.CustomerEndTime=null,c.CustomerTimeZone="",c.UtcStartTime=null,c.DurationValue=0,void 0!==i.AddOnDetails&&null!=i.AddOnDetails&&""!=i.AddOnDetails?(c.lstAddonService=JSON.parse(i.AddOnDetails),$.each(c.lstAddonService,function(e,t){t.isPointApply=!1,t.isPresetApply=!1,t.gcId=null,t.isPackage=null,t.isMembershipApply=null,t.isPriceBaseGCApply=!1,t.ServiceId=t.ServiceID,t.paidType=t.PaidType,t.price=t.Price,t.Originalprice=t.Price,t.discount=0,t.IsShowPriceOnline=!0})):c.lstAddonService=null,null!=_vgClassSessionSelection.model.IsOnline&&null!=_vgClassSessionSelection.model.IsOnline&&_vgClassSessionSelection.model.IsOnline&&null!=i.newPrice&&null!=i.newPrice&&(c.oldPrice=i.newPrice),0==e[0].isPaid){if(n.promotiondetail=$("#tr-"+i.appointmentID).data("promotiondetail"),void 0!==n.promotiondetail&&""!=n.promotiondetail){n.promotiondetail=n.promotiondetail.trim();var d=n.promotiondetail.split("-");c.PromotionID=n.promotiondetail.split("-")[0],c.IsAmount=0!=n.promotiondetail.split("-")[1],c.AmountValue=n.promotiondetail.split("-")[2],c.PerUserOne=n.promotiondetail.split("-")[3],d.length>4?c.PerTransactionOne=n.promotiondetail.split("-")[4]:c.PerTransactionOne="0",c.PromotionTitle=n.promotiondetail.split("|~~|")[1]}null!=_vgClassSessionSelection.model.IsOnline&&null!=_vgClassSessionSelection.model.IsOnline&&_vgClassSessionSelection.model.IsOnline&&null!=e[0].isPaid&&null!=e[0].isPaid&&0==e[0].isPaid&&null!=i.newPrice&&null!=i.newPrice&&(c.oldPrice=i.newPrice)}else n.classGCUsed=0,n.calssdiscountprice=0,c.isPointApply=!1,c.isPresetApply=!1,c.gcId=null,c.isPackage=null,c.isMembershipApply=null,c.isPriceBaseGCApply=!1;n.eventEnrollment.push(c)}),i.push(n),i.length>0){var l=0;if($.grep(i,function(e){$.grep(e.eventEnrollment,function(e){l=1==e.IsWorkShop&&1==e.StreamingStatus?1:0})}),1==l)_shopdetail.GetEventTimeZoneReschedule(i,l,e[0].isPaid);else{var c={};c.isPaid=1==e[0].isPaid,c.EventDetail=i,$("#ancShoppingCartIcon").data("classreshedule",JSON.stringify(c)),$("#ancShoppingCartIcon").attr("data-isbypass","true"),$("#ancShoppingCartIcon").click()}}}}else if(1==e[0].isUserExists&&0==e[0].isClassFull||1==e[0].isUserExists&&1==e[0].isClassFull)if(_vgClassSessionSelection.model.IsSearchFromInHouseClass){var d=_vgClassSessionSelection.getSelectedCustomer(),u=cache_glbData.filter(function(e){return e.ID==d?e:null});if((null==u||null!=u&&0==u.length)&&void 0!==$("#txtCustomerSearchClass").attr("custDetail")&&null!=$("#txtCustomerSearchClass").attr("custDetail")&&""!=$("#txtCustomerSearchClass").attr("custDetail")){u=[];var p=JSON.parse($("#txtCustomerSearchClass").attr("custDetail"));u.push(p),p=u[0].FN.split(" ")}var h=p[0]+" "+p[1];vagaro.alertsmall(h+" is already enrolled in this class.")}else vagaro.alertsmall("You are already enrolled in this class.");else 0==e[0].isUserExists&&1==e[0].isClassFull&&vagaro.alertsmall("A class can't take any new enrollment as it is full.");ShowLoader(!1)},GetCoreAPIURLWithToken:function(e,t){try{var i="",n=CoreAPIURL.split("/");return n[3]=t,""==(i=n.join("/")+e)&&(i=CoreAPIURL+e),i}catch(t){return CoreAPIURL+e}},CheckRescheduleLocation:function(e){var t=bkEvent.getResponseFromCache();if(null!=t)var i=t.filter(function(t){return t.appointmentID==e?t:null});var n=0;if(null!=i&&i.length>0){var o=void 0===i[0].StreamingEventCapacity?0:i[0].StreamingEventCapacity;_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.LiveStream&&0==o&&(n=2),_vgClassSessionSelection.commonProperty.streamingStatus==_vgClassSessionSelection.StreamingStatusEnum.InHouse&&0==i[0].eventCapacity&&(n=1)}return n},CalAccPriceWithTax:function(e,t){var i;return i=parseFloat(ConvertTodecimalMorePrecious(t/100*parseFloat(e),!0,2))+parseFloat(e),parseFloat(i).toFixed(2)},ConvertTodecimalMorePrecious:function(e,t,i){return isNaN(parseFloat(e))&&(e=0),t?Number(Math.round(e+"e"+i)+"e-"+i).toFixed(i):parseFloat(Number(Math.round(e+"e"+i)+"e-"+i).toFixed(i))},AddOnServiceBind:function(e,t,i){if(null!=e&&null!=e)if(null!=e[0].AddonsList&&e[0].AddonsList.length>0){$(_vgClassSessionSelection.Controls.divAddonPopupSection).show(),$(".moblie-devider").show(),$(".m-addon-text").show();var n=e[0].AddonsList;_vgClassSessionSelection.localData.AddonsList=n;var o=$("#hdnAppointmentId").val(),a=$("#tr-"+o).data("promotiondetail"),s=_vgClassSessionSelection.GetClassPromotionWithLastMinute(a),r=!String.isNullOrUndefineOrBlank(s)&&1==String(s).split("-")[5];$(_vgClassSessionSelection.Controls.AddOnList).empty();var l=$.grep(n,function(e){return 0==e.ServiceLevel}),c=0;$.each(l,function(e){var o=$.grep(n,function(t){return t.ParentServiceID==l[e].ServiceId&&1==t.IsOnlineService});l[e].MinItem=l[e].MinItem>o.length?o.length:l[e].MinItem,l[e].MaxItem=l[e].MaxItem>o.length?o.length:l[e].MaxItem,null!=o&&o.length>0&&(c++,o=o.map(function(n){n.IsRequired=l[e].IsRequired,n.MinItem=l[e].MinItem,n.MaxItem=l[e].MaxItem,n.PromotionDetail=_vgClassSessionSelection.GetAddonDealWithLastMinute(n.PromotionDetail,r),n.NewPrice=i?n.Price:_vgClassSessionSelection.calculateAddonPrice(n.Price,t,$("#txtQuantity").val(),i);try{if("undefined"!=typeof _shopdetail&&null!=_shopdetail&&void 0!==_shopdetail.IsIncludeTaxInOnlinePricing&&null!=_shopdetail.IsIncludeTaxInOnlinePricing&&1==_shopdetail.IsIncludeTaxInOnlinePricing){var o=n.Taxes;if(""!=o&&null!=o&&"0"!=o){var a=o.split(","),s=0;if(""!=_shopdetail.TaxesValues&&null!=_shopdetail.TaxesValues){if(a.length>0)for(var c=0;c<a.length;c++){var d=JSON.parse(_shopdetail.TaxesValues).Taxes;$.grep(d,function(e){e.BusinessTaxID==a[c]&&(s+=e.Tax)})}n.NewPrice=CalAccPriceWithTax(n.NewPrice,s)}}}}catch(e){}return n.Photo=n.Photo.indexOf("no-shop-image-big.")>0?"":n.Photo,n}),_vgClassSessionSelection.CreateNoneOTAboveObject(o),$(_vgClassSessionSelection.Controls.tmplAddOnCategory).tmpl(l[e]).appendTo(_vgClassSessionSelection.Controls.AddOnList),$(_vgClassSessionSelection.Controls.tmplAddOnService).tmpl(o).appendTo(_vgClassSessionSelection.Controls.AddonServices+o[0].ParentServiceID))}),0==c&&($(_vgClassSessionSelection.Controls.AddOnList).empty(),$(_vgClassSessionSelection.Controls.divAddonPopupSection).hide(),$(".moblie-devider").hide(),$(".m-addon-text").hide());try{if(1==isWaitingtoreal&&null!=Waitlistdata&&null!=typeof Waitlistdata){var d=JSON.parse(Waitlistdata);if(null!=d.lstServiceSPForRealAppointment&&""!=d.lstServiceSPForRealAppointment)for(var u=0;u<d.lstServiceSPForRealAppointment.length;u++){var p=d.lstServiceSPForRealAppointment[u].AddOnIDs.split(",");if(null!=p&&null!=p&&p.length>0)for(var h=0;h<p.length;h++)$("#check_"+p[h]).prop("checked",!0),$("#rdo_"+ +p[h]).prop("checked",!0)}}}catch(e){}_vgClassSessionSelection.CalculateTotalPrice()}else $(_vgClassSessionSelection.Controls.AddOnList).empty(),$(_vgClassSessionSelection.Controls.divAddonPopupSection).hide(),$(".moblie-devider").hide(),$(".m-addon-text").hide();else $(_vgClassSessionSelection.Controls.AddOnList).empty(),$(_vgClassSessionSelection.Controls.divAddonPopupSection).hide(),$(".moblie-devider").hide(),$(".m-addon-text").hide()},CalculateTotalPrice:function(e){if(void 0!==e&&null!=e){var t=parseInt($(e).attr("data-parentserviceid"));if(0==_vgClassSessionSelection.OnEventAddonValidate(t))return $(e).prop("checked",!1),!1}var i="FREE"==$(_vgClassSessionSelection.Controls.divHdrEventPrice).text()?0:parseFloat($(_vgClassSessionSelection.Controls.divHdrEventPrice).text().replace(_vgClassSessionSelection.GetcurrencySymbol(),""));$.each($("#divAddonPopupSection input[type='checkbox']:checked"),function(e,t){if("true"==$(t).attr("data-IsShowPriceOnline")){var n=void 0===$(t).attr("data-newprice")?0:parseFloat($(t).attr("data-newprice"));i+=parseFloat(n)}}),$.each($("#divAddonPopupSection input[type='radio']:checked"),function(e,t){if("true"==$(t).attr("data-IsShowPriceOnline")){var n=void 0===$(t).attr("data-newprice")?0:parseFloat($(t).attr("data-newprice"));i+=parseFloat(n)}}),i=_onlineCheckout.parseTodecimal(i,2).format("#.##"),$(".TotalClassPrice").text(_vgClassSessionSelection.GetcurrencySymbol()+i),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&$("#hdnAdjustClassTotalPrice").val(i)},CreateAddonCollection:function(e){var t=[];return $.each($("#divAddonPopupSection input[type='checkbox']:checked"),function(i,n){var o={};o.ServiceTitle=$(n).attr("data-serviceTitle"),o.Price=parseFloat($(n).attr("data-price")),o.Originalprice=parseFloat($(n).attr("data-price")),o.ServiceId=$(n).attr("data-serviceid"),o.ParentServiceID=$(n).attr("data-parentserviceId"),o.ServiceDesc=$(n).attr("data-serviceDisc"),o.IsShowPriceOnline=$(n).attr("data-IsShowPriceOnline"),o.customerID=e.customerID,o.cUserEmail=e.cUserEmail,o.autoID=e.autoID+"_"+o.ServiceId,o.eventID=e.eventID;var a=$(n).attr("data-promotiondetail");if(void 0!==a&&""!=a){var s=a.split("-");o.PromotionID=a.split("-")[0],o.IsAmount=0!=a.split("-")[1],o.AmountValue=a.split("-")[2],o.PerUserOne=a.split("-")[3],s.length>4?o.PerTransactionOne=a.split("-")[4]:o.PerTransactionOne="0",o.PromotionTitle=a.split("|~~|")[1]}t.push(o)}),$.each($("#divAddonPopupSection input[type='radio']:checked"),function(i,n){if("true"!=$(n).attr("data-IsNOTA")){var o={};o.ServiceTitle=$(n).attr("data-serviceTitle"),o.Price=parseFloat($(n).attr("data-price")),o.Originalprice=parseFloat($(n).attr("data-price")),o.ServiceId=$(n).attr("data-serviceid"),o.ParentServiceID=$(n).attr("data-parentserviceId"),o.ServiceDesc=$(n).attr("data-serviceDisc"),o.IsShowPriceOnline=$(n).attr("data-IsShowPriceOnline"),o.customerID=e.customerID,o.cUserEmail=e.cUserEmail,o.autoID=e.autoID+"_"+o.ServiceId,o.eventID=e.eventID;var a=$(n).attr("data-promotiondetail");if(void 0!==a&&""!=a){var s=a.split("-");o.PromotionID=a.split("-")[0],o.IsAmount=0!=a.split("-")[1],o.AmountValue=a.split("-")[2],o.PerUserOne=a.split("-")[3],s.length>4?o.PerTransactionOne=a.split("-")[4]:o.PerTransactionOne="0",o.PromotionTitle=a.split("|~~|")[1]}t.push(o)}}),t},AddonValidate:function(){var e=_vgClassSessionSelection.localData.AddonsList;if(null==e||null==e||0==e.length)return!0;var t=$.grep(e,function(e){return 0==e.ServiceLevel}),i=0;return $.each(t,function(n){var o=$.grep(e,function(e){return e.ParentServiceID==t[n].ServiceId&&1==e.IsOnlineService});if(null!=o&&o.length>0){var a=_vgClassSessionSelection.ValidateAddonService(o,t[n].MinItem,t[n].MaxItem,t[n].IsRequired,!1);$("#errMsg_"+t[n].ServiceId).text(a),$("#divErrorAddon_"+t[n].ServiceId).hide(),""!=a&&($("#divErrorAddon_"+t[n].ServiceId).show(),i++)}}),0==i},ValidateAddonService:function(e,t,i,n,o){var a="",s=0;if(0!=t||1==n||0!=i){if($.each(e,function(n){1==t&&1==i?$("#rdo_"+e[n].ServiceId).prop("checked")&&s++:$("#check_"+e[n].ServiceId).prop("checked")&&s++}),1==n&&t>0){if(t>s&&!o){var r=t>1?" add-ons.":" add-on.";a="Please select at least "+_vgClassSessionSelection.NumberToWord(t)+r}else if(0!=i&&s>i){r=i>1?" add-ons.":" add-on.";a="Please select total "+_vgClassSessionSelection.NumberToWord(i)+r}}else if(0!=i&&s>i){r=i>1?" add-ons.":" add-on.";a="Please select total "+_vgClassSessionSelection.NumberToWord(i)+r}return a}return a},calculateAddonPrice:function(e,t,i){for(var n=$("#hdnAppointmentId").val(),o=$("#tr-"+n).data("sessiondetail").split(","),a=0;a<=o.length-1&&parseInt(i)>=parseInt(o[a].split("-")[1]);a++)parseInt(o[a].split("-")[1]);return parseInt(i)*e*parseInt(t)},NumberToWord:function(e){var t="";return[{value:1e7,str:"crore"},{value:1e5,str:"lakh"},{value:1e3,str:"thousand"},{value:100,str:"hundred"},{value:90,str:"ninety"},{value:80,str:"eighty"},{value:70,str:"seventy"},{value:60,str:"sixty"},{value:50,str:"fifty"},{value:40,str:"forty"},{value:30,str:"thirty"},{value:20,str:"twenty"},{value:19,str:"nineteen"},{value:18,str:"eighteen"},{value:17,str:"seventeen"},{value:16,str:"sixteen"},{value:15,str:"fifteen"},{value:14,str:"fourteen"},{value:13,str:"thirteen"},{value:12,str:"twelve"},{value:11,str:"eleven"},{value:10,str:"ten"},{value:9,str:"nine"},{value:8,str:"eight"},{value:7,str:"seven"},{value:6,str:"six"},{value:5,str:"five"},{value:4,str:"four"},{value:3,str:"three"},{value:2,str:"two"},{value:1,str:"one"}].forEach(function(i){if(e>=i.value){if(!(e<=99)){var n=Math.floor(e/i.value),o=e%i.value;return o>0?NumberToWord(n)+" "+i.str+" "+NumberToWord(o):NumberToWord(n)+" "+i.str}t+=i.str,(e-=i.value)>0&&(t+=" ")}}),t},ResetMoreButton:function(){$("#eventDescription").css("height",""),$("#btnMoreContent").html("More"),$("#btnMoreContent").removeClass("active")},CreateClassAttendeeAddonCollection:function(e){for(var t=[],i=_vgSearchAddon.Model.SelectedAddonService,n=0;n<i.length;n++)for(var o=0;o<i[n].lstAddonService.length;o++){var a={};a.ServiceTitle=i[n].lstAddonService[o].ServiceTitle,"undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value?a.Price=parseFloat(ConvertTodecimalMorePrecious(parseFloat(i[n].lstAddonService[o].Price)/(1+_vgClassSessionSelection.GetTaxTotalForService(CalendarConfiguration.CommonDetails.BusinessTaxes,i[n].lstAddonService[o].Taxation)/100),!0,2)):a.Price=i[n].lstAddonService[o].Price,a.ServiceId=i[n].lstAddonService[o].serviceId,a.Duration=i[n].lstAddonService[o].Duration,a.ServiceDesc=i[n].lstAddonService[o].ServiceDesc,a.Taxation=_vgClassSessionSelection.GetTaxTotalForService(CalendarConfiguration.CommonDetails.BusinessTaxes,i[n].lstAddonService[o].Taxation),a.CalculatedTaxTypeWise=_vgClassSessionSelection.GetTaxesForService(CalendarConfiguration.CommonDetails.BusinessTaxes,i[n].lstAddonService[o].Taxation),a.pointsRedeem=i[n].lstAddonService[o].PointRedeem,t.push(a)}return t},CreateClassAttendeeAddonXMl:function(e,t,i,n){var o=_vgClassSessionSelection.GetCartUserDetail();$.each(e,function(e,a){var s=null;s=_vgClassSessionSelection.createXmlElement("appointment");var r;if((r=t.isHandleDuetoException,s.append(_vgClassSessionSelection.createXmlElement("isHandleDuetoException",1==r?"1":"0")),s.append(_vgClassSessionSelection.createXmlElement("appId",t.appointmentID)),s.append(_vgClassSessionSelection.createXmlElement("spid",t.sPID)),s.append(_vgClassSessionSelection.createXmlElement("spname","")),s.append(_vgClassSessionSelection.createXmlElement("isworkshop",t.IsWorkShop)),s.append(_vgClassSessionSelection.createXmlElement("appstarttime",new Date(t.eventDate).format("yyyy-MM-dd")+" "+t.startTime)),i.append(s),s.append(_vgClassSessionSelection.createXmlElement("fname",t.cFirstName)),s.append(_vgClassSessionSelection.createXmlElement("lname",t.cLastName)),s.append(_vgClassSessionSelection.createXmlElement("email",t.cUserEmail)),s.append(_vgClassSessionSelection.createXmlElement("cellno",t.cUserCellNo)),5!=n&&null!=txtDepositCls&&null!=txtDepositCls&&""!=txtDepositCls&&null!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls&&null!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls&&""!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls)&&(0!=_vgCal.ManageAtnd.model.NewApp_txtPriceCls&&0!=txtDepositCls.value))if("undefined"!=typeof hdnPriceWithTaxSwitch&&"1"==hdnPriceWithTaxSwitch.value&&_vgCal.ManageAtnd.objAtList.length<=1){if(void 0!==InHouseDeposit.model.AppObj[0].eventEnrollment&&null!=InHouseDeposit.model.AppObj[0].eventEnrollment&&InHouseDeposit.model.AppObj[0].eventEnrollment.length>0){var l,c=0;$.grep(InHouseDeposit.model.AppObj[0].eventEnrollment,function(e,t){if(e.depositsPercentage<100){c+=e.Price;var i=parseFloat(InHouseDeposit.ConvertDecimalWithFixed(100*parseFloat(e.depositsPaid)/e.Price,!0,2));if(e.depositsPercentage=i,e.lstAddonService.length>0)for(var n=0;n<e.lstAddonService.length;n++)c+=e.lstAddonService[n].Price,e.lstAddonService[n].depositsPercentage<100&&(e.lstAddonService[n].depositsPercentage=parseFloat(InHouseDeposit.ConvertDecimalWithFixed(100*parseFloat(e.lstAddonService[n].depositsPaid)/e.lstAddonService[n].Price,!0,2)))}}),1*(l=100*txtDepositCls.value/c)>100&&(l=100),s.append(_vgClassSessionSelection.createXmlElement("DepositsPercentage",l))}}else _vgCal.ManageAtnd.objAtList.length>1?s.append(_vgClassSessionSelection.createXmlElement("DepositsPercentage",_vgClassSessionSelection.GetDepositPercentage(t.customerID))):(1*(l=100*txtDepositCls.value/_vgCal.ManageAtnd.model.NewApp_txtPriceCls)>100&&(l=100),s.append(_vgClassSessionSelection.createXmlElement("DepositsPercentage",l)));if(100==a.depositsPercentage){if("undefined"!=a.CalculatedTaxTypeWise&&null!=a.CalculatedTaxTypeWise&&a.CalculatedTaxTypeWise.length>0){var d=0;$.each(a.CalculatedTaxTypeWise,function(e,t){d+=t.Tax}),s.append(_vgClassSessionSelection.createXmlElement("addontaxation",d)),s.append(_vgClassSessionSelection.createXmlElement("calculatedtaxtypewise",JSON.stringify(a.CalculatedTaxTypeWise)));var u=$.map(a.CalculatedTaxTypeWise,function(e){return e.BusinessTaxID}).join();s.append(_vgClassSessionSelection.createXmlElement("taxes",u))}}else if("undefined"!=typeof hdnPriceWithTaxSwitch&&null!=hdnPriceWithTaxSwitch&&null!=hdnPriceWithTaxSwitch&&!String.isNullOrUndefineOrBlank(hdnPriceWithTaxSwitch.value)&&"1"==hdnPriceWithTaxSwitch.value&&"undefined"!=a.CalculatedTaxTypeWise&&null!=a.CalculatedTaxTypeWise&&a.CalculatedTaxTypeWise.length>0){s.append(_vgClassSessionSelection.createXmlElement("calculatedtaxtypewise",JSON.stringify(a.CalculatedTaxTypeWise)));u=$.map(a.CalculatedTaxTypeWise,function(e){return e.BusinessTaxID}).join()}if(5==n){if(s.append(_vgClassSessionSelection.createXmlElement("paidtype",a.paidType)),a.paidType!=InHouseDeposit.arrpaidType.DepositsClass&&a.paidType!=InHouseDeposit.arrpaidType.PartiallyPaidClass||void 0!==a.depositsPaid&&(s.append(_vgClassSessionSelection.createXmlElement("depositspercentage",a.depositsPercentage)),s.append(_vgClassSessionSelection.createXmlElement("depositspaid",a.depositsPaid)),s.append(_vgClassSessionSelection.createXmlElement("payableamount",a.Price)),s.append(_vgClassSessionSelection.createXmlElement("depositsremaining",_vgClassSessionSelection.ConvertTodecimal(a.Price-a.depositsPaid,2,!1)))),InHouseDeposit.model.TipPer>0&&a.paidType==InHouseDeposit.arrpaidType.PaidClass){var p=InHouseDeposit.ConvertDecimalWithFixed(wadPrice,!1,2);1!=a.isPackage&&1!=a.isPointApply||(p=InHouseDeposit.ConvertDecimalWithFixed(a.Originalprice,!1,2));var h=0;tipCalculatedCount+=1,h=tipCalculatedCount==PaidClassCount?InHouseDeposit.ConvertDecimalWithFixed(InHouseDeposit.model.Tip-tipCalculated,!1,2):InHouseDeposit.ConvertDecimalWithFixed(p*InHouseDeposit.model.TipPer/100,!1,2),s.append(_vgClassSessionSelection.createXmlElement("tipAmount",h)),tipCalculated+=h}if(s.append(_vgClassSessionSelection.createXmlElement("promotionid",0)),(1==a.isPackage||0==a.isPackage)&&a.gcId>0||1==a.isPriceBaseGCApply){var m=[],g=[];1==a.isPriceBaseGCApply?s.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!0)):s.append(_vgClassSessionSelection.createXmlElement("ispricebasedgc",!1)),s.append(_vgClassSessionSelection.createXmlElement("ispackage",a.isPackage)),1==a.isPriceBaseGCApply&&$.each(a.GCDetailPriceBase,function(e,t){m.push(t.GCId),g.push(t.GCAmount)}),s.append(_vgClassSessionSelection.createXmlElement("gcid",void 0===a.gcId||null==a.gcId?0:a.gcId)),s.append(_vgClassSessionSelection.createXmlElement("gcids",0==m.length?0:m.join(","))),s.append(_vgClassSessionSelection.createXmlElement("gcamount",0==g.length?0:g.join(","))),a.RedeemServiceId>0&&s.append(_vgClassSessionSelection.createXmlElement("redeemserviceid",a.RedeemServiceId))}if(1==a.isPointApply){var v=0;1==a.IsPartialPointApply&&(v=a.PartialServicePrice),s.append(_vgClassSessionSelection.createXmlElement("ispartialpointapply",a.IsPartialPointApply)),s.append(_vgClassSessionSelection.createXmlElement("partialserviceprice",v)),s.append(_vgClassSessionSelection.createXmlElement("ispointapply",a.isPointApply)),s.append(_vgClassSessionSelection.createXmlElement("pointsredeem",a.pointsRedeem))}if(1==a.isMembershipApply&&null!=a.membershipUniqueID&&null!=a.membershipUniqueID&&""!=a.membershipUniqueID){s.append(_vgClassSessionSelection.createXmlElement("ismembershipapply",a.isMembershipApply)),s.append(_vgClassSessionSelection.createXmlElement("membershipdiscountpercentage",a.membershipDiscount)),s.append(_vgClassSessionSelection.createXmlElement("membershipuserid",a.membershipuserid)),s.append(_vgClassSessionSelection.createXmlElement("membershipuniqueid",a.membershipUniqueID));var f=null;if((f=_vgClassSessionSelection.createXmlElement("membershipredeemeddetails")).append(_vgClassSessionSelection.createXmlElement("businessid",a.BusinessID)),f.append(_vgClassSessionSelection.createXmlElement("redeembusinessid",a.RedeemBusinessId)),0==t.customerID)null!=(C=$.grep(o,function(e){return 0==t.customerID&&e.emailId==t.cUserEmail}))&&C.length>0?f.append(_vgClassSessionSelection.createXmlElement("userid",C[0].userId)):f.append(_vgClassSessionSelection.createXmlElement("userid",t.customerID));else f.append(_vgClassSessionSelection.createXmlElement("userid",t.customerID));f.append(_vgClassSessionSelection.createXmlElement("membershipuserid",a.membershipuserid)),f.append(_vgClassSessionSelection.createXmlElement("membershipid",a.MembershipID)),f.append(_vgClassSessionSelection.createXmlElement("membershipitemid",a.MembershipItemId)),f.append(_vgClassSessionSelection.createXmlElement("groupid",a.GroupId)),f.append(_vgClassSessionSelection.createXmlElement("isunlimitedvisit",-1==a.VisitRemaining)),f.append(_vgClassSessionSelection.createXmlElement("serviceproductname",a.eventName.trim())),s.append(f)}_vgCal.ManageAtnd.model.IsCheckout=!1}else s.append(_vgClassSessionSelection.createXmlElement("paidtype",t.paidType));s.append(_vgClassSessionSelection.createXmlElement("streamingstatus",t.StreamingStatus));var C,S="";0==t.customerID?(S=C=$.grep(o,function(e){return 0==t.customerID&&e.emailId==t.cUserEmail}),null!=C&&C.length>0?s.append(_vgClassSessionSelection.createXmlElement("userid",C[0].userId)):s.append(_vgClassSessionSelection.createXmlElement("userid",t.customerID))):(S=$.grep(o,function(e){return e.userId==t.customerID}),s.append(_vgClassSessionSelection.createXmlElement("userid",t.customerID)));if(null!=S&&S.length>0&&s.append(_vgClassSessionSelection.createXmlElement("isnewcustomer",S[0].isNewCustomer)),0==isCheckInApp){var y=!1;$(".cartremoverdtl").each(function(e,t){void 0!==$(t).attr("data-isWorkShop")&&"true"==$(t).attr("data-isWorkShop").toLowerCase()&&(y=!0)});var b=_vgClassSessionSelection.GetRescheduleDetail();null!=b&&(y||(isReschedule=!0),s.append(_vgClassSessionSelection.createXmlElement("eventsessionattendeeid",b.EventSessionAttendeesId)))}s.append(_vgClassSessionSelection.createXmlElement("isAddon",!0)),s.append(_vgClassSessionSelection.createXmlElement("uniqueAddonID","addon"+t.appointmentID+t.autoID)),s.append(_vgClassSessionSelection.createXmlElement("serviceid",a.ServiceId)),s.append(_vgClassSessionSelection.createXmlElement("addonname",a.ServiceTitle)),s.append(_vgClassSessionSelection.createXmlElement("price",a.Price))})},OnEventAddonValidate:function(e){var t=_vgClassSessionSelection.localData.AddonsList;if(null==t||null==t||0==t.length)return!0;var i=$.grep(t,function(t){return 0==t.ServiceLevel&&t.ServiceId==e}),n=0;return $.each(i,function(e){var o=$.grep(t,function(t){return t.ParentServiceID==i[e].ServiceId&&1==t.IsOnlineService});if(null!=o&&o.length>0){var a=_vgClassSessionSelection.ValidateAddonService(o,i[e].MinItem,i[e].MaxItem,i[e].IsRequired,!0);$("#errMsg_"+i[e].ServiceId).text(a),$("#divErrorAddon_"+i[e].ServiceId).hide(),""!=a&&n++}}),0==n},CreateNoneOTAboveObject:function(e){if(0==e[0].IsRequired&&(1==e[0].MinItem&&1==e[0].MaxItem||0==e[0].MinItem&&1==e[0].MaxItem)){var t={};t.MinItem=e[0].MinItem,t.MaxItem=e[0].MaxItem,t.ServiceId=e[0].ServiceId+e[0].ParentServiceID,t.ParentServiceID=e[0].ParentServiceID,t.ServiceTitle="None of the above",t.ServiceDesc="",t.IsShowPriceOnline=!1,t.Photo="",t.Price=0,t.NewPrice=0,t.PromotionDetail="",t.IsNOTA=!0,e.push(t)}},ClassPromotionForNewCustomer:function(e){var t=!0;try{if(1==e.hasOwnProperty("promotionID")){var i=e.promotionID;if(void 0!==i&&null!=i&&"undefined"!=typeof PromotionDetails&&null!=PromotionDetails){var n=$.grep(PromotionDetails,function(e){return e.PromotionID==i});null!=n&&n.length>0&&"2"==n[0].CustomerFilters&&0==IsForNewCustomer&&"0"!=UserID&&(t=!1),null!=n&&n.length>0&&"1"==n[0].CustomerFilters&&1==IsForNewCustomer&&"0"!=UserID&&(t=!1)}}}catch(e){}return t},GetClassPromotionWithLastMinute:function(e){try{if(String.isNullOrUndefineOrBlank(e))return e;if("undefined"==typeof PromotionDetails||null==PromotionDetails)return e;var t=e.split("-")[5];if(1==t){var i=jQuery.grep(PromotionDetails,function(e){return e.IsLastMinuteBooked==t});return i.length>0&&void 0!==i[0].IsLastMinuteBooked&&null!=i[0].IsLastMinuteBooked&&0!=i[0].IsLastMinuteBooked?e:""}}catch(e){}return e},GetAddonDealWithLastMinute:function(e,t){try{if(String.isNullOrUndefineOrBlank(e))return e;var i=e.split("|~~|");if(i.length<4)return e;for(var n="",o="",a=0;a+3<i.length;a+=4){var s=i[a]+"|~~|"+i[a+1]+"|~~|"+i[a+2]+"|~~|"+i[a+3];1==i[a].split("-")[5]?""===o&&(o=s):""===n&&(n=s)}return t&&""!==o?o:n}catch(t){return e}},UpdateClassDealDiscountBadge:function(e,t){try{var i=$(".promo-digit","#divdd-select-search5");if(0===i.length)return;if(String.isNullOrUndefineOrBlank($("#hdnClassIDForClass").val()))return;if(null==e||""===e.toString().trim())return void i.html("").hide();var n=e.toString().split("-"),o=n[1],a=Number(n[2]);if(isNaN(a)||a<=0)return void i.html("").hide();var s="undefined"!=typeof _shopdetail?_shopdetail.currencySymbol:"",r="";if(0==o){r=(a%1==0?a.toString():a.toFixed(2))+"% OFF"}else{var l=Number(t)-a;(isNaN(l)||l<0)&&(l=0),r=s+l.toFixed(2)}i.html('<div class="vg-service-video"><em>&#xf02b</em><span>'+r+"</span></div>").show(),$("#divdd-select-search5").show()}catch(e){}}},bkClassAvailableDates={timeSlotsCache:{},model:{},init:function(){this.model.cacheLen=3,this.model.cacheDuration=5},getCacheKey:function(){return this.model.csvServiceID.toString()+"-"+this.model.csvSPID.toString()+"-"+this.model.csvFilterType.toString()},addResponseToCache:function(e){if(void 0===this.timeSlotsCache[this.getCacheKey()]||null===this.timeSlotsCache[this.getCacheKey()]){this.timeSlotsCache[this.getCacheKey()]={timestamp:new Date,resp:e},Object.keys||(Object.keys=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t});var t=Object.keys(this.timeSlotsCache);t.length>this.model.cacheLen&&delete this.timeSlotsCache[t[0]]}},getResponseFromCache:function(){if(void 0!==this.timeSlotsCache[this.getCacheKey()]&&null!==this.timeSlotsCache[this.getCacheKey()]){var e=this.timeSlotsCache[this.getCacheKey()].timestamp,t=new Date;if(t.setMinutes(t.getMinutes()-this.model.cacheDuration),e>t)return this.timeSlotsCache[this.getCacheKey()].resp;this.removeCacheByCurKey()}return null},removeCacheByCurKey:function(){delete this.timeSlotsCache[this.getCacheKey()]}},bkEvent={timeSlotsCache:{},model:{},init:function(){this.model.cacheLen=3,this.model.cacheDuration=30},getCacheKey:function(){return this.model.searchFromDate.toString()+"-"+this.model.searchToDate.toString()+"-"+this.model.csvServiceID.toString()+"-"+this.model.csvSPID.toString()+"-"+this.model.csvFilterType.toString()},addResponseToCache:function(e){if(void 0===this.timeSlotsCache[this.getCacheKey()]||null===this.timeSlotsCache[this.getCacheKey()]){this.timeSlotsCache[this.getCacheKey()]={timestamp:new Date,resp:e},Object.keys||(Object.keys=function(e){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);return t});var t=Object.keys(this.timeSlotsCache);t.length>this.model.cacheLen&&delete this.timeSlotsCache[t[0]]}},getResponseFromCache:function(){if(void 0!==this.timeSlotsCache[this.getCacheKey()]&&null!==this.timeSlotsCache[this.getCacheKey()]){var e=this.timeSlotsCache[this.getCacheKey()].timestamp,t=new Date;if(t.setMinutes(t.getMinutes()-this.model.cacheDuration),e>t)return this.timeSlotsCache[this.getCacheKey()].resp;this.removeCacheByCurKey()}return null},removeCacheByCurKey:function(){delete this.timeSlotsCache[this.getCacheKey()]}}}(),$(document).on("click",".addguestlink",function(){$(this).closest("div.panel-default").find("div.panel-heading").attr("id");$("#ffguestmodel").attr("data-value",$(this).closest("div.panel-default").find("div.panel-heading").attr("id")),$("#ffguestdetail input").each(function(){$(this).val(""),$(this).removeClass("errorInput")}),$("#ffguestdetail div.validatemsg").each(function(){$(this).hide()}),$("html, body").animate({scrollTop:0},"swing",function(){})}),$(document).on("click",".classAppointment .w-dropdown-toggle",function(){var e=$(this).offset().top,t=$(".AppSearchResult").height()+50-($(this).offset().top+$(this).outerHeight()),i=$(".w-dropdown-list").height()+$(".w-dropdown-toggle").outerHeight();$(".w-dropdown-list").removeClass("activeFlip activeFlipTop"),e<i?$(this).next(".w-dropdown-list").addClass("activeFlip"):$(".w-dropdown-list").removeClass("activeFlip"),t<i?$(this).next(".w-dropdown-list").addClass("activeFlipTop"):$(".w-dropdown-list").removeClass("activeFlipTop")}),$(window).resize(function(){var e=$(".panel-heading").width();$(".ffattendeelist-bg").attr("style","Width:"+e+"px")}),$(window).on("orientationchange",function(){try{isMobileDevice()&&$("#classDetailpopup").is(":visible")&&setTimeout(function(){try{var e=$("#hdnAppointmentId").val(),t=$("#tr-"+e),i=null;if(t.length&&""!=t.data("availabledates"))try{i=JSON.parse(t.data("availabledates"))}catch(e){i=null}i&&null!=e&&""!==e&&_vgClassSessionSelection.ResetCalendarControl(i,e)}catch(e){}},300)}catch(e){}}),window.addEventListener("message",MyAccountlistener,!1),function(e,t){"use strict";if(void 0===e.$Interframe){var i=new Error("Interframe requires jQuery version 1.9.1 or higher, but lower than version 3."),n="undefined"==typeof jQuery?void 0:jQuery;if(void 0===n)throw i;var o=n.fn.jquery.split(" ")[0].split(".");o[0]<2&&o[1]<9||1==o[0]&&9==o[1]&&o[2]<1||o[0]>2&&3==o[0]&&2==o[1]&&o[2];var a=!0,s=!1,r=500,l=250,c=void 0,d=/Chrome/.test(navigator.userAgent),u=!1===d&&/Safari/.test(navigator.userAgent),p=/firefox/i.test(navigator.userAgent),h=0,m=!1,g=!1,v=e.parent!=e&&null!=t.referrer?e.parent:null,f="*",C=[],S=function(e,t){for(var i=C.length-1;i>=0;--i)if(C[i].window===e&&C[i].origin===t)return C[i];return null},y=!0,b=[],k=[],_=0,D=Number.MIN_VALUE,I=Number.MAX_VALUE,w=0,P=n(e).height(),A=n(e).width(),T=function(e){return"<"+e.localName+' id="'+e.id+'" class="'+e.className+'">'},x="object"!=typeof console||"function"!=typeof console.log?function(){}:function(t,i){"number"==typeof t&&h>=t&&console.log("["+e.location.href.replace(/#.*$/,"")+"]\n"+i)},F=function(e,t,i){if("object"==typeof e&&null!==e){var n=JSON.stringify("object"==typeof i?i:{});x(3,"Send "+n+" to "+t),e.postMessage(n,t)}},$=function(e,t){F(e.originalEvent.source,e.originalEvent.origin,t)},O=function(){"object"==typeof e.FB&&(void 0===c&&(c=null,setTimeout(function(){null===c&&(c=!1)},5e3)),(null===c||c)&&FB.Canvas.getPageInfo(function(t){null===c&&(c=!0,g=!0,v=null,x(0,"Facebook canvas detected"),setInterval(O,l)),F(e,e.location.origin,{object:"updateViewport2Window",top:t.scrollTop-t.offsetTop,height:t.clientHeight,width:t.clientWidth})}))},M=function(t,i){!1===g&&O();var o=n("#page-wrapper").length>0?n("#divLoginNew:visible").length>0?n("#divLoginNew")[0].scrollHeight:n("#dvRegister:visible").length>0?n("#dvRegister")[0].scrollHeight:n("#divClassDetailpopup:visible").length>0?n("#divClassDetailpopup")[0].scrollHeight:n("#divShoppingcartpopup:visible").length>0?n("#divShoppingcartpopup")[0].scrollHeight:n("#divGCHistoryPopup:visible").length>0?n("#divGCHistoryPopup")[0].scrollHeight:n("#ffguestmodel:visible").length>0?n("#ffguestmodel")[0].scrollHeight:n("#pnlAddFamilyFriendSharingModal:visible").length>0?n("#pnlAddFamilyFriendSharingModal")[0].scrollHeight:n("#divSPReviewPopup:visible").length>0?screen.height:n("#page-wrapper")[0].scrollHeight:d?n("html")[0].scrollHeight:p?n("body")[0].scrollHeight:u?n("html")[0].scrollHeight:n("body")[0].scrollHeight;if(void 0===t&&(t=o,Math.abs(_-t)<5||Math.abs(_-D)<5&&t+5<D||Math.abs(_-I)<5&&t-5>I))"function"==typeof i&&i(t,o);else if("isEmbedded"==i&&(t=o),!1!==g){var a=n.Event("changing.interframe",{height:t});if(n(e).trigger(a),a.isDefaultPrevented())"function"==typeof i&&i(t,o);else if(c)FB.Canvas.setSize({height:t}),x(1,"FB.Canvas.setSize({ height: "+t+" })"),"function"==typeof i&&i(t,o),setTimeout(function(){F(e,e.location.origin,{object:"updateSize",reqHeight:t,actHeight:t,orgHeight:o})},100);else if(b.push({height:t,callback:i}),0===k.length&&b.length>0){var s=b.shift();for(k.push(s.callback);b.length>0&&b[0].height===s.height;)k.push(b.shift().callback);n("#dvServiceContainer").length&&n("#dvServiceContainer").is(":visible")?F(v,f,{object:"requestSize",height:s.height,isOffsetChange:!1}):F(v,f,{object:"requestSize",height:s.height,isOffsetChange:!0})}}else"function"==typeof i&&i(t,o)};e.$Interframe={inspect:function(){return{mutationObserver:!(!e.MutationObserver&&!e.WebKitMutationObserver),pollingInterval:r,userAgent:navigator.userAgent,isChrome:d,isSafari:u,isFirefox:p,debug:h,isIniting:m,isRegistered:g,isFBParent:c,FBPollingInterval:l,myParent:v,parentOrigin:f,childFrames:C,autoSize:y,sizeRequestThreshold:5,sizeUpdateRequestQ:b,sizeUpdatingQ:k,curHeight:_,curMinHeight:D,curMaxHeight:I,viewport2Window:w,viewportTop:w+n(e).scrollTop(),viewportHeight:P,viewportWidth:A,setPollingInterval:function(e){return"number"==typeof e&&e>100&&(r=e),r},setFBPollingInterval:function(e){return"number"==typeof e&&e>100&&(l=e),l},setDebug:function(e){return"number"==typeof e&&(h=Math.min(Math.max(e,0),3)),h}}},getJQuery:function(){return n},init:function(i,o){if(m)x(2,"$Interframe.init() skipped.");else{x(2,"$Interframe.init() started."),m=!0,"boolean"==typeof i&&(y=i),"number"==typeof o&&(h=o);var l={"register?":function(e,t){void 0!==t&&void 0!==t.type&&"Embedded"==t.type?(n("body,html").removeClass("Embedded_Widget").addClass("Embedded_Widget"),void 0!==t.uid&&""!=t.uid&&n("body").attr("data-uid",t.uid)):void 0!==t&&void 0!==t.type&&"Popup_Widget"==t.type&&n("body,html").removeClass("Popup_Widget").addClass("Popup_Widget"),"*"!==f?x(0,'Received "register?".'):(x(0,'Received "register?". Send "register".'),$(e,{object:"register"}))},register:function(e,t){x(0,'Received "register". Send "registerACK".'),$(e,{object:"registerACK"})},registerACK:function(e,t){"*"!==f?x(0,'Received "registerACK".'):(x(0,'Received "registerACK". Send "registerDone".'),f=e.originalEvent.origin,$(e,{object:"registerDone"}))},registerDone:function(t,i){x(0,'Received "registerDone". Send "registerDoneACK".');var o=function(e,t){for(var i=n("iframe"),o=i.length-1;o>=0;--o)if(i[o].contentWindow===e){for(var a=C.length-1;a>=0;--a)C[a].window===e&&C.splice(a,1);return C.push({window:e,origin:t,frame:i[o]}),C[C.length-1]}return null}(t.originalEvent.source,t.originalEvent.origin);$(t,{object:"registerDoneACK"});var a=e.$Interframe.getViewport2Doc();(null===v||g)&&F(o.window,o.origin,{object:"updateViewport2Window",top:a.top-n(o.frame).offset().top,height:a.height,width:a.width})},registerDoneACK:function(t,i){x(0,'Received "registerDoneACK".'),g=!0,n(e).trigger(n.Event("registered.interframe"))},requestSize:function(t,i){if(n(".vagaro-iframe-100").length>0)for(var o=C.length-1;o>=0;--o){var r;if(C[o].window===t.originalEvent.source&&C[o].origin===t.originalEvent.origin)if(null!==(r=C[o])){var l="";if(void 0!==r.frame&&void 0!==r.frame.dataset&&void 0!==r.frame.dataset.uid&&(l=r.frame.dataset.uid),""!=l){var d=n(r.frame).height(),u=isNaN(i.height)?d:i.height,p=parseFloat(n(r.frame).css("max-height")),h=parseFloat(n(r.frame).css("min-height")),m=Math.max(Math.min(isNaN(p)?u:p,u),isNaN(h)?u:h);x(1,'Received "requestSize". orgH='+d+" reqH="+u+" actH="+m+" minH="+h+" maxH="+p);var g=m>=u?"no":"auto";n(".vagaro-container.vagaro-popup-widget").length>0&&(g="auto");try{n(r.frame).css("height",""),null!=n(r.frame).contents().find("#hdnBusinessID").val()&&"107141"==n(r.frame).contents().find("#hdnBusinessID").val()?(p<u&&(m=u),n(r.frame).attr("height",m).attr("scrolling",g).css("overflow",m>=u?"none":"auto").css("max-height",p<u?m:p)):n(r.frame).attr("height",m).attr("scrolling",g).css("overflow",m>=u?"none":"auto")}catch(e){n(r.frame).attr("height",m).attr("scrolling",g).css("overflow",m>=u?"none":"auto")}var f="100%";if(n("#"+l+" .vagaro-iframe-100").length>0?f=n("#"+l+" .vagaro-iframe-100").width():n("#"+l+" .vagaro-popup").length>0?f=n("#"+l+" .vagaro-popup").width():n("#"+l+" .vagaro-iframe").length>0&&(f=n("#"+l+" .vagaro-iframe").width()),n(r.frame).attr("width",f),s&&!a&&n("body,html").hasClass("Embedded_Widget")&&1==i.isOffsetChange&&d>u&&n(window).scrollTop()!=n("#"+l+" .vagaro-iframe iframe").offset().top&&n(window).scrollTop(n("#"+l+" .vagaro-iframe iframe").offset().top),a=!1,F(r.window,r.origin,{object:"updateSize",reqHeight:u,actHeight:m,orgHeight:d,minHeight:h,maxHeight:p,reqWidth:f,uid:l}),v||c)M(n(e).height()+m-d);else{var y=e.$Interframe.getViewport2Doc();n.each(C,function(){F(this.window,this.origin,{object:"updateViewport2Window",top:y.top-n(this.frame).offset().top,height:y.height,width:y.width})})}}}}else if(null!==(r=S(t.originalEvent.source,t.originalEvent.origin))){d=n(r.frame).height(),u=isNaN(i.height)?d:i.height,p=parseFloat(n(r.frame).css("max-height")),h=parseFloat(n(r.frame).css("min-height")),m=Math.max(Math.min(isNaN(p)?u:p,u),isNaN(h)?u:h);x(1,'Received "requestSize". orgH='+d+" reqH="+u+" actH="+m+" minH="+h+" maxH="+p);g=m>=u?"no":"auto";n(".vagaro-container.vagaro-popup-widget").length>0&&(g="auto");try{null!=n(r.frame).contents().find("#hdnBusinessID").val()&&"107141"==n(r.frame).contents().find("#hdnBusinessID").val()?(p<u&&(m=u),n(r.frame).attr("height",m).attr("scrolling",g).css("overflow",m>=u?"none":"auto").css("max-height",p<u?m:p)):n(r.frame).attr("height",m).attr("scrolling",g).css("overflow",m>=u?"none":"auto")}catch(e){n(r.frame).attr("height",m).attr("scrolling",g).css("overflow",m>=u?"none":"auto")}f="100%";if(n(".vagaro-popup").length>0?f=n(".vagaro-popup").width():n(".vagaro-iframe").length>0&&(f=n(".vagaro-iframe").width()),n(r.frame).attr("width",f),s&&!a&&n("body,html").hasClass("Embedded_Widget")&&1==i.isOffsetChange&&d>u&&n(window).scrollTop()!=n(".vagaro-iframe iframe").offset().top&&n(window).scrollTop(n(".vagaro-iframe iframe").offset().top),a=!1,F(r.window,r.origin,{object:"updateSize",reqHeight:u,actHeight:m,orgHeight:d,minHeight:h,maxHeight:p,reqWidth:f}),v||c)M(n(e).height()+m-d);else{y=e.$Interframe.getViewport2Doc();n.each(C,function(){F(this.window,this.origin,{object:"updateViewport2Window",top:y.top-n(this.frame).offset().top,height:y.height,width:y.width})})}}},updateSize:function(t,i){_=i.actHeight,void 0!==i.reqWidth&&void 0!==i.uid&&void 0!==n("body").attr("data-uid")&&""!=n("body").attr("data-uid")?n("body").attr("data-uid")===i.uid&&n("body").width(i.reqWidth):void 0!==i.reqWidth&&n("body").width(i.reqWidth),void 0!==i.minHeight&&(D=i.minHeight),void 0!==i.maxHeight&&(I=i.maxHeight),x(1,'Received "updateSize". curHeight='+_+" curMinHeight="+D+" curMaxHeight="+I),n.each(k,function(){"function"==typeof this&&this(i.reqHeight,i.actHeight,i.minHeight,i.maxHeight)}),k=[],n(e).trigger(n.Event("changed.interframe",{reqHeight:i.reqHeight,actHeight:i.actHeight,minHeight:i.minHeight,maxHeight:i.maxHeight})),setTimeout(M,r)},checkSize:function(e,t){x(1,'Received "checkSize".'),_=0,void 0!==t&&void 0!==typeof t.isEmbedded?M(0,"isEmbedded"):M()},openinNewWindow:function(e,t){var i;x(1,t.URL),i=t.URL,window.open("about:blank","newtab").location=i},updateViewport2Window:function(t,i){w=i.top,P=i.height,A=i.width,x(1,'Received "updateViewport2Window". viewport2Window='+w+" viewportHeight="+P+" viewportWidth="+A);var o=e.$Interframe.getViewport2Doc();n(e).trigger(n.Event("viewport.interframe",{top:o.top,height:o.height})),n.each(C,function(){F(this.window,this.origin,{object:"updateViewport2Window",top:o.top-n(this.frame).offset().top,height:o.height,width:o.width})})},updateViewportscroll:function(e,t){if(n("body").hasClass("Embedded_Widget")){var i=n(".vagaro-container").offset().top+t.height;n("html, body").animate({scrollTop:i},750,"swing",function(){})}},setStoratevalueintoParent:function(e,t){try{void 0!==t&&null!=t&&void 0!==t.storagedetail&&null!=t.storagedetail&&(""!=t.storagedetail.Value?localStorage.setItem(t.storagedetail.Key,t.storagedetail.Value):localStorage.removeItem(t.storagedetail.Key))}catch(e){x(0,"Error in setStoratevalueintoParent.")}},getStoratevaluefromParent:function(e,t){try{void 0!==t&&null!=t&&void 0!==t.storagedetail&&null!=t.storagedetail&&(t.storagedetail.Value=localStorage.getItem(t.storagedetail.Key),$(e,{object:"getStoratevalueatChild",storagedetail:t.storagedetail}))}catch(e){x(0,"Error in getStoratevaluefromParent.")}},getStoratevalueatChild:function(e,t){try{if(void 0!==t&&null!=t&&void 0!==t.storagedetail&&null!=t.storagedetail&&void 0!==t.storagedetail.callBackFunction){var i=window[t.storagedetail.callBackFunction];"function"==typeof i&&i(t.storagedetail)}}catch(e){x(0,"Error in getStoratevalueatChild.")}},redirectparent:function(e,t){try{void 0!==t&&null!=t&&void 0!==t.redirecturl&&null!=t.redirecturl&&(location.href=t.redirecturl)}catch(e){x(0,"Error in redirectparent.")}},redirectparentscrollTop:function(){try{n(window).scrollTop(0)}catch(e){x(0,"Error in redirectparentscrollTop.")}},setWidgetScroll:function(e,t){try{var i=0;void 0!==t&&null!=t&&void 0!==t.scrollValue&&null!=t.scrollValue&&(i=t.scrollValue,n("html,body").animate({scrollTop:i},400))}catch(e){x(0,"Error in setWidgetScroll.")}},scrollFunction:function(){try{document.getElementById("frameTitle").scrollIntoView({behaviour:"smooth"})}catch(e){x(0,"Error in scrollFunction.")}},adjustIframeHeight:function(){try{n("iframe").height();var e=n(window).height();n("iframe").css("height",.9*e|0)}catch(e){x(0,"Error in adjustIframeHeight.")}},resetIframeHeight:function(){try{n("iframe").not("#chatWindow").css("height","")}catch(e){x(0,"Error in resetIframeHeight.")}},setWidgetAddonpopupScroll:function(){try{var e=(null!=document.getElementById("frameTitle")?document.getElementById("frameTitle"):null!=document.getElementById("mainbody")?document.getElementById("mainbody"):0).offsetTop;n("html,body").animate({scrollTop:e},600)}catch(e){x(0,"Error in setWidgetAddonpopupScroll.")}}};n(e).on("message",function(t){try{x(3,'Received: "'+t.originalEvent.data+'"');var i=JSON.parse(t.originalEvent.data);if(i.hasOwnProperty("object")){if(i.object.indexOf("updateViewportscroll")>=0)return void l[i.object](t,i);if(i.object.indexOf("getStoratevalueatChild")>=0||i.object.indexOf("setStoratevalueintoParent")>=0||i.object.indexOf("getStoratevaluefromParent")>=0)return void l[i.object](t,i);if(i.object.indexOf("register")>=0||t.originalEvent.origin===f&&g||t.originalEvent.source===e)return void l[i.object](t,i);if(null!==S(t.originalEvent.source,t.originalEvent.origin))return void l[i.object](t,i)}x(1,'Ignored: "'+t.originalEvent.data+'" from '+t.originalEvent.origin)}catch(e){return void x(0,'Error processing "'+t.originalEvent.data,'": '+e.message)}}),e.parent!=e&&"string"==typeof t.referrer&&t.referrer.length>0&&(n("body,html").hasClass("Embedded_Widget")?F(e.parent,f,{object:"register",type:"Embedded"}):n("body,html").hasClass("Popup_Widget")?F(e.parent,f,{object:"register",type:"Popup_Widget"}):F(e.parent,f,{object:"register"})),n("iframe").each(function(){n("body").hasClass("Embedded_Widget")?F(this.contentWindow,"*",{object:"register?",type:"Embedded"}):n("body").hasClass("Popup_Widget")?F(this.contentWindow,"*",{object:"register?",type:"Popup_Widget"}):F(this.contentWindow,"*",{object:"register?"})}),n(e).on("resize",function(){null===v&&!0!==c&&(P=n(e).height(),A=n(e).width());var t=e.$Interframe.getViewport2Doc();n.each(C,function(){F(this.window,this.origin,{object:"updateViewport2Window",top:t.top-n(this.frame).offset().top,height:t.height,width:t.width})})}).on("scroll",function(){var t=e.$Interframe.getViewport2Doc();n.each(C,function(){F(this.window,this.origin,{object:"updateViewport2Window",top:t.top-n(this.frame).offset().top,height:t.height,width:t.width})})});var d=e.MutationObserver||e.WebKitMutationObserver;void 0===d?setInterval(function(){y&&M()},r):new d(function(e){y&&M()}).observe(t.body,{attributes:!0,childList:!0,characterData:!0,subtree:!0}),x(2,"$Interframe.init() done."),n(e).trigger(n.Event("init.interframe")),n(".vagaro-iframe iframe").length>0&&(void 0!==n(".vagaro-iframe iframe").css("height")&&n(".vagaro-iframe iframe").css("height",""),void 0!==n(".vagaro-iframe iframe").css("width")&&n(".vagaro-iframe iframe").css("width",""))}},resetViewportheight:function(){P=n(e).height()},getViewport2Window:function(){var t=Math.max(w,0),i=Math.min(w+P,n(e).height()),o={top:w,height:P,width:A,visibleTop:t,visibleHeight:Math.max(i-t,0)};return x(2,"$Interframe.getViewport2Window() = "+JSON.stringify(o)),o},getViewport2Doc:function(){var t=e.$Interframe.getViewport2Window(),i={top:t.top+n(e).scrollTop(),height:t.height,width:t.width,visibleTop:t.visibleTop+n(e).scrollTop(),visibleHeight:t.visibleHeight};return x(2,"$Interframe.getViewport2Doc() = "+JSON.stringify(i)),i},getViewport2Element:function(i){if((i=n(i)).length>0){var o={};if(i[0]===n(t)[0]||i[0]===n("html")[0])o=e.$Interframe.getViewport2Doc();else if(i[0]===n(e)[0])o=e.$Interframe.getViewport2Window();else{var a=i.css("display"),s=i.css("visibility");"none"===a&&i.css("visibility","hidden").css("display","block");var r=e.$Interframe.getViewport2Doc(),l=Math.max(r.top-i.offset().top,0)+i.scrollTop(),c=Math.min(r.top-i.offset().top+r.height,i.height())+i.scrollTop();o={top:r.top-i.offset().top+i.scrollTop(),height:r.height,width:r.width,visibleTop:l,visibleHeight:Math.max(c-l,0)};i.css("display",a).css("visibility","visible"===s?"":s)}}else o=e.$Interframe.getViewport2Doc();return x(2,"$Interframe.getViewport2Element("+T(i[0])+") = "+JSON.stringify(o)),o},centerPopup:function(t,i){if((t=n(t)).length>0){var o=t.css("display"),a=t.css("visibility");switch("none"===o&&t.css("visibility","hidden").css("display","block"),i="number"==typeof i?i:t.outerHeight(),t.css("position")){case"fixed":var s=e.$Interframe.getViewport2Window(),r=s.visibleTop+Math.max((s.visibleHeight-i)/2,0);s.visibleHeight>0&&t.css("top",r+"px").css("bottom",n(e).height()-r-i+"px").css("margin-top","0px").css("margin-bottom","0px");break;case"absolute":for(var l=t.parent();"static"===l.css("position")&&l[0]!==n("html")[0];)l=l.parent();r=(c=e.$Interframe.getViewport2Element(l[0])).visibleTop+Math.max((c.visibleHeight-i)/2,0);c.visibleHeight>0&&t.css("top",r+"px").css("bottom",l.scrollHeight-r-i+"px").css("margin-top","0px").css("margin-bottom","0px");break;case"relative":l=t.parent(),r=(c=e.$Interframe.getViewport2Element(l[0])).visibleTop+Math.max((c.visibleHeight-i)/2,0);c.visibleHeight>0&&t.css("margin-top",r+"px").css("margin-bottom",l.scrollHeight-r-i+"px").css("top","0px").css("bottom","0px");break;case"static":var c;l=t.parent(),r=(c=e.$Interframe.getViewport2Element(l[0])).visibleTop+Math.max((c.visibleHeight-i)/2,0);c.visibleHeight>0&&t.css("margin-top",r+"px").css("margin-bottom",l.scrollHeight-r-i+"px")}t.css("display",o).css("visibility","visible"===a?"":a),x(2,"$Interframe.centerPopup("+T(t[0])+", "+i+")")}},autoSize:function(e){!1===(y=!!e)&&(b=[]),x(2,"$Interframe.autoSize("+e+")")},setSize:function(e){M(e),x(2,"$Interframe.setSize("+e+")")},checkSize:function(e){n.each(C,function(){F(this.window,this.origin,{object:"checkSize",isEmbedded:e})}),x(2,"$Interframe.checkSize()")},getDevice:function(e){s=e},setStoratevalueintoParent:function(e){F(window.parent,"*",{object:"setStoratevalueintoParent",storagedetail:e})},getStoratevaluefromParent:function(e){F(window.parent,"*",{object:"getStoratevaluefromParent",storagedetail:e})},redirectparent:function(e){F(window.parent,"*",{object:"redirectparent",redirecturl:e})},redirectparentscrollTop:function(){F(window.parent,"*",{object:"redirectparentscrollTop"})},scrollFunction:function(){F(window.parent,"*",{object:"scrollFunction"})},adjustIframeHeight:function(){F(window.parent,"*",{object:"adjustIframeHeight"})},resetIframeHeight:function(){F(window.parent,"*",{object:"resetIframeHeight"})},sendEventMessage:function(e){F(window.parent,"*",e)},setWidgetScroll:function(e){F(window.parent,"*",{object:"setWidgetScroll",scrollValue:e})},setWidgetAddonpopupScroll:function(){F(window.parent,"*",{object:"setWidgetAddonpopupScroll"})}},n(e).on("load",function(t){e.$Interframe.init()})}}(window,document),function(e,t,i){i(e).on("registered.interframe",function(e){i("#footer").css("visibility","hidden")}).on("changing.interframe",function(e){e.height<300?e.preventDefault():"function"==typeof Pagination&&(Pagination.frozen=!0)}).on("changed.interframe",function(e){"function"==typeof Pagination&&(Pagination.frozen=!1)}).on("viewport.interframe",function(e){})}(window,document,jQuery),function(e,t,i){i(e).on("load",function(){if("undefined"!=typeof $Interframe&&void 0!==i.fn.modal){var t=i.fn.modal.Constructor.prototype.show;i.extend(i.fn.modal.Constructor.prototype,{show:function(n){var o=i(this.$element);void 0===this.$element&&(o=i(this._element));var a=o.not(".in,.show").find(".modal-dialog");if(0==a.length&&(a=o.find(".modal-dialog")),a.length>0){a.css("margin-top","0px").css("margin-bottom","0px").css("top","0px").css("bottom","0px"),o.css("display","block"),$Interframe.centerPopup(a);var s=function(e){$Interframe.centerPopup(a)};i(this.$element).on("shown.bs.modal",function(t){s(),i(e).on("viewport.interframe",s)}).on("hidden.bs.modal",function(t){i(e).off("viewport.interframe",s)})}return t.call(this,n)}})}})}(window,document,jQuery),
/*!
 * Webflow: Front-end site library
 * @license MIT
 * Inline scripts may access the api using an async handler:
 *   var Webflow = Webflow || [];
 *   Webflow.push(readyFunction);
 */
function(){"use strict";function e(e,t){return e(t={exports:{}},t.exports),t.exports
/*!
     * tram.js v0.8.2-global
     * Cross-browser CSS3 transitions in JavaScript
     * https://github.com/bkwld/tram
     * MIT License
     */}window.tram=function(e){function t(e,t){return(new E.Bare).init(e,t)}function i(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()})}function n(e){var t=parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,255&t]}function o(e,t,i){return"#"+(1<<24|e<<16|t<<8|i).toString(16).slice(1)}function a(){}function s(e,t,i){l("Units do not match ["+e+"]: "+t+", "+i)}function r(e,t,i){if(void 0!==t&&(i=t),void 0===e)return i;var n=i;return Z.test(e)||!J.test(e)?n=parseInt(e,10):J.test(e)&&(n=1e3*parseFloat(e)),0>n&&(n=0),n==n?n:i}function l(e){H.debug&&window&&window.console.warn(e)}var c=function(e,t){function i(e){return"object"==typeof e}function n(e){return"function"==typeof e}function o(){}return function a(s,r){function l(){var e=new c;return n(e.init)&&e.init.apply(e,arguments),e}function c(){}void 0===r&&(r=s,s=Object),l.Bare=c;var d,u=o[e]=s[e],p=c[e]=l[e]=new o;return p.constructor=l,l.mixin=function(t){return c[e]=l[e]=a(l,t)[e],l},l.open=function(e){if(d={},n(e)?d=e.call(l,p,u,l,s):i(e)&&(d=e),i(d))for(var o in d)t.call(d,o)&&(p[o]=d[o]);return n(p.init)||(p.init=s),l},l.open(r)}}("prototype",{}.hasOwnProperty),d={ease:["ease",function(e,t,i,n){var o=(e/=n)*e,a=o*e;return t+i*(-2.75*a*o+11*o*o+-15.5*a+8*o+.25*e)}],"ease-in":["ease-in",function(e,t,i,n){var o=(e/=n)*e,a=o*e;return t+i*(-1*a*o+3*o*o+-3*a+2*o)}],"ease-out":["ease-out",function(e,t,i,n){var o=(e/=n)*e,a=o*e;return t+i*(.3*a*o+-1.6*o*o+2.2*a+-1.8*o+1.9*e)}],"ease-in-out":["ease-in-out",function(e,t,i,n){var o=(e/=n)*e,a=o*e;return t+i*(2*a*o+-5*o*o+2*a+2*o)}],linear:["linear",function(e,t,i,n){return i*e/n+t}],"ease-in-quad":["cubic-bezier(0.550, 0.085, 0.680, 0.530)",function(e,t,i,n){return i*(e/=n)*e+t}],"ease-out-quad":["cubic-bezier(0.250, 0.460, 0.450, 0.940)",function(e,t,i,n){return-i*(e/=n)*(e-2)+t}],"ease-in-out-quad":["cubic-bezier(0.455, 0.030, 0.515, 0.955)",function(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t}],"ease-in-cubic":["cubic-bezier(0.550, 0.055, 0.675, 0.190)",function(e,t,i,n){return i*(e/=n)*e*e+t}],"ease-out-cubic":["cubic-bezier(0.215, 0.610, 0.355, 1)",function(e,t,i,n){return i*((e=e/n-1)*e*e+1)+t}],"ease-in-out-cubic":["cubic-bezier(0.645, 0.045, 0.355, 1)",function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}],"ease-in-quart":["cubic-bezier(0.895, 0.030, 0.685, 0.220)",function(e,t,i,n){return i*(e/=n)*e*e*e+t}],"ease-out-quart":["cubic-bezier(0.165, 0.840, 0.440, 1)",function(e,t,i,n){return-i*((e=e/n-1)*e*e*e-1)+t}],"ease-in-out-quart":["cubic-bezier(0.770, 0, 0.175, 1)",function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e+t:-i/2*((e-=2)*e*e*e-2)+t}],"ease-in-quint":["cubic-bezier(0.755, 0.050, 0.855, 0.060)",function(e,t,i,n){return i*(e/=n)*e*e*e*e+t}],"ease-out-quint":["cubic-bezier(0.230, 1, 0.320, 1)",function(e,t,i,n){return i*((e=e/n-1)*e*e*e*e+1)+t}],"ease-in-out-quint":["cubic-bezier(0.860, 0, 0.070, 1)",function(e,t,i,n){return(e/=n/2)<1?i/2*e*e*e*e*e+t:i/2*((e-=2)*e*e*e*e+2)+t}],"ease-in-sine":["cubic-bezier(0.470, 0, 0.745, 0.715)",function(e,t,i,n){return-i*Math.cos(e/n*(Math.PI/2))+i+t}],"ease-out-sine":["cubic-bezier(0.390, 0.575, 0.565, 1)",function(e,t,i,n){return i*Math.sin(e/n*(Math.PI/2))+t}],"ease-in-out-sine":["cubic-bezier(0.445, 0.050, 0.550, 0.950)",function(e,t,i,n){return-i/2*(Math.cos(Math.PI*e/n)-1)+t}],"ease-in-expo":["cubic-bezier(0.950, 0.050, 0.795, 0.035)",function(e,t,i,n){return 0===e?t:i*Math.pow(2,10*(e/n-1))+t}],"ease-out-expo":["cubic-bezier(0.190, 1, 0.220, 1)",function(e,t,i,n){return e===n?t+i:i*(1-Math.pow(2,-10*e/n))+t}],"ease-in-out-expo":["cubic-bezier(1, 0, 0, 1)",function(e,t,i,n){return 0===e?t:e===n?t+i:(e/=n/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t}],"ease-in-circ":["cubic-bezier(0.600, 0.040, 0.980, 0.335)",function(e,t,i,n){return-i*(Math.sqrt(1-(e/=n)*e)-1)+t}],"ease-out-circ":["cubic-bezier(0.075, 0.820, 0.165, 1)",function(e,t,i,n){return i*Math.sqrt(1-(e=e/n-1)*e)+t}],"ease-in-out-circ":["cubic-bezier(0.785, 0.135, 0.150, 0.860)",function(e,t,i,n){return(e/=n/2)<1?-i/2*(Math.sqrt(1-e*e)-1)+t:i/2*(Math.sqrt(1-(e-=2)*e)+1)+t}],"ease-in-back":["cubic-bezier(0.600, -0.280, 0.735, 0.045)",function(e,t,i,n,o){return void 0===o&&(o=1.70158),i*(e/=n)*e*((o+1)*e-o)+t}],"ease-out-back":["cubic-bezier(0.175, 0.885, 0.320, 1.275)",function(e,t,i,n,o){return void 0===o&&(o=1.70158),i*((e=e/n-1)*e*((o+1)*e+o)+1)+t}],"ease-in-out-back":["cubic-bezier(0.680, -0.550, 0.265, 1.550)",function(e,t,i,n,o){return void 0===o&&(o=1.70158),(e/=n/2)<1?i/2*e*e*((1+(o*=1.525))*e-o)+t:i/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t}]},u={"ease-in-back":"cubic-bezier(0.600, 0, 0.735, 0.045)","ease-out-back":"cubic-bezier(0.175, 0.885, 0.320, 1)","ease-in-out-back":"cubic-bezier(0.680, 0, 0.265, 1)"},p=document,h=window,m="bkwld-tram",g=/[\-\.0-9]/g,v=/[A-Z]/,f="number",C=/^(rgb|#)/,S=/(em|cm|mm|in|pt|pc|px)$/,y=/(em|cm|mm|in|pt|pc|px|%)$/,b=/(deg|rad|turn)$/,k="unitless",_=/(all|none) 0s ease 0s/,D=/^(width|height)$/,I=" ",w=p.createElement("a"),P=["Webkit","Moz","O","ms"],A=["-webkit-","-moz-","-o-","-ms-"],T=function(e){if(e in w.style)return{dom:e,css:e};var t,i,n="",o=e.split("-");for(t=0;t<o.length;t++)n+=o[t].charAt(0).toUpperCase()+o[t].slice(1);for(t=0;t<P.length;t++)if((i=P[t]+n)in w.style)return{dom:i,css:A[t]+e}},x=t.support={bind:Function.prototype.bind,transform:T("transform"),transition:T("transition"),backface:T("backface-visibility"),timing:T("transition-timing-function")};if(x.transition){var F=x.timing.dom;if(w.style[F]=d["ease-in-back"][0],!w.style[F])for(var $ in u)d[$][0]=u[$]}var O=t.frame=function(){var e=h.requestAnimationFrame||h.webkitRequestAnimationFrame||h.mozRequestAnimationFrame||h.oRequestAnimationFrame||h.msRequestAnimationFrame;return e&&x.bind?e.bind(h):function(e){h.setTimeout(e,16)}}(),M=t.now=function(){var e=h.performance,t=e&&(e.now||e.webkitNow||e.msNow||e.mozNow);return t&&x.bind?t.bind(e):Date.now||function(){return+new Date}}(),B=c(function(t){function n(e,t){var i=function(e){for(var t=-1,i=e?e.length:0,n=[];++t<i;){var o=e[t];o&&n.push(o)}return n}((""+e).split(I)),n=i[0];t=t||{};var o=z[n];if(!o)return l("Unsupported property: "+n);if(!t.weak||!this.props[n]){var a=o[0],s=this.props[n];return s||(s=this.props[n]=new a.Bare),s.init(this.$el,i,o,t),s}}function o(e,t,i){if(e){var o=typeof e;if(t||(this.timer&&this.timer.destroy(),this.queue=[],this.active=!1),"number"==o&&t)return this.timer=new G({duration:e,context:this,complete:a}),void(this.active=!0);if("string"==o&&t){switch(e){case"hide":c.call(this);break;case"stop":s.call(this);break;case"redraw":d.call(this);break;default:n.call(this,e,i&&i[1])}return a.call(this)}if("function"==o)return void e.call(this,this);if("object"==o){var l=0;p.call(this,e,function(e,t){e.span>l&&(l=e.span),e.stop(),e.animate(t)},function(e){"wait"in e&&(l=r(e.wait,0))}),u.call(this),l>0&&(this.timer=new G({duration:l,context:this}),this.active=!0,t&&(this.timer.complete=a));var h=this,m=!1,g={};O(function(){p.call(h,e,function(e){e.active&&(m=!0,g[e.name]=e.nextStyle)}),m&&h.$el.css(g)})}}}function a(){if(this.timer&&this.timer.destroy(),this.active=!1,this.queue.length){var e=this.queue.shift();o.call(this,e.options,!0,e.args)}}function s(e){var t;this.timer&&this.timer.destroy(),this.queue=[],this.active=!1,"string"==typeof e?(t={})[e]=1:t="object"==typeof e&&null!=e?e:this.props,p.call(this,t,h),u.call(this)}function c(){s.call(this),this.el.style.display="none"}function d(){this.el.offsetHeight}function u(){var e,t,i=[];for(e in this.upstream&&i.push(this.upstream),this.props)(t=this.props[e]).active&&i.push(t.string);i=i.join(","),this.style!==i&&(this.style=i,this.el.style[x.transition.dom]=i)}function p(e,t,o){var a,s,r,l,c=t!==h,d={};for(a in e)r=e[a],a in X?(d.transform||(d.transform={}),d.transform[a]=r):(v.test(a)&&(a=i(a)),a in z?d[a]=r:(l||(l={}),l[a]=r));for(a in d){if(r=d[a],!(s=this.props[a])){if(!c)continue;s=n.call(this,a)}t.call(this,s,r)}o&&l&&o.call(this,l)}function h(e){e.stop()}function g(e,t){e.set(t)}function f(e){this.$el.css(e)}function C(e,i){t[e]=function(){return this.children?S.call(this,i,arguments):(this.el&&i.apply(this,arguments),this)}}function S(e,t){var i,n=this.children.length;for(i=0;n>i;i++)e.apply(this.children[i],t);return this}t.init=function(t){if(this.$el=e(t),this.el=this.$el[0],this.props={},this.queue=[],this.style="",this.active=!1,H.keepInherited&&!H.fallback){var i=Y(this.el,"transition");i&&!_.test(i)&&(this.upstream=i)}x.backface&&H.hideBackface&&j(this.el,x.backface.css,"hidden")},C("add",n),C("start",o),C("wait",function(e){e=r(e,0),this.active?this.queue.push({options:e}):(this.timer=new G({duration:e,context:this,complete:a}),this.active=!0)}),C("then",function(e){return this.active?(this.queue.push({options:e,args:arguments}),void(this.timer.complete=a)):l("No active transition timer. Use start() or wait() before then().")}),C("next",a),C("stop",s),C("set",function(e){s.call(this,e),p.call(this,e,g,f)}),C("show",function(e){"string"!=typeof e&&(e="block"),this.el.style.display=e}),C("hide",c),C("redraw",d),C("destroy",function(){s.call(this),e.removeData(this.el,m),this.$el=this.el=null})}),E=c(B,function(t){function i(t,i){var n=e.data(t,m)||e.data(t,m,new B.Bare);return n.el||n.init(t),i?n.start(i):n}t.init=function(t,n){var o=e(t);if(!o.length)return this;if(1===o.length)return i(o[0],n);var a=[];return o.each(function(e,t){a.push(i(t,n))}),this.children=a,this}}),L=c(function(e){function t(){var e=this.get();this.update("auto");var t=this.get();return this.update(e),t}function i(e){var t=/rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(e);return(t?o(t[1],t[2],t[3]):e).replace(/#(\w)(\w)(\w)$/,"#$1$1$2$2$3$3")}var n=500,a="ease",s=0;e.init=function(e,t,i,o){this.$el=e,this.el=e[0];var l=t[0];i[2]&&(l=i[2]),q[l]&&(l=q[l]),this.name=l,this.type=i[1],this.duration=r(t[1],this.duration,n),this.ease=function(e,t,i){return void 0!==t&&(i=t),e in d?e:i}(t[2],this.ease,a),this.delay=r(t[3],this.delay,s),this.span=this.duration+this.delay,this.active=!1,this.nextStyle=null,this.auto=D.test(this.name),this.unit=o.unit||this.unit||H.defaultUnit,this.angle=o.angle||this.angle||H.defaultAngle,H.fallback||o.fallback?this.animate=this.fallback:(this.animate=this.transition,this.string=this.name+I+this.duration+"ms"+("ease"!=this.ease?I+d[this.ease][0]:"")+(this.delay?I+this.delay+"ms":""))},e.set=function(e){e=this.convert(e,this.type),this.update(e),this.redraw()},e.transition=function(e){this.active=!0,e=this.convert(e,this.type),this.auto&&("auto"==this.el.style[this.name]&&(this.update(this.get()),this.redraw()),"auto"==e&&(e=t.call(this))),this.nextStyle=e},e.fallback=function(e){var i=this.el.style[this.name]||this.convert(this.get(),this.type);e=this.convert(e,this.type),this.auto&&("auto"==i&&(i=this.convert(this.get(),this.type)),"auto"==e&&(e=t.call(this))),this.tween=new W({from:i,to:e,duration:this.duration,delay:this.delay,ease:this.ease,update:this.update,context:this})},e.get=function(){return Y(this.el,this.name)},e.update=function(e){j(this.el,this.name,e)},e.stop=function(){(this.active||this.nextStyle)&&(this.active=!1,this.nextStyle=null,j(this.el,this.name,this.get()));var e=this.tween;e&&e.context&&e.destroy()},e.convert=function(e,t){if("auto"==e&&this.auto)return e;var n,o="number"==typeof e,a="string"==typeof e;switch(t){case f:if(o)return e;if(a&&""===e.replace(g,""))return+e;n="number(unitless)";break;case C:if(a){if(""===e&&this.original)return this.original;if(t.test(e))return"#"==e.charAt(0)&&7==e.length?e:i(e)}n="hex or rgb string";break;case S:if(o)return e+this.unit;if(a&&t.test(e))return e;n="number(px) or string(unit)";break;case y:if(o)return e+this.unit;if(a&&t.test(e))return e;n="number(px) or string(unit or %)";break;case b:if(o)return e+this.angle;if(a&&t.test(e))return e;n="number(deg) or string(angle)";break;case k:if(o)return e;if(a&&y.test(e))return e;n="number(unitless) or string(unit or %)"}return function(e,t){l("Type warning: Expected: ["+e+"] Got: ["+typeof t+"] "+t)}(n,e),e},e.redraw=function(){this.el.offsetHeight}}),N=c(L,function(e,t){e.init=function(){t.init.apply(this,arguments),this.original||(this.original=this.convert(this.get(),C))}}),U=c(L,function(e,t){e.init=function(){t.init.apply(this,arguments),this.animate=this.fallback},e.get=function(){return this.$el[this.name]()},e.update=function(e){this.$el[this.name](e)}}),R=c(L,function(e,t){function i(e,t){var i,n,o,a,s;for(i in e)o=(a=X[i])[0],n=a[1]||i,s=this.convert(e[i],o),t.call(this,n,s,o)}e.init=function(){t.init.apply(this,arguments),this.current||(this.current={},X.perspective&&H.perspective&&(this.current.perspective=H.perspective,j(this.el,this.name,this.style(this.current)),this.redraw()))},e.set=function(e){i.call(this,e,function(e,t){this.current[e]=t}),j(this.el,this.name,this.style(this.current)),this.redraw()},e.transition=function(e){var t=this.values(e);this.tween=new V({current:this.current,values:t,duration:this.duration,delay:this.delay,ease:this.ease});var i,n={};for(i in this.current)n[i]=i in t?t[i]:this.current[i];this.active=!0,this.nextStyle=this.style(n)},e.fallback=function(e){var t=this.values(e);this.tween=new V({current:this.current,values:t,duration:this.duration,delay:this.delay,ease:this.ease,update:this.update,context:this})},e.update=function(){j(this.el,this.name,this.style(this.current))},e.style=function(e){var t,i="";for(t in e)i+=t+"("+e[t]+") ";return i},e.values=function(e){var t,n={};return i.call(this,e,function(e,i,o){n[e]=i,void 0===this.current[e]&&(t=0,~e.indexOf("scale")&&(t=1),this.current[e]=this.convert(t,o))}),n}}),W=c(function(t){function i(){var e,t,n,o=l.length;if(o)for(O(i),t=M(),e=o;e--;)(n=l[e])&&n.render(t)}var r={ease:d.ease[1],from:0,to:1};t.init=function(e){this.duration=e.duration||0,this.delay=e.delay||0;var t=e.ease||r.ease;d[t]&&(t=d[t][1]),"function"!=typeof t&&(t=r.ease),this.ease=t,this.update=e.update||a,this.complete=e.complete||a,this.context=e.context||this,this.name=e.name;var i=e.from,n=e.to;void 0===i&&(i=r.from),void 0===n&&(n=r.to),this.unit=e.unit||"","number"==typeof i&&"number"==typeof n?(this.begin=i,this.change=n-i):this.format(n,i),this.value=this.begin+this.unit,this.start=M(),!1!==e.autoplay&&this.play()},t.play=function(){this.active||(this.start||(this.start=M()),this.active=!0,function(e){1===l.push(e)&&O(i)}(this))},t.stop=function(){this.active&&(this.active=!1,function(t){var i,n=e.inArray(t,l);n>=0&&(i=l.slice(n+1),l.length=n,i.length&&(l=l.concat(i)))}(this))},t.render=function(e){var t,i=e-this.start;if(this.delay){if(i<=this.delay)return;i-=this.delay}if(i<this.duration){var n=this.ease(i,0,1,this.duration);return t=this.startRGB?function(e,t,i){return o(e[0]+i*(t[0]-e[0]),e[1]+i*(t[1]-e[1]),e[2]+i*(t[2]-e[2]))}(this.startRGB,this.endRGB,n):function(e){return Math.round(e*c)/c}(this.begin+n*this.change),this.value=t+this.unit,void this.update.call(this.context,this.value)}t=this.endHex||this.begin+this.change,this.value=t+this.unit,this.update.call(this.context,this.value),this.complete.call(this.context),this.destroy()},t.format=function(e,t){if(t+="","#"==(e+="").charAt(0))return this.startRGB=n(t),this.endRGB=n(e),this.endHex=e,this.begin=0,void(this.change=1);if(!this.unit){var i=t.replace(g,"");i!==e.replace(g,"")&&s("tween",t,e),this.unit=i}t=parseFloat(t),e=parseFloat(e),this.begin=this.value=t,this.change=e-t},t.destroy=function(){this.stop(),this.context=null,this.ease=this.update=this.complete=a};var l=[],c=1e3}),G=c(W,function(e){e.init=function(e){this.duration=e.duration||0,this.complete=e.complete||a,this.context=e.context,this.play()},e.render=function(e){e-this.start<this.duration||(this.complete.call(this.context),this.destroy())}}),V=c(W,function(e,t){e.init=function(e){var t,i;for(t in this.context=e.context,this.update=e.update,this.tweens=[],this.current=e.current,e.values)i=e.values[t],this.current[t]!==i&&this.tweens.push(new W({name:t,from:this.current[t],to:i,duration:e.duration,delay:e.delay,ease:e.ease,autoplay:!1}));this.play()},e.render=function(e){var t,i,n=!1;for(t=this.tweens.length;t--;)(i=this.tweens[t]).context&&(i.render(e),this.current[i.name]=i.value,n=!0);return n?void(this.update&&this.update.call(this.context)):this.destroy()},e.destroy=function(){if(t.destroy.call(this),this.tweens){var e;for(e=this.tweens.length;e--;)this.tweens[e].destroy();this.tweens=null,this.current=null}}}),H=t.config={debug:!1,defaultUnit:"px",defaultAngle:"deg",keepInherited:!1,hideBackface:!1,perspective:"",fallback:!x.transition,agentTests:[]};t.fallback=function(e){if(!x.transition)return H.fallback=!0;H.agentTests.push("("+e+")");var t=new RegExp(H.agentTests.join("|"),"i");H.fallback=t.test(navigator.userAgent)},t.fallback("6.0.[2-5] Safari"),t.tween=function(e){return new W(e)},t.delay=function(e,t,i){return new G({complete:t,duration:e,context:i})},e.fn.tram=function(e){return t.call(null,this,e)};var j=e.style,Y=e.css,q={transform:x.transform&&x.transform.css},z={color:[N,C],background:[N,C,"background-color"],"outline-color":[N,C],"border-color":[N,C],"border-top-color":[N,C],"border-right-color":[N,C],"border-bottom-color":[N,C],"border-left-color":[N,C],"border-width":[L,S],"border-top-width":[L,S],"border-right-width":[L,S],"border-bottom-width":[L,S],"border-left-width":[L,S],"border-spacing":[L,S],"letter-spacing":[L,S],margin:[L,S],"margin-top":[L,S],"margin-right":[L,S],"margin-bottom":[L,S],"margin-left":[L,S],padding:[L,S],"padding-top":[L,S],"padding-right":[L,S],"padding-bottom":[L,S],"padding-left":[L,S],"outline-width":[L,S],opacity:[L,f],top:[L,y],right:[L,y],bottom:[L,y],left:[L,y],"font-size":[L,y],"text-indent":[L,y],"word-spacing":[L,y],width:[L,y],"min-width":[L,y],"max-width":[L,y],height:[L,y],"min-height":[L,y],"max-height":[L,y],"line-height":[L,k],"scroll-top":[U,f,"scrollTop"],"scroll-left":[U,f,"scrollLeft"]},X={};x.transform&&(z.transform=[R],X={x:[y,"translateX"],y:[y,"translateY"],rotate:[b],rotateX:[b],rotateY:[b],scale:[f],scaleX:[f],scaleY:[f],skew:[b],skewX:[b],skewY:[b]}),x.transform&&x.backface&&(X.z=[y,"translateZ"],X.rotateZ=[b],X.scaleZ=[f],X.perspective=[S]);var Z=/ms/,J=/s|\./;return e.tram=t}(window.jQuery);var t={},i=e(function(e){var i=window.$,n=t&&i.tram;
/*!
         * Webflow._ (aka) Underscore.js 1.6.0 (custom build)
         * _.each
         * _.map
         * _.find
         * _.filter
         * _.any
         * _.contains
         * _.delay
         * _.defer
         * _.throttle (webflow)
         * _.debounce
         * _.keys
         * _.has
         * _.now
         *
         * http://underscorejs.org
         * (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
         * Underscore may be freely distributed under the MIT license.
         * @license MIT
         */
e.exports=function(){var e={VERSION:"1.6.0-Webflow"},t={},i=Array.prototype,o=Object.prototype,a=Function.prototype,s=(i.push,i.slice),r=(i.concat,o.toString,o.hasOwnProperty),l=i.forEach,c=i.map,d=(i.reduce,i.reduceRight,i.filter),u=(i.every,i.some),p=i.indexOf,h=(i.lastIndexOf,Array.isArray,Object.keys),m=(a.bind,e.each=e.forEach=function(i,n,o){if(null==i)return i;if(l&&i.forEach===l)i.forEach(n,o);else if(i.length===+i.length){for(var a=0,s=i.length;a<s;a++)if(n.call(o,i[a],a,i)===t)return}else{var r=e.keys(i);for(a=0,s=r.length;a<s;a++)if(n.call(o,i[r[a]],r[a],i)===t)return}return i});e.map=e.collect=function(e,t,i){var n=[];return null==e?n:c&&e.map===c?e.map(t,i):(m(e,function(e,o,a){n.push(t.call(i,e,o,a))}),n)},e.find=e.detect=function(e,t,i){var n;return g(e,function(e,o,a){if(t.call(i,e,o,a))return n=e,!0}),n},e.filter=e.select=function(e,t,i){var n=[];return null==e?n:d&&e.filter===d?e.filter(t,i):(m(e,function(e,o,a){t.call(i,e,o,a)&&n.push(e)}),n)};var g=e.some=e.any=function(i,n,o){n||(n=e.identity);var a=!1;return null==i?a:u&&i.some===u?i.some(n,o):(m(i,function(e,i,s){if(a||(a=n.call(o,e,i,s)))return t}),!!a)};e.contains=e.include=function(e,t){return null!=e&&(p&&e.indexOf===p?-1!=e.indexOf(t):g(e,function(e){return e===t}))},e.delay=function(e,t){var i=s.call(arguments,2);return setTimeout(function(){return e.apply(null,i)},t)},e.defer=function(t){return e.delay.apply(e,[t,1].concat(s.call(arguments,1)))},e.throttle=function(e){var t,i,o;return function(){t||(t=!0,i=arguments,o=this,n.frame(function(){t=!1,e.apply(o,i)}))}},e.debounce=function(t,i,n){var o,a,s,r,l,c=function(){var d=e.now()-r;d<i?o=setTimeout(c,i-d):(o=null,n||(l=t.apply(s,a),s=a=null))};return function(){s=this,a=arguments,r=e.now();var d=n&&!o;return o||(o=setTimeout(c,i)),d&&(l=t.apply(s,a),s=a=null),l}},e.defaults=function(t){if(!e.isObject(t))return t;for(var i=1,n=arguments.length;i<n;i++){var o=arguments[i];for(var a in o)void 0===t[a]&&(t[a]=o[a])}return t},e.keys=function(t){if(!e.isObject(t))return[];if(h)return h(t);var i=[];for(var n in t)e.has(t,n)&&i.push(n);return i},e.has=function(e,t){return r.call(e,t)},e.isObject=function(e){return e===Object(e)},e.now=Date.now||function(){return(new Date).getTime()},e.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var v=/(.)^/,f={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},C=/\\|'|\r|\n|\u2028|\u2029/g,S=function(e){return"\\"+f[e]};return e.template=function(t,i,n){!i&&n&&(i=n),i=e.defaults({},i,e.templateSettings);var o=RegExp([(i.escape||v).source,(i.interpolate||v).source,(i.evaluate||v).source].join("|")+"|$","g"),a=0,s="__p+='";t.replace(o,function(e,i,n,o,r){return s+=t.slice(a,r).replace(C,S),a=r+e.length,i?s+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":o&&(s+="';\n"+o+"\n__p+='"),e}),s+="';\n",i.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var r=new Function(i.variable||"obj","_",s)}catch(e){throw e.source=s,e}var l=function(t){return r.call(this,t,e)},c=i.variable||"obj";return l.source="function("+c+"){\n"+s+"}",l},e}()}),n=i&&"object"==typeof i&&"default"in i?i.default:i,o=e(function(e){var i={},o={},a=[],s=window.Webflow||[],r=window.jQuery,l=r(window),c=r(document),d=r.isFunction,u=i._=n,p=t&&r.tram,h=!1,m=!1,g=window.Modernizr;function v(e){i.env()&&(d(e.design)&&l.on("__wf_design",e.design),d(e.preview)&&l.on("__wf_preview",e.preview)),d(e.destroy)&&l.on("__wf_destroy",e.destroy),e.ready&&d(e.ready)&&function(e){if(h)return void e.ready();if(u.contains(a,e.ready))return;a.push(e.ready)}(e)}function f(e){d(e.design)&&l.off("__wf_design",e.design),d(e.preview)&&l.off("__wf_preview",e.preview),d(e.destroy)&&l.off("__wf_destroy",e.destroy),e.ready&&d(e.ready)&&function(e){a=u.filter(a,function(t){return t!==e.ready})}(e)}p.config.hideBackface=!1,p.config.keepInherited=!0,i.define=function(e,t,i){o[e]&&f(o[e]);var n=o[e]=t(r,u,i)||{};return v(n),n},i.require=function(e){return o[e]},i.push=function(e){h?d(e)&&e():s.push(e)},i.env=function(e){var t=window.__wf_design,i=void 0!==t;return e?"design"===e?i&&t:"preview"===e?i&&!t:"slug"===e?i&&window.__wf_slug:"editor"===e?window.WebflowEditor:"test"===e?window.__wf_test:"frame"===e?window!==window.top:void 0:i};var C,S=navigator.userAgent.toLowerCase(),y=navigator.appVersion.toLowerCase(),b=i.env.touch="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,k=i.env.chrome=/chrome/.test(S)&&/Google/.test(navigator.vendor)&&parseInt(y.match(/chrome\/(\d+)\./)[1],10),_=i.env.ios=g&&g.ios;i.env.safari=/safari/.test(S)&&!k&&!_,b&&c.on("touchstart mousedown",function(e){C=e.target}),i.validClick=b?function(e){return e===C||r.contains(e,C)}:function(){return!0};var D,I="resize.webflow orientationchange.webflow load.webflow",w="scroll.webflow "+I;function P(e,t){var i=[],n={};return n.up=u.throttle(function(e){u.each(i,function(t){t(e)})}),e&&t&&e.on(t,n.up),n.on=function(e){"function"==typeof e&&(u.contains(i,e)||i.push(e))},n.off=function(e){i=arguments.length?u.filter(i,function(t){return t!==e}):[]},n}function A(e){d(e)&&e()}function T(){D&&(D.reject(),l.off("load",D.resolve)),D=new r.Deferred,l.on("load",D.resolve)}i.resize=P(l,I),i.scroll=P(r("#page-wrapper"),w),i.redraw=P(),i.location=function(e){window.location=e},i.env()&&(i.location=function(e){window.dispatchEvent(new CustomEvent("__wf_location",{detail:e}))}),i.ready=function(){h=!0,m?(m=!1,u.each(o,v)):u.each(a,A),u.each(s,A),i.resize.up()},i.load=function(e){D.then(e)},i.destroy=function(e){e=e||{},m=!0,l.triggerHandler("__wf_destroy"),null!=e.domready&&(h=e.domready),u.each(o,f),i.resize.off(),i.scroll.off(),i.redraw.off(),a=[],s=[],"pending"===D.state()&&T()},r(i.ready),T(),e.exports=window.Webflow=i}),a=o&&"object"==typeof o&&"default"in o?o.default:o,s=(e(function(e){var t=a;t.define("brand",e.exports=function(e){var i,n={},o=e("html"),a=e("body"),s=window.location,r=/PhantomJS/i.test(navigator.userAgent);function l(){var e=a.children(".w-webflow-badge"),n=e.length&&e.get(0)===i,o=t.env("editor");n?o&&e.remove():(e.length&&e.remove(),o||a.append(i))}return n.ready=function(){var t,n,a,c=o.attr("data-wf-status"),d=o.attr("data-wf-domain")||"";/\.webflow\.io$/i.test(d)&&s.hostname!==d&&(c=!0),c&&!r&&(i=i||(t=e('<a class="w-webflow-badge"></a>').attr("href","https://webflow.com?utm_campaign=brandjs"),n=e("<img>").attr("src","https://d1otoma47x30pg.cloudfront.net/img/webflow-badge-icon.60efbf6ec9.svg").css({marginRight:"8px",width:"16px"}),a=e("<img>").attr("src","https://d1otoma47x30pg.cloudfront.net/img/webflow-badge-text.6faa6a38cd.svg"),t.append(n,a),t[0]),l(),setTimeout(l,500))},n})}),e(function(e){var t=window.jQuery,i={},n=[],o=".w-ix",a={reset:function(e,t){t.__wf_intro=null},intro:function(e,n){n.__wf_intro||(n.__wf_intro=!0,t(n).triggerHandler(i.types.INTRO))},outro:function(e,n){n.__wf_intro&&(n.__wf_intro=null,t(n).triggerHandler(i.types.OUTRO))}};i.triggers={},i.types={INTRO:"w-ix-intro"+o,OUTRO:"w-ix-outro"+o},i.init=function(){for(var e=n.length,o=0;o<e;o++){var s=n[o];s[0](0,s[1])}n=[],t.extend(i.triggers,a)},i.async=function(){for(var e in a){var t=a[e];a.hasOwnProperty(e)&&(i.triggers[e]=function(e,i){n.push([t,i])})}},i.async(),e.exports=i})),r=s&&"object"==typeof s&&"default"in s?s.default:s;e(function(e){var t=a,i=r;t.define("dropdown",e.exports=function(e,n){var o,a,s={},r=e(document),l=t.env(),c=t.env.touch,d=".w-dropdown",u="w--open",p="w-close"+d,h=i.triggers,m=!1;function g(){a=l&&t.env("design"),(o=r.find(d)).each(v)}function v(t,i){var o=e(i),s=e.data(i,d);s||(s=e.data(i,d,{open:!1,el:o,config:{}})),s.list=o.children(".w-dropdown-list"),s.toggle=o.children(".w-dropdown-toggle"),s.links=s.list.children(".w-dropdown-link"),s.outside=function(t){t.outside&&r.off("tap"+d,t.outside);return n.debounce(function(i){if(t.open){var n=e(i.target);n.closest(".w-dropdown-toggle").length||t.el.is(n.closest(d))||y(t)}})}(s),s.complete=function(e){return function(){e.list.removeClass(u),e.toggle.removeClass(u),e.manageZ&&e.el.css("z-index","")}}(s),s.leave=function(e){return function(){e.hovering=!1,y(e)}}(s),o.off(d),s.toggle.off(d),f(s),s.nav&&s.nav.off(d),s.nav=o.closest(".w-nav"),s.nav.on(p,C(s)),a?o.on("setting"+d,C(s)):(s.toggle.on("tap"+d,function(e){return n.debounce(function(){e.open?y(e):S(e)})}(s)),s.config.hover&&s.toggle.on("mouseenter"+d,function(e){return function(){e.hovering=!0,S(e)}}(s)),o.on(p,C(s)),l&&y(s))}function f(e){var t=Number(e.el.css("z-index"));e.manageZ=900===t||901===t,e.config={hover:Boolean(e.el.attr("data-hover"))&&!c,delay:Number(e.el.attr("data-delay"))||0}}function C(e){return function(t,i){return i=i||{},"w-close"===t.type?y(e):"setting"===t.type?(f(e),!0===i.open&&S(e),void(!1===i.open&&y(e,!0))):void 0}}function S(i){i.open||(!function(t){var i=t.el[0];o.each(function(t,n){var o=e(n);o.is(i)||o.has(i).length||o.triggerHandler(p)})}(i),i.open=!0,i.list.addClass(u),i.toggle.addClass(u),h.intro(0,i.el[0]),t.redraw.up(),i.manageZ&&i.el.css("z-index",901),a||r.on("tap"+d,i.outside),i.hovering&&i.el.on("mouseleave"+d,i.leave),window.clearTimeout(i.delayId))}function y(e,t){if(e.open&&(!e.config.hover||!e.hovering)){e.open=!1;var i=e.config;if(h.outro(0,e.el[0]),r.off("tap"+d,e.outside),e.el.off("mouseleave"+d,e.leave),window.clearTimeout(e.delayId),!i.delay||t)return e.complete();e.delayId=window.setTimeout(e.complete,i.delay)}}return s.ready=g,s.design=function(){m&&r.find(d).each(function(t,i){e(i).triggerHandler(p)}),m=!1,g()},s.preview=function(){m=!0,g()},s})}),e(function(e){var t=a;t.define("edit",e.exports=function(e,i,n){if(n=n||{},(t.env("test")||t.env("frame"))&&!n.fixture)return{exit:1};var o,a=e(window),s=e(document.documentElement),r=document.location,l="hashchange",c=n.load||function(){o=!0,window.WebflowEditor=!0,a.off(l,u),e.ajax({url:m("https://editor-api.webflow.com/api/editor/view"),data:{siteId:s.attr("data-wf-site")},xhrFields:{withCredentials:!0},dataType:"json",crossDomain:!0,success:p})},d=!1;try{d=localStorage&&localStorage.getItem&&localStorage.getItem("WebflowEditor")}catch(e){}function u(){o||/\?edit/.test(r.hash)&&c()}function p(t){var i;t?function(t,i){e.ajax({type:"GET",url:t,dataType:"script",cache:!0}).then(i,h)}((i=t.scriptPath,i.indexOf("//")>=0?i:m("https://editor-api.webflow.com"+i)),function(){window.WebflowEditor(t)}):console.error("Could not load editor data")}function h(e,t,i){throw console.error("Could not load editor script: "+t),i}function m(e){return e.replace(/([^:])\/\//g,"$1/")}return d?c():r.search?(/[?&](edit)(?:[=&?]|$)/.test(r.search)||/\?edit$/.test(r.href))&&c():a.on(l,u).triggerHandler(l),{}})}),e(function(e){
/*!
         * jQuery-ajaxTransport-XDomainRequest - v1.0.3
         * 2014-12-16 WEBFLOW - Removed UMD wrapper
         * https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest
         * Copyright (c) 2014 Jason Moon (@JSONMOON)
         * @license MIT (/blob/master/LICENSE.txt)
         */
e.exports=function(e){if(!e.support.cors&&e.ajaxTransport&&window.XDomainRequest){var t=/^https?:\/\//i,i=/^get|post$/i,n=new RegExp("^"+location.protocol,"i");e.ajaxTransport("* text html xml json",function(o,a,s){if(o.crossDomain&&o.async&&i.test(o.type)&&t.test(o.url)&&n.test(o.url)){var r=null;return{send:function(t,i){var n="",s=(a.dataType||"").toLowerCase();r=new XDomainRequest,/^\d+$/.test(a.timeout)&&(r.timeout=a.timeout),r.ontimeout=function(){i(500,"timeout")},r.onload=function(){var t="Content-Length: "+r.responseText.length+"\r\nContent-Type: "+r.contentType,n={code:200,message:"success"},o={text:r.responseText};try{if("html"===s||/text\/html/i.test(r.contentType))o.html=r.responseText;else if("json"===s||"text"!==s&&/\/json/i.test(r.contentType))try{o.json=e.parseJSON(r.responseText)}catch(e){n.code=500,n.message="parseerror"}else if("xml"===s||"text"!==s&&/\/xml/i.test(r.contentType)){var a=new ActiveXObject("Microsoft.XMLDOM");a.async=!1;try{a.loadXML(r.responseText)}catch(e){a=void 0}if(!a||!a.documentElement||a.getElementsByTagName("parsererror").length)throw n.code=500,n.message="parseerror","Invalid XML: "+r.responseText;o.xml=a}}catch(e){throw e}finally{i(n.code,n.message,o,t)}},r.onprogress=function(){},r.onerror=function(){i(500,"error",{text:r.responseText})},a.data&&(n="string"===e.type(a.data)?a.data:e.param(a.data)),r.open(o.type,o.url),r.send(n)},abort:function(){r&&r.abort()}}}})}}(window.jQuery)}),e(function(e){var t=a;t.define("forms",e.exports=function(e,i){var n,o,a,s={},r=e(document),l=window.location,c=window.XDomainRequest&&!window.atob,d=".w-form",u=/e(-)?mail/i,p=/^\S+@\S+$/,h=window.alert,m=t.env(),g=/list-manage[1-9]?.com/i,v=i.debounce(function(){h("Oops! This page has improperly configured forms. Please contact your website administrator to fix this issue.")},100);function f(t,i){var n=e(i),a=e.data(i,d);a||(a=e.data(i,d,{form:n})),C(a);var s=n.closest("div.w-form");a.done=s.find("> .w-form-done"),a.fail=s.find("> .w-form-fail");var r=a.action=n.attr("action");a.handler=null,a.redirect=n.attr("data-redirect"),g.test(r)?a.handler=k:r||(o?a.handler=b:v())}function C(e){var t=e.btn=e.form.find(':input[type="submit"]');e.wait=e.btn.attr("data-wait")||null,e.success=!1,t.prop("disabled",!1),e.label&&t.val(e.label)}function S(e){var t=e.btn,i=e.wait;t.prop("disabled",!0),i&&(e.label=t.val(),t.val(i))}function y(t,i){var n=null;return i=i||{},t.find(':input:not([type="submit"])').each(function(o,a){var s=e(a),r=s.attr("type"),l=s.attr("data-name")||s.attr("name")||"Field "+(o+1),c=s.val();if("checkbox"===r&&(c=s.is(":checked")),"radio"===r){if(null===i[l]||"string"==typeof i[l])return;c=t.find('input[name="'+s.attr("name")+'"]:checked').val()||null}"string"==typeof c&&(c=e.trim(c)),i[l]=c,n=n||function(e,t,i,n){var o=null;"password"===t?o="Passwords cannot be submitted.":e.attr("required")&&(n?(u.test(i)||u.test(e.attr("type")))&&(p.test(n)||(o="Please enter a valid email address for: "+i)):o="Please fill out the required field: "+i);return o}(s,r,l,c)}),n}function b(i){C(i);var n=i.form,a={name:n.attr("data-name")||n.attr("name")||"Untitled Form",source:l.href,test:t.env(),fields:{},dolphin:/pass[\s-_]?(word|code)|secret|login|credentials/i.test(n.html())};D(i);var s=y(n,a.fields);if(s)return h(s);if(S(i),o){var r="https://webflow.com/api/v1/form/"+o;c&&r.indexOf("https://webflow.com")>=0&&(r=r.replace("https://webflow.com","http://formdata.webflow.com")),e.ajax({url:r,type:"POST",data:a,dataType:"json",crossDomain:!0}).done(function(){i.success=!0,_(i)}).fail(function(){_(i)})}else _(i)}function k(t){C(t);var n=t.form,o={};if(!/^https/.test(l.href)||/^https/.test(t.action)){D(t);var a,s=y(n,o);if(s)return h(s);S(t),i.each(o,function(e,t){u.test(t)&&(o.EMAIL=e),/^((full[ _-]?)?name)$/i.test(t)&&(a=e),/^(first[ _-]?name)$/i.test(t)&&(o.FNAME=e),/^(last[ _-]?name)$/i.test(t)&&(o.LNAME=e)}),a&&!o.FNAME&&(a=a.split(" "),o.FNAME=a[0],o.LNAME=o.LNAME||a[1]);var r=t.action.replace("/post?","/post-json?")+"&c=?",c=r.indexOf("u=")+2;c=r.substring(c,r.indexOf("&",c));var d=r.indexOf("id=")+3;d=r.substring(d,r.indexOf("&",d)),o["b_"+c+"_"+d]="",e.ajax({url:r,data:o,dataType:"jsonp"}).done(function(e){t.success="success"===e.result||/already/.test(e.msg),t.success||console.info("MailChimp error: "+e.msg),_(t)}).fail(function(){_(t)})}else n.attr("method","post")}function _(e){var i=e.form,n=e.redirect,o=e.success;o&&n?t.location(n):(e.done.toggle(o),e.fail.toggle(!o),i.toggle(!o),C(e))}function D(e){e.evt&&e.evt.preventDefault(),e.evt=null}return s.ready=s.design=s.preview=function(){!function(){if(o=e("html").attr("data-wf-site"),!(n=e(d+" form")).length)return;n.each(f)}(),m||a||(a=!0,r.on("submit",d+" form",function(t){var i=e.data(this,d);i.handler&&(i.evt=t,i.handler(i))}))},s})}),e(function(e){var t=a,i=r;t.define("ix",e.exports=function(e,n){var o,a,s={},r=e(window),l=".w-ix",c=e.tram,d=t.env,u=d(),p=d.chrome&&d.chrome<35,h="none 0s ease 0s",m=e(),g={},v=[],f=[],C=[],S=1,y={tabs:".w-tab-link, .w-tab-pane",dropdown:".w-dropdown",slider:".w-slide",navbar:".w-nav"};function b(e){e&&(g={},n.each(e,function(e){g[e.slug]=e.value}),k())}function k(){var n=e("[data-ix]");n.length&&(n.each(I),n.each(_),v.length&&(t.scroll.on(w),setTimeout(w,1)),f.length&&t.load(P),C.length&&setTimeout(A,S),i.init(),t.redraw.up())}function _(o,a){var r=e(a),c=r.attr("data-ix"),d=g[c];if(d){var p=d.triggers;p&&(s.style(r,d.style),n.each(p,function(e){var n={},o=e.type,a=e.stepsB&&e.stepsB.length;function s(){T(e,r,{group:"A"})}function c(){T(e,r,{group:"B"})}if("load"!==o){if("click"===o)return r.on("click"+l,function(i){t.validClick(i.currentTarget)&&("#"===r.attr("href")&&i.preventDefault(),T(e,r,{group:n.clicked?"B":"A"}),a&&(n.clicked=!n.clicked))}),void(m=m.add(r));if("hover"===o)return r.on("mouseenter"+l,s),r.on("mouseleave"+l,c),void(m=m.add(r));if("scroll"!==o){var d=y[o];if(d){var p=r.closest(d);return p.on(i.types.INTRO,s).on(i.types.OUTRO,c),void(m=m.add(p))}}else v.push({el:r,trigger:e,state:{active:!1},offsetTop:D(e.offsetTop),offsetBot:D(e.offsetBot)})}else e.preload&&!u?f.push(s):C.push(s)}))}}function D(e){if(!e)return 0;e=String(e);var t=parseInt(e,10);return t!=t?0:(e.indexOf("%")>0&&(t/=100)>=1&&(t=.999),t)}function I(t,i){e(i).off(l)}function w(){for(var e=r.scrollTop(),t=r.height(),i=v.length,n=0;n<i;n++){var o=v[n],a=o.el,s=o.trigger,l=s.stepsB&&s.stepsB.length,c=o.state,d=a.offset().top,u=a.outerHeight(),p=o.offsetTop,h=o.offsetBot;p<1&&p>0&&(p*=t),h<1&&h>0&&(h*=t);var m=d+u-p>=e&&d+h<=e+t;m!==c.active&&((!1!==m||l)&&(c.active=m,T(s,a,{group:m?"A":"B"})))}}function P(){for(var e=f.length,t=0;t<e;t++)f[t]()}function A(){for(var e=C.length,t=0;t<e;t++)C[t]()}function T(t,i,n,a){var s=(n=n||{}).done,r=t.preserve3d;if(!o||n.force){var l=n.group||"A",d=t["loop"+l],h=t["steps"+l];if(h&&h.length){if(h.length<2&&(d=!1),!a){var m=t.selector;m&&(i=t.descend?i.find(m):t.siblings?i.siblings(m):e(m),u&&i.attr("data-ix-affect",1)),p&&i.addClass("w-ix-emptyfix"),r&&i.css("transform-style","preserve-3d")}for(var g=c(i),v={omit3d:!r},f=0;f<h.length;f++)x(g,h[f],v);v.start?g.then(C):C()}}function C(){if(d)return T(t,i,n,!0);"auto"===v.width&&g.set({width:"auto"}),"auto"===v.height&&g.set({height:"auto"}),s&&s()}}function x(e,i,n){var o="add",a="start";n.start&&(o=a="then");var s=i.transition;if(s){s=s.split(",");for(var r=0;r<s.length;r++){var l=s[r];e[o](l)}}var c=F(i,n)||{};if(null!=c.width&&(n.width=c.width),null!=c.height&&(n.height=c.height),null==s){n.start?e.then(function(){var i=this.queue;this.set(c),c.display&&(e.redraw(),t.redraw.up()),this.queue=i,this.next()}):(e.set(c),c.display&&(e.redraw(),t.redraw.up()));var d=c.wait;null!=d&&(e.wait(d),n.start=!0)}else{if(c.display){var u=c.display;delete c.display,n.start?e.then(function(){var e=this.queue;this.set({display:u}).redraw(),t.redraw.up(),this.queue=e,this.next()}):(e.set({display:u}).redraw(),t.redraw.up())}e[a](c),n.start=!0}}function F(e,t){var i=t&&t.omit3d,n={},o=!1;for(var a in e)"transition"!==a&&"keysort"!==a&&(!i||"z"!==a&&"rotateX"!==a&&"rotateY"!==a&&"scaleZ"!==a)&&(n[a]=e[a],o=!0);return o?n:null}return s.init=function(e){setTimeout(function(){b(e)},1)},s.preview=function(){o=!1,S=100,setTimeout(function(){b(window.__wf_ix)},1)},s.design=function(){o=!0,s.destroy()},s.destroy=function(){a=!0,m.each(I),t.scroll.off(w),i.async(),v=[],f=[],C=[]},s.ready=function(){if(u)return d("design")?s.design():s.preview();g&&a&&(a=!1,k())},s.run=T,s.style=u?function(t,i){var n=c(t);if(e.isEmptyObject(i))return;t.css("transition","");var o=t.css("transition");o===h&&(o=n.upstream=null);n.upstream=h,n.set(F(i)),n.upstream=o}:function(e,t){c(e).set(F(t))},s})}),e(function(e){var t=a;function i(e,t,i){var n,o,a,s=i.tram,r=Array.isArray,l=/(^|\s+)/g,c=[];function d(e,t){return c=r(e)?e:[e],o||d.build(),s(I(o.lightbox,"hide").focus()).add("opacity .3s").start({opacity:1}),D(o.html,"noscroll"),d.show(t||0)}function u(e){return function(t){this===t.target&&(t.stopPropagation(),t.preventDefault(),e())}}d.build=function(){return d.destroy(),(o={html:i(t.documentElement),empty:i()}).arrowLeft=P("control left inactive"),o.arrowRight=P("control right inactive"),o.close=P("control close"),o.spinner=P("spinner"),o.strip=P("strip"),a=new b(o.spinner,k("hide")),o.content=P("content").append(o.spinner,o.arrowLeft,o.arrowRight,o.close),o.container=P("container").append(o.content,o.strip),o.lightbox=P("backdrop hide").append(o.container),o.strip.on("tap",_("item"),g),o.content.on("swipe",v).on("tap",_("left"),p).on("tap",_("right"),h).on("tap",_("close"),m).on("tap",_("image, caption"),h),o.container.on("tap",_("view, strip"),m).on("dragstart",_("img"),C),o.lightbox.on("keydown",S).on("focusin",f),i("body").append(o.lightbox.prop("tabIndex",0)),d},d.destroy=function(){o&&(I(o.html,"noscroll"),o.lightbox.remove(),o=void 0)},d.show=function(e){if(e!==n){var t=c[e];if(!t)return d.hide();var r,l,u=n;return n=e,a.show(),function(e,t){var i=P("img","img");i.one("load",function(){t(i)}),i.attr("src",e)}(t.html&&(r=t.width,l=t.height,"data:image/svg+xml;charset=utf-8,"+encodeURI('<svg xmlns="http://www.w3.org/2000/svg" width="'+r+'" height="'+l+'"/>'))||t.url,function(r){if(e===n){var l,d,p=P("figure","figure").append(D(r,"image")),h=P("frame").append(p),m=P("view").append(h);t.html&&((d=(l=i(t.html)).is("iframe"))&&l.on("load",g),p.append(D(l,"embed"))),t.caption&&p.append(P("caption","figcaption").text(t.caption)),o.spinner.before(m),d||g()}function g(){var t;(a.hide(),e===n)?(w(o.arrowLeft,"inactive",e<=0),w(o.arrowRight,"inactive",e>=c.length-1),o.view?(s(o.view).add("opacity .3s").start({opacity:0}).then((t=o.view,function(){t.remove()})),s(m).add("opacity .3s").add("transform .3s").set({x:e>u?"80px":"-80px"}).start({opacity:1,x:0})):m.css("opacity",1),o.view=m,o.items&&D(I(o.items,"active").eq(e),"active")):m.remove()}}),d}},d.hide=function(){return s(o.lightbox).add("opacity .3s").start({opacity:0}).then(y),d},d.prev=function(){n>0&&d.show(n-1)},d.next=function(){n<c.length-1&&d.show(n+1)};var p=u(d.prev),h=u(d.next),m=u(d.hide),g=function(e){var t=i(this).index();e.preventDefault(),d.show(t)},v=function(e,t){e.preventDefault(),"left"===t.direction?d.next():"right"===t.direction&&d.prev()},f=function(){this.focus()};function C(e){e.preventDefault()}function S(e){var t=e.keyCode;27===t?d.hide():37===t?d.prev():39===t&&d.next()}function y(){o&&(I(o.html,"noscroll"),D(o.lightbox,"hide"),o.strip.empty(),o.view&&o.view.remove(),I(o.content,"group"),D(o.arrowLeft,"inactive"),D(o.arrowRight,"inactive"),n=o.view=void 0)}function b(e,t,i){this.$element=e,this.className=t,this.delay=i||200,this.hide()}function k(e,t){return e.replace(l,(t?" .":" ")+"w-lightbox-")}function _(e){return k(e,!0)}function D(e,t){return e.addClass(k(t))}function I(e,t){return e.removeClass(k(t))}function w(e,t,i){return e.toggleClass(k(t),i)}function P(e,n){return D(i(t.createElement(n||"div")),e)}return b.prototype.show=function(){var e=this;e.timeoutId||(e.timeoutId=setTimeout(function(){e.$element.removeClass(e.className),delete e.timeoutId},e.delay))},b.prototype.hide=function(){var e=this;if(e.timeoutId)return clearTimeout(e.timeoutId),void delete e.timeoutId;e.$element.addClass(e.className)},function(){var i=e.navigator.userAgent,n=i.match(/(iPhone|iPad|iPod);[^OS]*OS (\d)/);if(i.indexOf("Android ")>-1&&-1===i.indexOf("Chrome")||n&&!(n[2]>7)){var o=t.createElement("style");t.head.appendChild(o),e.addEventListener("orientationchange",a,!0),a()}function a(){var t=e.innerHeight,i=e.innerWidth,n=".w-lightbox-content, .w-lightbox-view, .w-lightbox-view:before {height:"+t+"px}.w-lightbox-view {width:"+i+"px}.w-lightbox-group, .w-lightbox-group .w-lightbox-view, .w-lightbox-group .w-lightbox-view:before {height:"+.86*t+"px}.w-lightbox-image {max-width:"+i+"px;max-height:"+t+"px}.w-lightbox-group .w-lightbox-image {max-height:"+.86*t+"px}.w-lightbox-strip {padding: 0 "+.01*t+"px}.w-lightbox-item {width:"+.1*t+"px;padding:"+.02*t+"px "+.01*t+"px}.w-lightbox-thumbnail {height:"+.1*t+"px}@media (min-width: 768px) {.w-lightbox-content, .w-lightbox-view, .w-lightbox-view:before {height:"+.96*t+"px}.w-lightbox-content {margin-top:"+.02*t+"px}.w-lightbox-group, .w-lightbox-group .w-lightbox-view, .w-lightbox-group .w-lightbox-view:before {height:"+.84*t+"px}.w-lightbox-image {max-width:"+.96*i+"px;max-height:"+.96*t+"px}.w-lightbox-group .w-lightbox-image {max-width:"+.823*i+"px;max-height:"+.84*t+"px}}";o.textContent=n}}(),d}t.define("lightbox",e.exports=function(e){var n,o,a={},s=i(window,document,e),r=e(document),l=t.env(),c=".w-lightbox";function d(e){var t,i,n=e.el.children(".w-json").html();if(n){try{n=JSON.parse(n)}catch(e){console.error("Malformed lightbox JSON configuration.",e)}!function(e){e.images&&(e.images.forEach(function(e){e.type="image"}),e.items=e.images);e.embed&&(e.embed.type="video",e.items=[e.embed]);e.groupId&&(e.group=e.groupId)}(n),(t=n.group)?((i=o[t])||(i=o[t]=[]),e.items=i,n.items.length&&(e.index=i.length,i.push.apply(i,n.items))):e.items=n.items}else e.items=[]}return a.ready=a.design=a.preview=function(){n=l&&t.env("design"),s.destroy(),o={},r.find(c).webflowLightBox()},jQuery.fn.extend({webflowLightBox:function(){e.each(this,function(t,i){var o=e.data(i,c);o||(o=e.data(i,c,{el:e(i),mode:"images",images:[],embed:""})),o.el.off(c),d(o),n?o.el.on("setting"+c,d.bind(null,o)):o.el.on("tap"+c,function(e){return function(){e.items.length&&s(e.items,e.index||0)}}(o)).on("click"+c,function(e){e.preventDefault()})})}}),a})}),e(function(e){var t=a;t.define("links",e.exports=function(e,i){var n,o,a,s={},r=e(window),l=t.env(),c=window.location,d=document.createElement("a"),u="w--current",p=/^#[a-zA-Z][\w:.-]*$/,h=/index\.(html|php)$/,m=/\/$/;function g(t){var i=n&&t.getAttribute("href-disabled")||t.getAttribute("href");if(d.href=i,!(i.indexOf(":")>=0)){var s=e(t);if(0===i.indexOf("#")&&p.test(i)){var r=e(i);r.length&&o.push({link:s,sec:r,active:!1})}else if("#"!==i){var l=d.href===c.href||i===a||h.test(i)&&m.test(a);f(s,u,l)}}}function v(){var e=r.scrollTop(),t=r.height();i.each(o,function(i){var o=i.link,a=i.sec,s=a.offset().top,r=a.outerHeight(),l=.5*t,c=a.is(":visible")&&s+r-l>=e&&s+l<=e+t;i.active!==c&&(i.active=c,f(o,u,c),n&&(o[0].__wf_current=c))})}function f(e,t,i){var n=e.hasClass(t);i&&n||(i||n)&&(i?e.addClass(t):e.removeClass(t))}return s.ready=s.design=s.preview=function(){n=l&&t.env("design"),a=t.env("slug")||c.pathname||"",t.scroll.off(v),o=[];for(var e=document.links,i=0;i<e.length;++i)g(e[i]);o.length&&(t.scroll.on(v),v())},s})}),e(function(e){var t=a;t.define("maps",e.exports=function(e,i){var n={},o=(e(document),null);function a(){(void 0).each(s)}function s(e,t){var i=l(t);o.maps.event.trigger(i.map,"resize"),i.setMapPosition()}n.ready=function(){},n.destroy=function(){t.resize.off(a),t.redraw.off(a)};var r="w-widget-map";function l(i,n){var a=e.data(i,r);if(a)return a;var s=e(i);a=e.data(i,r,{latLng:"51.511214,-0.119824",tooltip:"",style:"roadmap",zoom:12,marker:new o.maps.Marker({draggable:!1}),infowindow:new o.maps.InfoWindow({disableAutoPan:!0})});var l=n.widgetLatlng||a.latLng;a.latLng=l;var c=l.split(","),d=new o.maps.LatLng(c[0],c[1]);a.latLngObj=d;var u=!(t.env.touch&&n.disableTouch);a.map=new o.maps.Map(i,{center:a.latLngObj,zoom:a.zoom,maxZoom:18,mapTypeControl:!1,panControl:!1,streetViewControl:!1,scrollwheel:!n.disableScroll,draggable:u,zoomControl:!0,zoomControlOptions:{style:o.maps.ZoomControlStyle.SMALL},mapTypeId:a.style}),a.marker.setMap(a.map),a.setMapPosition=function(){a.map.setCenter(a.latLngObj);var e=0,t=0,i=s.css(["paddingTop","paddingRight","paddingBottom","paddingLeft"]);e-=parseInt(i.paddingLeft,10),e+=parseInt(i.paddingRight,10),t-=parseInt(i.paddingTop,10),t+=parseInt(i.paddingBottom,10),(e||t)&&a.map.panBy(e,t),s.css("position","")},o.maps.event.addListener(a.map,"tilesloaded",function(){o.maps.event.clearListeners(a.map,"tilesloaded"),a.setMapPosition()}),a.setMapPosition(),a.marker.setPosition(a.latLngObj),a.infowindow.setPosition(a.latLngObj);var p=n.widgetTooltip;p&&(a.tooltip=p,a.infowindow.setContent(p),a.infowindowOpen||(a.infowindow.open(a.map,a.marker),a.infowindowOpen=!0));var h=n.widgetStyle;h&&a.map.setMapTypeId(h);var m=n.widgetZoom;return null!=m&&(a.zoom=m,a.map.setZoom(Number(m))),o.maps.event.addListener(a.marker,"click",function(){window.open("https://maps.google.com/?z="+a.zoom+"&daddr="+a.latLng+"&key="+googleKeyFormap)}),a}return n})}),e(function(e){var t=a;t.define("scroll",e.exports=function(e){var i=e(document),n=window,o=n.location,a=function(){try{return Boolean(n.frameElement)}catch(e){return!0}}()?null:n.history,s=/^[a-zA-Z0-9][\w:.-]*$/;function r(i,r){if(s.test(i)){var l=e("#"+i);if(l.length){if(r&&(r.preventDefault(),r.stopPropagation()),o.hash!==i&&a&&a.pushState&&(!t.env.chrome||"file:"!==o.protocol))(a.state&&a.state.hash)!==i&&a.pushState({hash:i},"","#"+i);var c=t.env("editor")?".w-editor-body":"body",d=e("header, "+c+" > .header, "+c+" > .w-nav:not([data-no-scroll])"),u="fixed"===d.css("position")?d.outerHeight():0;n.setTimeout(function(){!function(t,i){var o=e(n).scrollTop(),a=t.offset().top-i;if("mid"===t.data("scroll")){var s=e(n).height()-i,r=t.outerHeight();r<s&&(a-=Math.round((s-r)/2))}var l=1;e("body").add(t).each(function(){var t=parseFloat(e(this).attr("data-scroll-time"),10);!isNaN(t)&&(0===t||t>0)&&(l=t)}),Date.now||(Date.now=function(){return(new Date).getTime()});var c=Date.now(),d=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||function(e){n.setTimeout(e,15)},u=(472.143*Math.log(Math.abs(o-a)+125)-2e3)*l,p=function(){var e=Date.now()-c;n.scroll(0,function(e,t,i,n){if(i>n)return t;return e+(t-e)*(o=i/n,o<.5?4*o*o*o:(o-1)*(2*o-2)*(2*o-2)+1);var o}(o,a,e,u)),e<=u&&d(p)};p()}(l,u)},r?0:300)}}}return{ready:function(){o.hash&&r(o.hash.substring(1));var n=o.href.split("#")[0];i.on("click","a.anchorhashscroll",function(i){if(!(t.env("design")||window.$.mobile&&e(i.currentTarget).hasClass("ui-link")))if("#"!==this.getAttribute("href")){var o=this.href.split("#"),a=o[0]===n?o[1]:null;a&&r(a,i)}else i.preventDefault()})}}})}),e(function(e){var t=a,i=r;t.define("tabs",e.exports=function(e){var n,o,a={},s=e.tram,r=e(document),l=t.env,c=l.safari,d=l(),u="data-w-tab",p=".w-tabs",h="w--current",m="w--tab-active",g=i.triggers,v=!1;function f(){o=d&&t.env("design"),(n=r.find(p)).length&&(n.each(y),t.env("preview")&&!v&&n.each(S),C(),t.redraw.on(a.redraw))}function C(){t.redraw.off(a.redraw)}function S(t,i){var n=e.data(i,p);n&&(n.links&&n.links.each(g.reset),n.panes&&n.panes.each(g.reset))}function y(t,i){var n=e(i),a=e.data(i,p);if(a||(a=e.data(i,p,{el:n,config:{}})),a.current=null,a.menu=n.children(".w-tab-menu"),a.links=a.menu.children(".w-tab-link"),a.content=n.children(".w-tab-content"),a.panes=a.content.children(".w-tab-pane"),a.el.off(p),a.links.off(p),function(e){var t={};t.easing=e.el.attr("data-easing")||"ease";var i=parseInt(e.el.attr("data-duration-in"),10);i=t.intro=i==i?i:0;var n=parseInt(e.el.attr("data-duration-out"),10);n=t.outro=n==n?n:0,t.immediate=!i&&!n,e.config=t}(a),!o){a.links.on("click"+p,function(e){return function(t){var i=t.currentTarget.getAttribute(u);i&&b(e,{tab:i})}}(a));var s=a.links.filter("."+h).attr(u);s&&b(a,{tab:s,immediate:!0})}}function b(i,n){n=n||{};var o=i.config,a=o.easing,r=n.tab;if(r!==i.current){i.current=r,i.links.each(function(t,i){var n=e(i);i.getAttribute(u)===r?n.addClass(h).each(g.intro):n.hasClass(h)&&n.removeClass(h).each(g.outro)});var l=[],d=[];i.panes.each(function(t,i){var n=e(i);i.getAttribute(u)===r?l.push(i):n.hasClass(m)&&d.push(i)});var p=e(l),f=e(d);if(n.immediate||o.immediate)return p.addClass(m).each(g.intro),f.removeClass(m),void(v||t.redraw.up());f.length&&o.outro?(f.each(g.outro),s(f).add("opacity "+o.outro+"ms "+a,{fallback:c}).start({opacity:0}).then(C)):C()}function C(){if(f.removeClass(m).css({opacity:"",transition:"",transform:"",width:"",height:""}),p.addClass(m).each(g.intro),t.redraw.up(),!o.intro)return s(p).set({opacity:1});s(p).set({opacity:0}).redraw().add("opacity "+o.intro+"ms "+a,{fallback:c}).start({opacity:1})}}return a.ready=a.design=a.preview=f,a.redraw=function(){v=!0,f(),v=!1},a.destroy=function(){(n=r.find(p)).length&&(n.each(S),C())},a})}),e(function(e){a.define("touch",e.exports=function(e){var t={},i=!document.addEventListener,n=window.getSelection;function o(t){var i,o,s,r=!1,l=!1,c=!1,d=Math.min(Math.round(.04*window.innerWidth),40);function u(t){if(1!=function(t){try{return void 0!==t&&void 0!==e(t.target)&&void 0!==e(t.target).prop("type")&&"range"==e(t.target).prop("type")}catch(e){return!1}}(t)){var n=t.touches;n&&n.length>1||(r=!0,l=!1,n?(c=!0,i=n[0].clientX,o=n[0].clientY):(i=t.clientX,o=t.clientY),s=i)}}function p(e){if(r){if(c&&"mousemove"===e.type)return e.preventDefault(),void e.stopPropagation();var t=e.touches,u=t?t[0].clientX:e.clientX,p=t?t[0].clientY:e.clientY,h=u-s;s=u,Math.abs(h)>d&&n&&""===String(n())&&(a("swipe",e,{direction:h>0?"right":"left"}),m()),(Math.abs(u-i)>10||Math.abs(p-o)>10)&&(l=!0)}}function h(e){if(r){if(r=!1,c&&"mouseup"===e.type)return e.preventDefault(),e.stopPropagation(),void(c=!1);l||a("tap",e)}}function m(){r=!1}t.addEventListener("touchstart",u,!1),t.addEventListener("touchmove",p,!1),t.addEventListener("touchend",h,!1),t.addEventListener("touchcancel",m,!1),t.addEventListener("mousedown",u,!1),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",h,!1),t.addEventListener("mouseout",m,!1),this.destroy=function(){t.removeEventListener("touchstart",u,!1),t.removeEventListener("touchmove",p,!1),t.removeEventListener("touchend",h,!1),t.removeEventListener("touchcancel",m,!1),t.removeEventListener("mousedown",u,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",h,!1),t.removeEventListener("mouseout",m,!1),t=null}}function a(t,i,n){var o=e.Event(t,{originalEvent:i});e(i.target).trigger(o,n)}return i&&(e.event.special.tap={bindType:"click",delegateType:"click"}),t.init=function(t){return i?null:(t="string"==typeof t?e(t).get(0):t)?new o(t):null},t.instance=t.init(document),t})})}(),Webflow.require("ix").init([{slug:"new-interaction",name:"New Interaction",value:{style:{},triggers:[{type:"scroll",selector:".fixed-tabs-div",stepsA:[{display:"none",opacity:0,transition:"opacity 500ms ease 0ms"}],stepsB:[{display:"block",opacity:1,transition:"opacity 200ms ease 0ms"}]}]}},{slug:"popup-date-picker",name:"Popup Date Picker",value:{style:{},triggers:[{type:"click",selector:".calendar-overall-div",stepsA:[{display:"block",opacity:0},{display:"block",opacity:1,transition:"opacity 500ms ease 0ms"}],stepsB:[{display:"block",opacity:0,transition:"opacity 500ms ease 0ms"},{display:"none",opacity:0}]}]}},{slug:"book-date-popup",name:"Book Date Popup",value:{style:{},triggers:[{type:"click",selector:".book-calendar-overall-div",stepsA:[{display:"block",opacity:0},{display:"block",opacity:1,transition:"opacity 500ms ease 0ms"}],stepsB:[{display:"block",opacity:0,transition:"opacity 500ms ease 0ms"},{display:"none",opacity:0}]}]}},{slug:"mobile-search-div",name:"Mobile Search Div",value:{style:{},triggers:[{type:"click",selector:".mobile-search-background-div",stepsA:[{display:"block",opacity:1,transition:"opacity 500ms ease 0ms"}],stepsB:[]}]}},{slug:"mobile-search-close",name:"Mobile Search Close",value:{style:{},triggers:[{type:"click",selector:".mobile-search-background-div",stepsA:[{display:"none",opacity:0,transition:"opacity 500ms ease 0ms"}],stepsB:[]}]}},{slug:"aesop-product-popup",name:"Aesop Product Popup",value:{style:{},triggers:[{type:"click",selector:".product-popup-background",stepsA:[{display:"flex",display:"-webkit-box",opacity:0},{display:"-webkit-box",display:"flex",opacity:1,transition:"opacity 500ms ease 0ms"}],stepsB:[]}]}},{slug:"close-product-popup",name:"Close Product Popup",value:{style:{},triggers:[{type:"click",selector:".product-popup-background",stepsA:[{opacity:0,transition:"opacity 500ms ease 0ms"},{display:"none"}],stepsB:[]}]}},{slug:"background-click-dissappear",name:"Background Click Dissappear",value:{style:{},triggers:[{type:"click",stepsA:[{opacity:0,transition:"opacity 500ms ease 0ms"},{display:"none"}],stepsB:[]}]}},{slug:"mobile-close-product-popup",name:"Mobile Close Product Popup",value:{style:{},triggers:[]}},{slug:"mobile-menu-expand",name:"Mobile Menu Expand",value:{style:{},triggers:[{type:"click",selector:".mobile-menu-background-div",stepsA:[{display:"block",opacity:0},{display:"block",opacity:1,transition:"opacity 500ms ease 0ms"}],stepsB:[{display:"block",opacity:0,transition:"opacity 500ms ease 0ms"},{display:"none",opacity:0}]}]}},{slug:"show-map",name:"Show Map",value:{style:{},triggers:[{type:"click",selector:".listings-map-40",stepsA:[{display:"block",opacity:1,transition:"opacity 500ms ease 0ms"}],stepsB:[{display:"none",opacity:0,transition:"opacity 500ms ease 0ms"}]}]}},{slug:"new-interaction-2",name:"New Interaction 2",value:{style:{},triggers:[{type:"hover",selector:".edit-link-block",stepsA:[{display:"block"}],stepsB:[]}]}},{slug:"mobile-show-pricing",name:"Mobile Show Pricing",value:{style:{},triggers:[{type:"click",selector:".hidden-mobile",stepsA:[{display:"block"}],stepsB:[]}]}},{slug:"change-address",name:"Change Address",value:{style:{},triggers:[{type:"click",selector:".change-address-div",stepsA:[{display:"block"}],stepsB:[]}]}},{slug:"change-address-2",name:"Change Address 2",value:{style:{},triggers:[{type:"click",selector:".change-address-div",stepsA:[{display:"none"}],stepsB:[]}]}},{slug:"heart-appear",name:"Heart Appear",value:{style:{},triggers:[{type:"hover",selector:".heart-appear",stepsA:[{opacity:1,transition:"opacity 200 ease 0"}],stepsB:[{opacity:0,transition:"opacity 200 ease 0"}]}]}},{slug:"like-heart",name:"Like Heart",value:{style:{},triggers:[{type:"click",selector:".heart-appear-fill",siblings:!0,stepsA:[{display:"block",opacity:1,transition:"opacity 200 ease 0"}],stepsB:[]}]}},{slug:"like-disappear",name:"Like Disappear",value:{style:{},triggers:[{type:"click",stepsA:[{display:"none",opacity:0,transition:"opacity 200 ease 0"}],stepsB:[]}]}},{slug:"show-text-editor",name:"Show Text Editor",value:{style:{},triggers:[{type:"click",selector:".text-editor-div",stepsA:[{display:"block",opacity:0},{display:"block",opacity:1,transition:"opacity 300ms ease 0"}],stepsB:[{display:"block",opacity:0,transition:"opacity 300ms ease 0"},{display:"none",opacity:0}]}]}},{slug:"expand-services",name:"Expand Services",value:{style:{},triggers:[{type:"click",selector:".expand-services",siblings:!0,stepsA:[{display:"block",opacity:1,transition:"opacity 200 ease 0"}],stepsB:[{display:"none",opacity:0,transition:"opacity 200 ease 0"}]}]}},{slug:"show-more-description",name:"Show More Description",value:{style:{},triggers:[{type:"click",selector:".listing-business-description",stepsA:[{height:"auto",transition:"height 200 ease 0"}],stepsB:[{height:"41px",transition:"height 200 ease 0"}]}]}},{slug:"gallery-solo-hover-heart",name:"Gallery Solo Hover Heart",value:{style:{},triggers:[{type:"hover",selector:".gallery-hover-div",descend:!0,stepsA:[{display:"flex",opacity:1,transition:"opacity 200 ease 0",display:"-webkit-box",display:"-ms-flexbox"}],stepsB:[{display:"none"}]}]}},{slug:"open-gallery-popup",name:"Open Gallery Popup",value:{style:{},triggers:[{type:"click",selector:".gallery-popup-div",stepsA:[{display:"flex",display:"-webkit-box",transition:"transform 200 ease 0"}],stepsB:[]}]}},{slug:"where-dropdown",name:"Where Dropdown",value:{style:{},triggers:[{type:"click",selector:".where-dropdown",descend:!0,stepsA:[{display:"block"}],stepsB:[{display:"none"}]}]}},{slug:"message-service-provider",name:"Message Service Provider",value:{style:{},triggers:[{type:"click",selector:".message-service-provider-background",stepsA:[{display:"flex",display:"-webkit-box"}],stepsB:[]}]}},{slug:"hide-message-service-provider",name:"Hide Message Service Provider",value:{style:{},triggers:[{type:"click",stepsA:[{display:"none"}],stepsB:[]}]}},{slug:"show-phone-number",name:"Show Phone Number",value:{style:{},triggers:[{type:"click",selector:".show-phone-number",stepsA:[{display:"block"}],stepsB:[{display:"none"}]}]}},{slug:"open-shopping-cart",name:"Open Shopping Cart",value:{style:{},triggers:[{type:"click",selector:".shopping-cart-background",stepsA:[{display:"block"}],stepsB:[{display:"none"}]}]}},{slug:"close-shopping-cart",name:"Close Shopping Cart",value:{style:{},triggers:[{type:"click",stepsA:[{display:"none"}],stepsB:[]}]}},{slug:"hover-day-circle",name:"Hover Day Circle",value:{style:{},triggers:[{type:"hover",selector:".day-circle",descend:!0,stepsA:[{display:"flex",opacity:1,transition:"opacity 200 ease 0"}],stepsB:[]}]}},{slug:"open-filters",name:"Open Filters",value:{style:{},triggers:[{type:"click",selector:".filter-background",stepsA:[{display:"block"}],stepsB:[]}]}},{slug:"close-filter",name:"Close Filter",value:{style:{},triggers:[{type:"click",selector:".filter-background",stepsA:[{display:"none"}],stepsB:[]}]}},{slug:"checkbox-click",name:"Checkbox Click",value:{style:{},triggers:[{type:"click",selector:".inner-check",descend:!0,stepsA:[{display:"flex"}],stepsB:[{display:"none"}]}]}},{slug:"show-delete-item-x",name:"Show Delete Item X",value:{style:{},triggers:[{type:"hover",selector:".delete-item-link",descend:!0,stepsA:[{display:"flex",opacity:0},{display:"flex",opacity:1,transition:"opacity 300ms ease 0"}],stepsB:[{display:"none"},{display:"flex",opacity:0}]}]}},{slug:"show-quantity-dropdown-arrow",name:"Show Quantity Dropdown Arrow",value:{style:{},triggers:[{type:"hover",selector:".quantity-dropdown-arrow",descend:!0,stepsA:[{opacity:.8,transition:"opacity 300ms ease 0"}],stepsB:[{opacity:0,transition:"opacity 300ms ease 0"}]}]}},{slug:"review-show-more-stars",name:"Review Show More Stars",value:{style:{},triggers:[{type:"click",selector:".second-stars-div",stepsA:[{display:"block",height:"0px"},{display:"block",height:"auto",transition:"height 300ms ease 0"}],stepsB:[]}]}},{slug:"hide-your-review-div",name:"Hide Your Review Div",value:{style:{},triggers:[{type:"click",selector:".your-review-div",stepsA:[{height:"0px",transition:"height 300ms ease 0"}],stepsB:[]},{type:"click",selector:".review-form-wrapper",stepsA:[{display:"block",height:"0px"},{display:"block",height:"auto",transition:"transform 200 ease 0, height 300ms ease 0"}],stepsB:[]}]}},{slug:"show-review-form-wrapper",name:"Show Review Form Wrapper",value:{style:{},triggers:[{type:"click",selector:".review-form-wrapper",stepsA:[{display:"block",opacity:0},{display:"block",opacity:1,transition:"opacity 200 ease 0"}],stepsB:[]}]}},{slug:"hero-list-move",name:"Hero List Move",value:{style:{x:"0px",y:"50px",z:"0px"},triggers:[{type:"load",loopA:!0,stepsA:[{wait:"2s"},{transition:"transform 250ms ease-out 0",x:"0px",y:"0px",z:"0px"},{wait:"3s"},{transition:"transform 250ms ease-out 0",x:"0px",y:"-50px",z:"0px"},{wait:"3s"},{transition:"transform 250ms ease-out 0",x:"0px",y:"-100px",z:"0px"},{wait:"3s"},{transition:"transform 250ms ease-out 0",x:"0px",y:"-150px",z:"0px"},{wait:"3s"},{transition:"transform 250ms ease-out 0",x:"0px",y:"-200px",z:"0px"},{wait:"3s"},{transition:"transform 600ms ease-out 0",x:"0px",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"open-mobile-dropown",name:"Open Mobile Dropown",value:{style:{},triggers:[{type:"click",selector:".mobile-dropdown",preserve3d:!0,stepsA:[{display:"block",opacity:0,x:"0px",y:"-100px",z:"0px"},{display:"block",opacity:1,transition:"transform 200 ease 0, opacity 200 ease 0",x:"0px",y:"0px",z:"0px"}],stepsB:[{display:"block",opacity:0,transition:"transform 200 ease 0, opacity 200 ease 0",x:"0px",y:"-100px",z:"0px"},{display:"none"}]}]}},{slug:"move-categories-left",name:"Move Categories Left",value:{style:{},triggers:[{type:"click",selector:".service-parent-div",preserve3d:!0,stepsA:[{transition:"transform 200 ease 0",x:"-667px",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"hide-map-icon",name:"Hide Map Icon",value:{style:{},triggers:[{type:"click",stepsA:[{opacity:0,transition:"opacity 100ms ease 0"}],stepsB:[{opacity:1,transition:"opacity 100ms ease 0"}]}]}},{slug:"show-map-icon",name:"Show Map Icon",value:{style:{},triggers:[{type:"click",stepsA:[],stepsB:[]}]}},{slug:"show-service-link",name:"Show Service Link",value:{style:{},triggers:[{type:"hover",selector:".service-link",descend:!0,stepsA:[{display:"inline-block"}],stepsB:[{display:"none"}]},{type:"click",selector:".service-mobile-hide",descend:!0,stepsA:[{display:"block"}],stepsB:[{display:"none"}]}]}},{slug:"show-order-summary",name:"Show Order Summary",value:{style:{},triggers:[{type:"click",selector:".show-hide-div",stepsA:[{display:"flex",height:"0px"},{display:"block",height:"auto",transition:"height 300ms ease 0"}],stepsB:[{display:"flex",height:"0px",transition:"height 300ms ease 0"},{display:"none"}]},{type:"click",selector:".dropdown-checkout",descend:!0,preserve3d:!0,stepsA:[{transition:"transform 300ms ease 0",rotateX:"0deg",rotateY:"0deg",rotateZ:"-90deg"}],stepsB:[{transition:"transform 300ms ease 0",rotateX:"0deg",rotateY:"0deg",rotateZ:"90deg"}]},{type:"click",selector:".view-order-summary",descend:!0,stepsA:[{opacity:0,transition:"opacity 200 ease 0"}],stepsB:[{opacity:1,transition:"opacity 200 ease 0"}]}]}},{slug:"initial-show-none",name:"Initial Show None",value:{style:{display:"none"},triggers:[]}},{slug:"add-service",name:"Add Service",value:{style:{},triggers:[{type:"click",selector:".add-service-2",stepsA:[{display:"flex",height:"0px"},{display:"flex",height:"auto",transition:"height 500ms ease 0"}],stepsB:[]}]}},{slug:"hover-back-arrow",name:"Hover Back Arrow",value:{style:{},triggers:[{type:"hover",selector:".back-arrow",preserve3d:!0,stepsA:[{transition:"transform 200 ease 0",x:"-4px",y:"0px",z:"0px"}],stepsB:[{transition:"transform 200 ease 0",x:"0px",y:"0px",z:"0px"}]}]}},{slug:"login-load",name:"Login Load",value:{style:{},triggers:[{type:"load",stepsA:[{opacity:0,x:"0px",y:"-400px",z:"0px"},{opacity:1,transition:"transform 1000ms ease-in-out-back 0, opacity 200 ease 0",x:"0px",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"open-class-booking",name:"open class booking",value:{style:{},triggers:[{type:"click",selector:".class-popup-background",stepsA:[{display:"flex"}],stepsB:[]},{type:"click",selector:".review-modal",stepsA:[{display:"block",opacity:1,transition:"opacity 200 ease 0"}],stepsB:[]}]}},{slug:"close-class-modal",name:"Close Class Modal",value:{style:{},triggers:[{type:"click",selector:".class-popup-background",stepsA:[{display:"none"}],stepsB:[]},{type:"click",selector:".review-modal",stepsA:[{display:"none"}],stepsB:[]}]}},{slug:"bg-modal-hide",name:"BG Modal Hide",value:{style:{},triggers:[{type:"click",stepsA:[{display:"none"}],stepsB:[]},{type:"click",selector:".modal",stepsA:[{display:"none"}],stepsB:[]}]}},{slug:"review-back-button",name:"Review Back Button",value:{style:{},triggers:[{type:"click",selector:".review-form-wrapper",stepsA:[{height:"0px",transition:"height 300ms ease 0"}],stepsB:[]},{type:"click",selector:".review-stars",stepsA:[{height:"auto",transition:"height 300ms ease 0"}],stepsB:[]}]}},{slug:"close-review-modal",name:"Close Review Modal",value:{style:{},triggers:[{type:"click",selector:".review-modal",stepsA:[{opacity:0,transition:"opacity 300ms ease 0"},{display:"none"}],stepsB:[]},{type:"click",selector:".review-background-div",stepsA:[{opacity:0,transition:"opacity 300ms ease 0"},{display:"none"}],stepsB:[]}]}},{slug:"close-class-modal-2",name:"Close Class Modal 2",value:{style:{},triggers:[{type:"click",selector:".review-modal",stepsA:[{opacity:0,transition:"opacity 300ms ease 0"},{display:"none"}],stepsB:[]},{type:"click",selector:".class-popup-background",stepsA:[{opacity:0,transition:"opacity 300ms ease 0"},{display:"none"}],stepsB:[]}]}},{slug:"gc-category-slide",name:"GC Category Slide",value:{style:{},triggers:[{type:"click",selector:".gc-flex-container",preserve3d:!0,stepsA:[{transition:"transform 300ms ease 0",x:"-150%",y:"0px",z:"0px"}],stepsB:[]},{type:"click",selector:".build-gc-container",preserve3d:!0,stepsA:[{transition:"transform 300ms ease 0",x:"-101%",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"back-to-gc-categories",name:"Back to GC Categories",value:{style:{},triggers:[{type:"click",selector:".build-gc-container",preserve3d:!0,stepsA:[{transition:"transform 400ms ease 0",x:"0%",y:"0px",z:"0px"}],stepsB:[]},{type:"click",selector:".gc-flex-container",preserve3d:!0,stepsA:[{transition:"transform 400ms ease 0",x:"0px",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"calendar-fall",name:"Calendar Fall",value:{style:{opacity:0,x:"0px",y:"-100px",z:"0px"},triggers:[{type:"load",stepsA:[{wait:"400ms"},{opacity:1,transition:"transform 400ms ease-out-back 0, opacity 200 ease 0",x:"0px",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"cal-success-check",name:"Cal Success Check",value:{style:{scaleX:.01,scaleY:.01,scaleZ:1},triggers:[{type:"load",stepsA:[{wait:"1200ms"},{transition:"transform 200 ease-out-back 0",scaleX:1,scaleY:1,scaleZ:1}],stepsB:[]}]}},{slug:"fade-in",name:"Fade In",value:{style:{opacity:0,x:"0px",y:"13px",z:"0px"},triggers:[{type:"load",stepsA:[{opacity:1,transition:"opacity 500ms ease 0, transform 500ms ease 0",x:"0px",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"fade-in-delay",name:"Fade in Delay",value:{style:{opacity:0},triggers:[{type:"load",stepsA:[{wait:"1500ms"},{opacity:1,transition:"opacity 1000ms ease 0"}],stepsB:[]}]}},{slug:"cal-success-check",name:"Cal Success Check",value:{style:{scaleX:.01,scaleY:.01,scaleZ:1},triggers:[{type:"load",stepsA:[{wait:"800ms"},{transition:"transform 200 ease-out-back 0",scaleX:1,scaleY:1,scaleZ:1}],stepsB:[]}]}},{slug:"cal-success-check-2",name:"Cal Success Check 2",value:{style:{scaleX:.01,scaleY:.01,scaleZ:1},triggers:[{type:"load",stepsA:[{wait:"800ms"},{transition:"transform 200 ease-out-back 0",scaleX:1,scaleY:1,scaleZ:1}],stepsB:[]}]}},{slug:"fade-in2",name:"Fade In",value:{style:{opacity:0,x:"0px",y:"13px",z:"0px"},triggers:[{type:"load",stepsA:[{opacity:1,transition:"opacity 500ms ease 0, transform 500ms ease 0",x:"0px",y:"0px",z:"0px"}],stepsB:[]}]}},{slug:"fade-in-delay2",name:"Fade in Delay",value:{style:{opacity:0},triggers:[{type:"load",stepsA:[{wait:"1500ms"},{opacity:1,transition:"opacity 1000ms ease 0"}],stepsB:[]}]}}]);var $=jQuery.noConflict();$window=$(window);!function(e){iPadAndroid?e("body").addClass("touchDevice ipadandroid"):e("body").addClass("desktop"),iOS&&e("html, body").addClass("iosdevice"),isiOSPRO&&e("html, body").addClass("iosPro"),iMacSafari&&e("body").addClass("mac-safari"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&e("html, body").addClass("vgcustomerapp"),e(".thm-topHeadBG").hasClass("facebook")&&e("html, body").addClass("facebookwidget"),-1==navigator.appVersion.indexOf("Win")||-1==navigator.userAgent.indexOf("Safari")||-1!=navigator.userAgent.indexOf("Chrome")||isWindowsPhoneTemp||e("body").addClass("windowsSafari"),isWindowsPhoneTemp&&e("body").addClass("windowsPhone touchDevice").removeClass("desktop"),isWebKit&&!isEdge&&(isWindowsPhone&&!iMacSafari||iPadAndroid||e("body").addClass("webkit-desktop")),e(document).ready(function(){$window.on("resize",function(){footerBottomfixed(),"undefined"!=typeof _featured&&void 0!==_featured.centerGalleryPopup?_featured.centerGalleryPopup():void 0!==_common.centerGalleryPopup&&_common.centerGalleryPopup(),centerModalPopup()}),"undefined"==typeof BasePage||"Home"!=BasePage&&"MyAccount"!=BasePage&&""!=BasePage||(lazyloadImages(),centerModalPopup())}),e(window).on("load",function(){document.getElementById("hero-list")&&setInterval(function(){heroTextSlider()},3e3),footerBottomfixed()})}(jQuery);var mobileMenu=function(){$("#desktop-menu").length&&($("#desktop-menu").children().clone(!0,!0).appendTo("#mobile-menu"),$("#mobile-menu a").each(function(){$(this).removeClass("profile-dropdown-links w-dropdown-link w-hidden-main").addClass("mobile-dropdown-link")}),_common.ApplyEnScroll("#mobile-menu"),$(".profilesidePicMobile").html($("#divUserPhoto").clone()).find("#divUserPhoto").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload"))},footerBottomfixed=function(){setTimeout(function(){if($("#footerdiv").length){var e;$("#footerdiv").css("height","auto"),e=$("#footerdiv").outerHeight(!0),$(".content-wrapper.footerpresent").css("margin-bottom","-"+e+"px"),$("#pushdiv").css("height",e),$("#footerdiv").css("height",e);var t=$(window).height()-(e+50);$(".profile-page").css("min-height",t)}},300)},shopdetailFixedNavHTML=function(e){if($("#downloadApp").hide(),$("#navbar").length){if(_shopdetail.VisibleControlLength("#mobile-check")>0){if("undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()){"undefined"==typeof isshowMobileApp&&(isshowMobileApp="true");try{"true"==isshowMobileApp.toLowerCase()&&0==$("#downloadApp").is(":visible")&&(iosDevices||iPadAndroid||isAndroidMobile||isWindowsPhone)&&$("#downloadApp").show()}catch(e){}"undefined"!=typeof w_type&&"1"!=w_type&&$(".thm-topHeadBG").show(),$("#download_ios").hide(),$("#download_and").hide(),$("#download_win").hide(),iOS?$("#download_ios").show():iPadAndroid?$("#download_and").show():isWindowsPhone?$("#download_win").show():$("#downloadApp").hide(),$("#downloadApp a").on("click",function(e){var t={BusinessID:parseInt(_siteBuilderDetail.businessID)},i=new vagaro.ajax;i.datamodel.async=!1,i.datamodel.Token=_shopdetail.GetCoreAPIURLWithToken("MyAccount/GetBrandedAppDetail",_siteBuilderDetail.SQLGroupID),i.datamodel.data=t,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(t){e.preventDefault(),null!=t.Data&&1==_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.IsBrandedAppEnabled?!String.isNullOrUndefineOrBlank(t.Data.iTunesURL)&&iOS?window.open(t.Data.iTunesURL,"_blank"):!String.isNullOrUndefineOrBlank(t.Data.PlayStoreURL)&&iPadAndroid?window.open(t.Data.PlayStoreURL,"_blank"):RedirectToIPhoneAndroidApp():RedirectToIPhoneAndroidApp()},i.datamodel.Error=_common.CallFailed,i.Post()})}if($("#clickOnMenuAbove,#clickOnMenuOr").hide(),void 0!==e){var t=$("#tabs.navbar-nav").children().clone(!0,!0);$("<div id='mobiletabmenu' class='mobiletabmenu thm-mobilenavsection clstopheadermenu2'></div>").prependTo(e),$(e).find("#mobiletabmenu").html(""),t.prependTo($(e).find("#mobiletabmenu")),$("#clickOnMenuAbove,#clickOnMenuOr").show()}$("#mobiletabmenu li").addClass("mobile-menu").removeClass("tab"),$("#mobiletabmenu a").removeClass("active tab w--current")}lazyLoadWithContainer("lazystyle","divBusinessPhotos"),lazyLoadWithContainer("lazypromotion","detailPromotion")}};function RedirectToIPhoneAndroidApp(){iOS?RedirecttoApp("iPhone"):iPadAndroid?RedirecttoApp("Android"):isWindowsPhone&&("undefined"!=typeof w_type&&"1"==w_type?window.open("http://www.windowsphone.com/s?appid=8346ba41-3bf5-4843-8824-c8a6269acd39","_blank"):window.location.href="http://www.windowsphone.com/s?appid=8346ba41-3bf5-4843-8824-c8a6269acd39")}function ClearHomeServicesDate(){$("#txtHomeServicesDate").val("Anytime"),$("#txtHomeServicesDate").data("date",getLocationDate()),$("#spnHomeServicesDate").hide()}function ClearHomeServicesDate1(){$("#txtHomeServicesDate1").data("date",getLocationDate()),$("#spnHomeServicesDate1").hide()}function openMobileSearch(e){1==$("#txtSearchServiceMain").length&&""==$("#txtSearchServiceMain").val()&&($("#divBusType").attr("style",""),$("#aMobileTab").show(),$("#btnSearchBuss").removeClass("mob-class-serachspace")),"book"==tabSegment&&($("#dvHome").show(),$("#dvFeatureBusiness").hide()),$("#search-bar-wrapper-all").fadeIn("500"),$("html,body").addClass("mob-overflow-hidden"),$("body").addClass("banner-hide-custapp"),"undefined"!=typeof vgAppicationType&&1==vgAppicationType&&void 0!==e&&1==e&&CallbackforMobileApp(0,0,"","",0,24);try{if($("#spnHomeServicesDate").hide(),"undefined"!=typeof vgAppicationType&&1==vgAppicationType){isFilterScreen=!0,$("#btnBackHomeSearch").data("isFilterclicked","1"),$("#mobileBack").show(),ClearHomeServicesDate();var t={id:"",text:""};$("body").removeClass("listing-like-page"),$(".sort-dropdown-div.w-dropdown.divSorting.listpage-sorting").hide(),$("#txtBusinessLocationSearch").select2("data",t),_common.SetChoiceForSeleect2($("#txtBusinessLocationSearch"),t),isBackHomeScreen=!0}else $("body").addClass("desktopcustomerbody"),$("#mobilemenutoggle").hide(),isMobileBrowserFilterScreen=!0}catch(e){}}function closeMobileSearch(){$("#select2-drop-mask").click(),$("#search-bar-wrapper-all").fadeOut("400"),$("body").removeClass("banner-hide-custapp"),$("html,body").removeClass("mob-overflow-hidden"),"book"==tabSegment&&($("#dvHome").hide(),$("#dvFeatureBusiness").show()),$("#mobile-check").is(":visible")&&($("#mobilemenutoggle").show(),isMobileBrowserFilterScreen=!1)}function lazyloadImages(){$(".lazy").length>0&&$(".lazy").lazyload({event:"lazyload",effect:"fadeIn"}).trigger("lazyload"),$(".lazy-bgimg").length>0&&$(".lazy-bgimg").lazyload({event:"lazyload",effect:"fadeIn"}).trigger("lazyload"),$(".lazy-img").length>0&&$("img.lazy-img").lazyload({event:"lazyload",effect:"fadeIn"}).trigger("lazyload")}function lazyLoadWithContainer(e,t){$("."+e).length>0&&$("."+e,$("#"+t)).lazyload({effect:"fadeIn",container:$("#"+t)})}var numMinuspixel=0;if(document.getElementById("hero-list")){var heroListElm=document.getElementById("hero-list").childElementCount;$("#hero-list").css("transform","translate3d(0,0,0)")}var i=1;function heroTextSlider(){heroListElm=document.getElementById("hero-list").childElementCount,i<heroListElm?($("#hero-list").removeClass("transition600ms"),numMinuspixel-=50,$("#hero-list").css("transform","translateY("+numMinuspixel+"px)"),i+=1):i<=heroListElm&&($("#hero-list").addClass("transition600ms"),numMinuspixel=0,i=1,$("#hero-list").css("transform","translateY(0px)"))}function centerModalPopup(){$(".popup-modal-main:visible").css({top:($(window).height()-$(".popup-modal-main:visible").outerHeight())/2})}function closeModalPopup(e){$(e).closest(".popup-container-main").fadeOut(300)}function openModalPopup(e){var t=$(e).attr("data-id");$("#"+t).fadeIn(300),centerModalPopup()}function truncateText(e,t,i,n){return e.length>i?e.substring(t,i)+(n?"...":""):e.substring(t,i)}function toCamelCase(e){if(void 0!==e&&null!=e||(e=""),e.length>1){var t="",n=e.split(" ");if(null!=n&&n.length>0)for(i=0;i<n.length;i++)t+=(i>0?" ":"")+n[i].substr(0,1).toUpperCase()+n[i].substr(1,n[i].length-1).toLowerCase();return t}return e.toUpperCase()}function htmlDecode(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#39;/g,"'").replace(/&#34;/g,'"')}
/*!
 * jQuery Smart Web App Banner (Add to Home Screen)
 * Copyright (c) 2012 Kurt Zenisek @ kzeni.com
 * Version: 1.3 (22-MAR-2013)
 * Requires: jQuery v1.7 or later
 */!function(e){e.fn.smartWebBanner=function(t){parseFloat(e("html").css("margin-top"));var i,n=null!=navigator.userAgent.match(/iPad/i),o=null!=navigator.userAgent.match(/iPod/i),a=null!=navigator.userAgent.match(/iPhone/i)&&null==navigator.userAgent.match(/Windows/i),s=null!=navigator.userAgent.match(/Android/i)&&null!=navigator.userAgent.match(/Mobile/i)&&null==navigator.userAgent.match(/Windows/i),r=null!=navigator.userAgent.match(/Windows/i)&&null!=navigator.userAgent.match(/Mobile/i)||null!=navigator.userAgent.match(/Windows/i)&&null!=navigator.userAgent.match(/WPDesktop/i),l="",c=/Safari/i.test(navigator.appVersion)&&!/CriOS/i.test(navigator.appVersion),d=navigator.standalone,u=document.title,p=window.location.href;if(!n){if(a)l="iPhone";else if(o)l="iPod";else{if(!s)return r?(l="Windows",void(isWinPhone=!0)):void 0;l="Android"}if("true"!=y("swb-closed")){var h=y("IsFromWidget");if(null==h||"null"==h||""==h||"1"!=h){if("String"==typeof t){if(void 0===m)var m=e.fn.smartWebBanner.defaults;switch(t){case"show":return e("#smartWebBanner").hasClass("shown")||g(),!1;case"hide":return e("#smartWebBanner").hasClass("shown")&&f(),!1}}else m=e.extend({},e.fn.smartWebBanner.defaults,t);m.autoApp&&0==e('meta[name="apple-mobile-web-app-capable"]').length&&e("head").append('<meta name="apple-mobile-web-app-capable" content="yes" />'),(m.debug||(a||n)&&c&&!d&&void 0===y("swb-closed")&&void 0===y("swb-saved"))&&(!function(){e("#page-wrapper").prepend('<div id="smartWebBanner"><a href="javascript:void(0);" id="swb-close">X</a><a href="#" id="swb-icon"></a><div id="swb-info"><strong>'+m.title+"</strong><span>"+m.author+'</span><br /><div class="pos-relative star-container font-size11" id="divrating"><div class="ratingstar vg-empty-star"><i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i></div><div class="ratingstar filled-star vg-filled-star"><i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i> <i class="fa fa-star"></i></div></div><div>GET - On the App Store</div></div><a href="#" id="swb-save" onclick=\'javascript:RedirecttoApp("'+l+"\");'>"+m.button+"</a></div>"),e("body").addClass("smart-banner"),n&&e("#smartWebBanner,#swb-instructions").addClass("ipad"),n||a||e("#swb-instructions").html("<strong>It appears this isn't an iOS device.</strong> This is a preview of the iPhone popup design though."),m.showFree&&e("#smartWebBanner").addClass("free"),"dark"==m.theme&&e("#smartWebBanner").addClass("dark"),m.useIcon&&(e('link[rel="apple-touch-icon-precomposed"]').length>0?iconURL=e('link[rel="apple-touch-icon-precomposed"]').attr("href"):e('link[rel="apple-touch-icon"]').length>0&&(iconURL=e('link[rel="apple-touch-icon"]').attr("href"),0!=m.iconGloss&&e("#swb-icon").addClass("gloss")),1==m.iconGloss&&e("#swb-icon").addClass("gloss"),""!=m.iconOverwrite&&(iconURL=m.iconOverwrite),e("#swb-icon").css("background-image","url("+iconURL+")")),m.useIcon&&iconURL||e("#smartWebBanner").addClass("no-icon"),i=e("#smartWebBanner").height();var t=4,o=100*t/5;e("#divrating .filled-star").css("width",o+"%"),"iPhone"!=l&&"iPod"!=l&&"Browser"!=l||e.getJSON("https://itunes.apple.com/lookup?id=536110000&callback=?",function(i){if(null!=i&&(t=i.results[0].averageUserRating,parseInt(t)>0)){var n=100*t/5;e("#divrating .filled-star").css("width",n+"%")}})}(),g())}else e.cookie("IsFromWidget",null,{path:"/"})}else e("head").append("<style>.ui-page { margin-top: -78px !important; }</style>")}function g(){null!=navigator.userAgent.match(/iPhone/i)&&navigator.userAgent.match(/Windows/i),/Safari/i.test(navigator.appVersion)&&/CriOS/i.test(navigator.appVersion);v()}function v(){e("#smartWebBanner").stop().animate({top:0},m.speedIn).addClass("shown"),e("#swb-close").on("click",function(){return f(),!1}),e("#swb-save,#swb-icon").on("click",function(){return function(){e("#swb-instructions").fadeIn(m.popupSpeedIn),m.titleSwap&&(document.title=m.title);m.url&&history.replaceState(null,null,m.url);0!=m.popupDuration&&setTimeout(function(){C()},m.popupDuration);S("swb-saved","true",m.daysReminder)}(),!1}),IsSmartBannerVisible=!0}function f(){e("body").removeClass("smart-banner"),e("#smartWebBanner").stop().animate({top:-(i+i/3)},m.speedOut).removeClass("shown"),C(),S("swb-closed","true",m.daysHidden),IsSmartBannerVisible=!1,SetOverlayTop()}function C(){e("#swb-instructions").fadeOut(m.popupSpeedOut),m.titleSwap&&setTimeout(function(){document.title=u},12e3),m.url&&setTimeout(function(){history.replaceState(null,null,p)},12e3)}function S(e,t,i){var n=new Date;n.setDate(n.getDate()+i);t=escape(t)+(null==i?"":"; expires="+n.toUTCString());document.cookie=e+"="+t+"; path=/;"}function y(e){var t,i,n,o=document.cookie.split(";");for(t=0;t<o.length;t++)if(i=o[t].substr(0,o[t].indexOf("=")),n=o[t].substr(o[t].indexOf("=")+1),(i=i.replace(/^\s+|\s+$/g,""))==e)return unescape(n)}},e.fn.smartWebBanner.defaults={title:"Web App",titleSwap:!0,url:"",author:"Save to Home Screen",speedIn:300,speedOut:400,useIcon:!0,iconOverwrite:"",iconGloss:"auto",showFree:!0,daysHidden:15,daysReminder:90,popupDuration:6e3,popupSpeedIn:200,popupSpeedOut:900,theme:"light",autoApp:!1,debug:!1,button:"View"}}(jQuery),function e(t,i,n){function o(s,r){if(!i[s]){if(!t[s]){var l="function"==typeof require&&require;if(!r&&l)return l(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=i[s]={exports:{}};t[s][0].call(d.exports,function(e){var i=t[s][1][e];return o(i||e)},d,d.exports,e,t,i,n)}return i[s].exports}for(var a="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,t,i){"use strict";var n=e("../main");"function"==typeof define&&define.amd?define(n):(window.PerfectScrollbar=n,void 0===window.Ps&&(window.Ps=n))},{"../main":6}],2:[function(e,t,i){"use strict";var n={};n.create=function(e,t){var i=document.createElement(e);return i.className=t,i},n.appendTo=function(e,t){return t.appendChild(e),e},n.css=function(e,t,i){return"object"==typeof t?function(e,t){for(var i in t){var n=t[i];"number"==typeof n&&(n=n.toString()+"px"),e.style[i]=n}return e}(e,t):void 0===i?function(e,t){try{return window.getComputedStyle(e)[t]}catch(e){return""}}(e,t):function(e,t,i){return"number"==typeof i&&(i=i.toString()+"px"),e.style[t]=i,e}(e,t,i)},n.matches=function(e,t){return void 0!==e.matches?e.matches(t):e.msMatchesSelector(t)},n.remove=function(e){void 0!==e.remove?e.remove():e.parentNode&&e.parentNode.removeChild(e)},n.queryChildren=function(e,t){return Array.prototype.filter.call(e.childNodes,function(e){return n.matches(e,t)})},t.exports=n},{}],3:[function(e,t,i){"use strict";var n=function(e){this.element=e,this.events={}};n.prototype.bind=function(e,t){void 0===this.events[e]&&(this.events[e]=[]),this.events[e].push(t),this.element.addEventListener(e,t,!1)},n.prototype.unbind=function(e,t){var i=void 0!==t;this.events[e]=this.events[e].filter(function(n){return!(!i||n===t)||(this.element.removeEventListener(e,n,!1),!1)},this)},n.prototype.unbindAll=function(){for(var e in this.events)this.unbind(e)};var o=function(){this.eventElements=[]};o.prototype.eventElement=function(e){var t=this.eventElements.filter(function(t){return t.element===e})[0];return void 0===t&&(t=new n(e),this.eventElements.push(t)),t},o.prototype.bind=function(e,t,i){this.eventElement(e).bind(t,i)},o.prototype.unbind=function(e,t,i){this.eventElement(e).unbind(t,i)},o.prototype.unbindAll=function(){for(var e=0;e<this.eventElements.length;e++)this.eventElements[e].unbindAll()},o.prototype.once=function(e,t,i){var n=this.eventElement(e),o=function(e){n.unbind(t,o),i(e)};n.bind(t,o)},t.exports=o},{}],4:[function(e,t,i){"use strict";t.exports=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}}()},{}],5:[function(e,t,i){"use strict";var n=e("./dom"),o=i.toInt=function(e){return parseInt(e,10)||0};function a(e){return["ps--in-scrolling"].concat(void 0===e?["ps--x","ps--y"]:["ps--"+e])}i.isEditable=function(e){return n.matches(e,"input,[contenteditable]")||n.matches(e,"select,[contenteditable]")||n.matches(e,"textarea,[contenteditable]")||n.matches(e,"button,[contenteditable]")},i.removePsClasses=function(e){for(var t=0;t<e.classList.length;t++){var i=e.classList[t];0===i.indexOf("ps-")&&e.classList.remove(i)}},i.outerWidth=function(e){return o(n.css(e,"width"))+o(n.css(e,"paddingLeft"))+o(n.css(e,"paddingRight"))+o(n.css(e,"borderLeftWidth"))+o(n.css(e,"borderRightWidth"))},i.startScrolling=function(e,t){for(var i=a(t),n=0;n<i.length;n++)e.classList.add(i[n])},i.stopScrolling=function(e,t){for(var i=a(t),n=0;n<i.length;n++)e.classList.remove(i[n])},i.env={isWebKit:"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style,supportsTouch:"undefined"!=typeof window&&("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),supportsIePointer:"undefined"!=typeof window&&null!==window.navigator.msMaxTouchPoints}},{"./dom":2}],6:[function(e,t,i){"use strict";var n=e("./plugin/destroy"),o=e("./plugin/initialize"),a=e("./plugin/update");t.exports={initialize:o,update:a,destroy:n}},{"./plugin/destroy":8,"./plugin/initialize":16,"./plugin/update":20}],7:[function(e,t,i){"use strict";t.exports=function(){return{handlers:["click-rail","drag-scrollbar","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipePropagation:!0,swipeEasing:!0,useBothWheelAxes:!1,wheelPropagation:!1,wheelSpeed:1,theme:"default"}}},{}],8:[function(e,t,i){"use strict";var n=e("../lib/helper"),o=e("../lib/dom"),a=e("./instances");t.exports=function(e){var t=a.get(e);t&&(t.event.unbindAll(),o.remove(t.scrollbarX),o.remove(t.scrollbarY),o.remove(t.scrollbarXRail),o.remove(t.scrollbarYRail),n.removePsClasses(e),a.remove(e))}},{"../lib/dom":2,"../lib/helper":5,"./instances":17}],9:[function(e,t,i){"use strict";var n=e("../instances"),o=e("../update-geometry"),a=e("../update-scroll");t.exports=function(e){!function(e,t){function i(e){return e.getBoundingClientRect()}var n=function(e){e.stopPropagation()};t.event.bind(t.scrollbarY,"click",n),t.event.bind(t.scrollbarYRail,"click",function(n){var s=n.pageY-window.pageYOffset-i(t.scrollbarYRail).top>t.scrollbarYTop?1:-1;a(e,"top",e.scrollTop+s*t.containerHeight),o(e),n.stopPropagation()}),t.event.bind(t.scrollbarX,"click",n),t.event.bind(t.scrollbarXRail,"click",function(n){var s=n.pageX-window.pageXOffset-i(t.scrollbarXRail).left>t.scrollbarXLeft?1:-1;a(e,"left",e.scrollLeft+s*t.containerWidth),o(e),n.stopPropagation()})}(e,n.get(e))}},{"../instances":17,"../update-geometry":18,"../update-scroll":19}],10:[function(e,t,i){"use strict";var n=e("../../lib/helper"),o=e("../../lib/dom"),a=e("../instances"),s=e("../update-geometry"),r=e("../update-scroll");function l(e,t){var i=null,a=null;var l=function(o){!function(o){var a=i+o*t.railXRatio,s=Math.max(0,t.scrollbarXRail.getBoundingClientRect().left)+t.railXRatio*(t.railXWidth-t.scrollbarXWidth);t.scrollbarXLeft=a<0?0:a>s?s:a;var l=n.toInt(t.scrollbarXLeft*(t.contentWidth-t.containerWidth)/(t.containerWidth-t.railXRatio*t.scrollbarXWidth))-t.negativeScrollAdjustment;r(e,"left",l)}(o.pageX-a),s(e),o.stopPropagation(),o.preventDefault()},c=function(){n.stopScrolling(e,"x"),t.event.unbind(t.ownerDocument,"mousemove",l)};t.event.bind(t.scrollbarX,"mousedown",function(s){a=s.pageX,i=n.toInt(o.css(t.scrollbarX,"left"))*t.railXRatio,n.startScrolling(e,"x"),t.event.bind(t.ownerDocument,"mousemove",l),t.event.once(t.ownerDocument,"mouseup",c),s.stopPropagation(),s.preventDefault()})}function c(e,t){var i=null,a=null;var l=function(o){!function(o){var a=i+o*t.railYRatio,s=Math.max(0,t.scrollbarYRail.getBoundingClientRect().top)+t.railYRatio*(t.railYHeight-t.scrollbarYHeight);t.scrollbarYTop=a<0?0:a>s?s:a;var l=n.toInt(t.scrollbarYTop*(t.contentHeight-t.containerHeight)/(t.containerHeight-t.railYRatio*t.scrollbarYHeight));r(e,"top",l)}(o.pageY-a),s(e),o.stopPropagation(),o.preventDefault()},c=function(){n.stopScrolling(e,"y"),t.event.unbind(t.ownerDocument,"mousemove",l)};t.event.bind(t.scrollbarY,"mousedown",function(s){a=s.pageY,i=n.toInt(o.css(t.scrollbarY,"top"))*t.railYRatio,n.startScrolling(e,"y"),t.event.bind(t.ownerDocument,"mousemove",l),t.event.once(t.ownerDocument,"mouseup",c),s.stopPropagation(),s.preventDefault()})}t.exports=function(e){var t=a.get(e);l(e,t),c(e,t)}},{"../../lib/dom":2,"../../lib/helper":5,"../instances":17,"../update-geometry":18,"../update-scroll":19}],11:[function(e,t,i){"use strict";var n=e("../../lib/helper"),o=e("../../lib/dom"),a=e("../instances"),s=e("../update-geometry"),r=e("../update-scroll");function l(e,t){var i=!1;t.event.bind(e,"mouseenter",function(){i=!0}),t.event.bind(e,"mouseleave",function(){i=!1});var a=!1;t.event.bind(t.ownerDocument,"keydown",function(l){if(!(l.isDefaultPrevented&&l.isDefaultPrevented()||l.defaultPrevented)){var c=o.matches(t.scrollbarX,":focus")||o.matches(t.scrollbarY,":focus");if(i||c){var d=document.activeElement?document.activeElement:t.ownerDocument.activeElement;if(d){if("IFRAME"===d.tagName)d=d.contentDocument.activeElement;else for(;d.shadowRoot;)d=d.shadowRoot.activeElement;if(n.isEditable(d))return}var u=0,p=0;switch(l.which){case 37:u=l.metaKey?-t.contentWidth:l.altKey?-t.containerWidth:-30;break;case 38:p=l.metaKey?t.contentHeight:l.altKey?t.containerHeight:30;break;case 39:u=l.metaKey?t.contentWidth:l.altKey?t.containerWidth:30;break;case 40:p=l.metaKey?-t.contentHeight:l.altKey?-t.containerHeight:-30;break;case 33:p=90;break;case 32:p=l.shiftKey?90:-90;break;case 34:p=-90;break;case 35:p=l.ctrlKey?-t.contentHeight:-t.containerHeight;break;case 36:p=l.ctrlKey?e.scrollTop:t.containerHeight;break;default:return}r(e,"top",e.scrollTop-p),r(e,"left",e.scrollLeft+u),s(e),a=function(i,n){var o=e.scrollTop;if(0===i){if(!t.scrollbarYActive)return!1;if(0===o&&n>0||o>=t.contentHeight-t.containerHeight&&n<0)return!t.settings.wheelPropagation}var a=e.scrollLeft;if(0===n){if(!t.scrollbarXActive)return!1;if(0===a&&i<0||a>=t.contentWidth-t.containerWidth&&i>0)return!t.settings.wheelPropagation}return!0}(u,p),a&&l.preventDefault()}}})}t.exports=function(e){l(e,a.get(e))}},{"../../lib/dom":2,"../../lib/helper":5,"../instances":17,"../update-geometry":18,"../update-scroll":19}],12:[function(e,t,i){"use strict";var n=e("../instances"),o=e("../update-geometry"),a=e("../update-scroll");function s(e,t){var i=!1;function n(n){var s=function(e){var t=e.deltaX,i=-1*e.deltaY;return void 0!==t&&void 0!==i||(t=-1*e.wheelDeltaX/6,i=e.wheelDeltaY/6),e.deltaMode&&1===e.deltaMode&&(t*=10,i*=10),t!=t&&i!=i&&(t=0,i=e.wheelDelta),e.shiftKey?[-i,-t]:[t,i]}(n),r=s[0],l=s[1];(function(t,i){var n=e.querySelector("textarea:hover, select[multiple]:hover, .ps-child:hover");if(n){var o=window.getComputedStyle(n);if(![o.overflow,o.overflowX,o.overflowY].join("").match(/(scroll|auto)/))return!1;var a=n.scrollHeight-n.clientHeight;if(a>0&&!(0===n.scrollTop&&i>0||n.scrollTop===a&&i<0))return!0;var s=n.scrollLeft-n.clientWidth;if(s>0&&!(0===n.scrollLeft&&t<0||n.scrollLeft===s&&t>0))return!0}return!1})(r,l)||(i=!1,t.settings.useBothWheelAxes?t.scrollbarYActive&&!t.scrollbarXActive?(a(e,"top",l?e.scrollTop-l*t.settings.wheelSpeed:e.scrollTop+r*t.settings.wheelSpeed),i=!0):t.scrollbarXActive&&!t.scrollbarYActive&&(a(e,"left",r?e.scrollLeft+r*t.settings.wheelSpeed:e.scrollLeft-l*t.settings.wheelSpeed),i=!0):(a(e,"top",e.scrollTop-l*t.settings.wheelSpeed),a(e,"left",e.scrollLeft+r*t.settings.wheelSpeed)),o(e),i=i||function(i,n){var o=e.scrollTop;if(0===i){if(!t.scrollbarYActive)return!1;if(0===o&&n>0||o>=t.contentHeight-t.containerHeight&&n<0)return!t.settings.wheelPropagation}var a=e.scrollLeft;if(0===n){if(!t.scrollbarXActive)return!1;if(0===a&&i<0||a>=t.contentWidth-t.containerWidth&&i>0)return!t.settings.wheelPropagation}return!0}(r,l),i&&(n.stopPropagation(),n.preventDefault()))}void 0!==window.onwheel?t.event.bind(e,"wheel",n):void 0!==window.onmousewheel&&t.event.bind(e,"mousewheel",n)}t.exports=function(e){s(e,n.get(e))}},{"../instances":17,"../update-geometry":18,"../update-scroll":19}],13:[function(e,t,i){"use strict";var n=e("../instances"),o=e("../update-geometry");t.exports=function(e){!function(e,t){t.event.bind(e,"scroll",function(){o(e)})}(e,n.get(e))}},{"../instances":17,"../update-geometry":18}],14:[function(e,t,i){"use strict";var n=e("../../lib/helper"),o=e("../instances"),a=e("../update-geometry"),s=e("../update-scroll");function r(e,t){var i=null,r={top:0,left:0};function l(){i&&(clearInterval(i),i=null),n.stopScrolling(e)}var c=!1;t.event.bind(t.ownerDocument,"selectionchange",function(){var t;e.contains(0===(t=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"").toString().length?null:t.getRangeAt(0).commonAncestorContainer)?c=!0:(c=!1,l())}),t.event.bind(window,"mouseup",function(){c&&(c=!1,l())}),t.event.bind(window,"keyup",function(){c&&(c=!1,l())}),t.event.bind(window,"mousemove",function(t){if(c){var d={x:t.pageX,y:t.pageY},u={left:e.offsetLeft,right:e.offsetLeft+e.offsetWidth,top:e.offsetTop,bottom:e.offsetTop+e.offsetHeight};d.x<u.left+3?(r.left=-5,n.startScrolling(e,"x")):d.x>u.right-3?(r.left=5,n.startScrolling(e,"x")):r.left=0,d.y<u.top+3?(r.top=u.top+3-d.y<5?-5:-20,n.startScrolling(e,"y")):d.y>u.bottom-3?(r.top=d.y-u.bottom+3<5?5:20,n.startScrolling(e,"y")):r.top=0,0===r.top&&0===r.left?l():i||(i=setInterval(function(){o.get(e)?(s(e,"top",e.scrollTop+r.top),s(e,"left",e.scrollLeft+r.left),a(e)):clearInterval(i)},50))}})}t.exports=function(e){r(e,o.get(e))}},{"../../lib/helper":5,"../instances":17,"../update-geometry":18,"../update-scroll":19}],15:[function(e,t,i){"use strict";var n=e("../../lib/helper"),o=e("../instances"),a=e("../update-geometry"),s=e("../update-scroll");function r(e,t,i,n){function r(t,i){s(e,"top",e.scrollTop-i),s(e,"left",e.scrollLeft-t),a(e)}var l={},c=0,d={},u=null,p=!1,h=!1;function m(){p=!0}function g(){p=!1}function v(e){return e.targetTouches?e.targetTouches[0]:e}function f(e){return(!e.pointerType||"pen"!==e.pointerType||0!==e.buttons)&&(!(!e.targetTouches||1!==e.targetTouches.length)||!(!e.pointerType||"mouse"===e.pointerType||e.pointerType===e.MSPOINTER_TYPE_MOUSE))}function C(e){if(f(e)){h=!0;var t=v(e);l.pageX=t.pageX,l.pageY=t.pageY,c=(new Date).getTime(),null!==u&&clearInterval(u),e.stopPropagation()}}function S(i){if(!h&&t.settings.swipePropagation&&C(i),!p&&h&&f(i)){var n=v(i),o={pageX:n.pageX,pageY:n.pageY},a=o.pageX-l.pageX,s=o.pageY-l.pageY;r(a,s),l=o;var u=(new Date).getTime(),m=u-c;m>0&&(d.x=a/m,d.y=s/m,c=u),function(i,n){var o=e.scrollTop,a=e.scrollLeft,s=Math.abs(i),r=Math.abs(n);if(r>s){if(n<0&&o===t.contentHeight-t.containerHeight||n>0&&0===o)return!t.settings.swipePropagation}else if(s>r&&(i<0&&a===t.contentWidth-t.containerWidth||i>0&&0===a))return!t.settings.swipePropagation;return!0}(a,s)&&(i.stopPropagation(),i.preventDefault())}}function y(){!p&&h&&(h=!1,t.settings.swipeEasing&&(clearInterval(u),u=setInterval(function(){o.get(e)&&(d.x||d.y)?Math.abs(d.x)<.01&&Math.abs(d.y)<.01?clearInterval(u):(r(30*d.x,30*d.y),d.x*=.8,d.y*=.8):clearInterval(u)},10)))}i?(t.event.bind(window,"touchstart",m),t.event.bind(window,"touchend",g),t.event.bind(e,"touchstart",C),t.event.bind(e,"touchmove",S),t.event.bind(e,"touchend",y)):n&&(window.PointerEvent?(t.event.bind(window,"pointerdown",m),t.event.bind(window,"pointerup",g),t.event.bind(e,"pointerdown",C),t.event.bind(e,"pointermove",S),t.event.bind(e,"pointerup",y)):window.MSPointerEvent&&(t.event.bind(window,"MSPointerDown",m),t.event.bind(window,"MSPointerUp",g),t.event.bind(e,"MSPointerDown",C),t.event.bind(e,"MSPointerMove",S),t.event.bind(e,"MSPointerUp",y)))}t.exports=function(e){(n.env.supportsTouch||n.env.supportsIePointer)&&r(e,o.get(e),n.env.supportsTouch,n.env.supportsIePointer)}},{"../../lib/helper":5,"../instances":17,"../update-geometry":18,"../update-scroll":19}],16:[function(e,t,i){"use strict";var n=e("./instances"),o=e("./update-geometry"),a={"click-rail":e("./handler/click-rail"),"drag-scrollbar":e("./handler/drag-scrollbar"),keyboard:e("./handler/keyboard"),wheel:e("./handler/mouse-wheel"),touch:e("./handler/touch"),selection:e("./handler/selection")},s=e("./handler/native-scroll");t.exports=function(e,t){e.classList.add("ps");var i=n.add(e,"object"==typeof t?t:{});e.classList.add("ps--theme_"+i.settings.theme),i.settings.handlers.forEach(function(t){a[t](e)}),s(e),o(e)}},{"./handler/click-rail":9,"./handler/drag-scrollbar":10,"./handler/keyboard":11,"./handler/mouse-wheel":12,"./handler/native-scroll":13,"./handler/selection":14,"./handler/touch":15,"./instances":17,"./update-geometry":18}],17:[function(e,t,i){"use strict";var n=e("../lib/helper"),o=e("./default-setting"),a=e("../lib/dom"),s=e("../lib/event-manager"),r=e("../lib/guid"),l={};function c(e,t){var i=this;for(var r in i.settings=o(),t)i.settings[r]=t[r];function l(){e.classList.add("ps--focus")}function c(){e.classList.remove("ps--focus")}i.containerWidth=null,i.containerHeight=null,i.contentWidth=null,i.contentHeight=null,i.isRtl="rtl"===a.css(e,"direction"),i.isNegativeScroll=function(){var t,i=e.scrollLeft;return e.scrollLeft=-1,t=e.scrollLeft<0,e.scrollLeft=i,t}(),i.negativeScrollAdjustment=i.isNegativeScroll?e.scrollWidth-e.clientWidth:0,i.event=new s,i.ownerDocument=e.ownerDocument||document,i.scrollbarXRail=a.appendTo(a.create("div","ps__scrollbar-x-rail"),e),i.scrollbarX=a.appendTo(a.create("div","ps__scrollbar-x"),i.scrollbarXRail),i.scrollbarX.setAttribute("tabindex",0),i.event.bind(i.scrollbarX,"focus",l),i.event.bind(i.scrollbarX,"blur",c),i.scrollbarXActive=null,i.scrollbarXWidth=null,i.scrollbarXLeft=null,i.scrollbarXBottom=n.toInt(a.css(i.scrollbarXRail,"bottom")),i.isScrollbarXUsingBottom=i.scrollbarXBottom==i.scrollbarXBottom,i.scrollbarXTop=i.isScrollbarXUsingBottom?null:n.toInt(a.css(i.scrollbarXRail,"top")),i.railBorderXWidth=n.toInt(a.css(i.scrollbarXRail,"borderLeftWidth"))+n.toInt(a.css(i.scrollbarXRail,"borderRightWidth")),a.css(i.scrollbarXRail,"display","block"),i.railXMarginWidth=n.toInt(a.css(i.scrollbarXRail,"marginLeft"))+n.toInt(a.css(i.scrollbarXRail,"marginRight")),a.css(i.scrollbarXRail,"display",""),i.railXWidth=null,i.railXRatio=null,i.scrollbarYRail=a.appendTo(a.create("div","ps__scrollbar-y-rail"),e),i.scrollbarY=a.appendTo(a.create("div","ps__scrollbar-y"),i.scrollbarYRail),i.scrollbarY.setAttribute("tabindex",0),i.event.bind(i.scrollbarY,"focus",l),i.event.bind(i.scrollbarY,"blur",c),i.scrollbarYActive=null,i.scrollbarYHeight=null,i.scrollbarYTop=null,i.scrollbarYRight=n.toInt(a.css(i.scrollbarYRail,"right")),i.isScrollbarYUsingRight=i.scrollbarYRight==i.scrollbarYRight,i.scrollbarYLeft=i.isScrollbarYUsingRight?null:n.toInt(a.css(i.scrollbarYRail,"left")),i.scrollbarYOuterWidth=i.isRtl?n.outerWidth(i.scrollbarY):null,i.railBorderYWidth=n.toInt(a.css(i.scrollbarYRail,"borderTopWidth"))+n.toInt(a.css(i.scrollbarYRail,"borderBottomWidth")),a.css(i.scrollbarYRail,"display","block"),i.railYMarginHeight=n.toInt(a.css(i.scrollbarYRail,"marginTop"))+n.toInt(a.css(i.scrollbarYRail,"marginBottom")),a.css(i.scrollbarYRail,"display",""),i.railYHeight=null,i.railYRatio=null}function d(e){return e.getAttribute("data-ps-id")}i.add=function(e,t){var i=r();return function(e,t){e.setAttribute("data-ps-id",t)}(e,i),l[i]=new c(e,t),l[i]},i.remove=function(e){delete l[d(e)],function(e){e.removeAttribute("data-ps-id")}(e)},i.get=function(e){return l[d(e)]}},{"../lib/dom":2,"../lib/event-manager":3,"../lib/guid":4,"../lib/helper":5,"./default-setting":7}],18:[function(e,t,i){"use strict";var n=e("../lib/helper"),o=e("../lib/dom"),a=e("./instances"),s=e("./update-scroll");function r(e,t){return e.settings.minScrollbarLength&&(t=Math.max(t,e.settings.minScrollbarLength)),e.settings.maxScrollbarLength&&(t=Math.min(t,e.settings.maxScrollbarLength)),t}t.exports=function(e){var t,i=a.get(e);i.containerWidth=e.clientWidth,i.containerHeight=e.clientHeight,i.contentWidth=e.scrollWidth,i.contentHeight=e.scrollHeight,e.contains(i.scrollbarXRail)||((t=o.queryChildren(e,".ps__scrollbar-x-rail")).length>0&&t.forEach(function(e){o.remove(e)}),o.appendTo(i.scrollbarXRail,e)),e.contains(i.scrollbarYRail)||((t=o.queryChildren(e,".ps__scrollbar-y-rail")).length>0&&t.forEach(function(e){o.remove(e)}),o.appendTo(i.scrollbarYRail,e)),!i.settings.suppressScrollX&&i.containerWidth+i.settings.scrollXMarginOffset<i.contentWidth?(i.scrollbarXActive=!0,i.railXWidth=i.containerWidth-i.railXMarginWidth,i.railXRatio=i.containerWidth/i.railXWidth,i.scrollbarXWidth=r(i,n.toInt(i.railXWidth*i.containerWidth/i.contentWidth)),i.scrollbarXLeft=n.toInt((i.negativeScrollAdjustment+e.scrollLeft)*(i.railXWidth-i.scrollbarXWidth)/(i.contentWidth-i.containerWidth))):i.scrollbarXActive=!1,!i.settings.suppressScrollY&&i.containerHeight+i.settings.scrollYMarginOffset<i.contentHeight?(i.scrollbarYActive=!0,i.railYHeight=i.containerHeight-i.railYMarginHeight,i.railYRatio=i.containerHeight/i.railYHeight,i.scrollbarYHeight=r(i,n.toInt(i.railYHeight*i.containerHeight/i.contentHeight)),i.scrollbarYTop=n.toInt(e.scrollTop*(i.railYHeight-i.scrollbarYHeight)/(i.contentHeight-i.containerHeight))):i.scrollbarYActive=!1,i.scrollbarXLeft>=i.railXWidth-i.scrollbarXWidth&&(i.scrollbarXLeft=i.railXWidth-i.scrollbarXWidth),i.scrollbarYTop>=i.railYHeight-i.scrollbarYHeight&&(i.scrollbarYTop=i.railYHeight-i.scrollbarYHeight),function(e,t){var i={width:t.railXWidth};t.isRtl?i.left=t.negativeScrollAdjustment+e.scrollLeft+t.containerWidth-t.contentWidth:i.left=e.scrollLeft,t.isScrollbarXUsingBottom?i.bottom=t.scrollbarXBottom-e.scrollTop:i.top=t.scrollbarXTop+e.scrollTop,o.css(t.scrollbarXRail,i);var n={top:e.scrollTop,height:t.railYHeight};t.isScrollbarYUsingRight?t.isRtl?n.right=t.contentWidth-(t.negativeScrollAdjustment+e.scrollLeft)-t.scrollbarYRight-t.scrollbarYOuterWidth:n.right=t.scrollbarYRight-e.scrollLeft:t.isRtl?n.left=t.negativeScrollAdjustment+e.scrollLeft+2*t.containerWidth-t.contentWidth-t.scrollbarYLeft-t.scrollbarYOuterWidth:n.left=t.scrollbarYLeft+e.scrollLeft,o.css(t.scrollbarYRail,n),o.css(t.scrollbarX,{left:t.scrollbarXLeft,width:t.scrollbarXWidth-t.railBorderXWidth}),o.css(t.scrollbarY,{top:t.scrollbarYTop,height:t.scrollbarYHeight-t.railBorderYWidth})}(e,i),i.scrollbarXActive?e.classList.add("ps--active-x"):(e.classList.remove("ps--active-x"),i.scrollbarXWidth=0,i.scrollbarXLeft=0,s(e,"left",0)),i.scrollbarYActive?e.classList.add("ps--active-y"):(e.classList.remove("ps--active-y"),i.scrollbarYHeight=0,i.scrollbarYTop=0,s(e,"top",0))}},{"../lib/dom":2,"../lib/helper":5,"./instances":17,"./update-scroll":19}],19:[function(e,t,i){"use strict";var n=e("./instances"),o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t};t.exports=function(e,t,i){if(void 0===e)throw"You must provide an element to the update-scroll function";if(void 0===t)throw"You must provide an axis to the update-scroll function";if(void 0===i)throw"You must provide a value to the update-scroll function";"top"===t&&i<=0&&(e.scrollTop=i=0,e.dispatchEvent(o("ps-y-reach-start"))),"left"===t&&i<=0&&(e.scrollLeft=i=0,e.dispatchEvent(o("ps-x-reach-start")));var a=n.get(e);"top"===t&&i>=a.contentHeight-a.containerHeight&&((i=a.contentHeight-a.containerHeight)-e.scrollTop<=2?i=e.scrollTop:e.scrollTop=i,e.dispatchEvent(o("ps-y-reach-end"))),"left"===t&&i>=a.contentWidth-a.containerWidth&&((i=a.contentWidth-a.containerWidth)-e.scrollLeft<=2?i=e.scrollLeft:e.scrollLeft=i,e.dispatchEvent(o("ps-x-reach-end"))),void 0===a.lastTop&&(a.lastTop=e.scrollTop),void 0===a.lastLeft&&(a.lastLeft=e.scrollLeft),"top"===t&&i<a.lastTop&&e.dispatchEvent(o("ps-scroll-up")),"top"===t&&i>a.lastTop&&e.dispatchEvent(o("ps-scroll-down")),"left"===t&&i<a.lastLeft&&e.dispatchEvent(o("ps-scroll-left")),"left"===t&&i>a.lastLeft&&e.dispatchEvent(o("ps-scroll-right")),"top"===t&&i!==a.lastTop&&(e.scrollTop=a.lastTop=i,e.dispatchEvent(o("ps-scroll-y"))),"left"===t&&i!==a.lastLeft&&(e.scrollLeft=a.lastLeft=i,e.dispatchEvent(o("ps-scroll-x")))}},{"./instances":17}],20:[function(e,t,i){"use strict";var n=e("../lib/helper"),o=e("../lib/dom"),a=e("./instances"),s=e("./update-geometry"),r=e("./update-scroll");t.exports=function(e){var t=a.get(e);t&&(t.negativeScrollAdjustment=t.isNegativeScroll?e.scrollWidth-e.clientWidth:0,o.css(t.scrollbarXRail,"display","block"),o.css(t.scrollbarYRail,"display","block"),t.railXMarginWidth=n.toInt(o.css(t.scrollbarXRail,"marginLeft"))+n.toInt(o.css(t.scrollbarXRail,"marginRight")),t.railYMarginHeight=n.toInt(o.css(t.scrollbarYRail,"marginTop"))+n.toInt(o.css(t.scrollbarYRail,"marginBottom")),o.css(t.scrollbarXRail,"display","none"),o.css(t.scrollbarYRail,"display","none"),s(e),r(e,"top",e.scrollTop),r(e,"left",e.scrollLeft),o.css(t.scrollbarXRail,"display",""),o.css(t.scrollbarYRail,"display",""))}},{"../lib/dom":2,"../lib/helper":5,"./instances":17,"./update-geometry":18,"./update-scroll":19}]},{},[1]),function(e){e.mobiscroll.themes.jqm={defaults:{jqmBorder:"a",jqmBody:"c",jqmHeader:"b",jqmWheel:"d",jqmClickPick:"c",jqmSet:"b",jqmCancel:"c"},init:function(t,i){var n=i.settings;e(".dw",t).removeClass("dwbg").addClass("ui-overlay-shadow ui-corner-all ui-body-"+n.jqmBorder),e(".dwb-s span",t).attr("data-role","button").attr("data-theme",n.jqmSet),e(".dwb-n span",t).attr("data-role","button").attr("data-theme",n.jqmCancel),e(".dwb-c span",t).attr("data-role","button").attr("data-theme",n.jqmCancel),e(".dwwb",t).attr("data-role","button").attr("data-theme",n.jqmClickPick),e(".dwv",t).addClass("ui-header ui-bar-"+n.jqmHeader),e(".dwwr",t).addClass("ui-body-"+n.jqmBody),e(".dwpm .dwwl",t).addClass("ui-body-"+n.jqmWheel),e(".dwpm .dwl",t).addClass("ui-body-"+n.jqmBody),t.trigger("create"),e(".dwo",t).click(function(){i.cancel()})}}}(jQuery),jQuery.mobiscroll.themes.android={defaults:{dateOrder:"Mddyy",mode:"clickpick",height:50,showLabel:!1}},function(e){var t={defaults:{dateOrder:"Mddyy",mode:"mixed",rows:5,width:40,height:36,showLabel:!1,useShortLabels:!0}};e.mobiscroll.themes["android-ics"]=t,e.mobiscroll.themes["android-ics light"]=t}(jQuery),jQuery.mobiscroll.themes.ios={defaults:{dateOrder:"MMdyy",rows:5,height:35,width:30,headerText:!1,showLabel:!1,useShortLabels:!0}},function(e){var t=e.mobiscroll,i={invalid:[],showInput:!0,inputClass:""},n=function(t){var n,o,a=e.extend({},t.settings),s=e.extend(t.settings,i,a),r=e(this),l=this.id+"_dummy",c=0,d=0,u={},p=s.wheelArray||function t(i){var n=[];return c=c>d++?c:d,i.children("li").each(function(i){var o=e(this),a=o.clone();a.children("ul,ol").remove();var s=a.html().replace(/^\s\s*/,"").replace(/\s\s*$/,""),r=!!o.data("invalid"),l={key:o.data("val")||i,value:s,invalid:r,children:null},c=o.children("ul,ol");c.length&&(l.children=t(c)),n.push(l)}),d--,n}(r),h=function(e){var t,i=[];for(t=0;t<e;t++)i[t]=s.labels&&s.labels[t]?s.labels[t]:t;return i}(c),m=[],g=function(e){var t,i=[],n=e,o=!0,a=0;for(;o;)t=y(n),i[a++]=t.key,(o=t.children)&&(n=t.children);return i}(p),v=S(g,c);function f(t,i,n,o){for(var a=0;a<i;){var s=e(".dwwl"+a,t),r=C(o,a,n);e.each(r,function(t,i){e('.dw-li[data-val="'+i+'"]',s).removeClass("dw-v")}),a++}}function C(e,t,i){for(var n,o=0,a=i,s=[];o<t;){var r=e[o];for(n in a)if(a[n].key==r){a=a[n].children;break}o++}for(o=0;o<a.length;)a[o].invalid&&s.push(a[o].key),o++;return s}function S(e,t,i){var n,o,a,s=0,r=[],l=p;if(t)for(n=0;n<t;n++)r[n]=[{}];for(;s<e.length;){for(r[s]=[b(l,h[s])],n=0,a=void 0;n<l.length&&void 0===a;)l[n].key==e[s]&&(void 0!==i&&s<=i||void 0===i)&&(a=n),n++;if(void 0!==a&&l[a].children)s++,l=l[a].children;else{if(!(o=y(l))||!o.children)return r;s++,l=o.children}}return r}function y(e,t){if(!e)return!1;for(var i,n=0;n<e.length;)if(!(i=e[n++]).invalid)return t?n-1:i;return!1}function b(e,t){for(var i={keys:[],values:[],label:t},n=0;n<e.length;)i.values.push(e[n].value),i.keys.push(e[n].key),n++;return i}function k(t,i){e(".dwc",t).css("display","").slice(i).hide()}function _(e,t){var i,n,o,a=[],s=p,r=0,l=!1;if(void 0!==e[r]&&r<=t)for(i=0,n=e[r],o=void 0;i<s.length&&void 0===o;)s[i].key!=e[r]||s[i].invalid||(o=i),i++;else n=s[o=y(s,!0)].key;for(l=void 0!==o&&s[o].children,a[r]=n;l;){if(s=s[o].children,l=!1,o=void 0,void 0!==e[++r]&&r<=t)for(i=0,n=e[r],o=void 0;i<s.length&&void 0===o;)s[i].key!=e[r]||s[i].invalid||(o=i),i++;else n=s[o=!1===(o=y(s,!0))?void 0:o].key;l=!(void 0===o||!y(s[o].children))&&s[o].children,a[r]=n}return{lvl:r+1,nVector:a}}return e("#"+l).remove(),s.showInput&&(n=e('<input type="text" id="'+l+'" value="" class="'+s.inputClass+'" readonly />').insertBefore(r),t.settings.anchor=n,s.showOnFocus&&n.focus(function(){t.show()}),s.showOnTap&&t.tap(n,function(){t.show()})),s.wheelArray||r.hide().closest(".ui-field-contain").trigger("create"),{width:50,wheels:v,headerText:!1,onBeforeShow:function(e){var i=t.temp;m=i.slice(0),t.settings.wheels=S(i,c,c),o=!0},onSelect:function(e,t){n&&n.val(e)},onChange:function(e,t){n&&"inline"==s.display&&n.val(e)},onClose:function(){n&&n.blur()},onShow:function(t){e(".dwwl",t).on("mousedown touchstart",function(){clearTimeout(u[e(".dwwl",t).index(this)])})},validate:function(e,i,n){var a=t.temp;if(void 0!==i&&m[i]!=a[i]||void 0===i&&!o){t.settings.wheels=S(a,null,i);var s=[],r=(i||0)+1,l=_(a,i);for(void 0!==i&&(t.temp=l.nVector.slice(0));r<l.lvl;)s.push(r++);if(k(e,l.lvl),m=t.temp.slice(0),s.length)return o=!0,t.settings.readonly=function(e,t){for(var i=[];e;)i[--e]=!0;return i[t]=!1,i}(c,i),clearTimeout(u[i]),u[i]=setTimeout(function(){t.changeWheel(s),t.settings.readonly=!1},1e3*n),!1;f(e,l.lvl,p,t.temp)}else{f(e,(l=_(a,a.length)).lvl,p,a),k(e,l.lvl)}o=!1}}};e.each(["list","image","treelist"],function(e,i){t.presets[i]=n,t.presetShort(i)})}(jQuery),function(e){var t={inputClass:"",invalid:[],rtl:!1,group:!1,groupLabel:"Groups"};e.mobiscroll.presetShort("select"),e.mobiscroll.presets.select=function(i){var n,o,a,s,r,l=e.extend({},i.settings),c=e.extend(i.settings,t,l),d=e(this),u=d.prop("multiple"),p=this.id+"_dummy",h=u?d.val()?d.val()[0]:e("option",d).attr("value"):d.val(),m=d.find('option[value="'+h+'"]').parent(),g=m.index()+"",v=g,f=(e('label[for="'+this.id+'"]').attr("for",p),e('label[for="'+p+'"]')),C=void 0!==c.label?c.label:f.length?f.text():d.attr("name"),S=[],y=[],b={},k=c.readonly;function _(){var t,i=0,n=[],o=[],a=[[]];return c.group?(c.rtl&&(i=1),e("optgroup",d).each(function(t){n.push(e(this).attr("label")),o.push(t)}),a[i]=[{values:n,keys:o,label:c.groupLabel}],t=m,i+=c.rtl?-1:1):t=d,n=[],o=[],e("option",t).each(function(){var t=e(this).attr("value");n.push(e(this).text()),o.push(t),e(this).prop("disabled")&&S.push(t)}),a[i]=[{values:n,keys:o,label:C}],a}function D(e,t){var o=[];if(u){var s=[],l=0;for(l in i._selectedValues)s.push(b[l]),o.push(l);r.val(s.join(", "))}else r.val(e),o=t?i.values[a]:null;t&&(n=!0,d.val(o).trigger("change"))}function I(e){if(u&&e.hasClass("dw-v")&&e.closest(".dw").find(".dw-ul").index(e.closest(".dw-ul"))==a){var t=e.attr("data-val");return e.hasClass("dw-msel")?(e.removeClass("dw-msel").removeAttr("aria-selected"),delete i._selectedValues[t]):(e.addClass("dw-msel").attr("aria-selected","true"),i._selectedValues[t]=t),"inline"==c.display&&D(t,!0),!1}}c.group&&!e("optgroup",d).length&&(c.group=!1),c.invalid.length||(c.invalid=S),c.group?c.rtl?(o=1,a=0):(o=0,a=1):(o=-1,a=0),e("#"+p).remove(),r=e('<input type="text" id="'+p+'" class="'+c.inputClass+'" readonly />').insertBefore(d),e("option",d).each(function(){b[e(this).attr("value")]=e(this).text()}),c.showOnFocus&&r.focus(function(){i.show()}),c.showOnTap&&i.tap(r,function(){i.show()});for(var w=d.val()||[],P=0;P<w.length;P++)i._selectedValues[w[P]]=w[P];return D(b[h]),d.off(".dwsel").on("change.dwsel",function(){n||i.setValue(u?d.val()||[]:[d.val()],!0),n=!1}).hide().closest(".ui-field-contain").trigger("create"),i._setValue||(i._setValue=i.setValue),i.setValue=function(t,n,o,s,r){var l,p=e.isArray(t)?t[0]:t;if(h=void 0!==p?p:e("option",d).attr("value"),u){i._selectedValues={};for(var f=0;f<t.length;f++)i._selectedValues[t[f]]=t[f]}if(c.group?(m=d.find('option[value="'+h+'"]').parent(),v=m.index(),l=c.rtl?[h,m.index()]:[m.index(),h],v!==g&&(c.wheels=_(),i.changeWheel([a]),g=v+"")):l=[h],i._setValue(l,n,o,s,r),n){var C=!!u||h!==d.val();D(b[h],C)}},i.getValue=function(e){return(e?i.temp:i.values)[a]},{width:50,wheels:void 0,headerText:!1,multiple:u,anchor:r,formatResult:function(e){return b[e[a]]},parseValue:function(){var t=d.val()||[],n=0;if(u)for(i._selectedValues={};n<t.length;n++)i._selectedValues[t[n]]=t[n];return h=u?d.val()?d.val()[0]:e("option",d).attr("value"):d.val(),m=d.find('option[value="'+h+'"]').parent(),v=m.index(),g=v+"",c.group&&c.rtl?[h,v]:c.group?[v,h]:[h]},validate:function(t,n,r){if(void 0===n&&u){var l=i._selectedValues,p=0;for(p in e(".dwwl"+a+" .dw-li",t).removeClass("dw-msel").removeAttr("aria-selected"),l)e(".dwwl"+a+' .dw-li[data-val="'+l[p]+'"]',t).addClass("dw-msel").attr("aria-selected","true")}if(n===o)if((v=i.temp[o])!==g){if(m=d.find("optgroup").eq(v),v=m.index(),h=(h=m.find("option").eq(0).val())||d.val(),c.wheels=_(),c.group)return i.temp=c.rtl?[h,v]:[v,h],c.readonly=[c.rtl,!c.rtl],clearTimeout(s),s=setTimeout(function(){i.changeWheel([a]),c.readonly=k,g=v+""},1e3*r),!1}else c.readonly=k;else h=i.temp[a];var f=e(".dw-ul",t).eq(a);e.each(c.invalid,function(t,i){e('.dw-li[data-val="'+i+'"]',f).removeClass("dw-v")})},onBeforeShow:function(e){c.wheels=_(),c.group&&(i.temp=c.rtl?[h,m.index()]:[m.index(),h])},onMarkupReady:function(t){var n;if(e(".dwwl"+o,t).on("mousedown touchstart",function(){clearTimeout(s)}),u)for(n in t.addClass("dwms"),e(".dwwl",t).eq(a).addClass("dwwms").attr("aria-multiselectable","true"),e(".dwwl",t).on("keydown",function(t){32==t.keyCode&&(t.preventDefault(),t.stopPropagation(),I(e(".dw-sel",this)))}),y={},i._selectedValues)y[n]=i._selectedValues[n]},onValueTap:I,onSelect:function(e){D(e,!0),c.group&&(i.values=null)},onCancel:function(){var e;if(c.group&&(i.values=null),u)for(e in i._selectedValues={},y)i._selectedValues[e]=y[e]},onChange:function(e){"inline"!=c.display||u||(r.val(e),n=!0,d.val(i.temp[a]).trigger("change"))},onClose:function(){r.blur()}}}}(jQuery);var BusinessLocationImage="",ApiURLEnumWaitlist=(ProximityCookieName="proximitystate_v3",ApiPath="websiteapi/homepage/",{LoadUserControl:"loadusercontrol",savewaitlist:"savewaitlist",GetWaitListDetails:(MyAccountApiPath="myaccountapi/homepage/")+"getwaitlistdetails",GetAvailableDatesWaitlist:MyAccountApiPath+"getavailabledateswaitlist",UpdateWaitlist:MyAccountApiPath+"updatewaitlist"});_vgWaitlist={TimeSlot:{Anytime:1,Morning:2,Afternoon:3,Evening:4},TimeSlotStr:{Anytime:"Anytime",Morning:"Morning",Afternoon:"Afternoon",Evening:"Evening"},UnderMaintanance:{UnderMaintananceInProgress:"-9",UnderMaintananceComplete:"-10"},localData:{BusinessID:0,WaitlistID:0,GroupId:"",UserID:0,Comment:"",LoginUserID:0,SelectedServices:"",isOutCallService:!1,BusinessPackageID:"",IsWaitlistMultiService:!1,isServicePerformAtSameTime:!1,MasterSPServiceDetail:[],MasterSPServiceDetailSave:[],SelectedServiceProviderList:[],SelectedDates:[],ServiceProviderWorkingHours:[],SelectedServiceProviderWorkingHours:[],ThankYouResponse:[],IsOnline:!0,TimeSlot:{Anytime:1,Morning:2,Afternoon:3,Evening:4},TimeSlotStr:{Anytime:"Anytime",Morning:"Morning",Afternoon:"Afternoon",Evening:"Evening"},EventType:{ServiceBundle:0,Service:1,Class:2},TypeService:{Single:1,Multiple:2,Any:3},IsRemove:0,IsOnChangeSP:0,DatePickerSectedDate:"",EditResponse:null,txtAnyProvider:"Any Provider",DateFormateForMoment:"MMM D, YYYY",DateFormateFor_MomentNew:"dddd, MMMM D, YYYY",TimeFormat:"hh:nn a/p",objWaitlistData:[],objReturnval:new Array,indexOfPicker:1,minDateForOffline:"",maxDateForOffline:"",waitlistSelectedDate:"",objWaitlistDataForMobile:[],isCalledForMobileDateChanged:!1,SelectTimeText:"Select Time",UnderMaintananceMessage:"Business is Under Maintenance. This won't take long",lstfamilyfriendmembers:{},CurrentEditId:"",FromMyAccount:!1},model:{divWaitlistpopup:"divWaitlistpopup",cboServiceProviderWaitlist:"cboServiceProviderWaitlist",txtWaitlistDate:"txtWaitlistDate",divWaitlistDate:"divWaitlistDate",WaitlistTimesInputCheck:"WaitlistTimesInputCheck",chkAnytime:"chkAnytime",chkMorning:"chkMorning",chkAfternoon:"chkAfternoon",chkEvening:"chkEvening",divSPWaitlist:"divSPWaitlist",divBundleWaitlist:"divBundleWaitlist",lblSPWaitlist:"lblSPWaitlist",lblBundleNameWaitlist:"lblBundleNameWaitlist",divServiceNameWaitlist:"divServiceNameWaitlist",divSP1Waitlist:"divSP1Waitlist",selectedcurrentClassDiv:"select-cross-position",newdatepicker:"newdatepicker",newdivSearchDate:"NewdivSearchDate",txtdivSearchTime:"txtdivSearchTime"},initOffline:function(e){this.localData.IsOnline=e},ShowWaitlistPopup:function(){if(UserID<=0)return showCommonLoginPopup("BookWaitlistAppointment"),!1;if($("body").addClass("show-passive-alert-popup"),$("html").addClass("waitlistpopupHidden"),$("#AddWaitlistDateTime").removeClass("btn-margin-left"),_vgWaitlist.localData.BusinessID=$("#hdnBusinessID").val(),_vgWaitlist.ShowLoaderWaitlist(!0),_vgWaitlist.ClearData(),"undefined"!=typeof groupID&&(_vgWaitlist.localData.GroupId=groupID),_vgWaitlist.BindServiceProvider(),_vgWaitlist.GetSelectedData(),_vgWaitlist.BindFamilyFriendList(),_vgWaitlist.localData.WaitlistID=0,_vgWaitlist.ResetWaitlistDatetimeControl(!1),"undefined"!=typeof _common&&void 0!==_common.isCreateLinkPreserve&&_common.isCreateLinkPreserve(!0)&&(lSPID=_common.isCreateLinkPreserve(!1),"-1"!=lSPID[0]))try{"undefined"!=typeof lSPID&&null!=lSPID&&""!=lSPID&&($("#cboServiceProviderWaitlist1").val(lSPID).trigger("change"),$("#cboServiceProviderWaitlist1").attr("disabled","disabled"))}catch(e){$("#cboServiceProviderWaitlist1").val("").trigger("change"),$("#cboServiceProviderWaitlist1").removeAttr("disabled")}if("undefined"!=typeof _common&&void 0!==_common.IsWidgetForServiceProvider&&_common.IsWidgetForServiceProvider(!0)){var e=_common.IsWidgetForServiceProvider(!1);$("#cboServiceProviderWaitlist1").val(e).trigger("change"),$("#cboServiceProviderWaitlist1").prop("disabled",!0)}},ShowHideWaitlistPopup:function(e){1==e?($(".Waitlistpopupbody").scrollTop(0),setTimeout(function(){$("#"+this.model.divWaitlistpopup).modal("show")},1e3),$("body").addClass("widgetpopupOpen")):($(".select2-container").removeClass("waitlist-dropdownList"),$("body").removeClass("show-passive-alert-popup"),$("html").removeClass("waitlistpopupHidden"),$("#"+this.model.divWaitlistpopup).modal("hide"),$("body").removeClass("widgetpopupOpen"))},BindServiceProvider:function(){for(var e=void 0!==$("#hdnServiceLimit").val()&&""!=$("#hdnServiceLimit").val()&&null!=$("#hdnServiceLimit").val()?$("#hdnServiceLimit").val():3,t=1;t<=e;t++){var i=$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+t);void 0!==i.data("select2")&&i.pumselect2("destroy"),i.pumselect2({placeholder:"Service Provider",closeOnSelect:!1,templateResult:function(e){return e.id?$('<span class="multicheck-checkbox"></span><label class="labelpadd">'+e.text+"</label>"):e.text}}).on("select2:open",function(e){$("span.select2-container.select2-container--default.select2-container--open").addClass("waitlist-dropdownList vagaro-dropdown-multiselect"),1==_vgWaitlist.localData.SelectedServices.length&&1==$("#"+_vgWaitlist.model.divSP1Waitlist).hasClass("WaitListServiceFullWidth")&&$("span.select2-container.select2-container--default.select2-container--open").addClass("waitlist-dropdownList vagaro-dropdown-multiselect dropdown-full-width")}),$("#"+this.model.cboServiceProviderWaitlist+t).empty()}},BindFamilyFriendList:function(){try{var e=_vgWaitlist.localData.lstfamilyfriendmembers;if(void 0!==e&&null!=e&&e.length>0)$(".familycktfrnd ul").empty(),$("#familycktfrndlistTemplate").tmpl(e).appendTo(".familycktfrndlist");else{var t=new vagaro.ajax;t.datamodel.Token="GetListofFamilyFriendtoBook",t.datamodel.data=[{UserID:UserID}],t.datamodel.callback=function(e){var t=1;$.each(e,function(e,i){i.Index=t,t++}),_vgWaitlist.localData.lstfamilyfriendmembers=e,$(".familycktfrnd ul").empty(),$("#familycktfrndlistTemplate").tmpl(e).appendTo(".familycktfrndlist")},t.datamodel.Error=_vgWaitlist.CallFailed,t.Post()}}catch(e){}},GetSelectedData:function(){_vgWaitlist.localData.SelectedServices=[],_vgWaitlist.localData.SelectedServicesDetails=[],_vgWaitlist.localData.MasterSPServiceDetail=[];for(var e=_shopdetail.VisibleControlLength("#dvSections .dvSectionDynamic")+1,t=0,i=1;i<=e;i++){var n=$("#txtService"+i).data("choice");if(""!=n)try{var o=JSON.parse(n);if(!o.hasOwnProperty("id")||""==o.id)return _vgWaitlist.ShowWarningMessage("Please select a service first."),void _vgWaitlist.ShowLoaderWaitlist(!1);if(1==i&&o.eventType==arrEventType.ServiceBundle){_vgWaitlist.localData.BusinessPackageID=o.id,_vgWaitlist.localData.isServicePerformAtSameTime=2==o.lstServiceBundleDetail[0].isServicePerformAtSameTime,$("#"+_vgWaitlist.model.lblBundleNameWaitlist).text(o.text);continue}1==_vgWaitlist.BindSPDropdown(i,t+1,o)&&(t+=1)}catch(e){}}var a=""!=_vgWaitlist.localData.BusinessPackageID?e-1:e;t>0&&""==_vgWaitlist.localData.BusinessPackageID||""!=_vgWaitlist.localData.BusinessPackageID&&a==t?($("#"+_vgWaitlist.model.divBundleWaitlist).hide(),""!=_vgWaitlist.localData.BusinessPackageID&&$("#"+_vgWaitlist.model.divBundleWaitlist).show(),1==t&&a==t?($("#"+_vgWaitlist.model.lblSPWaitlist+"1").text("Select Professional:"),$("#"+_vgWaitlist.model.divServiceNameWaitlist).removeClass("WaitlistDisc"),$("#"+_vgWaitlist.model.divSP1Waitlist).removeClass("WaitListServiceFull"),$("#"+_vgWaitlist.model.divServiceNameWaitlist).addClass("WaitlistDiscfullwidth"),$(".newaddwaitlistdatepicker").removeClass("multiNewadddatepicker"),$("#"+_vgWaitlist.model.divSP1Waitlist).addClass("WaitListServicehalfWidth"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&($("#divwaitlistServiceTitle").show(),$("#divwaitlistServiceTitle").html(o.text))):(t>1||a!=t)&&($("#"+_vgWaitlist.model.divServiceNameWaitlist).removeClass("WaitlistDiscfullwidth"),$("#"+_vgWaitlist.model.divSP1Waitlist).removeClass("WaitListServicehalfWidth "),$("#"+_vgWaitlist.model.divServiceNameWaitlist).addClass("WaitlistDisc"),$("#"+_vgWaitlist.model.divSP1Waitlist).addClass("WaitListServiceFull"),$(".newaddwaitlistdatepicker").addClass("multiNewadddatepicker"),$("#divwaitlistServiceTitle").hide(),$("#divwaitlistServiceTitle").html("")),_vgWaitlist.GetAvailableDates(null)):_vgWaitlist.ShowErrorMessage()},ShowErrorMessage:function(){_vgWaitlist.ShowWarningMessage("There is a no provider providing this service"),_vgWaitlist.ShowLoaderWaitlist(!1)},BindSPDropdown:function(e,t,i){var n=$("#txtSP"+e).data("select2");if(void 0!==n){var o=n.opts.data().results;if(o.length>0&&(o=o.slice(1)),o.length>0){if(_vgWaitlist.localData.SelectedServices.push(i.id),"undefined"!=typeof IsAutoAssignEmployee&&1==IsAutoAssignEmployee){var a={};a.ServiceId=i.id,a.ServiceName=i.text,a.Photo=i.photo,_vgWaitlist.localData.SelectedServicesDetails.push(a)}_vgWaitlist.localData.isOutCallService=i.isOutCallService,$("#"+_vgWaitlist.model.divSPWaitlist+t).show(),$("#"+_vgWaitlist.model.lblSPWaitlist+t).text(i.text);var s=$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+t),r=$.extend(!0,[],o),l="#txtService"+e,c=$(l).data("choice"),d=$(l).data("addon");if(""!=c)try{var u=JSON.parse(c),p=null!=d?JSON.parse(d):[];u.hasOwnProperty("id")&&""!=u.id&&(filterData=_shopdetail.FilterSPMulti(r,u,p))}catch(e){filterData=o}$.grep(filterData,function(e){var t={};t.ServiceId=i.id,t.SPIds=e.id,t.SPName=e.text,t.Servicename=i.text,_vgWaitlist.localData.MasterSPServiceDetail.push(t),0==e.isServiceProvide?s.append($("<option disabled></option>").val(e.id).html(e.text)):s.append($("<option></option>").val(e.id).html(e.text))}),s.data("isSkipChangeEvent",!0);var h=$("#txtSP"+e).data("choice");if(""!=h)try{var m=JSON.parse(h);m.hasOwnProperty("id")&&""!=m.id?s.val(m.id).trigger("change"):s.val("").trigger("change")}catch(e){s.val("").trigger("change")}else s.val("").trigger("change");return!0}}return!1},GetGroupId:function(){return void 0!==_vgWaitlist.localData.GroupId&&null!=_vgWaitlist.localData.GroupId?_vgWaitlist.localData.GroupId:""},GetAvailableDates:function(e,t){if(null!=e){var i;if(void 0!==(i=void 0!==$(e).context?$("#"+$(e).context.id):$("#"+$(e).attr("id"))).data("isSkipChangeEvent")&&1==i.data("isSkipChangeEvent"))return void i.data("isSkipChangeEvent",!1);_vgWaitlist.ReSetControls()}var n=_vgWaitlist.GetServiceProviders(!0);if(""==n)destroydatepicker({divid:"#"+_vgWaitlist.model.newdivSearchDate+_vgWaitlist.localData.indexOfPicker,textid:"#"+_vgWaitlist.model.newdatepicker+_vgWaitlist.localData.indexOfPicker,flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),preset:"date",unavailableShowDate:!0,arrValidDates:[""],isApplyInWidget:!0,isMobileFriendly:!1}),$("#WaitlistTimeDate").hide(),_vgWaitlist.ReSetControls(),_vgWaitlist.ShowErrorMessage();else{"-1"==n&&(n="");var o={},a=new vagaro.ajax;o.businessID=_vgWaitlist.localData.BusinessID,o.spID=n,a.datamodel.Token=ApiURLEnumWaitlist.GetAvailableDatesWaitlist,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.data=o,a.datamodel.callback=1==t?_vgWaitlist.AvailableDates_CallSuccessForEdit:_vgWaitlist.AvailableDates_CallSuccess,a.datamodel.Error=_vgWaitlist.CallFailed,a.datamodel.GroupToken=_vgWaitlist.GetGroupId(),a.Post()}},AvailableDates_CallSuccess:function(e){if(_vgWaitlist.ShowLoaderWaitlist(!1),null!=e&&e.length>0&&""!=e[0]&&_vgWaitlist.localData.MasterSPServiceDetail.length>0){if($("#"+_vgWaitlist.model.divWaitlistpopup).modal("show"),prepaidEnscroll_waitlist(),"undefined"!=typeof _shopdetail&&void 0!==_shopdetail.lastAppBookingDate){var t,i;new Date(moment(e[0])._d),(t=new Date(moment(e[e.length-1])._d)).setDate(t.getDate()+1),i=new Date(t),i=_shopdetail.getSunday(i),i=new Date(i.setDate(i.getDate()+6));for(var n=t;n<=i;n.setDate(n.getDate()+1))e.push(n.format("MMM dd,yyyy"))}if(_vgWaitlist.localData.objReturnval=e,1==_vgWaitlist.localData.objWaitlistData.length&&_vgWaitlist.DestroyApplyDateTimePicker(_vgWaitlist.localData.indexOfPicker,_vgWaitlist.localData.objReturnval),$("#txtdivSearchDate").length>0){var o=getdatepickervalue("#txtdivSearchDate",null,!0,!0);null!=o&&(-1==e.indexOf(o.format("MMM dd,yyyy"))&&(o=new Date(moment(e[0])._d)),setdatepickervalue({divid:"#"+_vgWaitlist.model.newdivSearchDate+_vgWaitlist.localData.indexOfPicker,textid:"#"+_vgWaitlist.model.newdatepicker+_vgWaitlist.localData.indexOfPicker,flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isApplyInWidget:!0},new Date(o)),_vgWaitlist.localData.waitlistSelectedDate=o,_vgWaitlist.localData.objWaitlistData[0].DateW=moment(o).format(_vgWaitlist.localData.DateFormateForMoment))}_vgWaitlist.GetServiceProviderWorkingHours(void 0,_vgWaitlist.localData.indexOfPicker),void 0!==setPopupPosi&&void 0!==getQueryStringData&&"Builder"==getQueryStringData("Type")&&setPopupPosi($("#"+_vgWaitlist.model.divWaitlistpopup))}else{destroydatepicker({divid:"#"+_vgWaitlist.model.newdivSearchDate+_vgWaitlist.localData.indexOfPicker,textid:"#"+_vgWaitlist.model.newdatepicker+_vgWaitlist.localData.indexOfPicker,flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),preset:"date",unavailableShowDate:!0,arrValidDates:[""],isApplyInWidget:!0,isMobileFriendly:!1,onGenerate:_vgWaitlist.onGenerateNew});var a=$("#"+_vgWaitlist.model.divWaitlistpopup);0==a.is(":visible")&&0==a.hasClass("in")&&_vgWaitlist.ShowErrorMessage()}},AvailableDates_CallSuccessForEdit:function(e){null!=e&&e.length>0&&""!=e[0]&&_vgWaitlist.localData.MasterSPServiceDetail.length>0?($("#dvwaitlistPopupHeader").text("Edit Waitlist"),$("#btnAddWaitlistOnline").text("Edit Waitlist"),$(".Waitlistpopupbody").scrollTop(0),$("#"+_vgWaitlist.model.divWaitlistpopup).modal("show"),void 0!==setPopupPosi&&"undefined"!=typeof WebsiteBuilderType&&"Builder"==WebsiteBuilderType&&setPopupPosi($("#"+_vgWaitlist.model.divWaitlistpopup)),_vgWaitlist.localData.objReturnval=e,_vgWaitlist.ShowLoaderWaitlist(!1),$.grep(_vgWaitlist.localData.SelectedServiceProviderWorkingHours,function(t){$.grep(e,function(e){if(moment(t.dtWaitlistDate).format("MMM DD,YYYY")==e){var i=$.extend(!0,{},t);t.arrIntervals=[];var n={};n.TimeW=i.TimeW,n.DateW=i.DateW,n.copyobjSelectedServiceProviderWorkingHours=i,_vgWaitlist.localData.objWaitlistData.push(n)}})}),5==_vgWaitlist.localData.objWaitlistData.length&&$("#WaitlistTimeDate").hide(),_vgWaitlist.ResetWaitlistDatetimeControl(!0)):(destroydatepicker({divid:"#"+_vgWaitlist.model.newdivSearchDate+_vgWaitlist.localData.indexOfPicker,textid:"#"+_vgWaitlist.model.newdatepicker+_vgWaitlist.localData.indexOfPicker,flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),preset:"date",unavailableShowDate:!0,arrValidDates:[""],isApplyInWidget:!0,isMobileFriendly:!1,onGenerate:_vgWaitlist.onGenerateNew}),_vgWaitlist.ShowErrorMessage())},CallFailed:function(e){_vgWaitlist.ShowLoaderWaitlist(!1)},ShowLoaderWaitlist:function(e){1==_vgWaitlist.localData.IsOnline?ShowLoader(e):_vgCal.Common.ShowLoader(e)},GetServiceProviderWorkingHours:function(e,t){if(_vgWaitlist.localData.indexOfPicker=t,void 0!==e&&$.grep(_vgWaitlist.localData.objWaitlistData,function(t){return t.DateW!=moment(e).format(_vgWaitlist.localData.DateFormateForMoment)}).length>5)return _vgWaitlist.ShowWarningMessage("Please add only 5 dates for waitlist"),$("#selectWaitlist"+_vgWaitlist.localData.indexOfPicker).find("input[type=checkbox]:checkbox").prop("checked",!1),$("#selectWaitlist"+_vgWaitlist.localData.indexOfPicker).find("input[type=checkbox]:checkbox").attr("disabled",!0),!1;if(1==_vgWaitlist.localData.IsOnline&&void 0!==e)for(var i=_shopdetail.VisibleControlLength(".divSPWaitlist"),n=1;n<=i;n++)$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+n).select2("close");_vgWaitlist.ShowLoaderWaitlist(!0);var o=$("#"+_vgWaitlist.model.newdatepicker+_vgWaitlist.localData.indexOfPicker),a=$.grep(_vgWaitlist.localData.SelectedServiceProviderWorkingHours,function(e){return e.SelectedDate==moment(o.val()).format("MMM-DD-YYYY")});if(a.length>0)_vgWaitlist.EnableIntervalNew(a[0],_vgWaitlist.localData.indexOfPicker),_vgWaitlist.ShowLoaderWaitlist(!1);else if(1==_vgWaitlist.localData.IsOnline){"undefined"!=typeof IsAutoAssignEmployee&&1==IsAutoAssignEmployee&&(i=_shopdetail.VisibleControlLength(".divSPWaitlist"),$("#lblSPWaitlist1").show(),void 0===_vgWaitlist.localData.BusinessPackageID||"0"==_vgWaitlist.localData.BusinessPackageID||""==_vgWaitlist.localData.BusinessPackageID?(1==i&&($("#lblSPWaitlist1").hide(),$("#divSP1Waitlist").hide()),$(".WaitListServiceFull").hide()):$(".WaitListServiceFull").hide());var s=_vgWaitlist.GetServiceProviders(!1),r={};r.BusinessID=_vgWaitlist.localData.BusinessID,r.ServiceProviderID=s,r.strSelectedDate=o.val(),r.loginUserID=UserID;var l=new vagaro.ajax;l.datamodel.Token="GetServiceProviderWorkingHours",l.datamodel.data=[r],l.datamodel.callback=_vgWaitlist.SuccessServiceProviderWorkingHours,l.datamodel.Error=_vgWaitlist.CallFailed,l.datamodel.GroupToken=_vgWaitlist.GetGroupId(),l.Post()}else 0==_vgWaitlist.localData.IsOnline&&null!=(o=getdatepickervalue("#"+_vgWaitlist.model.newdatepicker+_vgWaitlist.localData.indexOfPicker,!1,!1,!1))&&_vgWaitlist.SetWorkingHoursOffline(o)},SetWorkingHoursOffline:function(e){var t={Morning:!0,AfterNoon:!0,Evening:!0,IsSelected:!1};t.Day=e.getDate(),t.Month=e.getMonth(),t.Year=e.getFullYear(),t.SelectedDate=moment(e).format("MMM-DD-YYYY"),t.dtWaitlistDate=new Date(e),t.arrIntervals=[],_vgWaitlist.localData.SelectedServiceProviderWorkingHours.push(t),_vgWaitlist.EnableIntervalNew(t,_vgWaitlist.localData.indexOfPicker),_vgWaitlist.ShowLoaderWaitlist(!1)},SuccessServiceProviderWorkingHours:function(e){if(null!=e){var t={};(t=$.extend(!0,{},e)).arrIntervals=[],_vgWaitlist.localData.SelectedServiceProviderWorkingHours.push(t),_vgWaitlist.EnableIntervalNew(t,_vgWaitlist.localData.indexOfPicker),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&1==_vgWaitlist.localData.isCalledForMobileDateChanged&&(_vgWaitlist.localData.isCalledForMobileDateChanged=!1,_vgWaitlist.BindIntervalNewForMobile(_vgWaitlist.localData.indexOfPicker))}_vgWaitlist.ShowLoaderWaitlist(!1)},EnableInterval:function(e){$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").attr("disabled",!0),1==e.Morning&&1==e.AfterNoon&&1==e.Evening?$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").attr("disabled",!1):(1==e.Morning&&$("#"+_vgWaitlist.model.chkMorning).attr("disabled",!1),1==e.AfterNoon&&$("#"+_vgWaitlist.model.chkAfternoon).attr("disabled",!1),1==e.Evening&&$("#"+_vgWaitlist.model.chkEvening).attr("disabled",!1)),$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").prop("checked",!1)},EnableIntervalNew:function(e,t){$("#selectWaitlist"+t).find("input[type=checkbox]").attr("disabled",!0),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#selectWaitlist"+t).find("li").addClass("rescheck-disable"),1==e.Morning&&1==e.AfterNoon&&1==e.Evening?($("#selectWaitlist"+t).find("input[type=checkbox]").attr("disabled",!1),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#selectWaitlist"+t).find("li").removeClass("rescheck-disable")):(1==e.Morning&&($("#CheckMorning"+t).attr("disabled",!1),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#CheckMorning"+t).parents("li").removeClass("rescheck-disable")),1==e.AfterNoon&&($("#CheckAfternoon"+t).attr("disabled",!1),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#CheckAfternoon"+t).parents("li").removeClass("rescheck-disable")),1==e.Evening&&($("#CheckEvening"+t).attr("disabled",!1),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&$("#CheckEvening"+t).parents("li").removeClass("rescheck-disable"))),$("#selectWaitlist"+t).find("input[type=checkbox]:checked").prop("checked",!1)},GetInterval:function(e){return e<12?_vgWaitlist.TimeSlot.Morning:e>=12&&e<17?_vgWaitlist.TimeSlot.Afternoon:e>=17?_vgWaitlist.TimeSlot.Evening:void 0},DispalySelecedDates:function(e){0==$.grep(_vgWaitlist.localData.SelectedDates,function(t){return null!=e&&t.SelectedDate==e.SelectedDate&&t.arrIntervals.length>0?(t.IsSelected=!0,!0):(t.IsSelected=!1,!1)}).length&&null!=e&&($("#"+_vgWaitlist.model.txtWaitlistDate+'_picker .xdsoft_calendar td[data-date="'+e.Day+'"][data-month="'+e.Month+'"][data-year="'+e.Year+'"]').addClass("xdsoft_current"),$("#"+_vgWaitlist.model.txtWaitlistDate).data("SelectedByUser",!0))},SelectTimeSlots:function(e){var t=$("#"+_vgWaitlist.model.txtWaitlistDate),i=$("#"+_vgWaitlist.model.txtWaitlistDate+"_picker .xdsoft_calendar td.xdsoft_current.select-cross");if(i.length>0){var n=$(i[0]),o=new Date(n.data("year"),n.data("month"),n.data("date"));moment(o).format("MMM-DD-YYYY")!=t.val()&&setdatepickervalue({divid:"#"+_vgWaitlist.model.divWaitlistDate,textid:"#"+_vgWaitlist.model.txtWaitlistDate},o)}var a=-1,s=$.grep(_vgWaitlist.localData.SelectedDates,function(i,n){return i.SelectedDate==t.val()?(_vgWaitlist.SetInterval(i,parseInt($(e).val())),0==i.arrIntervals.length&&(a=n),!0):(i.IsSelected=!1,!1)});a>-1&&_vgWaitlist.localData.SelectedDates.splice(a,1),0==s.length&&$.grep(_vgWaitlist.localData.SelectedServiceProviderWorkingHours,function(i){if(i.SelectedDate==t.val()){var n=$.extend(!0,{},i);_vgWaitlist.SetInterval(n,parseInt($(e).val())),_vgWaitlist.localData.SelectedDates.push(n)}})},SetInterval:function(e,t){if(null!=t){var i=$("."+_vgWaitlist.model.WaitlistTimesInputCheck+' :checkbox[value="'+t+'"]');if(i.length>0&&1==i.is(":checked")){if(t!=_vgWaitlist.TimeSlot.Anytime&&-1==$.inArray(t,e.arrIntervals)){var n=$.inArray(_vgWaitlist.TimeSlot.Anytime,e.arrIntervals);n>-1&&e.arrIntervals.splice(n,1),e.arrIntervals.push(t),e.arrIntervals.sort()}else t==_vgWaitlist.TimeSlot.Anytime&&(e.arrIntervals=[],e.arrIntervals.push(_vgWaitlist.TimeSlot.Anytime));t!=_vgWaitlist.TimeSlot.Anytime&&3==e.arrIntervals.length&&(e.arrIntervals=[],e.arrIntervals.push(_vgWaitlist.TimeSlot.Anytime))}else{var o=$.inArray(t,e.arrIntervals);o>-1&&e.arrIntervals.splice(o,1)}}_vgWaitlist.BindInterval(e.arrIntervals);var a="xdsoft_current",s="xdsoft_current select-cross",r=$("#"+_vgWaitlist.model.txtWaitlistDate+'_picker .xdsoft_calendar td[data-date="'+e.Day+'"][data-month="'+e.Month+'"][data-year="'+e.Year+'"]');if(e.arrIntervals.length>0){if(e.IsSelected=!0,r.length>0&&(r.removeClass(a).addClass(s),0==$(".selectdatesi").length)){var l=r.find("div");l.addClass(_vgWaitlist.model.selectedcurrentClassDiv),l.append("<span class ='selectdatesi' onclick='_vgWaitlist.RemoveDate(this);' ontouchstart='_vgWaitlist.RemoveDate(this);' >&#xf00d;</span>")}}else e.IsSelected=!1,$(".selectdatesi").remove(),r.length>0&&r.removeClass(s).addClass(a)},BindInterval:function(e){$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").prop("checked",!1),$.grep(e,function(e){$("."+_vgWaitlist.model.WaitlistTimesInputCheck+' :checkbox[value="'+e+'"]').prop("checked",!0)})},BindIntervalNew:function(e,t){$("#selectWaitlist"+parseInt(t)).find("input[type=checkbox]:checked").removeAttr("checked");var i=e.split(",");$.each(i,function(e,i){$("#selectWaitlist"+parseInt(t)+' :checkbox[value="'+i+'"]').prop("checked",!0)})},BindIntervalNewForMobile:function(e){$(".rescheckbox-part").removeClass("info"),$("#divMobileTimeSlot").show(),$("#divWaitlistpopup").css("top","0px"),$("#divMainWaitlist").hide(),$("#btnAddWaitlistOnline").hide(),$("#saveAvailabilitybtn").show(),$("#divMainWaitlistLabel").hide(),$("#divSaveTimeSlotLabel").show(),$("#btnCancelWaitlist").hide(),$("#selectDate1").val($("#newdatepicker"+e).val()),_vgWaitlist.localData.objWaitlistDataForMobile=[];var t={};t.DateW=moment($("#selectDate1").val()).format(_vgWaitlist.localData.DateFormateForMoment);var i=[];$("#selectWaitlist"+e+" input:checked").each(function(){i.push($(this).val())}),t.TimeW=i.join(","),_vgWaitlist.localData.objWaitlistDataForMobile.push(t),1==_vgWaitlist.localData.objWaitlistData.length&&(_vgWaitlist.localData.objWaitlistData[0].DateW=t.DateW),$("#selectWaitlistMobile").find("input[type=checkbox]:checked").removeAttr("checked");var n=$.grep(_vgWaitlist.localData.SelectedServiceProviderWorkingHours,function(e){return e.SelectedDate==moment($("#selectDate1").val()).format("MMM-DD-YYYY")});n.length>0&&_vgWaitlist.EnableIntervalNew(n[0],"Mobile");var o=$("#selectWaitlist"+e).find("input[type=checkbox]:checked");$("#saveAvailabilitybtn").attr("onclick","_vgWaitlist.SaveAvailability("+e+");"),$("#selectWaitlistMobile").find("input[type=checkbox]").attr("onclick","_vgWaitlist.validateTimeForMobile('Mobile', this,"+e+");"),$.each(o,function(e,t){$('#selectWaitlistMobile :checkbox[value="'+t.value+'"]').prop("checked",!0).closest("li").addClass("info"),$('#selectWaitlistMobile :checkbox[value="'+t.value+'"]').prop("checked",!0).attr("aria-checked",!0)})},BackButtonMobileClick:function(){_vgWaitlist.ResetWaitlistDatetimeControl(!1),$("#divMobileTimeSlot").hide(),$("#divWaitlistpopup").css("top","50px"),$("#divMainWaitlist").show(),$("#btnAddWaitlistOnline").show(),$("#saveAvailabilitybtn").hide(),$("#divMainWaitlistLabel").show(),$("#divSaveTimeSlotLabel").hide(),$("#btnCancelWaitlist").show()},SaveAvailability:function(e){""!=_vgWaitlist.localData.objWaitlistDataForMobile[0].TimeW?(_vgWaitlist.localData.objWaitlistData[e-1].TimeW!=_vgWaitlist.localData.objWaitlistDataForMobile[0].TimeW&&(_vgWaitlist.localData.objWaitlistData[e-1].TimeW="",_vgWaitlist.localData.objWaitlistData[e-1].TimeW=_vgWaitlist.localData.objWaitlistDataForMobile[0].TimeW,1==_vgWaitlist.localData.objWaitlistDataForMobile.length&&(_vgWaitlist.localData.objWaitlistData[0].DateW=_vgWaitlist.localData.objWaitlistDataForMobile[0].DateW)),_vgWaitlist.BackButtonMobileClick()):_vgWaitlist.ShowWarningMessage("Please select time for waitlist.")},validateTimeForMobile:function(e,t,i){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker"+i).val()))return $(t).prop("checked",!1),!1;$(t).closest("li").addClass("info"),$(t).attr("aria-checked",!0);var n=$(t).next().find("span").html();1==$("#selectWaitlist"+e+" #CheckAnytime"+e).prop("checked")&&n==_vgWaitlist.TimeSlotStr.Anytime?($("#selectWaitlist"+e+" #CheckMorning"+e).prop("checked",!1).closest("li").removeClass("info"),$("#selectWaitlist"+e+" #CheckMorning"+e).attr("aria-checked",!1),$("#selectWaitlist"+e+" #CheckAfternoon"+e).prop("checked",!1).closest("li").removeClass("info"),$("#selectWaitlist"+e+" #CheckAfternoon"+e).attr("aria-checked",!1),$("#selectWaitlist"+e+" #CheckEvening"+e).prop("checked",!1).closest("li").removeClass("info"),$("#selectWaitlist"+e+" #CheckEvening"+e).attr("aria-checked",!1)):n!=_vgWaitlist.TimeSlotStr.Morning&&n!=_vgWaitlist.TimeSlotStr.Afternoon&&n!=_vgWaitlist.TimeSlotStr.Evening||1!=$("#selectWaitlist"+e+" #Check"+n+e).prop("checked")||($("#selectWaitlist"+e+" #CheckAnytime"+e).prop("checked",!1).closest("li").removeClass("info"),$("#selectWaitlist"+e+" #CheckAnytime"+e).attr("aria-checked",!1)),1==$("#selectWaitlist"+e+" #CheckMorning"+e).prop("checked")&&1==$("#selectWaitlist"+e+" #CheckAfternoon"+e).prop("checked")&&1==$("#selectWaitlist"+e+" #CheckEvening"+e).prop("checked")&&($("#selectWaitlist"+e).find("input[type=checkbox]").prop("checked",!1).closest("li").removeClass("info"),$("#selectWaitlist"+e).find("input[type=checkbox]").attr("aria-checked",!1),$("#selectWaitlist"+e+" #CheckAnytime"+e).prop("checked",!0).closest("li").addClass("info"),$("#selectWaitlist"+e+" #CheckAnytime"+e).attr("aria-checked",!0)),0==$(t).prop("checked")&&($(t).closest("li").removeClass("info"),$(t).attr("aria-checked",!1));var o=[],a=[];$("#txtdivSearchTime"+i).val(_vgWaitlist.localData.SelectTimeText),$("#selectWaitlist"+e+" input:checked").each(function(){$(this).val()==_vgWaitlist.TimeSlot.Anytime&&(o.push(_vgWaitlist.TimeSlotStr.Anytime),a.push(_vgWaitlist.TimeSlot.Anytime)),$(this).val()==_vgWaitlist.TimeSlot.Morning&&(o.push(_vgWaitlist.TimeSlotStr.Morning),a.push(_vgWaitlist.TimeSlot.Morning)),$(this).val()==_vgWaitlist.TimeSlot.Afternoon&&(o.push(_vgWaitlist.TimeSlotStr.Afternoon),a.push(_vgWaitlist.TimeSlot.Afternoon)),$(this).val()==_vgWaitlist.TimeSlot.Evening&&(o.push(_vgWaitlist.TimeSlotStr.Evening),a.push(_vgWaitlist.TimeSlot.Evening))}),o.length>0&&$("#txtdivSearchTime"+i).val(o.join(", ")),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?(_vgWaitlist.localData.objWaitlistDataForMobile[0].TimeW=a.join(","),1==_vgWaitlist.localData.objWaitlistDataForMobile.length&&(_vgWaitlist.localData.objWaitlistDataForMobile[0].DateW=moment($("#newdatepicker1").val()).format(_vgWaitlist.localData.DateFormateForMoment))):(_vgWaitlist.localData.objWaitlistData[i-1].TimeW=a.join(","),1==_vgWaitlist.localData.objWaitlistData.length&&(_vgWaitlist.localData.objWaitlistData[0].DateW=moment($("#newdatepicker1").val()).format(_vgWaitlist.localData.DateFormateForMoment)))},RemoveDate:function(e){var t=$(e).parents("td");if(t.length>0){var i=new Date(t.data("year"),t.data("month"),t.data("date")),n=$.grep(_vgWaitlist.localData.SelectedDates,function(e){return e.SelectedDate!=moment(i).format("MMM-DD-YYYY")});_vgWaitlist.localData.SelectedDates=n,t.removeClass("xdsoft_current select-cross"),e.remove(),$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").prop("checked",!1),$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").attr("disabled",!0)}},GetServiceProviders:function(e){for(var t="",i=[],n=[],o=_shopdetail.VisibleControlLength(".divSPWaitlist"),a=1;a<=o;a++)null!=$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+a).val()&&$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+a).val().length>0&&$.grep($("#"+_vgWaitlist.model.cboServiceProviderWaitlist+a).val(),function(e){var t={};t.SPIds=e,n.push(t)});if(0==n.length){var s=_vgWaitlist.localData.MasterSPServiceDetail.uniqueObjects(["SPIds"]);if(1==e&&0==n.length&&s.length>0)return"-1";n=s}else n=n.uniqueObjects(["SPIds"]);return $.grep(n,function(e){i.push(e.SPIds)}),i.length>0&&(t=i.join(",")),t},onGenerate:function(e,t){var i="xdsoft_current",n="xdsoft_current select-cross",o=!1,a=null,s=!1,r=$("#"+_vgWaitlist.model.txtWaitlistDate);$(".selectdatesi").remove();var l=$.grep(_vgWaitlist.localData.SelectedDates,function(t){var r=$("#"+_vgWaitlist.model.txtWaitlistDate+'_picker .xdsoft_calendar td[data-date="'+t.Day+'"][data-month="'+t.Month+'"][data-year="'+t.Year+'"]');return r.length>0&&(0==o&&(o=!0,a=t),1==t.IsSelected||null!=e&&0==s&&t.SelectedDate==moment(new Date(e)).format("MMM-DD-YYYY")?(null!=e&&0==s&&t.SelectedDate==moment(new Date(e)).format("MMM-DD-YYYY")&&(s=!0),r.find("div").addClass(_vgWaitlist.model.selectedcurrentClassDiv),r.removeClass(i).addClass(n).find("div").append("<span class ='selectdatesi' onclick='_vgWaitlist.RemoveDate(this);' ontouchstart='_vgWaitlist.RemoveDate(this);' >&#xf00d;</span>"),t.arrIntervals.length>0&&(_vgWaitlist.EnableInterval(t),_vgWaitlist.BindInterval(t.arrIntervals)),!0):(r.removeClass(n).addClass(i),!1))});if(1!=o||0!=s||0!=l.length||void 0!==r.data("SelectedByUser")&&0!=r.data("SelectedByUser")||(c=$("#"+_vgWaitlist.model.txtWaitlistDate+'_picker .xdsoft_calendar td[data-date="'+a.Day+'"][data-month="'+a.Month+'"][data-year="'+a.Year+'"]')).length>0&&(c.find("div").addClass(_vgWaitlist.model.selectedcurrentClassDiv),c.removeClass(i).addClass(n).find("div").append("<span class ='selectdatesi' onclick='_vgWaitlist.RemoveDate(this);' ontouchstart='_vgWaitlist.RemoveDate(this);' >&#xf00d;</span>"),a.arrIntervals.length>0&&(_vgWaitlist.EnableInterval(a),_vgWaitlist.BindInterval(a.arrIntervals))),0==o&&$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").prop("checked",!1),null!=e&&0==s){var c=$("#"+_vgWaitlist.model.txtWaitlistDate+'_picker .xdsoft_calendar td[data-date="'+e.getDate()+'"][data-month="'+e.getMonth()+'"][data-year="'+e.getFullYear()+'"]');(void 0===r.data("SelectedByUser")||0==r.data("SelectedByUser"))&&c.length>0&&c.removeClass(i).removeClass(n)}r.data("SelectedByUser",!1),0==$("#"+_vgWaitlist.model.txtWaitlistDate+"_picker .xdsoft_calendar td").hasClass("xdsoft_current")&&$("."+_vgWaitlist.model.WaitlistTimesInputCheck+" :checkbox").attr("disabled",!0)},onGenerateNew:function(e,t,i){var n=!1;_vgClassSessionSelection.VisibleControlLength("#mobile-check")&&(n=!0);var o="xdsoft_current";$(".xdsoft_calendar td").removeClass(o),n&&(o="vg_current",$("#vgCalendar_"+_vgWaitlist.model.newdatepicker+i+" .vg_calendar-date-div td").removeClass(o)),$("#"+_vgWaitlist.model.newdatepicker+i),$.grep(_vgWaitlist.localData.objWaitlistData,function(t,a){if(n)r=moment(t.DateW)._d,(s=$("#vgCalendar_"+_vgWaitlist.model.newdatepicker+i+' .vg_calendar-date-div td[data-value="'+moment(r).format("YYYY-MM-DD")+'"]')).length>0?s.addClass(o):0==_vgWaitlist.localData.objWaitlistData.filter(function(t){return t.DateW==moment(e).format(_vgWaitlist.localData.DateFormateForMoment)}).length&&$("#vgCalendar_"+_vgWaitlist.model.newdatepicker+i+' .vg_calendar-date-div td[data-value="'+moment(e).format("YYYY-MM-DD")+'"]').removeClass(o);else{var s,r=moment(t.DateW)._d;(s=$("#"+_vgWaitlist.model.newdatepicker+i+'_picker .xdsoft_calendar td[data-date="'+r.getDate()+'"][data-month="'+r.getMonth()+'"][data-year="'+r.getFullYear()+'"]')).length>0?s.addClass(o):0==_vgWaitlist.localData.objWaitlistData.filter(function(t){return t.DateW==moment(e).format(_vgWaitlist.localData.DateFormateForMoment)}).length&&$("#"+_vgWaitlist.model.newdatepicker+i+'_picker .xdsoft_calendar td[data-date="'+e.getDate()+'"][data-month="'+e.getMonth()+'"][data-year="'+e.getFullYear()+'"]').removeClass(o)}var l=a+1;if(t.DateW==moment(new Date(e)).format(_vgWaitlist.localData.DateFormateForMoment)){var c=$.grep(_vgWaitlist.localData.SelectedServiceProviderWorkingHours,function(e){return e.SelectedDate==moment(t.DateW).format("MMM-DD-YYYY")});c.length>0?_vgWaitlist.EnableIntervalNew(c[0],l):_vgWaitlist.localData.SelectedServiceProviderWorkingHours.length>0&&(_vgWaitlist.localData.isCalledForMobileDateChanged=!0,_vgWaitlist.GetServiceProviderWorkingHours(void 0,l)),_vgWaitlist.BindIntervalNew(t.TimeW,l)}})},ClearData:function(){_vgWaitlist.localData.GroupId="",_vgWaitlist.localData.SelectedServices=[],_vgWaitlist.localData.isOutCallService=!1,_vgWaitlist.localData.BusinessPackageID="",_vgWaitlist.localData.isServicePerformAtSameTime=!1,_vgWaitlist.localData.SelectedDates=[],_vgWaitlist.localData.ServiceProviderWorkingHours=[],_vgWaitlist.localData.SelectedServiceProviderWorkingHours=[],_vgWaitlist.localData.objWaitlistData=[],_vgWaitlist.localData.indexOfPicker=1,$("#WaitlistTimeDate").show(),_vgWaitlist.localData.IsOnline=!0,_vgWaitlist.localData.MasterSPServiceDetail=[],_vgWaitlist.localData.EditResponse=null;for(var e=void 0!==$("#hdnServiceLimit").val()&&null!=$("#hdnServiceLimit").val()&&null!=$("#hdnServiceLimit").val()&&""!=$("#hdnServiceLimit").val()?$("#hdnServiceLimit").val():3,t=1;t<=5;t++)$("#"+_vgWaitlist.model.newdatepicker+t).val(""),$("#selectWaitlist"+t+" :checkbox").attr("onclick","_vgWaitlist.validateTimeForMobile("+t+", this,"+t+");").prop("checked",!1).attr("disabled",!0);for(t=1;t<=e;t++)$("#"+_vgWaitlist.model.divSPWaitlist+ +t).hide();$("#"+_vgWaitlist.model.divBundleWaitlist).hide(),$("#dvwaitlistPopupHeader").text("Add to Waitlist"),$("#btnAddWaitlistOnline").text("Add to Waitlist")},ClearDataOffline:function(){_vgWaitlist.localData.SelectedServices=[],_vgWaitlist.localData.isOutCallService=!1,_vgWaitlist.localData.BusinessPackageID="",_vgWaitlist.localData.SelectedDates=[],_vgWaitlist.localData.ServiceProviderWorkingHours=[],_vgWaitlist.localData.SelectedServiceProviderWorkingHours=[],_vgWaitlist.localData.IsOnline=!1,_vgWaitlist.localData.MasterSPServiceDetail=[],_vgWaitlist.localData.BusinessID=0,_vgWaitlist.localData.UserID=0,_vgWaitlist.localData.LoginUserID=0,_vgWaitlist.localData.Comment="",$("#WaitlistTimeDate").show(),_vgWaitlist.localData.objWaitlistData=[],_vgWaitlist.localData.indexOfPicker=1,_vgWaitlist.localData.objReturnval=[""];for(var e=1;e<=5;e++)$("#selectWaitlist"+e+" :checkbox").attr("onclick","_vgWaitlist.validateTimeForMobile("+e+", this,"+e+");").prop("checked",!1).attr("disabled",!0);_vgWaitlist.DestroyApplyDateTimePicker(_vgWaitlist.localData.indexOfPicker,""),setdatepickervalue({divid:"#"+_vgWaitlist.model.newdivSearchDate+_vgWaitlist.localData.indexOfPicker,textid:"#"+_vgWaitlist.model.newdatepicker+_vgWaitlist.localData.indexOfPicker,isMobileFriendly:!1},_vgWaitlist.localData.waitlistSelectedDate),_vgWaitlist.ResetWaitlistDatetimeControl(!1)},ReSetControls:function(){_vgWaitlist.localData.SelectedDates=[],_vgWaitlist.localData.SelectedServiceProviderWorkingHours=[],$("#WaitlistTimeDate").show(),_vgWaitlist.localData.objWaitlistData=[],_vgWaitlist.localData.indexOfPicker=1,_vgWaitlist.localData.objReturnval=[""],_vgWaitlist.ResetWaitlistDatetimeControl(!1),$("#selectWaitlist1").find("input[type=checkbox]:checkbox").prop("checked",!1).attr("disabled",!0),$(".xdsoft_calendar td").removeClass("xdsoft_current"),$(".xdsoft_calendar td").removeClass("xdsoft_current select-cross"),$(".selectdatesi").remove()},ValiDateWaitlistOffline:function(){var e=NewApp_hdnCustomerID.value;if(0==e.length||"-1"==e||""==e.value)return SetErrorDisplayMessage("2","Please select a customer to book an waitlist.",""),!1;if(_vgWaitlist.localData.UserID=parseInt(NewApp_hdnCustomerID.value),_vgWaitlist.localData.MasterSPServiceDetailSave=[],0!=_vgWaitlist.localData.BusinessPackageID||1==_vgWaitlist.localData.IsWaitlistMultiService){var t=GetSelectedServies(hdnAppDate.value),i=t.split("|")[0].split(","),n=t.split("|")[1].split("~"),o=[];t.split("|").length>8&&(o=JSON.parse(t.split("|")[9]));for(var a=0;a<=i.length-1;a++){(l={}).SPIds=n[a],l.ServiceId=i[a];var s="";!String.isNullOrUndefineOrBlank(o)&&o.length>0&&(s=$.map(o[a],function(e){return e.serviceId}).join(",")),l.ServiceAddOnID=s,_vgWaitlist.localData.MasterSPServiceDetailSave.push(l)}}else{var r=null!=$("#cboServiceProviderWaitlist").val()&&""!=$("#cboServiceProviderWaitlist").val()?$("#cboServiceProviderWaitlist").val():0;if(0==r)return SetErrorDisplayMessage("2","Please select professional to book an waitlist.",""),!1;var l,c=parseInt(GetServiceID());(l={}).SPIds=r,l.ServiceId=c,_vgWaitlist.localData.MasterSPServiceDetailSave.push(l)}if(_vgWaitlist.localData.objWaitlistData.map(function(e){return e.TimeW}).indexOf("")>-1)return _vgWaitlist.ShowWarningMessage("Please Select Date and Time for Waitlist."),!1;if(1==_vgWaitlist.DuplicateDates())return _vgWaitlist.ShowWarningMessage("Please select unique dates."),!1;_vgWaitlist.localData.objWaitlistData.sort(function(e,t){return new Date(e.DateW)-new Date(t.DateW)});var d=$.grep(_vgWaitlist.localData.objWaitlistData,function(e){return e.TimeSlots=e.TimeW,e.FullDate=moment(new Date(e.DateW.replace(/-/g,"/"))).format("MMM-DD-YYYY"),!0});if(0==d.length)return _vgWaitlist.ShowWarningMessage("Please Select Date and Time for Waitlist."),!1;_vgWaitlist.SaveWaitlist(d),disableAppBookButton()},DestroyApplyDateTimePicker:function(e,t){if(1==_vgWaitlist.localData.IsOnline){var i=!1;_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&(i=!0),destroydatepicker({divid:"#"+_vgWaitlist.model.newdivSearchDate+e,textid:"#"+_vgWaitlist.model.newdatepicker+e,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isMobileFriendly:i,arrValidDates:t,onGenerate:function(t,i){_vgWaitlist.onGenerateNew(t,i,e)},BeforecallBackOnOpenForMobile:function(t){setdatepickervalue({divid:"#"+_vgWaitlist.model.newdivSearchDate+e,textid:"#"+_vgWaitlist.model.newdatepicker+e,flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isApplyInWidget:!0},new Date(t))},AftercallBackOnOpenForMobile:function(t){setTimeout(function(){_vgWaitlist.onGenerateNew(t,void 0,e)},500)},numberOfMonths:8,callBackOnChange:function(t){if(_vgWaitlist.localData.objWaitlistData[e-1].DateW!=moment(t).format(_vgWaitlist.localData.DateFormateForMoment)&&(_vgWaitlist.localData.objWaitlistData[e-1].TimeW="",_vgWaitlist.localData.objWaitlistData[e-1].DateW=moment(t).format(_vgWaitlist.localData.DateFormateForMoment),$("#selectWaitlist"+e).find("input[type=checkbox]").prop("checked",!1),$("#txtdivSearchTime"+e).val(_vgWaitlist.localData.SelectTimeText)),1==_vgWaitlist.DuplicateDates($("#newdatepicker"+e).val()))return!1;$("#newdivSearchTime"+e).click(),i&&_vgWaitlist.onGenerateNew(t,void 0,e)},flagVgMultiMonthDatePicker:!0,preset:"date",unavailableShowDate:!0,isApplyInWidget:!0,scrollMonth:!1})}else 0==_vgWaitlist.localData.IsOnline&&destroydatepicker({divid:"#"+_vgWaitlist.model.newdivSearchDate+e,textid:"#"+_vgWaitlist.model.newdatepicker+e,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isMobileFriendly:!1,onGenerate:function(t,i){_vgWaitlist.onGenerateNew(t,i,e)},callBackOnChange:function(t){_vgWaitlist.localData.objWaitlistData[e-1].DateW!=moment(t).format(_vgWaitlist.localData.DateFormateForMoment)&&(_vgWaitlist.localData.objWaitlistData[e-1].TimeW="",_vgWaitlist.localData.objWaitlistData[e-1].DateW=moment(t).format(_vgWaitlist.localData.DateFormateForMoment),$("#selectWaitlist"+e).find("input[type=checkbox]").prop("checked",!1),$("#txtdivSearchTime"+e).val(_vgWaitlist.localData.SelectTimeText)),$("#newdivSearchTime"+e).click()},flagVgMultiMonthDatePicker:!0,preset:"date",unavailableShowDate:!0,isApplyInWidget:!1,MinDate:_vgWaitlist.localData.minDateForOffline,MaxDate:_vgWaitlist.localData.maxDateForOffline})},GetDatesForWaitlist:function(e,t){var i=t;return i=new Date(Math.max.apply(null,_vgWaitlist.localData.objWaitlistData.map(function(e){return new Date(e.DateW)}))),1==_vgWaitlist.localData.IsOnline?(e=$.grep(e,function(e){return new Date(e)>i})).length>0&&(i=e[0]):i.setDate(i.getDate()+1),i},AddWaitlistDateTime:function(e){if(5!=_vgWaitlist.localData.objWaitlistData.length){var t={DateW:""};if(-1==_vgWaitlist.localData.objWaitlistData.map(function(e){return e.TimeW}).indexOf("")){_vgWaitlist.DestroyApplyDateTimePicker(parseInt(_vgWaitlist.localData.objWaitlistData.length+1),_vgWaitlist.localData.objReturnval);var i=_vgWaitlist.GetDatesForWaitlist(_vgWaitlist.localData.objReturnval,_vgWaitlist.localData.waitlistSelectedDate);setdatepickervalue({divid:"#"+_vgWaitlist.model.newdivSearchDate+parseInt(_vgWaitlist.localData.objWaitlistData.length+1),textid:"#"+_vgWaitlist.model.newdatepicker+parseInt(_vgWaitlist.localData.objWaitlistData.length+1),flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isApplyInWidget:!0},new Date(i)),t.DateW=moment($("#newdatepicker"+parseInt(_vgWaitlist.localData.objWaitlistData.length+1)).val()).format(_vgWaitlist.localData.DateFormateForMoment),t.TimeW=0==_vgWaitlist.localData.IsOnline?""+_vgWaitlist.TimeSlot.Anytime:"",_vgWaitlist.localData.objWaitlistData.push(t),$("#AddWaitlistDateTime").addClass("btn-margin-left"),$("#WaitlistDateTime"+parseInt(_vgWaitlist.localData.objWaitlistData.length)).show(),_vgWaitlist.ResetWaitlistDatetimeControl(!1),$("#NewdivSearchDate"+parseInt(_vgWaitlist.localData.objWaitlistData.length)).attr("tabindex",-1).focus()}else _vgWaitlist.ShowWarningMessage("Please update time for date",e)}else _vgWaitlist.ShowWarningMessage("Please add only 5 dates for waitlist",e);5==_vgWaitlist.localData.objWaitlistData.length&&$("#WaitlistTimeDate").hide()},HideWaitlistDateTime:function(e){$("#WaitlistTimeDate").show(),$(e).parents("[id^=WaitlistDateTime]").hide();var t=$(e).parents("[id^=WaitlistDateTime]").attr("id").substr(-1);_vgWaitlist.localData.objWaitlistData.splice(t-1,1),1==_vgWaitlist.localData.objWaitlistData.length&&$("#AddWaitlistDateTime").removeClass("btn-margin-left"),_vgWaitlist.ResetWaitlistDatetimeControl(!1),$("#AddWaitlistDateTime").attr("tabindex",-1).focus()},ResetWaitlistDatetimeControl:function(e){if(0==_vgWaitlist.localData.objWaitlistData.length){var t={};t.DateW=""!=$("#newdatepicker1").val()?moment($("#newdatepicker1").val()).format(_vgWaitlist.localData.DateFormateForMoment):"",t.TimeW=0==_vgWaitlist.localData.IsOnline?""+_vgWaitlist.TimeSlot.Anytime:"",_vgWaitlist.localData.objWaitlistData.push(t)}$('[id^="WaitlistDateTime"]').hide();for(var i=1;i<=5;i++)$("#newdatepicker"+i).val(""),setdatepickervalue({divid:"#"+_vgWaitlist.model.newdivSearchDate+i,textid:"#"+_vgWaitlist.model.newdatepicker+i,flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isApplyInWidget:!0},""),$("#txtdivSearchTime"+i).val(_vgWaitlist.localData.SelectTimeText),$("#selectWaitlist"+i).find("input[type=checkbox]:checked").removeAttr("checked");$.each(_vgWaitlist.localData.objWaitlistData,function(t,i){var n=t+1;if($("#newdatepicker"+n).val(i.DateW),_vgWaitlist.localData.objReturnval.length>0&&(e&&(_vgWaitlist.DestroyApplyDateTimePicker(n,_vgWaitlist.localData.objReturnval),""!=i.DateW&&_vgWaitlist.EnableIntervalNew(i.copyobjSelectedServiceProviderWorkingHours,n)),setdatepickervalue({divid:"#"+_vgWaitlist.model.newdivSearchDate+n,textid:"#"+_vgWaitlist.model.newdatepicker+n,flagVgMultiMonthDatePicker:!0,dateTimeFormat:DatePickerFormat(VagaroCountryDateFormat.SmallDate),isApplyInWidget:!0},new Date(i.DateW))),$("#txtdivSearchTime"+n).val(""!=i.TimeW?_vgWaitlist.TimeSlotValueReverse(i.TimeW):_vgWaitlist.localData.SelectTimeText),$("#selectWaitlist"+n).find("input[type=checkbox]:checked").removeAttr("checked"),""!=i.TimeW){var o=i.TimeW.split(",");$.each(o,function(e,t){$("#selectWaitlist"+n+' :checkbox[value="'+t+'"]').prop("checked",!0)})}$("#WaitlistDateTime"+n).show()})},DuplicateDates:function(e){if(void 0!==e&&""!=e)return _vgWaitlist.localData.objWaitlistData.filter(function(t){return t.DateW==e}).length>1&&(_vgWaitlist.ShowWarningMessage("Please select unique dates."),!0);var t=_vgWaitlist.localData.objWaitlistData.map(function(e){return e.DateW});return!!t.some(function(e,i){return t.indexOf(e)!=i})},TimeSlotValue:function(e){var t=e.trim().split(","),i=new Array;return $.grep(t,function(e){e.trim()==_vgWaitlist.TimeSlotStr.Anytime?i.push(_vgWaitlist.TimeSlot.Anytime):e.trim()==_vgWaitlist.TimeSlotStr.Morning?i.push(_vgWaitlist.TimeSlot.Morning):e.trim()==_vgWaitlist.TimeSlotStr.Afternoon?i.push(_vgWaitlist.TimeSlot.Afternoon):e.trim()==_vgWaitlist.TimeSlotStr.Evening&&i.push(_vgWaitlist.TimeSlot.Evening)}),i.sort().join(",")},TimeSlotValueReverse:function(e){var t=e.trim().split(","),i=new Array;return $.grep(t,function(e){e==_vgWaitlist.TimeSlot.Anytime?i.push(_vgWaitlist.TimeSlotStr.Anytime):e==_vgWaitlist.TimeSlot.Morning?i.push(_vgWaitlist.TimeSlotStr.Morning):e==_vgWaitlist.TimeSlot.Afternoon?i.push(_vgWaitlist.TimeSlotStr.Afternoon):e==_vgWaitlist.TimeSlot.Evening&&i.push(_vgWaitlist.TimeSlotStr.Evening)}),i.join(", ")},SubmitWaitlist:function(){if(_vgWaitlist.localData.objWaitlistData.map(function(e){return e.TimeW}).indexOf("")>-1)return _vgWaitlist.ShowWarningMessage("Please Select Date and Time for Waitlist."),!1;_vgWaitlist.localData.objWaitlistData.sort(function(e,t){return new Date(e.DateW)-new Date(t.DateW)});var e=$.grep(_vgWaitlist.localData.objWaitlistData,function(e){return e.TimeSlots=e.TimeW,e.FullDate=moment(new Date(e.DateW.replace(/-/g,"/"))).format("MMM-DD-YYYY"),!0});if(0==e.length)return _vgWaitlist.ShowWarningMessage("Please Select Date and Time for Waitlist."),!1;_vgWaitlist.localData.MasterSPServiceDetailSave=[];var t=[],i=!1;if(void 0!==_vgWaitlist.localData.SelectedServices&&_vgWaitlist.localData.SelectedServices.length>0){for(var n=_vgWaitlist.localData.SelectedServices,o=0;o<=n.length-1;o++){for(var a=o+1,s=$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+a).val(),r="",l=o+1,c=0;c<SelectedAddonService.length;c++)if(SelectedAddonService[c].MainServiceID==n[o]&&SelectedAddonService[c].SrNo==l)for(var d=0;d<SelectedAddonService[c].lstAddonService.length;d++)r+=SelectedAddonService[c].lstAddonService[d].ServiceId+",";if(r=r.substring(0,r.length-1),null!=s&&s.length>0){if(objMasterSPServiceDetailSave={},objMasterSPServiceDetailSave.SPIds=s.join(","),""!=_vgWaitlist.localData.BusinessPackageID&&1==_vgWaitlist.localData.isServicePerformAtSameTime&&($.grep(s,function(e){0==i&&(-1==$.inArray(e,t)?t.push(e):i=!0)}),1==i))break;objMasterSPServiceDetailSave.ServiceAddOnID=r,objMasterSPServiceDetailSave.ServiceId=n[o],_vgWaitlist.localData.MasterSPServiceDetailSave.push(objMasterSPServiceDetailSave)}else objMasterSPServiceDetailSave={},objMasterSPServiceDetailSave.SPIds=0,objMasterSPServiceDetailSave.ServiceId=n[o],objMasterSPServiceDetailSave.ServiceAddOnID=r,_vgWaitlist.localData.MasterSPServiceDetailSave.push(objMasterSPServiceDetailSave)}if(""!=_vgWaitlist.localData.BusinessPackageID&&1==_vgWaitlist.localData.isServicePerformAtSameTime&&1==i)return _vgWaitlist.localData.MasterSPServiceDetailSave=[],_vgWaitlist.ShowWarningMessage("Services in this service bundle could not be booked with same provider.Please select different Provider for All Services."),!1}0==_vgWaitlist.localData.WaitlistID?_vgWaitlist.SaveWaitlist(e):_vgWaitlist.UpdateWaitlist()},SaveWaitlist:function(e){var t={Device:"Website",Calledfrom:"Calendar"};if(1==_vgWaitlist.localData.IsOnline)if("true"==isFacebook?t.Calledfrom="FacebookWidget":"true"==isWidget?t.Calledfrom="Widget":"true"==isGoogle?t.Calledfrom="Google":t.Calledfrom="Shopdetail","undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.isFBExtensions&&1==vagaroFBExtensions.isFBExtensions?t.Device="Insta":void 0!==_shopdetail.IsBookFromFacebook&&"true"==_shopdetail.IsBookFromFacebook.toLowerCase()&&(t.Device="Facebook"),"undefined"!=typeof isWindowsApp&&1==isWindowsApp)t.Device="Windows";else if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){t.Device="CustomerApp";var i=null!=navigator.userAgent?navigator.userAgent:"";i.toLowerCase().indexOf("customerios")>-1?t.Device="iOS":i.toLowerCase().indexOf("customerandroid amazon")>-1?t.Device="Amazon":i.toLowerCase().indexOf("customerandroid")>-1&&(t.Device="Android"),"undefined"!=typeof IsBrandedApp&&null!=IsBrandedApp&&""!==IsBrandedApp&&null!=IsBrandedApp&&1==IsBrandedApp&&(t.Device=t.Device+" Branded")}else if(vgAppicationType==objApplicationType.CheckinApp)t.Device="CheckIn";else if(_shopdetail.VisibleControlLength("#mobile-check")>0){t.Device="MobileWeb","undefined"!=typeof vagaroFBExtensions&&void 0!==vagaroFBExtensions.isFBExtensions&&1==vagaroFBExtensions.isFBExtensions?t.Device="Insta":void 0!==_shopdetail.IsBookFromFacebook&&"true"==_shopdetail.IsBookFromFacebook.toLowerCase()&&(t.Device="Facebook");var n=navigator.userAgent;OpenedFrom={iphone:n.match(/(iPhone|iPod)/),blackberry:n.match(/BlackBerry/),kindle:n.match(/Silk/),android:n.match(/Android/),windows:n.match(/Windows/),ipad:n.match(/iPad/)},OpenedFrom.windows?t.Device=t.Device+" Windows Phone":OpenedFrom.iphone?t.Device=t.Device+" iPhone":OpenedFrom.android?t.Device=t.Device+" Android":OpenedFrom.blackberry?t.Device=t.Device+" Blackberry":OpenedFrom.ipad?t.Device=t.Device+" iPad":OpenedFrom.kindle&&(t.Device=t.Device+" kindle")}var o=_vgWaitlist.localData.isOutCallService;if(1==_vgWaitlist.localData.IsOnline){$("#dvOutCallSection").is(":visible")&&(o=$("#mobile-appointments").prop("checked"));var a=$(".familycktfrnd ul li.selected").data("value");if(void 0===a||null==a||a<0)return vagaro.alert("Sorry something went wrong, please try again!"),!1;t.LoginUserID=UserID,t.UserID=a,t.Comment=""}else t.LoginUserID=_vgWaitlist.localData.LoginUserID,t.UserID=_vgWaitlist.localData.UserID,t.Comment=_vgWaitlist.localData.Comment;_vgWaitlist.ShowLoaderWaitlist(!0);var s=new vagaro.ajax;if(t.BusinessID=_vgWaitlist.localData.BusinessID,t.IsOnline=_vgWaitlist.localData.IsOnline,t.AppointmentType=_vgWaitlist.localData.EventType.Service,t.BusinessPackageID=""==_vgWaitlist.localData.BusinessPackageID||0==_vgWaitlist.localData.BusinessPackageID?null:_vgWaitlist.localData.BusinessPackageID,t.IsOutCall=o,t.WaitlistDetails=e,t.ServiceProviderServices=_vgWaitlist.localData.MasterSPServiceDetailSave,"undefined"!=typeof ChangeAppStatus&&1==ChangeAppStatus.IsNewCall()){$.grep(t.WaitlistDetails,function(e){void 0!==navigator.userAgent&&navigator.userAgent.search("Firefox")>=0?e.FullDate=moment(new Date(e.FullDate.replace(/-/g,"/"))).format("YYYY-MM-DD"):e.FullDate=moment(new Date(e.FullDate)).format("YYYY-MM-DD")}),$.grep(t.ServiceProviderServices,function(e){if(e.SPIds=e.SPIds.toString(),e.ServiceId=parseInt(e.ServiceId),void 0===_vgWaitlist.localData.BusinessPackageID||"0"==_vgWaitlist.localData.BusinessPackageID||""==_vgWaitlist.localData.BusinessPackageID){var t="";if(null!=arrMulSearchObject&&arrMulSearchObject.length>0){for(var i=0;i<arrMulSearchObject.length;i++)if(arrMulSearchObject[i].Service==e.ServiceId&&null!=arrMulSearchObject[i].AddonDetail&&arrMulSearchObject[i].AddonDetail.length>0)for(var n=0;n<arrMulSearchObject[i].AddonDetail.length;n++)t+=""==t?arrMulSearchObject[i].AddonDetail[n].ServiceID.toString():","+arrMulSearchObject[i].AddonDetail[n].ServiceID.toString()}else{var o=_vgAddon.BindMulitAddons();for(i=0;i<o.length;i++)t+=""==t?o[i].ServiceID.toString():","+o[i].ServiceID.toString()}e.ServiceAddOnID=t}});var r={Comment:t.Comment,AppointmentType:t.AppointmentType,BusinessPackageID:parseInt(t.BusinessPackageID),IsOutCall:t.IsOutCall,WaitlistDetails:t.WaitlistDetails,ServiceProviderServices:t.ServiceProviderServices,CalledFrom:t.Calledfrom,UserID:parseInt(t.UserID),IsCallFromMobile:!1,IsOnline:t.IsOnline,BusinessID:parseInt(t.BusinessID),Device:t.Device,LoginUserID:parseInt(t.LoginUserID),MasterWaitlistDetails:null};Scheduler.AjaxPostCall(VagaroCoreApiURLEnum.ManageWaitlist,r,_vgWaitlist.SuccessSaveWaitlist,_vgWaitlist.CallFailed)}else s.datamodel.Token=ApiPath+ApiURLEnumWaitlist.savewaitlist,s.datamodel.data=t,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=_vgWaitlist.SuccessSaveWaitlist,s.datamodel.Error=_vgWaitlist.CallFailed,s.Post()},UpdateWaitlist:function(){var e=$.grep(_vgWaitlist.localData.objWaitlistData,function(e){return""!=e.TimeSlots});if(e.length<=0)return _vgWaitlist.ShowWarningMessage("Please Select Date and Time for Waitlist."),!1;_vgWaitlist.ShowLoaderWaitlist(!0);var t={},i=new vagaro.ajax;t.WaitlistID=_vgWaitlist.localData.WaitlistID,t.businessID=_vgWaitlist.localData.BusinessID,t.loginUserID=UserID,t.lstWaitlistDetail=e,t.lstMasterSPServiceDetail=_vgWaitlist.localData.MasterSPServiceDetailSave,i.datamodel.Token=ApiURLEnumWaitlist.UpdateWaitlist,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=t,i.datamodel.callback=_vgWaitlist.SuccessUpdateWaitlist,i.datamodel.Error=_vgWaitlist.CallFailed,i.datamodel.GroupToken=_vgWaitlist.GetGroupId(),i.Post()},SuccessSaveWaitlist:function(e){var t=!1;if("undefined"!=typeof ChangeAppStatus&&1==ChangeAppStatus.IsNewCall()){if(t=!0,e.CustomCode!=VagaroApiResponseEnum.ResponseCode.Success)return _vgWaitlist.ShowLoaderWaitlist(!1),void 0!==e.Message&&null!=e.Message&&""!=e.Message.toString().trim()?msg=e.Message:msg="something went wrong, please try again!",void _vgWaitlist.ShowFailMessage(msg);e=e.Data}if(null!=e&&0!=e){if(1==t){if(null!=e.ErrorSummary&&e.ErrorSummary.length>0&&16==e.ErrorSummary[0].Type)return _vgWaitlist.ShowLoaderWaitlist(!1),_shopdetail.HideShowDisableBookMessageForApps(!0),void $("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide")}else if(null!=e.ErrorSummary&&e.ErrorSummary.length>0&&16==e.ErrorSummary[0].type)return _vgWaitlist.ShowLoaderWaitlist(!1),_shopdetail.HideShowDisableBookMessageForApps(!0),void $("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide");if(1==_vgWaitlist.localData.IsOnline)$("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide"),$("html").removeClass("waitlistpopupHidden"),_shopdetail.VisibleControlLength("#mobile-check")>0&&$("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide"),_vgWaitlist.WaitlistSuccessfullBooked(e);else if(_vgWaitlist.ShowSucessMessage("Waitlist has been saved."),_vgWaitlist.ClaearWaitlistDataOffline(),0==$("#spanFeature").hasClass("available-show")||""==$("#lblFeatureCount").text())$("#spanFeature").addClass("available-show"),$("#lblFeatureCount").html("1");else try{var i=parseInt($("#lblFeatureCount").text());i+=1,$("#lblFeatureCount").text(i)}catch(e){}}else 1==_vgWaitlist.localData.IsOnline?($("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide"),$("html").removeClass("waitlistpopupHidden")):enableAppBookButton(),_vgWaitlist.ShowFailMessage("Some error occured.Please try again later");_vgWaitlist.ShowLoaderWaitlist(!1)},ClaearWaitlistDataOffline:function(){try{var e=$("#divCustomers"),t=$("#ulCustomers");null!=e&&e.is(":visible")&&e.slideUp(250,function(){t.unbind("scroll")}),$("#divSingleAppointment").hide(),flgIsMultiAppointment=!1,ClearMultiSelectAppointments(),getResourceCombo().options.length=0,AddItemsToDDL("0","Select Resource",!0),lblBookedBy.innerHTML=""}catch(e){}},EditWaitlist:function(e,t,i,n){_vgWaitlist.ShowLoaderWaitlist(!0),_vgWaitlist.ClearData(),_vgWaitlist.BindServiceProvider(),_vgWaitlist.localData.GroupId=i,_vgWaitlist.localData.CurrentEditId=".clswlEdit"+e+i,$("#"+_vgWaitlist.model.lblBundleNameWaitlist).val("");var o={},a=new vagaro.ajax;_vgWaitlist.localData.FromMyAccount=!0,o.strWaitlistID=e,o.strBusinessId=t,a.datamodel.Token=ApiURLEnumWaitlist.GetWaitListDetails,a.datamodel.IsNewVagaroAPI=!0,a.datamodel.data=o,a.datamodel.callback=_vgWaitlist.EditWaitlistSuccess,a.datamodel.Error=_vgWaitlist.CallFailed,a.datamodel.GroupToken=i,a.Post()},EditWaitlistSuccess:function(e){if(void 0!==e&&null!=e&&null!=e.selectedWaitlistMaster){if(null!=e.selectedWaitlistMaster.WaitlistID&&(e.selectedWaitlistMaster.WaitlistID==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceInProgress)||e.selectedWaitlistMaster.WaitlistID==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceComplete)))return e.selectedWaitlistMaster.WaitlistID==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceInProgress)?_vgWaitlist.ShowFailMessage(_vgWaitlist.localData.UnderMaintananceMessage):e.selectedWaitlistMaster.WaitlistID==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceComplete)&&location.reload(!0),void _vgWaitlist.ShowLoaderWaitlist(!1);if(1==e.selectedWaitlistMaster.IsBlock)return _vgWaitlist.ShowLoaderWaitlist(!1),void _vgWaitlist.ShowFailMessage("Your booking is blocked");_vgWaitlist.localData.BusinessID=e.selectedWaitlistMaster.BusinessID,_vgWaitlist.localData.WaitlistID=e.selectedWaitlistMaster.WaitlistID,_vgWaitlist.localData.EditResponse=e,_vgWaitlist.GetSelectedDataForEdit()}else _vgWaitlist.ShowFailMessage("Some error occured.Please try again later");_vgWaitlist.ShowLoaderWaitlist(!1)},GetSelectedDataForEdit:function(){var e=_vgWaitlist.localData.EditResponse.selectedWaitlistDetails,t=0,i=[],n=$.grep(e,function(n,o){if(-1==$.inArray(n.WaitlistDate,i)){var a={},s=moment(n.strWaitlistDate)._d;a.dtWaitlistDate=new Date(s),a.SelectedDate=moment(s).format("MMM-DD-YYYY"),a.Day=s.getDate(),a.Month=s.getMonth(),a.Year=s.getFullYear(),a.IsSelected=!1,a.arrIntervals=[],$.grep(n.ReqIntervals.split(","),function(e){a.arrIntervals.push(parseInt(e))}),a.Morning=n.Morning,a.AfterNoon=n.AfterNoon,a.Evening=n.Evening,a.DateW=moment(s).format(_vgWaitlist.localData.DateFormateForMoment),a.TimeW=n.ReqIntervals,_vgWaitlist.localData.SelectedServiceProviderWorkingHours.push(a),i.push(n.WaitlistDate)}if(e[0].WaitlistDate==n.WaitlistDate)return 1==_vgWaitlist.BindSPDropdownForEdit(t+1,n)&&(t+=1),!0});if(t>0&&n.length==t){var o=_vgWaitlist.localData.EditResponse.selectedWaitlistMaster;o.EventType==arrEventType.Service&&o.BusinessPackageID>0&&(_vgWaitlist.localData.BusinessPackageID=o.BusinessPackageID,_vgWaitlist.localData.isServicePerformAtSameTime=2==o.IsServicePerformSameTime,$("#"+_vgWaitlist.model.lblBundleNameWaitlist).text(o.ServiceBundleName),$("#"+_vgWaitlist.model.divBundleWaitlist).show()),1==t?($("#"+_vgWaitlist.model.lblSPWaitlist+"1").text("Select Professional:"),$("#"+_vgWaitlist.model.divServiceNameWaitlist).removeClass("WaitlistDisc"),$("#"+_vgWaitlist.model.divSP1Waitlist).removeClass("WaitListServiceFull"),$("#"+_vgWaitlist.model.divServiceNameWaitlist).addClass("WaitlistDiscfullwidth"),$("#"+_vgWaitlist.model.divSP1Waitlist).addClass("WaitListServicehalfWidth "),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0&&($("#divwaitlistServiceTitle").show(),$("#divwaitlistServiceTitle").html(e[0].ServiceTitle))):t>1&&($("#"+_vgWaitlist.model.divServiceNameWaitlist).removeClass("WaitlistDiscfullwidth"),$("#"+_vgWaitlist.model.divSP1Waitlist).removeClass("WaitListServicehalfWidth "),$("#"+_vgWaitlist.model.divServiceNameWaitlist).addClass("WaitlistDisc"),$("#"+_vgWaitlist.model.divSP1Waitlist).addClass("WaitListServiceFull"),$("#divwaitlistServiceTitle").hide(),$("#divwaitlistServiceTitle").html("")),1==t?$(".newaddwaitlistdatepicker").removeClass("multiNewadddatepicker"):t>3?$(".newaddwaitlistdatepicker").addClass("multiNewadddatepicker"):$(".newaddwaitlistdatepicker").removeClass("multiNewadddatepicker"),_vgWaitlist.GetAvailableDates(null,!0)}else _vgWaitlist.ShowErrorMessage()},BindSPDropdownForEdit:function(e,t){var i=[];""!=t.AllServiceProviderID&&(i=t.AllServiceProviderID.split(","));var n=_vgWaitlist.localData.EditResponse.selectedWaitlistAllProviders;if(i.length>0){var o=$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+e);if(0==$.grep(i,function(e){var i=$.grep(n,function(t){return t.spid==e});if(i.length>0){var a={};return a.ServiceId=t.ServiceID,a.Servicename=t.ServiceTitle,a.SPIds=e,a.SPName=i[0].spName,o.append($("<option></option>").val(a.SPIds).html(a.SPName)),_vgWaitlist.localData.MasterSPServiceDetail.push(a),!0}return!1}).length)return!1;if(_vgWaitlist.localData.SelectedServices.push(t.ServiceID),$("#"+_vgWaitlist.model.divSPWaitlist+e).show(),$("#"+_vgWaitlist.model.lblSPWaitlist+e).text(t.ServiceTitle),o.data("isSkipChangeEvent",!0),"0"!=t.ServiceProviderID){var a=t.FilterServiceProviderID.split(",");a.length>0?o.val(a).trigger("change"):o.val("").trigger("change")}else o.val("").trigger("change");return!0}return!1},EditWaitlistSuccess1:function(e){if(void 0!==e&&null!=e){var t=e.ServiceProviderList,i=e.SelectedServiceProviderList,n=e.AvaibaleDatesList,o=e.SelectedWaitlist,a=e.SelectedWaitlistDetails,s=0;_vgWaitlist.localData.BusinessID=o[0].BusinessID,_vgWaitlist.localData.WaitlistID=o[0].WaitlistID,_vgWaitlist.localData.IsOnChangeSP=1,$("#"+_vgWaitlist.model.lblBundleNameWaitlist).val(""),$("#"+_vgWaitlist.model.divBundleWaitlist).hide(),""!=o[0].ServiceTitle&&($("#"+_vgWaitlist.model.lblBundleNameWaitlist).text(o[0].ServiceTitle),$("#"+_vgWaitlist.model.divBundleWaitlist).show());var r=a.uniqueObjects(["ServiceID"]);_vgWaitlist.localData.SelectedServices=[],$.grep(i,function(e){s++;var i=$.grep(r,function(t){return t.ServiceID==e.ServiceID});if(_vgWaitlist.localData.SelectedServices.push(i[0].ServiceID),$("#"+_vgWaitlist.model.lblSPWaitlist+s).text(i[0].ServiceTitle),$("#"+_vgWaitlist.model.divSPWaitlist+s).show(),$.grep(t,function(t){objMasterSPServiceDetail={},objMasterSPServiceDetail.SPIds=t.ServiceProviderID,_vgWaitlist.localData.MasterSPServiceDetail.push(objMasterSPServiceDetail),t.ServiceID==e.ServiceID&&$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+s).append($("<option></option>").val(t.ServiceProviderID).html(t.Name))}),0==e.ServiceProviderID)$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+s).trigger("change");else{var n=e.ServiceProviderID.split(",");$("#"+_vgWaitlist.model.cboServiceProviderWaitlist+s).val(n).trigger("change")}}),1==i.length?($("#"+_vgWaitlist.model.lblSPWaitlist+"1").text("Select Professional:"),$("#"+_vgWaitlist.model.divServiceNameWaitlist).removeClass("WaitlistDisc"),$("#"+_vgWaitlist.model.divSP1Waitlist).removeClass("WaitListServiceFull"),$("#"+_vgWaitlist.model.divServiceNameWaitlist).addClass("WaitlistDiscfullwidth"),$("#"+_vgWaitlist.model.divSP1Waitlist).addClass("WaitListServicehalfWidth")):($("#"+_vgWaitlist.model.divServiceNameWaitlist).removeClass("WaitlistDiscfullwidth"),$("#"+_vgWaitlist.model.divSP1Waitlist).removeClass("WaitListServicehalfWidth"),$("#"+_vgWaitlist.model.divServiceNameWaitlist).addClass("WaitlistDisc"),$("#"+_vgWaitlist.model.divSP1Waitlist).addClass("WaitListServiceFull"));var l=a.uniqueObjects(["ReqStartTime"]);$.grep(l,function(e){var t={};t.FullDate=e.ReqStartTime,t.Date=e.Day,t.Month=e.Month,t.Year=e.Year,t.TimeSlots=e.ReqIntervals,t.IsSelected=!1,_vgWaitlist.localData.SelectedDates.push(t)}),new Date;var c=[];$.grep(n,function(e){c.push(e.AvailableDate)}),_vgClassSessionSelection=void 0,destroydatepicker({divid:"#"+_vgWaitlist.model.divWaitlistDate,textid:"#"+_vgWaitlist.model.txtWaitlistDate,flagVgMultiMonthDatePicker:!0,dateTimeFormat:"MMM-DD-YYYY",preset:"date",unavailableShowDate:!0,arrValidDates:c,contentWindow:datePicker_contentWindow,isApplyInWidget:!0,inline:!0,contentWindow:"cboServiceProviderWaitlist",isMobileFriendly:!1,callBackOnChange:_vgWaitlist.GetServiceProviderWorkingHours,onGenerate:_vgWaitlist.DispalySelecedDates}),$(".Waitlistpopupbody").scrollTop(0),$("#"+_vgWaitlist.model.divWaitlistpopup).modal("show"),_vgWaitlist.DispalySelecedDates(),_vgWaitlist.localData.IsOnChangeSP=0}_vgWaitlist.ShowLoaderWaitlist(!1)},SuccessUpdateWaitlist:function(e){if(null!=e){var t=e,i=t.lstErrorSummary;if(null!=i&&i.length>0){if(e.lstErrorSummary[0].UnderMaintananceStatus==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceInProgress)||e.lstErrorSummary[0].UnderMaintananceStatus==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceComplete))return e.lstErrorSummary[0].UnderMaintananceStatus==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceInProgress)?_vgWaitlist.ShowFailMessage(_vgWaitlist.localData.UnderMaintananceMessage,_vgWaitlist.localData.CurrentEditId):e.lstErrorSummary[0].UnderMaintananceStatus==parseInt(_vgWaitlist.UnderMaintanance.UnderMaintananceComplete)&&location.reload(!0),void _vgWaitlist.ShowLoaderWaitlist(!1);if(16==i[0].type)return _vgWaitlist.ShowLoaderWaitlist(!1),$("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide"),void _vgWaitlist.ShowFailMessage("Your booking is blocked",_vgWaitlist.localData.CurrentEditId)}var n=t.waitlistMaster,o=$("#divWaitlistDetail"+n.WaitlistID+t.GroupId),a=t.lstwaitlistDetail,s=t.lstWaitlistProviders,r=a[0].ReqStartTime,l=[],c=[],d=$.grep(a,function(e){if(-1==$.inArray(e.ReqStartTime,c)){var t={};t.WaitlistID=e.WaitlistID,t.WaitlistDetailID=e.WaitlistDetailID,t.DisplayDate=moment(e.strReqStartTime).format("MMM D");var i=e.ReqIntervals.split(","),n=[];$.grep(i,function(e){parseInt(e)==_vgWaitlist.TimeSlot.Morning?n.push(_vgWaitlist.TimeSlotStr.Morning):parseInt(e)==_vgWaitlist.TimeSlot.Afternoon?n.push(_vgWaitlist.TimeSlotStr.Afternoon):parseInt(e)==_vgWaitlist.TimeSlot.Evening?n.push(_vgWaitlist.TimeSlotStr.Evening):n.push(_vgWaitlist.TimeSlotStr.Anytime)}),t.TimeSlots=n.join(", ").trim(),l.push(t),c.push(e.ReqStartTime)}if(e.ReqStartTime==r){var o="";if("0"==e.ServiceProviderID)o=_vgWaitlist.localData.txtAnyProvider;else{var a=[];$.grep(e.ServiceProviderID.split(","),function(e){var t=$.grep(s,function(t){return t.SPID==parseInt(e)});t.length>0&&a.push(t[0].ServiceProviderName)}),a.length>0&&(a.length>1?o=a.join(" or ").trim():a.length>0&&(o=a[0]))}return e.strProviderName=o,!0}return!1}),u=$("#ServiceProviderName"+n.WaitlistID+t.GroupId);if(1==d.length)$(u).html("with "+d[0].strProviderName);else{var p="";$.grep(d,function(e){""!=p&&(p+="</BR>"),p+=e.ServiceTitle+" with "+e.strProviderName}),$(u).html(p)}$(o).empty(),$("#divOriginalPrice"+n.WaitlistID+t.GroupId).html(parseFloat(e.waitlistMaster.Price+e.waitlistMaster.OutCallPrice)),$("#scriptWaitlistDetail").tmpl(l).appendTo("#divWaitlistDetail"+n.WaitlistID+t.GroupId),_vgWaitlist.ShowLoaderWaitlist(!1),$("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide"),_vgWaitlist.ShowSucessMessage("Waitlist has been updated.",_vgWaitlist.localData.CurrentEditId),setTimeout(function(){_vgWaitlist.localData.CurrentEditId.attr("aria-label","Waitlist has been updated.")},500)}else _vgWaitlist.ShowLoaderWaitlist(!1),$("#"+_vgWaitlist.model.divWaitlistpopup).modal("hide"),_vgWaitlist.ShowFailMessage("Some error occured.Please try again later",_vgWaitlist.localData.CurrentEditId)},ShowSucessMessage:function(e,t){1==_vgWaitlist.localData.IsOnline?"true"==isWidget?vagaro.alertsmall(e):_common.PassiveAlertSuccessgreen(e,t):SetErrorDisplayMessage("1",e,"")},ShowFailMessage:function(e,t){1==_vgWaitlist.localData.IsOnline?"true"==isWidget?vagaro.alertsmall(e):_common.PassiveAlertfail(e,t):SetErrorDisplayMessage("0",e,"")},ShowWarningMessage:function(e,t){1==_vgWaitlist.localData.IsOnline?"true"==isWidget?vagaro.alertsmall(e):_common.PassiveAlertwarning(e,t):SetErrorDisplayMessage("2",e,"")},WaitlistSuccessfullBooked:function(e){_shopdetail.RemoveAllControls(!0,!0),_shopdetail.SetControls(null),_shopdetail.VisibleControlLength("#mobile-check")>0&&_shopdetail.backpage(),$("#no-appointment-found").hide(),$("#divWaitlistAppointment").hide();var t={},i=e.WaitlistDetails,n=e.WaitlistProviders,o=i.uniqueObjects(["ReqStartTime"]),a=[];$.grep(o,function(e){var i={};i.date=e.strReqStartTime,i.dateLable=moment(e.strReqStartTime).format(_vgWaitlist.localData.DateFormateFor_MomentNew);var n=e.ReqIntervals.split(","),o=[];$.grep(n,function(e){parseInt(e)==_vgWaitlist.TimeSlot.Morning?o.push(_vgWaitlist.TimeSlotStr.Morning):parseInt(e)==_vgWaitlist.TimeSlot.Afternoon?o.push(_vgWaitlist.TimeSlotStr.Afternoon):parseInt(e)==_vgWaitlist.TimeSlot.Evening?o.push(_vgWaitlist.TimeSlotStr.Evening):o.push(_vgWaitlist.TimeSlotStr.Anytime)}),i.time=o.join(", ").trim(),a.push(i),t.TimeSlots=a});var s=[];$.grep(i,function(e){if(e.ReqStartTime==i[0].ReqStartTime){var t={};if("0"==e.ServiceProviderID){var o={};if(o.servicename=e.ServiceTitle,o.proiderList=_vgWaitlist.GetServiceProvidersDetail(e.FilterServiceProviderID,n),o.lstAddonService=[],null!=e.AddOnIDs&&null!=e.AddOnIDs&&""!=e.AddOnIDs.trim())for(var a=0;a<e.AddOnIDs.split("|~|").length;a++)o.lstAddonService.push({AddonName:e.AddOnIDs.split("|~|")[a]});if("undefined"!=typeof IsAutoAssignEmployee&&1==IsAutoAssignEmployee){var r=_vgWaitlist.localData.SelectedServicesDetails.filter(t=>t.ServiceId==e.ServiceID);String.isNullOrUndefineOrBlank(r)||(o.image=r[0].Photo)}t.typeService=_vgWaitlist.localData.TypeService.Any,t.serviceList=[],t.serviceList.push(o),s.push(t)}else{var l=_vgWaitlist.GetServiceProvidersDetail(e.FilterServiceProviderID,n);if(1==l.length){var c={};if(c.servicename=e.ServiceTitle,c.image=l[0].image,c.spname=l[0].spname,c.spinit=l[0].spinit,c.lstAddonService=[],null!=e.AddOnIDs&&null!=e.AddOnIDs&&""!=e.AddOnIDs.trim())for(a=0;a<e.AddOnIDs.split("|~|").length;a++)c.lstAddonService.push({AddonName:e.AddOnIDs.split("|~|")[a]});"undefined"!=typeof IsAutoAssignEmployee&&1==IsAutoAssignEmployee&&(r=_vgWaitlist.localData.SelectedServicesDetails.filter(t=>t.ServiceId==e.ServiceID),String.isNullOrUndefineOrBlank(r)||(c.image=r[0].Photo)),t.typeService=_vgWaitlist.localData.TypeService.Single,t.serviceList=[],t.serviceList.push(c),s.push(t)}else{var d={};if(d.servicename=e.ServiceTitle,d.proiderList=l,d.lstAddonService=[],null!=e.AddOnIDs&&null!=e.AddOnIDs&&""!=e.AddOnIDs.trim())for(a=0;a<e.AddOnIDs.split("|~|").length;a++)d.lstAddonService.push({AddonName:e.AddOnIDs.split("|~|")[a]});"undefined"!=typeof IsAutoAssignEmployee&&1==IsAutoAssignEmployee&&(r=_vgWaitlist.localData.SelectedServicesDetails.filter(t=>t.ServiceId==e.ServiceID),String.isNullOrUndefineOrBlank(r)||(d.image=r[0].Photo)),t.typeService=_vgWaitlist.localData.TypeService.Multiple,t.serviceList=[],t.serviceList.push(d),s.push(t)}}}}),t.lstWaitlistServices=s,_vgWaitlist.localData.ThankYouResponse=[],_vgWaitlist.localData.ThankYouResponse.push(t),_vgWaitlist.Waitlist_ThankyouScreen()},Waitlist_ThankyouScreen:function(){var e={UserControlPath:"~/UserControls/ShopDetail/ucAppoinmentBooked.ascx",PageNamePath:"~/detail.aspx",isRemoveFormTag:!1,Parameters:{}},t=new vagaro.ajax;t.datamodel.Token=ApiPath+ApiURLEnumWaitlist.LoadUserControl,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.callback=function(e){$(".pagebodycontainer").html($("#bookingthankyouDiv").html());var t=$("#dvOnlineAppoinmentBooked");_common.ScrollToToZero();var i=$("#dvOnlineAppoinmentBooked");i.html(""),i.append(e),i.show(),$("#pageSection").hide().removeClass("pagesectionFlex"),$("html, body").removeClass("overflowHidden"),$("html, body").removeClass("modal-open"),$(".modal-backdrop").last().remove(),t.find("#divThankyouAppointment").hide(),t.find("#divThankyouWaitlistdetail").show(),t.find(".appt-location-map").attr("style","background-image: url("+_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.CDNUrl+_siteBuilderDetail.BusinessLocationImage+_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.BusinessLocationImage+")"),1==_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.IsMobileServiceMandatory&&$(".appt-location-map").removeClass("map-marker-div"),$("#tmplWaitlistMain").tmpl(_vgWaitlist.localData.ThankYouResponse).appendTo("#divappbokingdtl"),t.find("#divAppointment").addClass("appointment-waitlist"),t.find(".apptproviderimg").lazyload({effect:"fadeIn",failure_limit:50,event:"lazyload",data_error:"",isShowIntials:!0,intial_selecter:".avatar-inital"}).trigger("lazyload"),Webflow.destroy(),Webflow.ready(),DisplayFullView(!0),("undefined"!=typeof isWidget&&"true"==isWidget.toLowerCase()||"undefined"!=typeof vgAppicationType&&vgAppicationType==objApplicationType.CheckinApp)&&$("#btnAddWaitlist1").hide(),1==_siteBuilderDetail.isFromAppClip?t.find("#appt-location-map").hide():t.find("#appt-location-map").show(),1!=_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.IsMobileServiceMandatory?t.find("#appt-location-map").show():t.find("#appt-location-map").hide(),(1==_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.IsMobileServiceMandatory||2==_siteBuilderDetail.UserLocationInfo.Model.BusinessDetail.IsMobileServiceMandatory)&&_siteBuilderDetail.GetCitiesPopUpDetail.selectedCount>0&&$(".appt-location-map").css("background-size","contain")},t.datamodel.data=e,t.datamodel.Error=CallFail_LoadUserControlWithProxy,t.Post(),_shopdetail.SetGoogleMapDirection()},GetServiceProvidersDetail:function(e,t){var i=e.split(","),n=[];return $.grep(i,function(e){$.grep(t,function(t){parseInt(e)==t.SPID&&(objDisplayProvider={},objDisplayProvider.spname=t.ServiceProviderName,objDisplayProvider.image=t.Photo,objDisplayProvider.spinit=FindInitials(t.ServiceProviderName.length>2?t.ServiceProviderName:"","SP"),n.push(objDisplayProvider))})}),n},GetDateTimeForDisplay:function(e,t){return 1==t?moment(new Date(e)).format("ddd, MMM D, YYYY"):moment(new Date(e)).format("h:mm A")},LoadWaitListEvents:function(){$("#newdivSearchTime1").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker1").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(1):($("#selectWaitlist1").toggle(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime2").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker2").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(2):($("#selectWaitlist1").hide(),$("#selectWaitlist2").toggle(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime3").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker3").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(3):($("#selectWaitlist1").hide(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").toggle(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime4").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker4").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(4):($("#selectWaitlist1").hide(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").toggle(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime5").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker5").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(5):($("#selectWaitlist1").hide(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").toggle())})}},$(document).ready(function(){$("#newdivSearchTime1").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker1").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(1):($("#selectWaitlist1").toggle(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime2").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker2").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(2):($("#selectWaitlist1").hide(),$("#selectWaitlist2").toggle(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime3").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker3").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(3):($("#selectWaitlist1").hide(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").toggle(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime4").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker4").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(4):($("#selectWaitlist1").hide(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").toggle(),$("#selectWaitlist5").hide())}),$("#newdivSearchTime5").click(function(){if(1==_vgWaitlist.DuplicateDates($("#newdatepicker5").val()))return!1;SetTopLeft(".calendar-popups-center"),_vgClassSessionSelection.VisibleControlLength("#mobile-check")>0?_vgWaitlist.BindIntervalNewForMobile(5):($("#selectWaitlist1").hide(),$("#selectWaitlist2").hide(),$("#selectWaitlist3").hide(),$("#selectWaitlist4").hide(),$("#selectWaitlist5").toggle())})}),$(document).keyup(function(e){if(13==e.which&&$("#divWaitlistpopup:visible").length&&iosDevices&&"false"==isWidget)return $(".modal:visible").each(function(e,t){centerModal(t)}),!1}),$(document).click(function(e){var t=$(".classForOutSideClick");t.is(e.target)||0!==t.has(e.target).length||$(".clsCloseDropDown").hide()}),function(e){var t;e.mobiscroll.themes.wp={defaults:{width:70,height:68,accent:"none",dateOrder:"mmMMddDDyy",showLabel:!1,onAnimStart:function(i,n,o){e(".dwwl"+n,i).addClass("wpam"),clearTimeout(t[n]),t[n]=setTimeout(function(){e(".dwwl"+n,i).removeClass("wpam")},1e3*o+100)}},init:function(i,n){var o,a;t={},e(".dw",i).addClass("wp-"+n.settings.accent),e(".dwwl",i).on("touchstart mousedown DOMMouseScroll mousewheel",".dw-sel",function(){o=!0,a=e(this).closest(".dwwl").hasClass("wpa"),e(".dwwl",i).removeClass("wpa"),e(this).closest(".dwwl").addClass("wpa")}).on("touchmove mousemove",function(){o=!1}).on("touchend mouseup",function(){o&&a&&e(this).closest(".dwwl").removeClass("wpa")})}},e.mobiscroll.themes["wp light"]=e.mobiscroll.themes.wp}(jQuery);var dtCh="/",minYear=1900,maxYear=2100;function isInteger(e){var t;for(t=0;t<e.length;t++){var i=e.charAt(t);if(i<"0"||i>"9")return!1}return!0}function stripCharsInBag(e,t){var i,n="";for(i=0;i<e.length;i++){var o=e.charAt(i);-1==t.indexOf(o)&&(n+=o)}return n}function daysInFebruary(e){return e%4!=0||e%100==0&&e%400!=0?28:29}function DaysArray(e){for(var t=new Array(12),i=1;i<=e;i++)t[i]=31,4!=i&&6!=i&&9!=i&&11!=i||(t[i]=30),2==i&&(t[i]=29);return t}function chkDate(e,t){var i=DaysArray(12),n=e.indexOf(dtCh),o=e.indexOf(dtCh,n+1),a=e.substring(0,n),s=e.substring(n+1,o),r=e.substring(o+1);strYr=r,"0"==s.charAt(0)&&s.length>1&&(s=s.substring(1)),"0"==a.charAt(0)&&a.length>1&&(a=a.substring(1));for(var l=1;l<=3;l++)"0"==strYr.charAt(0)&&strYr.length>1&&(strYr=strYr.substring(1));if(month=parseInt(a),day=parseInt(s),year=parseInt(strYr),-1==n||-1==o)return!1;if(a.length<1||month<1||month>12)return!1;if(1==month){if(day>31)return!1}else if(day>i[month])return!1;if(s.length<1||day<1||day>31||2==month&&day>daysInFebruary(year))return!1;if(4!=r.length||0==year||year<minYear||year>maxYear)return!1;if(-1!=e.indexOf(dtCh,o+1)||0==isInteger(stripCharsInBag(e,dtCh)))return!1;if(t){var c=new Date;if(new Date(e).getTime()>c.getTime())return!1}return!0}var iPadAndroid=(userAgent=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase()).match(/ipad/i)||userAgent.match(/iphone/i)||userAgent.match(/itouch/i)||userAgent.match(/android/i)||!1;function dummyreleasefamily(){}!function(e){_sharing={},_sharing.BusinessID=0,_sharing.LoggedInUserId=0,_sharing.isLoadCustFromDB,_sharing.syncDuration,_sharing.IsDisableAutoFillFromInputBox="True",_sharing._URL=window.URL||window.webkitURL,_sharing.UploadedFFImageName="",_sharing.UploadedFFImageStream="",_sharing.OldUploadedFFImageName="",_sharing.IsImageUploaded=!1,_sharing.FFUserEmailId="",_sharing.PreviousFFUserEmailId="",_sharing.FFUserId=0,_sharing.UserFamilyFriendID=0,_sharing.FFMasterUserId=0,_sharing.FFMasterUserFullName="",_sharing.UserExistsMsg="Only employees can edit their own profile.",_sharing.defaultYear="",_sharing.UserImageSize="",_sharing.parentPage="",_sharing.SelectedFFRelation="",_sharing.ExistingUserRelationWithMaster="",_sharing.ExistingUserRelation="",_sharing.FFIsInvitationAccepted=0,_sharing.IsEditMode=!1,_sharing.IsViceVersaUser=!1,_sharing.curSelectedEleForAction=null,_sharing.VagaroYearsTaken=0,_sharing.IsUserCellNotValid=!1,_sharing.CountryId=1,_sharing.CellCountryID=1,_sharing.IsFirstTimeKeyUp=!1,_sharing.mousedownHappened=!1,_sharing.IndexedPetDbData=null,_sharing.SourceButtonName="",_sharing.IsOnLineShoppingCart=!0,_sharing.IsOverrideInfo=!0,_sharing.Age=-1,_sharing.IsShareAppointments=!1,_sharing.ExistingIsShareAppointments=!1,_sharing.IsShareAppointmentsAccepted=0,_sharing.strFFMasterUserId="",_sharing.strFFUserId="",_sharing.strUserFamilyFriendID="";var t=!1,n={};e("#hdnCellCountryID").val();DefaultCellCountryID="undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail?countryIdBusDetail:"undefined"!=typeof glbBusinessCountryId&&null!=glbBusinessCountryId?glbBusinessCountryId:"undefined"!=typeof BusinessCountryID&&null!=BusinessCountryID?BusinessCountryID:1,e(document).ready(function(){if("true"==_sharing.IsDisableAutoFillFromInputBox.toLowerCase())try{var i=get_browser();navigator.userAgent.search("Firefox")>=0?i.version>38?e("#textfiled").attr("autocomplete","new-password"):e("#textfiled").attr("autocomplete","off"):navigator.userAgent.search("Edge")>=0?e("#textfiled").attr("autocomplete","off"):navigator.userAgent.search("Chrome")>=0?i.version>64?e("#textfiled").attr("autocomplete","new-password"):e("#textfiled").attr("autocomplete","false"):e("#textfiled").attr("autocomplete","off")}catch(e){}setTimeout(function(){"undefined"!=typeof _siteBuilderDetail&&"true"!=_siteBuilderDetail.isRequestFromVagaro||(_sharing.bindImageUploadEventsForFFSharing(),_sharing.BindYearandWeight(),_sharing.GetAllPetDetails());try{if(window.parent.location.href.toString().toLowerCase().indexOf("/livestream/")<-1)return}catch(e){}},500);try{i=get_browser();navigator.userAgent.search("Firefox")>=0?i.version>38?e("div#pnlAddFamilyFriendSharingModal input[type='text'].addeditff-txtinput").attr("autocomplete","new-password"):e("div#pnlAddFamilyFriendSharingModal input[type='text'].addeditff-txtinput").attr("autocomplete","off"):navigator.userAgent.search("Edge")>=0?e("div#pnlAddFamilyFriendSharingModal input[type='text'].addeditff-txtinput").attr("autocomplete","off"):navigator.userAgent.search("Chrome")>=0?i.version>64?e("div#pnlAddFamilyFriendSharingModal input[type='text'].addeditff-txtinput").attr("autocomplete","new-password"):e("div#pnlAddFamilyFriendSharingModal input[type='text'].addeditff-txtinput").attr("autocomplete","false"):e("div#pnlAddFamilyFriendSharingModal input[type='text'].addeditff-txtinput").attr("autocomplete","off")}catch(e){}e("div#pnlAddFamilyFriendSharingModal").on("click",function(){void 0!==e("#selFFSpeciesBreed").data("select2")&&void 0!==e("#selFFSpeciesBreed").data("isopen")&&e("#selFFSpeciesBreed").data("isopen")&&e("#selFFSpeciesBreed").select2("close")}),e("#ffdivEditDelete, #aCaneclEditFFProfilePic").click(function(){e(".ff-gallery-edit-dropdown").toggle()}),e("#divAddEditPopupFFProfilePic3DotMenu").mouseleave(function(){e(".ff-gallery-edit-dropdown").hide()}),DefaultCellCountryID="undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail?countryIdBusDetail:"undefined"!=typeof glbBusinessCountryId&&null!=glbBusinessCountryId?glbBusinessCountryId:"undefined"!=typeof BusinessCountryID&&null!=BusinessCountryID?BusinessCountryID:1;void 0!==getCookie&&void 0!==ProximityCookieName&&null!=typeof ProximityCookieName&&""!=typeof ProximityCookieName&&getCookie(ProximityCookieName),t=!0}),e("#txtCustomerSearchFriend").on("click",function(e){_sharing.FriendsAssignVariables(),txtSearchCustomer_focus()}),e("#txtCustomerSearchFriend").on("keyup",function(t){if(1==_sharing.IsFirstTimeKeyUp){if(""==e(this).val())return!1;_sharing.FriendsAssignVariables(),txtSearchCustomer_focus(),_sharing.IsFirstTimeKeyUp=!1}}),_sharing.HideParent=function(){setTimeout(function(){e("#ulCustomersFriends > li").each(function(){e(this).attr("data-custid")==document.getElementById("hdnUserID").value&&e(this).hide()})},100)},_sharing.BindYearandWeight=function(){var t=new Date,i=t.getFullYear()-(0==_sharing.VagaroYearsTaken?120:_sharing.VagaroYearsTaken),n=t.getFullYear();if(e("#cboFFYear").empty(),e("#cboFFYear").append(e("<option></option>").val(-1).html("Year")),i<n)for(var o=i;o<=n;o++)e("#cboFFYear").append(e("<option></option>").val(o).html(o));1==_sharing.CountryId||2==_sharing.CountryId?e("#txtFFWeight").attr("placeholder","Enter Weight (lbs)"):3!=_sharing.CountryId&&4!=_sharing.CountryId||e("#txtFFWeight").attr("placeholder","Enter Weight (KG)")},_sharing.FriendsAssignVariables=function(){var e={},t="searchfriendfamilycustomer";null!=glbPageName&&null!=cache_PageType&&cache_PageType[t]!=glbPageName&&(e.liSelectedClassName="drpselected",e.isFromiPadAndroid="true"==iPadAndroid.toString(),e.isLoadCustFromDB="true"==_sharing.isLoadCustFromDB.toLowerCase(),e.syncDuration=parseInt(_sharing.syncDuration),e.HasCustomerRight=!0,e.BusinessId=_sharing.BusinessID),InitializecomponentWrapper(t,e)},_sharing.containsAlphabet=function(e){return/[a-zA-Z]/.test(e)},_sharing.ShowFriendFamilyPopup=function(){_sharing.IsHasCustomerModifyRights()&&("onlinemyaccount"==_sharing.parentPage.toLowerCase()||"onlineclassbook"==_sharing.parentPage.toLowerCase()||"onlineshoppingcart"==_sharing.parentPage.toLowerCase()||"booknowupsell"==_sharing.parentPage.toLowerCase()?_sharing.OpenCreateNewFamilyFriendPopup():(e("#pnlFamilyFriendSharingModal").modal("show"),_sharing.IsFirstTimeKeyUp=!0),"checkout"==_sharing.parentPage.toLowerCase()&&_checkout.SetTabIndex())},e("#pnlFamilyFriendSharingModal").on("show.bs.modal",function(){centerModal(this),e("#txtCustomerSearchFriend").val(""),"customermodule"==_sharing.parentPage.toLowerCase()?(_sharing.FFMasterUserId=e("#hdnCustomerID").length>0?parseInt(e("#hdnCustomerID").val()):0,_sharing.FFMasterUserFullName=e("#FullName").length>0?e("#FullName").text():"User"):"checkout"==_sharing.parentPage.toLowerCase()?(_sharing.FFMasterUserId=parseInt(_checkoutCalculate.payeeId),_sharing.FFMasterUserFullName=_checkoutCalculate.payeeFirstName+" "+_checkoutCalculate.payeeLastName):"onlinemyaccount"!=_sharing.parentPage.toLowerCase()&&"onlineclassbook"!=_sharing.parentPage.toLowerCase()&&"onlineshoppingcart"!=_sharing.parentPage.toLowerCase()&&"booknowupsell"!=_sharing.parentPage.toLowerCase()||(_sharing.FFMasterUserId=UserID,_sharing.FFMasterUserFullName=FullUserName)}),e("#pnlFamilyFriendSharingModal").on("shown.bs.modal",function(){e("#txtCustomerSearchFriend").focus()}),e("#pnlAddFamilyFriendSharingModal").on("show.bs.modal",function(){centerModal(this),e("#divAddEditFamilyFriendContent").scrollTop(0),e("#divAddNewFamilyFriendTabLink a.w-tab-link:first").click(),"customermodule"==_sharing.parentPage.toLowerCase()?(_sharing.FFMasterUserId=e("#hdnCustomerID").length>0?parseInt(e("#hdnCustomerID").val()):0,_sharing.FFMasterUserFullName=e("#FullName").length>0?e("#FullName").text():"User"):"checkout"==_sharing.parentPage.toLowerCase()?(_sharing.FFMasterUserId=parseInt(_checkoutCalculate.payeeId),_sharing.FFMasterUserFullName=_checkoutCalculate.payeeFirstName+" "+_checkoutCalculate.payeeLastName):"onlineclassbook"==_sharing.parentPage.toLowerCase()||"onlineshoppingcart"==_sharing.parentPage.toLowerCase()||"booknowupsell"==_sharing.parentPage.toLowerCase()?(_sharing.FFMasterUserId=UserID,_sharing.FFMasterUserFullName=FullUserName):"onlinemyaccount"==_sharing.parentPage.toLowerCase()&&(_sharing.FFMasterUserId=UserID,_sharing.FFMasterUserFullName=FullUserName,_sharing.strFFMasterUserId=strUserID),e(".span-masteruser-fullname").html(_sharing.FFMasterUserFullName),_sharing.IsCCPaymentSupport?e("#divShareCCChkContainer").show():e("#divShareCCChkContainer").hide(),_sharing.ShowHideLoadingPanel(!1),void 0!==setPopupPosi&&"undefined"!=typeof WebsiteBuilderType&&"Builder"==WebsiteBuilderType&&(iOS||isAndroidMobile||(e("#pnlAddFamilyFriendSharingModal").addClass("modalforWb"),setPopupPosi(e("#pnlAddFamilyFriendSharingModal"))))}),e("#pnlAddFamilyFriendSharingModal").on("shown.bs.modal",function(){"undefined"==typeof vgAppicationType&&e("#divAddNewFamilyFriendContainer div.ff-info-parent").find(":text").filter(":visible:enabled").first().focus()}),e("#pnlAddFamilyFriendSharingModal").on("hide.bs.modal",function(){_sharing.ClearControls()}),e("#pnlFamilyFriendSharingModal").on("hidden.bs.modal",function(){e("#divCustomersFriends").hide(),e("body").removeClass("familyfriendpopup")}),e("#pnlAddFamilyFriendSharingModal").on("hidden.bs.modal",function(){e("#pnlFamilyFriendSharingModal").is(":visible")&&e("#txtCustomerSearchFriend").focus()}),_sharing.ajaxCall=function(e,t,i,n,o,a,s){var r=new vagaro.ajax;r.datamodel.Token=e,r.datamodel.data=t,r.datamodel.callback=i,r.datamodel.Error=n,!0===s&&(r.datamodel.IsNewVagaroAPI=s),!1===a&&(r.datamodel.async=!1),!0===o?r.PostQue():r.Post()},e("#txtFFWeight").keypress(function(t){var i=e(this);46==t.which&&-1==i.val().indexOf(".")||!(t.which<48||t.which>57)||0==t.which||8==t.which||t.preventDefault();var n=e(this).val();-1!=n.indexOf(".")&&n.substring(n.indexOf(".")).length>2&&0!=t.which&&8!=t.which&&e(this)[0].selectionStart>=n.length-2&&t.preventDefault()}),_sharing.restrictAlphabets=function(e){var t=e.which||e.keycode;return t>=48&&t<=57||8==t||t>=35&&t<=40||46==t},_sharing.OpenCreateNewFamilyFriendPopup=function(t){_sharing.parentPage=void 0!==t&&null!=t&&""!=t.trim()?t:_sharing.parentPage,void 0!==_sharing.parentPage&&null!=_sharing.parentPage&&"onlinemyaccount"==_sharing.parentPage.toLowerCase()&&e(".active-menuclick").length>0&&void 0!==GatherClickElement&&(GatherClickElement(e(".active-menuclick")),e(".active-menuclick").removeClass("active-menuclick")),0==_sharing.IsEditMode&&(e("#txtFFPhone").length>0&&friendfamilycellPhone.setPhoneData(_sharing.CellCountryID,""),e("#txtFFPhoneOpt").length>0&&childcellphone.setPhoneData(_sharing.CellCountryID,"")),_sharing.IsHasCustomerModifyRights&&(e("#pnlAddFamilyFriendSharingModal").modal("show"),void 0!==setPopupPosi&&void 0!==getQueryStringData&&"Builder"==getQueryStringData("Type")&&(iOS||isAndroidMobile||(e("#pnlAddFamilyFriendSharingModal").addClass("modalforWb"),setPopupPosi(e("#pnlAddFamilyFriendSharingModal")))))},_sharing.CloseCreateNewFamilyFriendPopup=function(){e("#pnlAddFamilyFriendSharingModal").modal("hide")},_sharing.onTabChange=function(i,n,o){e("#divAddNewFamilyFriendContainer").hasClass("hide-block-ffsharing")&&(_sharing.AddErrorHideClassforFFSharing(!1),DefaultCellCountryID="undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail?countryIdBusDetail:"undefined"!=typeof glbBusinessCountryId&&null!=glbBusinessCountryId?glbBusinessCountryId:"undefined"!=typeof BusinessCountryID&&null!=BusinessCountryID?BusinessCountryID:1,void 0!==getCookie&&void 0!==ProximityCookieName&&null!=typeof ProximityCookieName&&""!=typeof ProximityCookieName&&(cookie=getCookie(ProximityCookieName)),1==t&&(friendfamilycellPhone=e("#txtFFPhone").PhonePlugin({UserRole:2,ControlText:"Primary Phone",CurrentLocationCountryID:"undefined"!=typeof cookie&&null!=cookie?parseInt(cookie.countryid):DefaultCellCountryID,CountryId:"undefined"!=typeof CellCountryID&&null!=CellCountryID?CellCountryID:"undefined"!=typeof cookie&&null!=cookie?parseInt(cookie.countryid):DefaultCellCountryID}),childcellphone=e("#txtFFPhoneOpt").PhonePlugin({UserRole:2,ControlText:"Primary Phone",CurrentLocationCountryID:"undefined"!=typeof cookie&&null!=cookie?parseInt(cookie.countryid):DefaultCellCountryID,CountryId:"undefined"!=typeof CellCountryID&&null!=CellCountryID?CellCountryID:"undefined"!=typeof cookie&&null!=cookie?parseInt(cookie.countryid):DefaultCellCountryID})),t=!1),_sharing.SelectedFFRelation=i,e("#divAddNewFamilyFriendContainer .ffsharing-showhide").hide(),e("#divAddNewFamilyFriendContainer .ffsharing-"+i.toLowerCase()).show(),e("#divAddNewFamilyFriendTabLink a.w-tab-link").removeClass("w--current").attr("aria-selected",!1),e(n).addClass("w--current").attr("aria-selected",!0),"pet"==i.toLowerCase()?e("div#divAddNewFamilyFriendContainer div.w-tab-body.ffsharing-tabbody").addClass("border-bottom-none"):e("div#divAddNewFamilyFriendContainer div.w-tab-body.ffsharing-tabbody").removeClass("border-bottom-none"),3!=e("#divFFGendarSelectOptions").val()||"pet"!=_sharing.SelectedFFRelation.toLowerCase()&&"child"!=_sharing.SelectedFFRelation.toLowerCase()&&"friend"!=_sharing.SelectedFFRelation.toLowerCase()?e("#divFFGendarSelectOptions").val(3):(e("#divFFGendarSelectOptions").val(3),e("#divFFGendarSelectOptions").removeClass("errorInput")),"undefined"==typeof vgAppicationType&&e("#divAddNewFamilyFriendContainer div.ff-info-parent").find(":text").filter(":visible:enabled").first().focus()},_sharing.onToggleChange=function(t){null==t&&"undefined"==t&&""==t||(1==t.checked?(e(t).attr("aria-label","Toggle on for"),e(t).next().attr("aria-checked",!0)):(e(t).attr("aria-label","Toggle off for"),e(t).next().attr("aria-checked",!1))),e("#ADDlblTitle").removeAttr("tabindex")},_sharing.checkBirthDate=function(){var t=e("#cboFFDay").val(),i=e("#cboFFMonth").val(),n=e("#cboFFYear").val(),o=!0;return"-1"==t&&"-1"==i&&"-1"==n||(o=!1,o=chkDate(i+"/"+t+"/"+n,!0)),o},_sharing.applyValidationToElement=function(t,i){t.firstFalseElement=t.isValid?i:t.firstFalseElement,t.isValid=!1,e("#"+i).addClass("errorInput")},_sharing.IsAllInputDetailsValid=function(t){if(_sharing.mousedownHappened)return _sharing.mousedownHappened=!1,!0;var i=e("#cboFFDay").val(),n=e("#cboFFMonth").val(),o=e("#cboFFYear").val();_sharing.Age=_sharing.CalculateAge(n+"/"+i+"/"+o);var a={isValid:!0,firstFalseElement:null},s=""!=e("#hdnIsSubmitedFormOnce").val()&&"True"==e("#hdnIsSubmitedFormOnce").val(),r=/^[A-Za-z0-9_\+-]+(\.[A-Za-z0-9_\+-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.([A-Za-z]{2,10})$/;return e("#txtFFEmail:visible:enabled").length>0&&(void 0!==t&&"txtFFEmail"==t.id||void 0===t)&&(""==e.trim(e("#txtFFEmail").val())?s&&_sharing.applyValidationToElement(a,"txtFFEmail"):e("#txtFFEmail").val().length>100||!r.test(e("#txtFFEmail").val())?s&&(_sharing.applyValidationToElement(a,"txtFFEmail"),e("#txtFFEmail").val().length>100?_sharing.ShowHidePassiveAlert(2,"Email addresses cannot exceed more than 100 characters."):_sharing.ShowHidePassiveAlert(2,"Please enter a valid email address.")):(s&&e("#txtFFEmail").removeClass("errorInput"),void 0!==t&&"txtFFEmail"==t.id&&_sharing.CheckCustomerExists(e("#txtFFEmail")))),e("#txtFFEmailOpt:visible:enabled").length>0&&""!=e.trim(e("#txtFFEmailOpt").val())?(void 0!==t&&"txtFFEmailOpt"==t.id||void 0===t)&&(e("#txtFFEmailOpt").val().length>100||!r.test(e("#txtFFEmailOpt").val())?s&&(_sharing.applyValidationToElement(a,"txtFFEmailOpt"),e("#txtFFEmailOpt").val().length>100?_sharing.ShowHidePassiveAlert(2,"Email addresses cannot exceed more than 100 characters."):_sharing.ShowHidePassiveAlert(2,"Please enter a valid email address.")):(s&&e("#txtFFEmailOpt").removeClass("errorInput"),void 0!==t&&"txtFFEmailOpt"==t.id&&_sharing.CheckCustomerExists(e("#txtFFEmailOpt")))):e("#txtFFEmailOpt").removeClass("errorInput"),e("#txtFFWeight:visible:enabled").length>0&&""!=e.trim(e("#txtFFWeight").val())?(void 0!==t&&"txtFFWeight"==t.id&&s||void 0===t)&&(isNaN(parseFloat(e("#txtFFWeight").val()))||parseFloat(e("#txtFFWeight").val()).toFixed(2)>999.99?(_sharing.applyValidationToElement(a,"txtFFWeight"),_sharing.ShowHidePassiveAlert(2,"Please enter valid weight. It should not be greater then 999.99.")):e("#txtFFWeight").removeClass("errorInput")):e("#txtFFWeight").removeClass("errorInput"),e("#txtFFfirstName:visible:enabled").length>0&&(void 0!==t&&"txtFFfirstName"==t.id&&s||void 0===t)&&(""==e.trim(e("#txtFFfirstName").val())?_sharing.applyValidationToElement(a,"txtFFfirstName"):e("#txtFFfirstName").val().length>100?(_sharing.applyValidationToElement(a,"txtFFfirstName"),_sharing.ShowHidePassiveAlert(2,"First name cannot be more than 100 characters.")):e("#txtFFfirstName").removeClass("errorInput")),e("#txtFFlastName:visible:enabled").length>0&&(void 0!==t&&"txtFFlastName"==t.id&&s||void 0===t)&&(""==e.trim(e("#txtFFlastName").val())?_sharing.applyValidationToElement(a,"txtFFlastName"):e("#txtFFlastName").val().length>100?(_sharing.applyValidationToElement(a,"txtFFlastName"),_sharing.ShowHidePassiveAlert(2,"Last name cannot be more than 100 characters.")):e("#txtFFlastName").removeClass("errorInput")),e("#divFFGendarSelectOptions:visible:enabled").length>0&&(void 0!==t&&"divFFGendarSelectOptions"==t.id&&s||void 0===t)&&(-1==e("#divFFGendarSelectOptions").val()?_sharing.applyValidationToElement(a,"divFFGendarSelectOptions"):e("#divFFGendarSelectOptions").removeClass("errorInput")),e("#cboFFMonth:visible:enabled").length>0&&e("#cboFFDay:visible:enabled").length>0&&e("#cboFFYear:visible:enabled").length>0&&void 0===t&&s&&(_sharing.checkBirthDate()?(e("#cboFFMonth").removeClass("errorInput"),e("#cboFFDay").removeClass("errorInput"),e("#cboFFYear").removeClass("errorInput")):(a.isValid=!1,e("#cboFFMonth").addClass("errorInput"),e("#cboFFDay").addClass("errorInput"),e("#cboFFYear").addClass("errorInput"))),e("#divShareCCChkContainer:visible").length>0&&e("#ffCCfile:enabled").length>0&&_sharing.IsCCPaymentSupport&&0==_sharing.IsCallFromOnlinePage()&&(1==e("#ffCCfile").prop("checked")&&0==_sharing.IsOnLineShoppingCart?(_sharing.applyValidationToElement(a,"ffCCfile"),swal({title:"",text:"Credit Card Processing is required to add a card on file. Would you like to sign up for Credit Card Processing?",timer:4e3,showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Sign Up for Credit Card Processing",cancelButtonText:"Not Now",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model text-left"},function(e){e&&(window.location.href="/merchants/settings/premiumfeature/creditcardzenswipecms")}),setTimeout(function(){e(".gencutom-title").html("Credit Card Processing Required")},100),e("#ffCCfile").prop("checked",!1).attr("aria-label","Toggle off for").next().attr("aria-checked",!1)):e("#ffCCfile").removeClass("errorInput")),1==e("#ffShareAppointments").prop("checked")&&s?a.isValid=_sharing.CheckDateofbirthandEmail(!0,a.isValid):s&&(a.isValid=_sharing.CheckDateofbirthandEmail(!1,a.isValid)),void 0===t&&s&&_sharing.FFMasterUserId==_sharing.FFUserId&&(a.isValid=!1,_sharing.ShowHidePassiveAlert(2,"This user has already been added to this customer's Family & Friends Sharing.")),a.isValid||null==a.firstFalseElement||void 0!==t||e("#"+a.firstFalseElement).focus(),-1!=_sharing.Age&&_sharing.Age>=0&&_sharing.Age<18&&"Child"==_sharing.SelectedFFRelation&&e("#ffShareAppointments").prop("checked",!0).attr("aria-label","Toggle on for").next().attr("aria-checked",!0),null!=t&&"undefined"!=t&&""!=t&&"checkbox"==t.type&&(1==t.checked?e(t).attr("aria-label","Toggle on for").next().attr("aria-checked",!0):e(t).attr("aria-label","Toggle off for").next().attr("aria-checked",!1)),a.isValid},_sharing.ClearControls=function(){_sharing.strFFMasterUserId="",_sharing.strFFUserId="",_sharing.strUserFamilyFriendID="",_sharing.UploadedFFImageName="",_sharing.SelectedFFRelation="",_sharing.ExistingUserRelationWithMaster="",_sharing.ExistingUserRelation="",_sharing.FFIsInvitationAccepted=0,_sharing.OldUploadedFFImageName="",_sharing.UploadedFFImageStream="",_sharing.IsImageUploaded=!1,_sharing.FFUserEmailId="",_sharing.PreviousFFUserEmailId="",_sharing.FFUserId=0,_sharing.UserFamilyFriendID=0,_sharing.IsEditMode=!1,_sharing.IsViceVersaUser=!1,_sharing.IsUserCellNotValid=!1,_sharing.EnableDisableControl(!1),e("#divAddEditPopupFFProfilePicPreview").css("background-image",""),e("#divAddEditPopupFFProfilePicPreview").removeClass("ffsolidborder"),e("#divAddEditPopupFFProfilePicTextCont").show(),e("#divAddEditPopupFFProfilePic3DotMenu").hide(),e("#ffallowperson").prop("checked",!1).attr("aria-label","Toggle off for").next().attr("aria-checked",!1),e("#ffCCfile").prop("checked",!1).attr("aria-label","Toggle off for").next().attr("aria-checked",!1),e("#ffnotif").prop("checked",!1).attr("aria-label","Toggle off for").next().attr("aria-checked",!1),e("#AddEditPopupFFProfilePicUpload").val(null),e("#txtFFEmail").val(""),e("#txtFFEmail").removeClass("errorInput"),e("#txtFFPhone").val(""),e("#txtFFPhone").removeClass("errorInput"),e("#txtFFfirstName").val(""),e("#txtFFfirstName").removeClass("errorInput"),e("#txtFFlastName").val(""),e("#txtFFlastName").removeClass("errorInput"),e("#txtFFEmailOpt").val(""),e("#txtFFEmailOpt").removeClass("errorInput"),e("#txtFFPhoneOpt").val(""),e("#txtFFPhoneOpt").removeClass("errorInput");var t={id:"",text:"",species:""};e("#selFFSpeciesBreed").select2("data",t),_sharing.SetChoiceForSeleect2(e("#selFFSpeciesBreed"),t),e("#selFFSpeciesBreed").removeClass("errorInput"),e("#txtFFWeight").val(""),e("#txtFFWeight").removeClass("errorInput"),e("#hdnIsSubmitedFormOnce").val(""),e("#hdnFFUserEmailId").val(""),e("#divFFGendarSelectOptions").val(3),e("#divFFGendarSelectOptions").removeClass("errorInput"),e("#cboFFMonth").removeClass("errorInput"),e("#cboFFDay").removeClass("errorInput"),e("#cboFFYear").removeClass("errorInput"),e("#cboFFMonth").val(-1),e("#cboFFDay").val(-1),e("#cboFFYear").val(-1),e("div.addedit-ffpopup-uploadpropic-cnt div.drag-drop-new").removeClass("drag-drop-error"),"undefined"==typeof vgAppicationType&&e("#divAddNewFamilyFriendContainer div.ff-info-parent").find(":text").filter(":visible:enabled").first().focus(),e("#ffShareAppointments").prop("checked",!1).attr("aria-label","Toggle off for").next().attr("aria-checked",!1),e(".invitationtag").hide(),e("#lnkResend").hide(),_sharing.IsShareAppointments=!1,_sharing.ExistingIsShareAppointments=!1,_sharing.IsShareAppointmentsAccepted=0},_sharing.GetMasterRelation=function(e){return"Parent"==e?1==_sharing.IsEditMode&&null!=_sharing.ExistingUserRelationWithMaster&&"pet"==_sharing.ExistingUserRelationWithMaster.toLowerCase()?"Pet":"Child":"Child"==e||"Pet"==e?"Parent":e},_sharing.AddEditUserFamilyFriend=function(){if(e("#hdnIsSubmitedFormOnce").val("True"),_sharing.IsAllInputDetailsValid()){var t=e("#txtFFEmailOpt:visible").length>0,i=e("#txtFFEmail:visible").length>0,n=i?e("#txtFFEmail").val():t?e("#txtFFEmailOpt").val():null;if(t&&(null==n||null==n||""==n)||!i&&!t)_sharing.ProceedAddEditUserFamilyFriend(null);else{var o={};o.EmailId=n,o.ParentPage=_sharing.parentPage;var a={};a.objEntity=o,_sharing.ShowHideLoadingPanel(!0),_sharing.ajaxCall("CheckUserExistsByEmailID",a,_sharing.ProceedAddEditUserFamilyFriend,_sharing.CallFailedCustomerJSON,!1)}}},_sharing.ProceedAddEditUserFamilyFriend=function(t){if(_sharing.ShowHideLoadingPanel(!1),!(!t||t&&_sharing.IsEditMode&&t.UserID===_sharing.FFUserId)){var i=e("#txtFFEmail:visible").length>0?e("#txtFFEmail"):e("#txtFFEmailOpt:visible").length>0?e("#txtFFEmailOpt"):null;return _sharing.ShowHidePassiveAlert(2,"A user with this email address already exists. Vagaro does not allow more than one user with the same email address."),e(i).val(""),e(i).focus(),e("#txtFFfirstName").val(""),void e("#txtFFlastName").val("")}var o={};o.IsOnlyUpdateInOffline=_sharing.IsCallFromOnlinePage()&&("onlinemyaccount"==_sharing.parentPage.toLowerCase()||"onlineshoppingcart"==_sharing.parentPage.toLowerCase()||"booknowupsell"==_sharing.parentPage.toLowerCase()),o.CallingParentPage=_sharing.parentPage,o.IsSyncInSelfGroup=_sharing.IsCallFromOnlinePage(),"onlinemyaccount"==_sharing.parentPage.toLowerCase()?(o.strUserID=_sharing.strFFUserId,o.strUserFamilyFriendID=1==_sharing.IsViceVersaUser?"":_sharing.strUserFamilyFriendID,o.strMasterUserID=0==String.isNullOrUndefineOrBlank(_sharing.strFFMasterUserId)?_sharing.strFFMasterUserId:""):(o.UserID=_sharing.FFUserId,o.UserFamilyFriendID=1==_sharing.IsViceVersaUser?0:_sharing.UserFamilyFriendID,o.MasterUserID=0==isNaN(_sharing.FFMasterUserId)?_sharing.FFMasterUserId:0),o.IsInvitationAccepted=_sharing.FFIsInvitationAccepted,o.imageInputStream=_sharing.UploadedFFImageStream,void 0!==_sharing.UploadedFFImageName&&null!=_sharing.UploadedFFImageName&&_sharing.UploadedFFImageName.indexOf("://")>0?o.originalImageName=_sharing.UploadedFFImageName.substring(_sharing.UploadedFFImageName.lastIndexOf("/")+1):o.originalImageName=_sharing.UploadedFFImageName,o.oldFileName=_sharing.OldUploadedFFImageName,o.Relation=_sharing.SelectedFFRelation,o.RelationWithMaster=_sharing.GetMasterRelation(_sharing.SelectedFFRelation),o.PreviousRelation=_sharing.ExistingUserRelation,o.PreviousShareAppointments=_sharing.ExistingIsShareAppointments,"onlineappointment"==_sharing.parentPage.toLowerCase()?(o.IsAllowBook=!0,o.IsShareCC=!1,o.IsCCNotification=!0,o.IsShareAppointments=!1,o.IsShareAppointmentsAccepted=0):(o.IsAllowBook=e("#ffallowperson").prop("checked"),o.IsShareCC=e("#ffCCfile").prop("checked"),o.IsCCNotification=e("#ffnotif").prop("checked"),o.IsShareAppointments=e("#ffShareAppointments").prop("checked"),o.IsShareAppointmentsAccepted=_sharing.IsShareAppointmentsAccepted,e("#ffShareAppointments").prop("checked")?e("#ffShareAppointments").prop("checked")&&1==_sharing.ExistingIsShareAppointments&&1!=_sharing.IsShareAppointmentsAccepted&&(o.IsShareAppointments=!0,o.IsShareAppointmentsAccepted=_sharing.IsShareAppointmentsAccepted):1==_sharing.ExistingIsShareAppointments&&1!=_sharing.IsShareAppointmentsAccepted?(o.IsShareAppointments=!0,o.IsShareAppointmentsAccepted=_sharing.IsShareAppointmentsAccepted):(o.IsShareAppointments=!1,o.IsShareAppointmentsAccepted=0));var a=_sharing.GetChoiceForSeleect2(e("#selFFSpeciesBreed"));if(void 0!==a&&null!=a&&void 0!==a.id&&null!=a.id&&""!=a.id){var s=a.id.split("_");o.Species=s[0],o.Breed=s[1]}else o.Species=null,o.Breed=null;o.Weight=""==e("#txtFFWeight").val()||isNaN(parseInt(e("#txtFFWeight").val()))?null:parseFloat(e("#txtFFWeight").val()).toFixed(2),"onlinemyaccount"==_sharing.parentPage.toLowerCase()?(o.strBusinessId=strVgBusienssId,o.strLoginUserId=strUserID):(o.businessID=_sharing.BusinessID,o.loginUserID=_sharing.LoggedInUserId),o.device=_sharing.parentPage;var r=e("#txtFFPhone:visible").length>0?e("#txtFFPhone"):e("#txtFFPhoneOpt:visible").length>0?e("#txtFFPhoneOpt"):null,l=e("#txtFFEmail:visible").length>0?e("#txtFFEmail"):e("#txtFFEmailOpt:visible").length>0?e("#txtFFEmailOpt"):null;if(o.Cell=void 0!==r&&null!=r?e(r).val():null,o.CustomerEmail=null!=l?e(l).val():null,0==_sharing.IsOverrideInfo&&(o.Cell=e("#txtFFPhone:visible").length>0?_sharing.txtFFPhone:e("#txtFFPhoneOpt:visible").length>0?_sharing.txtFFPhoneOpt:null,o.CustomerEmail=e("#txtFFEmail:visible").length>0?_sharing.txtFFEmail:e("#txtFFEmailOpt:visible").length>0?_sharing.txtFFEmailOpt:null),e("#txtFFPhone:visible").length>0||e("#txtFFPhoneOpt:visible").length>0){var c={};if(e("#txtFFPhone:visible").length>0&&!friendfamilycellPhone.validatePhoneNumber(!0)||e("#txtFFPhoneOpt:visible").length>0&&!childcellphone.validatePhoneNumber(!0)){var d=e("#txtFFPhone:visible").length>0?friendfamilycellPhone.getValidateMessage():childcellphone.getValidateMessage();return 3==d.WarningType?_sharing.ShowHidePassiveAlert(2,"A phone number must be 10 digits."):_sharing.ShowHidePassiveAlert(2,d.WarningMessage),!1}c=e("#txtFFPhone:visible").length>0?friendfamilycellPhone.getPhoneData():childcellphone.getPhoneData(),o.CellCountryID=c.countryId,o.DialingCode=c.dialingCode,o.Cell=c.phoneNo,o.CountryID="undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail?countryIdBusDetail:1}if(o.FirstName=1==_sharing.IsOverrideInfo?_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val()):_sharing.txtFFfirstName,o.LastName=1==_sharing.IsOverrideInfo?_sharing.FnReplaceFamilyFriendSharing(e("#txtFFlastName").val()):_sharing.txtFFlastName,o.Gender=1==_sharing.IsOverrideInfo?e("#divFFGendarSelectOptions").val():_sharing.divFFGendarSelectOptions,e("#cboFFDay:visible").length>0&&e("#cboFFMonth:visible").length>0&&e("#cboFFYear:visible").length>0){var u=1==_sharing.IsOverrideInfo?e("#cboFFDay").val():_sharing.cboFFDay,p=1==_sharing.IsOverrideInfo?e("#cboFFMonth").val():_sharing.cboFFMonth,h=1==_sharing.IsOverrideInfo?e("#cboFFYear").val():_sharing.cboFFYear;"-1"!=u&&"-1"!=p?(o.Year="-1"!=h?h:_sharing.defaultYear,o.Month=p,o.Day=u):(o.Year=null,o.Month=null,o.Day=null)}_sharing.ShowHideLoadingPanel(!0);var m={};m.objReq=o,m.ObjFFData=n,setTimeout(function(){_sharing.ajaxCall("AddEditUserFamilyFriend",m,_sharing.onSuccessSaveFriendFamily,_sharing.onFailSaveFriendFamily,!1,!1)},100)},_sharing.CreateCurrentFamilyobject=function(e){n.Day=e.Day,n.Month=e.Month,n.Year=e.Year,n.FirstName=e.FirstName,n.LastName=e.LastName,n.Cell=e.Phone,n.originalImageName=e.ImageName,n.CustomerEmail=e.Email,n.Gender=e.Gender,n.Species=e.Species,n.Breed=e.Breed,n.Weight=e.Weight},_sharing.FnReplaceFamilyFriendSharing=function(e){return e.replace(/[^a-zA-Z ]/g,"")},_sharing.onSuccessSaveFriendFamily=function(t){if(null!=t&&1==t.Result){if("onlinemyaccount"==_sharing.parentPage.toLowerCase()&&String.isNullOrUndefineOrBlank(t.strUserID))_sharing.ShowHidePassiveAlert(3,"Something went wrong. Please try again.");else if("onlinemyaccount"!=_sharing.parentPage.toLowerCase()&&t.UserID<=0)_sharing.ShowHidePassiveAlert(3,"Something went wrong. Please try again.");else{if("onlinemyaccount"==_sharing.parentPage.toLowerCase()?_sharing.strFFUserId=t.strUserID:_sharing.FFUserId=t.UserID,"customermodule"==_sharing.parentPage.toLowerCase())"#profile"==e("#CustomerTab .active a").attr("data-href").toLowerCase()?_shareListing.GetUserFamilyAndFriendDetails(_sharing.FFMasterUserId,_sharing.BusinessID):"#memberships"==e("#CustomerTab .active a").attr("data-href").toLowerCase()?(e("#divMemberChipsForMS").html(""),membershipUserFamily=null,MemEditSelectedFamilyFriendsCount=0,MemEditSelectedFamilyFriendsArr=null,GetMembershipUserFamilyFriendDetails(parseInt(_MembershipTable.CustomerID))):"#packages"==e("#CustomerTab .active a").attr("data-href").toLowerCase()?(e("#divMemberChipsForCustomPKG").html(""),e("#divMemberChipsForNormalPKG").html(""),_vgPackageManagement.model.packageUserFamily=null,_vgPackageManagement.model.SelectedFamilyFriendsCount=0,_vgPackageManagement.model.SelectedFamilyFriendsArr=null,_vgPackageManagement.GetPackageUserFamilyFriendDetails(parseInt(_vgPackageManagement.model.customerID))):_shareListing.GetUserFamilyAndFriendDetails(_sharing.FFMasterUserId,_sharing.BusinessID);else if("onlinemyaccount"==_sharing.parentPage.toLowerCase())_shareListing.GetUserFamilyAndFriendDetails(_sharing.strFFMasterUserId,strVgBusienssId);else if("checkout"==_sharing.parentPage.toLowerCase())1==FFDetailsBindFor?e("#divMemberChipsForCustomPKG").html(""):e("#divMemberChipsForMS").html(""),FamilyAndFriendsDetails=null,SelectedFamilyFriendsCount=0,SelectedFamilyFriendsArr=null,_checkout.GetFamilyAndFriendsDetailsByUserID(!0);else if("onlineappointment"==_sharing.parentPage.toLowerCase()){t.FullName=t.FirstName+" "+t.LastName,e(".familycktfrndlist").children(".familycktfrndlistblok:not(.init)").removeClass("selected");var i=e("#FFlistingOnlineAppBook").children(".familycktfrndlistblok").map(function(){if(void 0!==e(this).attr("data-value"))return e(this).attr("data-value").trim()}).get();if(jQuery.inArray(t.UserID.toString(),i)>-1){var n=e("*[data-value="+t.UserID+"]");e(n).addClass("selected"),e(n).find(".avtar-name").html(t.FullName),e(".familycktfrndlist").children(".init").html(n.html()),e(".familycktfrndlist").children(".init").find(".fficons").css("display","block"),e("#addnewffpopup").hide()}else{var o=e("#OnlineAddfamilyfrndTemplate").tmpl(t);e(".familycktfrndlist").find(" > li:nth-last-child(1)").before(o),e(".familycktfrndlist").children(".init").html(o.html()),e(".familycktfrndlist").children(".init").find(".fficons").css("display","block"),e("#addnewffpopup").hide()}var a=e(".familycktfrnd ul li.selected").data("value"),s=e("<XMLDocument/>");s.append(_vgClassSessionSelection.createXmlElement("itms").append(_vgClassSessionSelection.createXmlElement("itm").append(_vgClassSessionSelection.createXmlElement("ity",1)).append(_vgClassSessionSelection.createXmlElement("ns"))));for(var r=0;r<_shopdetail.BookingDetail.serviceid.split(",").length;r++){var l=_vgClassSessionSelection.createXmlElement("n",_shopdetail.BookingDetail.serviceid.split(",")[r]);s.find("ns").append(l)}var c=0;if("undefined"!=typeof isWaitingtoreal&&"undefined"!=typeof waitlistID&&0!=isWaitingtoreal&&0!=waitlistID&&(c=waitlistID),void 0!==a&&a>0){var d={};d.lBusinessID=e("#hdnBusinessID").val(),d.isOutcall=_shopdetail.BookingDetail.isoutcall,d.lUserID=a,d.ServiceId=_shopdetail.BookingDetail.serviceid,d.ServiceDate=_shopdetail.BookingDetail.date,d.IsPaid=IsPaid,d.ServiceList=s.html(),d.WaitlistID=c,d.EncryptUserId=t.EncryptUserId;var u=new vagaro.ajax;u.datamodel.Token="GetDiscountDetailofUserToBookApp",u.datamodel.data=[d],u.datamodel.callback=function(e){_shopdetail.GetDiscountDetailofUserToBookAppResponse(e,1)},u.datamodel.Error=function(e){_shopdetail.HideShowLoader(!1)},u.Post(),_shopdetail.ValidateAndGetFormDetailsforFFSharing()}else"bookwithcc"==_sharing.SourceButtonName.toLowerCase()?_shopdetail.ValidateBookingDataWithCC():"bookwithoutcc"==_sharing.SourceButtonName.toLowerCase()&&_shopdetail.ValidateBookingDataWithoutCC(),_sharing.SourceButtonName=""}else if("onlineclassbook"==_sharing.parentPage.toLowerCase()){var p=_shareListing.OnlineClassBookElement,h=e(p).closest(".attendeelist").siblings(".panel-heading").attr("id");t.FullName=t.FirstName+" "+t.LastName,t.Email=_sharing.FFUserEmailId;i=e("div.clsaccordion").find(".panel-default").map(function(){if(void 0!==e(this).attr("data-value"))return e(this).attr("data-value").trim()}).get();if(jQuery.inArray(t.UserID.toString(),i)>-1)_sharing.ShowHidePassiveAlert(2,"This User! has been already selected in other attendee list"),e("#"+h).siblings("div.collapse").collapse("hide");else{o=e("#OnlineAddFFSubAttendeelistTemplate").tmpl(t);var m=e("#OnlineAddFFClassSelectionTemplate").tmpl(t);e("#"+h).find(".ffshipping-bg").html(m),e("#"+h).siblings("div.collapse").collapse("hide"),e("#"+h).siblings("div.attendeelist").find("#lstoffamilyandfriends").find(" > li:nth-last-child(2)").before(o),e("#"+h).closest("div.panel-default").attr("data-value",t.UserID),e("#"+h).closest("div.panel-default").attr("data-email",t.Email),e("#"+h).closest("div.panel-default").attr("data-fullname",t.FullName)}void 0!==IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&null!=IsWebsiteBuilderCommunication&&1==IsWebsiteBuilderCommunication&&void 0!==e("#divClassDetailpopup")&&null!=e("#divClassDetailpopup")&&null!=e("#divClassDetailpopup")&&e("#divClassDetailpopup").css({"overflow-x":"hidden","overflow-y":"auto"})}else"onlineshoppingcart"==_sharing.parentPage.toLowerCase()?(null!=onlineShoppingCart.Memberships&&onlineShoppingCart.Memberships.length>0&&(_onlineCheckout.FamilyAndFriendsDetails=null,_onlineCheckout.RelationshipsArr=null,_onlineCheckout.ChildAge="",_onlineCheckout.FamilyAndFriendsDetails=null,_onlineCheckout.SelectedFamilyFriendsCount=null,_onlineCheckout.MaxNoFamilyFriends=null,_onlineCheckout.SelectedFamilyFriendsArr=null,e("#divMemberChipsForMS").empty(),_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(2)),null!=onlineShoppingCart.Packages&&onlineShoppingCart.Packages.length>0&&(_onlineCheckout.FamilyAndFriendsDetails=null,_onlineCheckout.PackageSharingDetail=null,e.each(onlineShoppingCart.Packages,function(t,i){e("#"+i.ServiceId+"_"+i.autoId).empty(),_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(1)}))):"booknowupsell"==_sharing.parentPage.toLowerCase()&&(currentPage="booknowupsell",void 0!==_shopdetail.BookingDetail.MembershipUpSellData&&null!=_shopdetail.BookingDetail.MembershipUpSellData&&_shopdetail.BookingDetail.MembershipUpSellData.length>0&&(_onlineCheckout.FamilyAndFriendsDetails=null,_onlineCheckout.RelationshipsArr=null,_onlineCheckout.ChildAge="",_onlineCheckout.SelectedFamilyFriendsCount=null,_onlineCheckout.MaxNoFamilyFriends=null,_onlineCheckout.SelectedFamilyFriendsArr=null,_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(4)),void 0!==_shopdetail.BookingDetail.PackageUpSellData&&null!=_shopdetail.BookingDetail.PackageUpSellData&&_shopdetail.BookingDetail.PackageUpSellData.length>0&&(_onlineCheckout.FamilyAndFriendsDetails=null,_onlineCheckout.PackageSharingDetail=null,e.each(_shopdetail.BookingDetail.PackageUpSellData,function(t,i){e("#divMemberChipsForMS").empty(),_onlineCheckout.GetFamilyAndFriendsDetailsandBindforPkgMS(5)})));var g=e("#txtFFPhone:visible").length>0?e("#txtFFPhone"):e("#txtFFPhoneOpt:visible").length>0?e("#txtFFPhoneOpt"):null,v=new Object;v.CustomerID=_sharing.FFUserId,v.FullName=e("#txtFFfirstName").val().trim()+" "+e("#txtFFlastName").val().trim(),v.glbCell=null!=g?e(g).val().trim():"",_sharing.AddNewCustomerInLocalStorage_Cust(v,!1),_sharing.IsEditMode?_sharing.ShowHidePassiveAlert(1,_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val())+" has been updated in your Family & Friends Sharing.","#headingfamily"):(_sharing.ShowHidePassiveAlert(1,_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val())+" has been added to Family & Friends Sharing.","#divEditProfile2"),e("#divUserDetail").attr("aria-label",_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val())+" has been added to Family & Friends Sharing.").attr("tabindex",-1),setTimeout(function(){e("#divUserDetail").attr("tabindex",-1).focus()},1e3),setTimeout(function(){e("#divUserDetail").removeAttr("aria-label")},2e3)),"onlineappointment"==_sharing.parentPage.toLowerCase()&&_sharing.ClearControls()}_sharing.CloseCreateNewFamilyFriendPopup(),e("#pnlFamilyFriendSharingModal").modal("hide")}else _sharing.IsEditMode?_sharing.ShowHidePassiveAlert(3,_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val())+" failed to be updated in your Family & Friends Sharing. Please try again."):_sharing.ShowHidePassiveAlert(3,_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val())+" failed to be added as a Family & Friends Sharing. Please try again.");_sharing.ShowHideLoadingPanel(!1)},_sharing.onFailSaveFriendFamily=function(t){_sharing.ShowHideLoadingPanel(!1),_sharing.IsEditMode?_sharing.ShowHidePassiveAlert(3,_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val())+" failed to be updated in your Family & Friends Sharing. Please try again."):_sharing.ShowHidePassiveAlert(3,_sharing.FnReplaceFamilyFriendSharing(e("#txtFFfirstName").val())+" failed to be added as a Family & Friends Sharing. Please try again."),_sharing.CloseCreateNewFamilyFriendPopup()},_sharing.ToggleMenuClick=function(t){e(".active-menuclick").removeClass("active-menuclick"),e(t).addClass("active-menuclick")},_sharing.deleteUserFamilyAndFriend=function(t,i,n,o,a){swal({title:"",text:"Are you sure want to remove "+unescape(a)+" from Family & Friends Sharing?",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Remove",cancelButtonText:"Cancel",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model text-left"},function(e){void 0!==e&&null!=e&&1==e?(_sharing.curSelectedEleForAction=o,_sharing.UserFamilyAndFriendActions(t,i,1,n)):_sharing.curSelectedEleForAction=null}),setTimeout(function(){e(".gencutom-title").html("Remove from Family & Friends Sharing")},100)},_sharing.attachUserToBusiness=function(t,i,n){_sharing.IsHasCustomerModifyRights()&&(swal({title:"",text:"Are you sure you want to attach this user to business?",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Attach",cancelButtonText:"Cancel",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model text-left"},function(e){void 0!==e&&null!=e&&1==e?(_sharing.curSelectedEleForAction=n,_sharing.UserFamilyAndFriendActions(t,i,2,!1)):_sharing.curSelectedEleForAction=null}),setTimeout(function(){e(".gencutom-title").html("Attach User To Business")},100))},_sharing.resendInvitation=function(t,i,n,o){swal({title:"",text:"Are you sure you want to resend invitaion?",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Send",cancelButtonText:"Cancel",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model text-left"},function(a){void 0!==a&&null!=a&&1==a?(_sharing.curSelectedEleForAction=e(n).closest("div.ffsharing-mem-container"),_sharing.UserFamilyAndFriendActions(t,i,o,!0)):_sharing.curSelectedEleForAction=null}),setTimeout(function(){e(".gencutom-title").html("Resend Invitation")},100)},_sharing.UserFamilyAndFriendActions=function(t,i,n,o){var a={};"customermodule"==_sharing.parentPage.toLowerCase()?_sharing.FFMasterUserId=e("#hdnCustomerID").length>0?parseInt(e("#hdnCustomerID").val()):0:"onlinemyaccount"==_sharing.parentPage.toLowerCase()&&(_sharing.strFFMasterUserId=strUserID),_sharing.containsAlphabet(t)?a.strUserFamilyFriendID=t:a.UserFamilyFriendID=t,_sharing.containsAlphabet(i)?(a.strMasterUserID=1==n&&0==o?i:_sharing.strFFMasterUserId,a.strUserID=1==n&&0==o?_sharing.strFFMasterUserId:i,a.strLoginUserId=strUserID,a.strBusinessId=strVgBusienssId):(a.MasterUserID=1==n&&0==o?i:_sharing.FFMasterUserId,a.UserID=1==n&&0==o?_sharing.FFMasterUserId:i,a.loginUserID=_sharing.LoggedInUserId,a.businessID=_sharing.BusinessID),a.Action=n,a.IsOnlyUpdateInOffline=_sharing.IsCallFromOnlinePage(),a.ParentPage=_sharing.parentPage.toLowerCase(),_sharing.ShowHideLoadingPanel(!0);var s={};s.objRequest=a,setTimeout(function(){_sharing.ajaxCall("UserFamilyAndFriendActions",s,_sharing.onSuccessUserFamilyAndFriendActions,_sharing.onFailCommonMethod,!1,!1)},100)},_sharing.onSuccessUserFamilyAndFriendActions=function(t){if(_sharing.ShowHideLoadingPanel(!1),t.Result){if(1==t.Action){var i="";if(("customermodule"==_sharing.parentPage.toLowerCase()||"onlinemyaccount"==_sharing.parentPage.toLowerCase())&&e(_sharing.curSelectedEleForAction).length>0){i=e(_sharing.curSelectedEleForAction).data("userfullname");var n=e(_sharing.curSelectedEleForAction).closest("div.ffsharing-mem-container");e(n).remove(),e("div#divFamilyFriendListingContainer div#familyListDiv div#familyListID div.ffsharing-mem-container").length<=0&&e("#txtFamily").hide(),e("div#divFamilyFriendListingContainer div#familyListDiv div#FriendlistID div.ffsharing-mem-container").length<=0&&e("#txtFriends").hide(),e("div#divFamilyFriendListingContainer div#familyListDiv div.ffsharing-mem-container").length<=0&&(e("div#divFamilyFriendListingContainer div#familyListDiv").hide(),e("div#divFamilyFriendListingContainer div#addFamilyDiv").show())}""!=i?_sharing.ShowHidePassiveAlert(1,i+" has been removed from Family & Friends Sharing.","#headingfamily"):_sharing.ShowHidePassiveAlert(1,"User has been removed from Family & Friends Sharing.","#headingfamily")}else if(2==t.Action){if("customermodule"==_sharing.parentPage.toLowerCase()){var o="",a="";e(_sharing.curSelectedEleForAction).length>0&&(o=e(_sharing.curSelectedEleForAction).data("userfullname"),a=e(_sharing.curSelectedEleForAction).data("userphone").toString());var s=new Object;s.CustomerID=t.UserID,s.FullName=o,s.glbCell=a,_sharing.AddNewCustomerInLocalStorage_Cust(s,!0),_shareListing.GetUserFamilyAndFriendDetails(_sharing.FFMasterUserId,_sharing.BusinessID)}_sharing.ShowHidePassiveAlert(1,"Customer added to the customer list.")}else if(3==t.Action||5==t.Action){if("customermodule"==_sharing.parentPage.toLowerCase()||"onlinemyaccount"==_sharing.parentPage.toLowerCase())if(e(_sharing.curSelectedEleForAction).length>0){var r=e(_sharing.curSelectedEleForAction).find("div.div-ffinvitation-state-bedge");null!=r&&e(r).length>0&&(e(r).text("Invitation Pending"),e(r).removeClass("denied-tag-2").addClass("pending-tag-2"))}else e(".invitationtag").hide(),e(".pending-tag").show(),"onlinemyaccount"==_sharing.parentPage.toLowerCase()?_shareListing.GetUserFamilyAndFriendDetails(_sharing.strFFMasterUserId,strVgBusienssId):_shareListing.GetUserFamilyAndFriendDetails(_sharing.FFMasterUserId,_sharing.BusinessID);_sharing.ShowHidePassiveAlert(1,"Invitation sent successfully.")}}else _sharing.ShowHidePassiveAlert(3,"Something Went Wrong. Please try again.");_sharing.curSelectedEleForAction=null},_sharing.onFailCommonMethod=function(e){_sharing.ShowHideLoadingPanel(!1),_sharing.curSelectedEleForAction=null,_sharing.ShowHidePassiveAlert(3,"Something Went Wrong. Try again.")},_sharing.checkUserAlreadyFamilyFriend=function(e){"onlinemyaccount"==_sharing.parentPage.toLowerCase()?_sharing.GetUserFamilyAndFriendDetailsById(strVgBusienssId,e):_sharing.GetUserFamilyAndFriendDetailsById(0,e)},_sharing.GetUserFamilyAndFriendDetailsById=function(t,i){"customermodule"==_sharing.parentPage.toLowerCase()?_sharing.FFMasterUserId=e("#hdnCustomerID").length>0?parseInt(e("#hdnCustomerID").val()):0:"onlineshoppingcart"==_sharing.parentPage.toLowerCase()||"booknowupsell"==_sharing.parentPage.toLowerCase()?_sharing.FFMasterUserId=UserID:"onlinemyaccount"==_sharing.parentPage.toLowerCase()&&(_sharing.strFFMasterUserId=strUserID);var n={};_sharing.containsAlphabet(t)?n.strUserFamilyFriendID=t:n.UserFamilyFriendID=t,_sharing.containsAlphabet(i)?n.strUserID=i:n.UserID=i,String.isNullOrUndefineOrBlank(_sharing.strFFMasterUserId)?n.MasterUserID=_sharing.FFMasterUserId:n.strMasterUserID=_sharing.strFFMasterUserId,n.IsLoadFromOffline=_sharing.IsCallFromOnlinePage(),n.ParentPage=_sharing.parentPage.toLowerCase(),0==_sharing.IsCallFromOnlinePage()&&(n.strBusinessId=ReactBId),_sharing.ShowHideLoadingPanel(!0);var o={};o.objRequest=n,setTimeout(function(){_sharing.ajaxCall("GetFamilyAndFriendDetailsByFriendFamilyId",o,_sharing.onSuccessGetUserFamilyAndFriendDetailsById,_sharing.onFailCommonMethod,!1,!1)},100)},_sharing.GetUserFamilyAndFriendDetailsByEmail=function(e){var t={};t.IsLoadFromOffline=_sharing.IsCallFromOnlinePage(),t.ParentPage=_sharing.parentPage.toLowerCase(),String.isNullOrUndefineOrBlank(_sharing.strFFMasterUserId)?t.MasterUserID=_sharing.FFMasterUserId:t.strMasterUserID=_sharing.strFFMasterUserId,t.EmailId=e;var i={};i.objRequest=t,_sharing.ajaxCall("GetFamilyAndFriendDetailsByFriendFamilyId",i,_sharing.onSuccessGetUserFamilyAndFriendDetailsById,_sharing.onFailCommonMethod,!1,!1)},_sharing.onSuccessGetUserFamilyAndFriendDetailsById=function(e){_sharing.CreateCurrentFamilyobject(e),"onlinemyaccount"==_sharing.parentPage.toLowerCase()?null!=e&&e.IsUserAvailable&&0==e.IsDeleted&&(_sharing.IsEditMode=!0,_sharing.OpenCreateNewFamilyFriendPopup(_sharing.parentPage),_sharing.bindUserFamilyFriendData(e)):null!=e&&e.UserID>0&&e.MasterUserID>0&&0==e.IsDeleted&&(_sharing.IsEditMode=!0,_sharing.OpenCreateNewFamilyFriendPopup(_sharing.parentPage),_sharing.bindUserFamilyFriendData(e)),_sharing.ShowHideLoadingPanel(!1)},_sharing.bindUserFamilyFriendData=function(t){if(null!=t){"onlinemyaccount"==_sharing.parentPage.toLowerCase()?(_sharing.strFFUserId=t.strUserID,_sharing.strUserFamilyFriendID=t.strUserFamilyFriendID):(_sharing.FFUserId=t.UserID,_sharing.UserFamilyFriendID=t.UserFamilyFriendID),_sharing.FFIsInvitationAccepted=t.IsInvitationAccepted,_sharing.ExistingUserRelationWithMaster=t.IsViceVersaUser?t.Relation:t.RelationOfMaster,_sharing.ExistingUserRelation=t.IsViceVersaUser?t.RelationOfMaster:t.Relation;var i,n=t.IsViceVersaUser?t.RelationOfMaster.toLowerCase():t.Relation.toLowerCase();if(e("#divAddNewFamilyFriendTabLink a.w-tab-link.fftablink-"+n).click(),_sharing.IsViceVersaUser=t.IsViceVersaUser,null!=t.Photo&&""!=t.Photo&&(_sharing.UploadedFFImageName=t.Photo,_sharing.OldUploadedFFImageName=t.Photo,_sharing.setImageOnAddEdit(_sharing.UploadedFFImageName)),1==_sharing.IsEditMode||0==_sharing.IsCallFromOnlinePage()||1==_sharing.IsCallFromOnlinePage()){if(e("#txtFFfirstName").val(t.FirstName),e("#txtFFlastName").val(t.LastName),e("#txtFFPhone").removeClass("errorInput"),e("#txtFFPhoneOpt").removeClass("errorInput"),null!=t.Phone&&""!=t.Phone)l=(l=t.Phone).replace(/-/g,""),e("#txtFFPhone").val(l),e("#txtFFPhoneOpt").val(l),null!=t.IsCellValid&&0==t.IsCellValid&&(_sharing.ShowHidePassiveAlert(2,"Please enter a valid phone number."),e("#txtFFPhone").addClass("errorInput"),e("#txtFFPhoneOpt").addClass("errorInput"),_sharing.IsUserCellNotValid=!0);if(e("#txtFFPhone:visible").length>0){var o=document.getElementById("txtFFPhone");null!=t.Phone&&t.CellCountryID>0?t.Phone=o.value=friendfamilycellPhone.setPhoneData(t.CellCountryID,t.Phone):t.Phone=o.value=""}else if(e("#txtFFPhoneOpt:visible").length>0){o=document.getElementById("txtFFPhoneOpt");null!=t.Phone&&t.CellCountryID>0?t.Phone=o.value=childcellphone.setPhoneData(t.CellCountryID,t.Phone):t.Phone=o.value=""}null!=t.Email&&""!=t.Email&&(_sharing.FFUserEmailId=t.Email,_sharing.PreviousFFUserEmailId=t.Email,e("#hdnFFUserEmailId").val(t.Email),e("#txtFFEmail").val(t.Email),e("#txtFFEmailOpt").val(t.Email));var a=t.Day,s=t.Month,r=t.Year;e("#cboFFMonth").val(s),e("#cboFFDay").val(a),r==_sharing.defaultYear?e("#cboFFYear").val(-1):e("#cboFFYear").val(r),e("#divFFGendarSelectOptions").val(t.Gender),_sharing.IsOverrideInfo=!0}else{var l;if(_sharing.txtFFfirstName=t.FirstName,_sharing.txtFFlastName=t.LastName,null!=t.Phone&&""!=t.Phone)l=(l=t.Phone).replace(/-/g,""),_sharing.txtFFPhone=l,_sharing.txtFFPhoneOpt=l;null!=t.Email&&""!=t.Email&&(_sharing.FFUserEmailId=t.Email,_sharing.PreviousFFUserEmailId=t.Email,e("#hdnFFUserEmailId").val(t.Email),_sharing.txtFFEmail=t.Email,_sharing.txtFFEmailOpt=t.Email);a=t.Day,s=t.Month,r=t.Year;_sharing.cboFFMonth=s,_sharing.cboFFDay=a,r==_sharing.defaultYear?_sharing.cboFFYear=-1:_sharing.cboFFYear=r,_sharing.divFFGendarSelectOptions=t.Gender}if(null!=t.Species&&""!=t.Species.trim()&&null!=t.Breed&&""!=t.Breed.trim()){var c={id:t.Species+"_"+t.Breed,text:t.Breed,species:t.Species};e("#selFFSpeciesBreed").select2("data",c),_sharing.SetChoiceForSeleect2(e("#selFFSpeciesBreed"),c)}null!=t.Weight&&0!=t.Weight&&e("#txtFFWeight").val(t.Weight),e("#ffallowperson").prop("checked",t.IsAllowtoBookApp).attr("aria-label","Toggle on for").next().attr("aria-checked",!0),e("#ffCCfile").prop("checked",t.IsShareCC).attr("aria-label","Toggle on for").next().attr("aria-checked",!0),e("#ffnotif").prop("checked",t.IsCCNotification).attr("aria-label","Toggle on for").next().attr("aria-checked",!0),_sharing.IsShareAppointments=t.IsShareAppointments,_sharing.IsEditMode&&(_sharing.IsShareAppointmentsAccepted=t.IsShareAppointmentsAccepted),_sharing.ExistingIsShareAppointments=t.IsShareAppointments,e(".invitationtag").hide(),1!=_sharing.IsViceVersaUser&&(!String.isNullOrUndefineOrBlank(_sharing.strUserFamilyFriendID)||"onlinemyaccount"==_sharing.parentPage.toLowerCase()&&!String.isNullOrUndefineOrBlank(_sharing.strFFUserId)?1==_sharing.ExistingIsShareAppointments&&1!=_sharing.IsShareAppointmentsAccepted?1==_sharing.IsShareAppointments&&_sharing.IsEditMode&&(e("#lnkResend").attr("onclick",'_sharing.resendInvitation("'+_sharing.strUserFamilyFriendID+'","'+_sharing.strFFUserId+'",this,5)'),e("#lnkResend").show(),i=0==_sharing.IsShareAppointmentsAccepted?".pending-tag":".red-tag",e(i).show()):(e("#lnkResend").hide(),e("#ffShareAppointments").prop("checked",_sharing.IsShareAppointments).attr("aria-label","Toggle on for").next().attr("aria-checked",!0)):(_sharing.UserFamilyFriendID>0||"onlinemyaccount"==_sharing.parentPage.toLowerCase()&&_sharing.FFUserId>0)&&(1==_sharing.ExistingIsShareAppointments&&1!=_sharing.IsShareAppointmentsAccepted?1==_sharing.IsShareAppointments&&_sharing.IsEditMode&&(e("#lnkResend").attr("onclick","_sharing.resendInvitation("+_sharing.UserFamilyFriendID+","+_sharing.FFUserId+",this,5)"),e("#lnkResend").show(),i=0==_sharing.IsShareAppointmentsAccepted?".pending-tag":".red-tag",e(i).show()):(e("#lnkResend").hide(),e("#ffShareAppointments").prop("checked",_sharing.IsShareAppointments).attr("aria-label","Toggle on for").next().attr("aria-checked",!0))))}"1"!=t.UserType&&(_sharing.EnableDisableControl(!0),_sharing.ShowHidePassiveAlert(2,_sharing.UserExistsMsg))},_sharing.isAdvancedUpload=function(){var e=document.createElement("div");return("draggable"in e||"ondragstart"in e&&"ondrop"in e)&&"FormData"in window},_sharing.isSupportedBrowser=function(){return window.File&&window.FileReader&&window.FileList&&window.Image},_sharing.isValidImage=function(e){var t=jQuery.Deferred(),i=new Image;return i.onload=function(){this.width+this.height!==0?t.resolve(!0):this.onerror()},i.onerror=function(){_sharing.ShowHidePassiveAlert(2,"Unable to upload image. Please try again."),t.resolve(!1)},i.src=_sharing._URL.createObjectURL(e),t.promise()},_sharing.bindImageUploadEventsForFFSharing=function(){if(_sharing.isAdvancedUpload()){var t=e("div.addedit-ffpopup-uploadpropic-cnt div.drag-drop-new");t.off(),t.on("drag dragstart dragend dragover dragenter dragleave drop",function(e){e.preventDefault(),e.stopPropagation()}).on("dragover dragenter",function(){t.addClass("drag-drop-active")}).on("dragleave dragend drop",function(){t.removeClass("drag-drop-active")}).on("drop",function(i){glbdroppedFile=i.originalEvent.dataTransfer.files;var n=!0,o=glbdroppedFile[0];isValidFileWeb(/(gif|png|jpg|jpeg|bmp|GIF|PNG|JPG|JPEG|BMP)$/i,o.name)||(e(this).closest(".drag-drop-new").addClass("drag-drop-error").removeClass("drag-drop-active"),_sharing.ShowHidePassiveAlert(2,"Please upload a jpg, gif, png or bmp file.","#btnFFCustomerSave"),n=!1);try{if(n){var a=4194304;if(o.size>a){var s=parseFloat(4.096).toFixed(0);_sharing.ShowHidePassiveAlert(2,"This image is too large. (Maximum upload size is "+s+" MB.) Please try again.","#btnFFCustomerSave"),e(this).closest(".drag-drop-new").addClass("drag-drop-error").removeClass("drag-drop-active"),n=!1}}}catch(i){n=!0}n&&(t.addClass("drag-drop-active").removeClass("drag-drop-error"),null!=o&&_sharing.setCommonUploadedImage(o,parent)),t.removeClass("drag-drop-active")}),e("#AddEditPopupFFProfilePicUpload").off(),e("#AddEditPopupFFProfilePicUpload").on("change",function(i){if(e("#AddEditPopupFFProfilePicUpload").parent().find("div.drag-drop-new").removeClass("drag-drop-active"),!(i.target.files.length<=0)){glbdroppedFile=!1;var n=!0,o=i.target.files[0];isValidFileWeb(/(gif|png|jpg|jpeg|bmp|GIF|PNG|JPG|JPEG|BMP)$/i,o.name)||(e("#divAddEditPopupFFProfilePicPreview.drag-drop-new").addClass("drag-drop-error").removeClass("drag-drop-active"),_sharing.ShowHidePassiveAlert(2,"Please upload a jpg, gif, png or bmp file.","#btnFFCustomerSave"),n=!1);try{if(n){var a=4194304;if(o.size>a){var s=parseFloat(4.096).toFixed(0);_sharing.ShowHidePassiveAlert(2,"This image is too large. (Maximum upload size is "+s+" MB.) Please try again.","#btnFFCustomerSave"),e("#divAddEditPopupFFProfilePicPreview.drag-drop-new").addClass("drag-drop-error").removeClass("drag-drop-active"),n=!1}}}catch(i){n=!0}n&&(t.addClass("drag-drop-active").removeClass("drag-drop-error"),null!=o&&_sharing.setCommonUploadedImage(o,parent)),t.removeClass("drag-drop-active")}}),e(".FFdragImage").click(function(){document.getElementById("AddEditPopupFFProfilePicUpload").click()})}},_sharing.setUploadedImage=function(t,i,n){var o=null;try{o=n=e(n)}catch(e){o=window}_sharing.ShowHideLoadingPanel(!1),e(o).find(".drag-drop-new").hasClass("drag-drop-error")||(0!=glbdroppedFile||0!=e("#AddEditPopupFFProfilePicUpload").get(0).files.length?_sharing.isSupportedBrowser()&&_sharing.isValidImage(i).then(function(e){e&&(_sharing.UploadedFFImageName=i.name,_sharing.UploadedFFImageStream=t,_sharing.IsImageUploaded=!0,_sharing.setImageOnAddEdit(t))}):e(o).find(".drag-drop-new").addClass("drag-drop-error"))},_sharing.setCommonUploadedImage=function(e,t){_sharing.ShowHideLoadingPanel(!0);var i,n="";if(regex=new RegExp("[^.]+$"),n=e.name.match(regex)[0],i=e.name.toLowerCase().replace(/\.heic/,".jpeg"),"heic"!=n.toLowerCase()){var o=new FileReader;o.onload=function(i){_sharing.setUploadedImage(i.target.result,e,t)},o.readAsDataURL(e)}else getJPEGFileFromHEICWeb(e,i,function(e){var i=new FileReader;i.onload=function(i){_sharing.setUploadedImage(i.target.result,e,t)},i.readAsDataURL(e)})},_sharing.setImageOnAddEdit=function(t){e("#divAddEditPopupFFProfilePicPreview").css("background-image","url('"+t+"')"),e("#divAddEditPopupFFProfilePicPreview").addClass("ffsolidborder"),e("#divAddEditPopupFFProfilePicTextCont").hide(),e("#divAddEditPopupFFProfilePic3DotMenu").show()},_sharing.deleteFFProfilePic=function(){swal({title:"",text:"Are you sure want to remove profile picture of this user?",showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Remove",cancelButtonText:"Cancel",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model text-left"},function(t){void 0!==t&&null!=t&&1==t&&(_sharing.UploadedFFImageName="",_sharing.UploadedFFImageStream="",_sharing.IsImageUploaded=!1,e("#AddEditPopupFFProfilePicUpload").val(null),e("#divAddEditPopupFFProfilePicPreview").css("background-image",""),e("#divAddEditPopupFFProfilePicPreview").removeClass("ffsolidborder"),e("#divAddEditPopupFFProfilePicTextCont").show(),e("#divAddEditPopupFFProfilePic3DotMenu").hide())}),setTimeout(function(){e(".gencutom-title").html("Remove Profile Picture")},100)},_sharing.CheckCustomerExists=function(t){if("onlineappointment"==_sharing.parentPage.toLowerCase()||e("#pnlAddFamilyFriendSharingModal").is(":visible")){var i=e(t).val();if(trim(i).toLowerCase()!=trim(document.getElementById("hdnFFUserEmailId").value).toLowerCase()){var n={};if(_sharing.IsCallFromOnlinePage()){n.EmailId=i,n.ParentPage=_sharing.parentPage,"onlinemyaccount"==_sharing.parentPage.toLowerCase()&&(n.strFFMasterUserId=_sharing.strFFMasterUserId);var o={};o.objEntity=n,_sharing.ajaxCall("CheckUserExistsByEmailID",o,_sharing.CallCustomerSuccessEmail,_sharing.CallFailedCustomerJSON,!1)}else n.strUserName=i,n.lBusinessID=_sharing.BusinessID,setTimeout(function(){CallWSJSON("VagaroWebOffline.asmx/CheckUserExistsByEmailID",JSON.stringify(n),_sharing.CallCustomerSuccessEmail,_sharing.CallFailedCustomerJSON)},100)}}},_sharing.CallCustomerSuccessEmail=function(t){_sharing.ShowHideLoadingPanel(!1),0==_sharing.IsCallFromOnlinePage()&&(t=t.d);var i=e("#txtFFEmail:visible").length>0?e("#txtFFEmail"):e("#txtFFEmailOpt:visible").length>0?e("#txtFFEmailOpt"):null;if(null!=i){var n=!1,o=!0;if(null!=t){if(_sharing.IsEditMode)return _sharing.ShowHidePassiveAlert(2,"A user with this email address already exisits. Vagaro does not allow more than one user with the same email address."),e(i).val(_sharing.PreviousFFUserEmailId),void e(i).focus();if(t.UserID==_sharing.FFMasterUserId&&"onlinemyaccount"!=_sharing.parentPage.toLowerCase())return _sharing.ShowHidePassiveAlert(2,"This user has already been added to this customer's Family & Friends Sharing."),e(i).val(_sharing.PreviousFFUserEmailId),void e(i).focus();if("onlinemyaccount"==_sharing.parentPage.toLowerCase()&&t.strUserID==_sharing.strFFMasterUserId)return _sharing.ShowHidePassiveAlert(2,"This user has already been added to this customer's Family & Friends Sharing."),e(i).val(_sharing.PreviousFFUserEmailId),void e(i).focus();1==t.UserType?1==_sharing.IsCallFromOnlinePage()?_sharing.confirmDialognAction(!0,t):(n="This email is used by an existing Vagaro user “"+t.FirstName+" "+t.LastName+"”. Would you like to continue adding "+t.FirstName+" "+t.LastName+" to Family and Friends Sharing?",swal({title:"",text:n,timer:4e3,showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Use This Profile",cancelButtonText:"Cancel",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model text-left"},function(e){void 0!==e&&null!=e&&(e?_sharing.confirmDialognAction(!0,t):_sharing.confirmDialognAction(!1,t))}),setTimeout(function(){e(".gencutom-title").html("Use Existing Vagaro Profile")},100)):"onlineappointment"==_sharing.parentPage.toLowerCase()?(n="This email is used by an existing Vagaro user “"+t.FirstName+" "+t.LastName+"”. Would you like to continue adding "+t.FirstName+" "+t.LastName+" to Family and Friends Sharing?",swal({title:"",text:n,timer:4e3,showCancelButton:!0,confirmButtonColor:"#DD6B55",confirmButtonText:"Use This Profile",cancelButtonText:"Cancel",animation:"slide-from-bottom",closeOnConfirm:!0,closeOnCancel:!0,customClass:"sweet-alert-model text-left"},function(e){void 0!==e&&null!=e&&(e?(_sharing.EnableDisableControl(!0),_sharing.confirmDialognAction(!0,t)):_sharing.confirmDialognAction(!1,t))}),setTimeout(function(){e(".gencutom-title").html("Use Existing Vagaro Profile")},100)):(_sharing.ShowHidePassiveAlert(2,_sharing.UserExistsMsg),o=!1,_sharing.confirmDialognAction(!0,t))}else{var a=e(i).val();_sharing.FFUserEmailId=a,_sharing.PreviousFFUserEmailId=a,e("#hdnFFUserEmailId").val(a)}o||_sharing.EnableDisableControl(!0)}},_sharing.CallFailedCustomerJSON=function(e){_sharing.ShowHideLoadingPanel(!1);try{var t=JSON.parse(e.responseText);_sharing.ShowHidePassiveAlert(2,t.Message)}catch(e){_sharing.ShowHidePassiveAlert(3,"Something went wrong, Try Again.")}},_sharing.EnableDisableControl=function(t){t?(e("div.addedit-ffpopup-uploadpropic-cnt div.drag-drop-new").off(),e("#AddEditPopupFFProfilePicUpload").off(),e("#aDeleteFFProfilePic").removeAttr("onclick")):(_sharing.bindImageUploadEventsForFFSharing(),e("#aDeleteFFProfilePic").attr("onclick","_sharing.deleteFFProfilePic()"));e("#AddEditPopupFFProfilePicUpload").prop("disabled",t),e("#txtFFEmail").prop("disabled",t),e("#txtFFEmailOpt").prop("disabled",t),e("#txtFFPhone").prop("disabled",t),e("#txtFFPhoneOpt").prop("disabled",t),e("#txtFFfirstName").prop("disabled",t),e("#txtFFlastName").prop("disabled",t),e("#cboFFMonth").prop("disabled",t),e("#cboFFDay").prop("disabled",t),e("#cboFFYear").prop("disabled",t),e("#divFFGendarSelectOptions").prop("disabled",t)},_sharing.confirmDialognAction=function(t,i){if(_sharing.IsOverrideInfo=!0,1==t){if("onlinemyaccount"==_sharing.parentPage.toLowerCase()?_sharing.strFFUserId=i.strUserID:_sharing.FFUserId=i.UserID,_sharing.FFUserEmailId=i.EmailId,_sharing.PreviousFFUserEmailId=i.EmailId,1==_sharing.IsEditMode||0==_sharing.IsCallFromOnlinePage()||1==_sharing.IsCallFromOnlinePage()){if(""!=i.Cell&&null!=i.IsCellValid&&0==i.IsCellValid){_sharing.ShowHidePassiveAlert(2,"Please enter a valid phone number."),e("#txtFFPhone").addClass("errorInput"),e("#txtFFPhoneOpt").addClass("errorInput"),_sharing.IsUserCellNotValid=!0}else e("#txtFFPhone").removeClass("errorInput"),e("#txtFFPhoneOpt").removeClass("errorInput");if(e("#hdnFFUserEmailId").val(i.EmailId),e("#txtFFfirstName").val(i.FirstName),e("#txtFFlastName").val(i.LastName),e("#txtFFEmail").val(i.EmailId),e("#txtFFEmailOpt").val(i.EmailId),e("#txtFFPhone").val(i.Cell),e("#txtFFPhoneOpt").val(i.Cell),"undefined"!=i.sBirthDate&&null!=i.sBirthDate&&""!=i.sBirthDate)(n=i.sBirthDate.split("/")).length>0&&(vDay=n[1],vMonth=n[0],vYear=n[2],vDay=vDay.replace(/^0+/,""),e("#cboFFDay").val(vDay),vMonth=vMonth.replace(/^0+/,""),e("#cboFFMonth").val(vMonth),vYear==_sharing.defaultYear?e("#cboFFYear").val("-1"):e("#cboFFYear").val(vYear));e("#divFFGendarSelectOptions").val(i.Gender)}else{var n;if(e("#hdnFFUserEmailId").val(i.EmailId),_sharing.txtFFfirstName=i.FirstName,_sharing.txtFFlastName=i.LastName,_sharing.txtFFEmail=i.EmailId,_sharing.txtFFEmailOpt=i.EmailId,_sharing.txtFFPhone=i.Cell,_sharing.txtFFPhoneOpt=i.Cell,"undefined"!=i.sBirthDate&&null!=i.sBirthDate&&""!=i.sBirthDate)(n=i.sBirthDate.split("/")).length>0&&(vDay=n[1],vMonth=n[0],vYear=n[2],vDay=vDay.replace(/^0+/,""),_sharing.cboFFDay=vDay,vMonth=vMonth.replace(/^0+/,""),_sharing.cboFFMonth=vMonth,vYear==_sharing.defaultYear?_sharing.cboFFYear=-1:_sharing.cboFFYear=vYear,_sharing.Age=_sharing.CalculateAge(i.sBirthDate));_sharing.divFFGendarSelectOptions=i.Gender,0==i.IsFirstTimeCustomer?_sharing.IsOverrideInfo=!1:_sharing.IsOverrideInfo=!0}""!=i.Photo&&null!=i.Photo&&(_sharing.UploadedFFImageStream="",_sharing.UploadedFFImageName=i.CDNUrl+_sharing.UserImageSize+"/"+i.Photo,_sharing.OldUploadedFFImageName=i.CDNUrl+_sharing.UserImageSize+"/"+i.Photo,_sharing.setImageOnAddEdit(_sharing.UploadedFFImageName)),"onlinemyaccount"==_sharing.parentPage.toLowerCase()?_sharing.GetUserFamilyAndFriendDetailsByEmail(i.EmailId):_sharing.checkUserAlreadyFamilyFriend(i.UserID)}else{var o=e("#txtFFEmail:visible").length>0?e("#txtFFEmail"):e("#txtFFEmailOpt:visible").length>0?e("#txtFFEmailOpt"):null;""!=_sharing.PreviousFFUserEmailId?(e("#hdnFFUserEmailId").val(_sharing.PreviousFFUserEmailId),null!=o&&(e(o).val(_sharing.PreviousFFUserEmailId),e(o).focus())):(e("#hdnFFUserEmailId").val(""),null!=o&&(e(o).val(""),e(o).focus()))}},_sharing.CheckCustomerExistsByID=function(e){if(0!=e){var t={};t.lUserID=e,t.lBusinessID=_sharing.BusinessID,t.AllCCDeatils=!1,CallWSJSON("VagaroWebOffline.asmx/GetCustomerDetailsByIDNew",JSON.stringify(t),_sharing.CallEditCustomer,_sharing.CallFailedCustomerJSON)}},_sharing.CallEditCustomer=function(t){if(null!=(t=t.d)){_sharing.FFUserId=t.UserID,_sharing.OpenCreateNewFamilyFriendPopup(),null!=t.Photo&&""!=t.Photo&&(-1!=t.Photo.indexOf("user-")&&-1!=t.Photo.indexOf("http")||(_sharing.UploadedFFImageName=t.Photo,_sharing.OldUploadedFFImageName=t.Photo,_sharing.setImageOnAddEdit(_sharing.UploadedFFImageName))),e("#txtFFfirstName").val(t.FirstName),e("#txtFFlastName").val(t.LastName);var i=t.Cell;if(i=i.replace(/-/g,""),e("#txtFFPhone").val(i),e("#txtFFPhoneOpt").val(i),""!=i&&null!=t.IsCellValid&&0==t.IsCellValid?(_sharing.ShowHidePassiveAlert(2,"Please enter a valid phone number."),e("#txtFFPhone").addClass("errorInput"),e("#txtFFPhoneOpt").addClass("errorInput"),_sharing.IsUserCellNotValid=!0):(e("#txtFFPhone").removeClass("errorInput"),e("#txtFFPhoneOpt").removeClass("errorInput")),null!=t.Cell&&t.CellCountryID>0&&(friendfamilycellPhone.setPhoneData(t.CellCountryID,t.Cell),childcellphone.setPhoneData(t.CellCountryID,t.Cell)),null!=t.EmailId&&""!=t.EmailId&&(_sharing.FFUserEmailId=t.EmailId,_sharing.PreviousFFUserEmailId=t.EmailId,e("#hdnFFUserEmailId").val(t.EmailId),e("#txtFFEmail").val(t.EmailId),e("#txtFFEmailOpt").val(t.EmailId)),null!=t.BirthDate){t.BirthDate=moment(new Date(t.sBirthDate))._d;var n=t.BirthDate.getDate(),o=t.BirthDate.getMonth(),a=t.BirthDate.getFullYear();e("#cboFFMonth").val(o+1),e("#cboFFDay").val(n),a==_sharing.defaultYear?e("#cboFFYear").val(-1):e("#cboFFYear").val(a)}e("#divFFGendarSelectOptions").val(t.Gender),_sharing.checkUserAlreadyFamilyFriend(t.UserID)}"1"!=t.UserType&&(_sharing.EnableDisableControl(!0),_sharing.ShowHidePassiveAlert(2,_sharing.UserExistsMsg)),_sharing.ShowHideLoadingPanel(!1)},_sharing.AddNewCustomerInLocalStorage_Cust=function(t,i){if(_sharing.IsLocalStorageSupported()&&void 0!==localStorage.cusList)try{var n=JSON.parse(localStorage.cusList||[]);if(void 0!==n&&null!=n&&void 0!==t&&null!=t){i=void 0!==i&&null!=i&&1==i;var o=e.grep(n,function(e){return e.ID==t.CustomerID});if((void 0===o||null==o||o.length<=0)&&0==i)return;var a={};a.ID=t.CustomerID.toString(),a.FN=t.FullName,a.C=t.glbCell,a.D=i?"":o[0].D,a.N=i?"":o[0].N,(n=e.grep(n,function(e){return e.ID!=t.CustomerID})).push(a),localStorage.cusList=JSON.stringify(n),localStorage.data="Change","checkout"==_sharing.parentPage.toLowerCase()?setCheckoutCustomerLocalStorageData():"customermodule"==_sharing.parentPage.toLowerCase()&&setCustomerModuleCustomerLocalStorageData()}}catch(e){localStorage.removeItem("cusList"),localStorage.removeItem("cusSynInfo")}},_sharing.GetSetLocalStorageForPetDetails=function(e){var t=null;try{_sharing.IsLocalStorageSupported()&&(null!=e&&e.length>0?localStorage.setItem("petdetails",JSON.stringify(e)):null==e&&void 0!==localStorage.petdetails&&(t=JSON.parse(localStorage.getItem("petdetails"))))}catch(e){t=null,localStorage.removeItem("petdetails")}return t},_sharing.GetSetIndexedDBForPetDetails=function(e){return new Promise(function(t,n){try{if(!_sharing.IsIndexedDBSupported())return void t([]);var o,a=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.msIndexedDB,s=new Date,r=s.getFullYear()+""+_sharing.fixDigit(s.getMonth()+1)+_sharing.fixDigit(s.getDate());if(null!=e&&e.length>0){(l=a.open("PetDB",r)).onupgradeneeded=function(t){var n=t.target.result;if(!n.objectStoreNames.contains("petDetails")){var o=n.createObjectStore("petDetails",{keyPath:"speciesId",autoIncrement:!0});o.createIndex("text","text",{unique:!1});var a=e.length;for(i in e)a>0&&(a--,o.add(e[i]))}},l.onsuccess=function(e){t(l.result)},l.onerror=function(e){n(e)}}else{var l,c=!1;(l=a.open("PetDB",r)).onupgradeneeded=function(){c=!0},l.onsuccess=function(e){if(!(o=e.target.result).objectStoreNames.contains("petDetails")||c)return o.close(),a.deleteDatabase("PetDB"),void t([]);var i=o.transaction(["petDetails"],"readonly").objectStore("petDetails"),s=[],r=i.openCursor();r.onsuccess=function(e){var i=e.target.result;i?(s.push(i.value),i.continue()):(_sharing.IndexedPetDbData=s,t(s))},r.onerror=function(){n("Read error")}},l.onerror=function(e){n(e)}}}catch(e){n(e)}})},_sharing.fixDigit=function(e){return 1===e.toString().length?"0"+e:e},_sharing.IsIndexedDBSupported=function(){return!!(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.msIndexedDB)},_sharing.IsLocalStorageSupported=function(){var e=!1;try{"object"==typeof localStorage&&(localStorage.setItem("localStorage",1),localStorage.removeItem("localStorage"),e=!0)}catch(t){e=!1}return e},_sharing.ShowHideLoadingPanel=function(e){"onlinemyaccount"==_sharing.parentPage.toLowerCase()||"onlineappointment"==_sharing.parentPage.toLowerCase()||"onlineclassbook"==_sharing.parentPage.toLowerCase()||"onlineshoppingcart"==_sharing.parentPage.toLowerCase()||"booknowupsell"==_sharing.parentPage.toLowerCase()?ShowLoader(e):""!=_sharing.parentPage.trim()&&ShowLoadingPanel(e)},_sharing.ShowHidePassiveAlert=function(e,t,i){"onlinemyaccount"==_sharing.parentPage.toLowerCase()||"onlineappointment"==_sharing.parentPage.toLowerCase()||"onlineclassbook"==_sharing.parentPage.toLowerCase()||"onlineshoppingcart"==_sharing.parentPage.toLowerCase()||"booknowupsell"==_sharing.parentPage.toLowerCase()?1==e?_common.PassiveAlertSuccessgreen(t,i):2==e?_common.PassiveAlertwarning(t,i):3==e&&_common.PassiveAlertfail(t):1==e?ShowHideDoneMessage(t):2==e?ShowHideWarningMessage(t):3==e&&ShowHideFailedMessage(t)},_sharing.GetAllPetDetails=async function(){try{const t=await _sharing.GetSetIndexedDBForPetDetails(null);if(t&&t.length>0)_sharing.bindPetDatabaseToSelect(t);else{var e={objRequest:{businessID:_sharing.BusinessID,loginUserID:_sharing.LoggedInUserId}};_sharing.ShowHideLoadingPanel(!0),_sharing.ajaxCall("websiteapi/homepage/getallpetdetails",e,_sharing.onSuccessGetAllPetDetails,_sharing.onFailCommonMethod,!1,!1,!0)}}catch(e){console.log("Error:",e)}},_sharing.onSuccessGetAllPetDetails=function(e){null!=e&&e.length>0&&(_sharing.bindPetDatabaseToSelect(e),_sharing.GetSetIndexedDBForPetDetails(e)),_sharing.ShowHideLoadingPanel(!1)},_sharing.bindPetDatabaseToSelect=function(t){if(null!=t&&t.length>0){var i={dropdownCssClass:"familypetdrop",isInitSelection:!1,isSearchRequire:!0,selectOnClick:!0,placeholder:"Select Species/Breed",collapasable:!1,selectAllText:!1,scrollTop:!1};i.data=t,_sharing.BindSelect2Dropdown(e("#selFFSpeciesBreed"),i)}},_sharing.BindSelect2Dropdown=function(t,i){void 0!==i.placeholder&&""!=i||((i={}).dropdownCssClass="",i.isSearchRequire=!1,i.selectOnClick=!0,i.placeholder=""),t.select2("destroy"),t.off("selected"),t.off("select2-close"),t.select2({searchInputPlaceholder:void 0!==i.placeholder&&""!=i.placeholder?i.placeholder:"",combobox:i.isSearchRequire,collapasable:!1,selectOnClick:!0,minimumInputLength:0,maximumInputLength:100,dropdownCssClass:i.dropdownCssClass,formContainer:"#page-wrapper",data:function(){return void 0!==i.data?{results:e.extend(!0,[],i.data)}:null},matcher:function(e,t,i){for(var n=/\s\s+/g,o=/[^0-9a-zA-Z\" \"]+/gi,a=e.replace(n," "),s=(a=a.toLowerCase().replace(o,"")).split(" "),r="",l=s.length,c=0,d=0;d<=s.length-1;d++){var u="";if(((u=(u=void 0===i.id?t.replace(n," "):(u=i.id.replace(n," ")).replace("_"," ")).toLowerCase().replace(o,"")).match("^"+s[d])||-1!=u.indexOf(" "+s[d]))&&((""==r||s[d].indexOf(r)<0)&&(c+=1),r=" "+u,c>=l))break}return c>=l&&(i.isShow=!0,!0)},formatNoMatches:function(){return e(".select2-results .select2-no-results").remove(),"No matches found"}}).on("select2-opening",function(e){t.select2("data",{id:"",text:"",species:""})}).on("selected",function(i){e(i.target).data("selecteddetail",JSON.stringify(i.choice)),void 0!==t.data("choice")&&_sharing.SetChoiceForSeleect2(t,i.choice)}).on("select2-open",function(n){e(this).data("isopen",!0);var o=_sharing.GetChoiceForSeleect2(t);void 0!==o.id&&t.select2("data",{id:o.id,text:o.text}),(void 0===i.selectAllText||i.selectAllText)&&setTimeout(function(){e(n.target).parent("div").find(".select2-input").get(0).setSelectionRange(0,9999)},100)}).on("change",function(e){if(void 0!==t.data("choice")&&""==t.data("select2").getVal().toString()){var i={id:"",text:"",species:""};t.select2("data",i),_sharing.SetChoiceForSeleect2(t,i)}}).on("select2-close",function(t){e(this).data("isopen",!1),e("#select2-drop-mask").removeClass("hidemask"),setTimeout(function(){e("#select2-drop-mask").off("touchstart.custom")},500)})},_sharing.SetChoiceForSeleect2=function(e,t){e.data("choice",JSON.stringify(t))},_sharing.GetChoiceForSeleect2=function(e){try{return JSON.parse(e.data("choice"))}catch(e){return{}}},_sharing.SetDefaultForSeleect2=function(e){e.data("choice",JSON.stringify({id:"",text:""}))},_sharing.IsCallFromOnlinePage=function(){return void 0!==_sharing.parentPage&&null!=_sharing.parentPage&&("onlinemyaccount"==_sharing.parentPage.toLowerCase()||"onlineappointment"==_sharing.parentPage.toLowerCase()||"onlineclassbook"==_sharing.parentPage.toLowerCase()||"onlineshoppingcart"==_sharing.parentPage.toLowerCase()||"booknowupsell"==_sharing.parentPage.toLowerCase())},_sharing.IsSpecificParentPage=function(e){var t=!1;return void 0!==e&&null!=e&&""!=e.trim()&&(t=void 0!==_sharing.parentPage&&null!=_sharing.parentPage&&""!=_sharing.parentPage.trim()&&_sharing.parentPage.toLowerCase()==e.toLowerCase()),t},_sharing.IsHasCustomerModifyRights=function(){var e=!1;return _sharing.IsSpecificParentPage("CustomerModule")&&"undefined"!=typeof GetCustomerRight||_sharing.IsSpecificParentPage("CustomerHistory")&&"undefined"!=typeof GetCustomerRight?e="2"==GetCustomerRight():_sharing.IsSpecificParentPage("checkout")&&void 0!==_checkout.HasCustomerModifyRights?e=_checkout.HasCustomerModifyRights:(_sharing.IsSpecificParentPage("onlinemyaccount")||_sharing.IsSpecificParentPage("onlineappointment")||_sharing.IsSpecificParentPage("onlineclassbook")||_sharing.IsSpecificParentPage("onlineshoppingcart")||_sharing.IsSpecificParentPage("booknowupsell"))&&(e=!0),e||_sharing.ShowHidePassiveAlert(2,"Sorry you don`t have permission."),e},e("#btnFFCustomerClose").mousedown(function(){_sharing.mousedownHappened=!0}),_sharing.CheckAnyTabSelected=function(){return 1===e("#divAddNewFamilyFriendTabLink a.w-tab-link.w--current").length?(e("#divAddNewFamilyFriendTabLink").removeClass("error-ffsharing-tab-select"),e("#dvFFSharingError").html(""),!0):(e("#divAddNewFamilyFriendTabLink").addClass("error-ffsharing-tab-select"),e("#dvFFSharingError").html("required."),!1)},_sharing.AddErrorHideClassforFFSharing=function(t){t?(e("#divAddNewFamilyFriendTabLink").removeClass("error-ffsharing-tab-select"),e("#dvFFSharingError").html(""),e("#divAddNewFamilyFriendTabLink a.w-tab-link").removeClass("w--current"),e("#divAddNewFamilyFriendContainer").addClass("hide-block-ffsharing"),e("#dvFFSharingOp").addClass("hide-block-ffsharing")):(e("#divAddNewFamilyFriendTabLink").removeClass("error-ffsharing-tab-select"),e("#dvFFSharingError").html(""),e("#divAddNewFamilyFriendContainer").removeClass("hide-block-ffsharing"),e("#dvFFSharingOp").removeClass("hide-block-ffsharing"))},_sharing.CalculateAge=function(e){var t=-1;if(null!=e){var i=new Date,n=e.split("/");if("-1"!=n[0]&&"-1"!=n[1]&&"-1"!=n[2]){var o=new Date(n[2],1*n[0]-1,n[1]);t=Math.floor((i.getTime()-o.getTime())/315576e5)}}return t},_sharing.CheckDateofbirthandEmail=function(t,i){var n;e("#txtFFfirstName").val(),e("#txtFFlastName").val();if("Child"==_sharing.SelectedFFRelation)if(t){n=e.trim(e("#txtFFEmailOpt").val());var o=e("#cboFFDay").val(),a=e("#cboFFMonth").val(),s=e("#cboFFYear").val();_sharing.Age=_sharing.CalculateAge(a+"/"+o+"/"+s),""==n?(e("#txtFFEmailOpt").addClass("errorInput"),"-1"==o||"-1"==a||"-1"==s?(e("#cboFFMonth").addClass("errorInput"),e("#cboFFDay").addClass("errorInput"),e("#cboFFYear").addClass("errorInput"),i=!1):_sharing.Age<18&&_sharing.Age>=0?(e("#txtFFEmailOpt").removeClass("errorInput"),e("#lblOptional").show()):(e("#txtFFEmailOpt").addClass("errorInput"),e("#lblOptional").hide(),i=!1)):(e("#cboFFMonth").removeClass("errorInput"),e("#cboFFDay").removeClass("errorInput"),e("#cboFFYear").removeClass("errorInput"),_sharing.Age<18&&_sharing.Age>=0?e("#lblOptional").show():e("#lblOptional").hide())}else 1==_sharing.ExistingIsShareAppointments&&1!=_sharing.IsShareAppointmentsAccepted?-1!=_sharing.Age?""==e.trim(e("#txtFFEmailOpt").val())&&_sharing.Age>18?(e("#txtFFEmailOpt").addClass("errorInput"),e("#lblOptional").hide(),i=!1):(e("#lblOptional").show(),e("#txtFFEmailOpt").removeClass("errorInput")):""==e.trim(e("#txtFFEmailOpt").val())?(e("#txtFFEmailOpt").addClass("errorInput"),e("#lblOptional").hide(),i=!1):(e("#lblOptional").show(),e("#txtFFEmailOpt").removeClass("errorInput")):(e("#lblOptional").show(),e("#txtFFEmailOpt").removeClass("errorInput")),e("#cboFFMonth").removeClass("errorInput"),e("#cboFFDay").removeClass("errorInput"),e("#cboFFYear").removeClass("errorInput"),-1!=_sharing.Age&&_sharing.Age>=0&&_sharing.Age<18&&(swal({title:"",text:"This setting is defaulted on and cannot be turned off because your child is under the age of 18.",customClass:"swal-white-greenbtn sweet-alert-model employee-exists"},function(t){swal.close(),e("#ffShareAppointments").prop("checked",!0).attr("aria-label","Toggle on for").next().attr("aria-checked",!0)}),e(".gencutom-title").html("Viewing Your Child's Appointments"));return i},_sharing.CheckIsInvitationAccepted=function(){var t=e("#txtFFfirstName").val()+" "+e("#txtFFlastName").val();null!=t&&"undefined"!=t&&""!=t.trim()&&(_sharing.FFMasterUserFullName=t),1==e("#ffShareAppointments").prop("checked")?1!=_sharing.FFIsInvitationAccepted?(swal({title:"",text:_sharing.FFMasterUserFullName+" will be sent the Family & Friends Sharing email and must accept the invitation to activate the View Appointment Setting.",customClass:"swal-white-greenbtn sweet-alert-model employee-exists"},function(e){swal.close(),_sharing.CheckDateofbirthandEmail(!0,!0)}),e("#pnlAddFamilyFriendSharingModal").length>0&&e("#pnlAddFamilyFriendSharingModal").removeAttr("tabindex"),e(".gencutom-title").html("Family & Friends Acceptance Required")):_sharing.CheckDateofbirthandEmail(!0,!0):_sharing.ExistingIsShareAppointments&&1!=_sharing.IsShareAppointmentsAccepted?_sharing.CheckDateofbirthandEmail(!0,!0):(_sharing.IsShareAppointments=!1,_sharing.CheckDateofbirthandEmail(!1,!0))}}(jQuery,window,document),function(e){_shareListing={},_shareListing.listDiv=e("#familyListDiv"),_shareListing.parentPage="",_shareListing.IsOnlineCall=!1,_shareListing.MasterUserId=0,_shareListing.BusinessID=0,_shareListing.strMasterUserId="",_shareListing.strBusinessID="",_shareListing.InvitationPendingType=0,_shareListing.InvitationAcceptedType=1,_shareListing.InvitationDenyedType=2,_shareListing.OnlineClassBookElement=null,e(document).on("touchstart click",function(t){e(t.target).closest("._3-circle-menu-pkg").length||e(t.target).closest(".dots-dropdownparent").length||(e(".dots-dropdown").hide(),e("._3-circle-menu-pkg").removeClass("active"),e("#scrollright .custmng-gridcont:visible").length&&e("#scrollright .custmng-gridcont:visible").removeClass("custHeight100"))}),_shareListing.GetUserFamilyAndFriendDetails=function(e,t){var i={};_shareListing.containsAlphabet(e)?(_shareListing.strMasterUserId=e,i.strLoginUserId=_shareListing.strMasterUserId):(_shareListing.MasterUserId=parseInt(e),i.UserID=_shareListing.MasterUserId),_shareListing.containsAlphabet(t)?(_shareListing.strBusinessID=t,i.strBusinessId=_shareListing.strBusinessID):(_shareListing.BusinessID=parseInt(t),i.businessID=_shareListing.BusinessID),i.IsInvitationAccepted=null,_shareListing.IsOnlineCall=_shareListing.IsCallFromOnlinePage(),i.IsLoadFromOffline=_shareListing.IsOnlineCall,i.ParentPage=_shareListing.parentPage,_shareListing.ShowHideLoadingPanel(!0);var n={};n.objRequest=i,setTimeout(function(){_shareListing.ajaxCall("GetFamilyAndFriendsDetailsByUserID",n,_shareListing.onSuccessGetUserFamilyAndFriendDetails,_shareListing.onFailGetUserFamilyAndFriendDetails,!1,!1)},100)},_shareListing.containsAlphabet=function(e){return/[a-zA-Z]/.test(e)},_shareListing.SetClassBookingParentPage=function(e,t){_shareListing.parentPage=t,_sharing.parentPage=t,_shareListing.loadAddEditFamilyFriendUserControl(1,0,0,!1,e,""),_shareListing.OnlineClassBookElement=e},_shareListing.onSuccessGetUserFamilyAndFriendDetails=function(t){if(_shareListing.ShowHideLoadingPanel(!1),_shareListing.BindFamilyFriendInUserProfile(t),"undefined"!=typeof FFCustIDEditSetting&&0!=FFCustIDEditSetting){var i=e("#divFFUserDetail"+FFCustIDEditSetting);i.length>0&&(i.find(".btnEdit").click(),FFCustIDEditSetting=0)}},_shareListing.onFailGetUserFamilyAndFriendDetails=function(e){_shareListing.ShowHideLoadingPanel(!1),ShowHideFailedMessage("Something Went Wrong. Family and Friends Listing Failed.")},_shareListing.loadAddEditFamilyFriendUserControl=function(t,i,n,o,a,s){if(_shareListing.IsHasCustomerModifyRights(a))if(_shareListing.IsOnlineCall=_shareListing.IsCallFromOnlinePage(),_shareListing.IsOnlineCall&&e("#divAddEditFamilyFriendUserControlContainer").length>0&&(""==e("#divAddEditFamilyFriendUserControlContainer").html()||null==e("#divAddEditFamilyFriendUserControlContainer").html())){_shareListing.ShowHideLoadingPanel(!0),e("#divAddEditFamilyFriendUserControlContainer").html("");var r={UserControlPath:"~/ShopOwner/UserControls/ucFamilyFriendSharing.ascx",PageNamePath:"~/Public.Master",isRemoveFormTag:!0};"undefined"!=typeof BasePage&&"MyAccount"!=BasePage?r.Parameters={IsFromDetail:!0}:"undefined"!=typeof BasePage&&"MyAccount"==BasePage&&(r.Parameters={IsFromMyAccount:!0}),setTimeout(function(){vagaro.ajaxCall(ApiURLEnumCommon.loadusercontrol,r,function(r){e("#divAddEditFamilyFriendUserControlContainer").html(r),_shareListing.ShowHideLoadingPanel(!1),_sharing.parentPage=_shareListing.parentPage,"onlineclassbook"!=_shareListing.parentPage.toLowerCase()&&"onlineshoppingcart"!=_shareListing.parentPage.toLowerCase()&&"booknowupsell"!=_shareListing.parentPage.toLowerCase()||("undefined"!=typeof AppBookBusinessID&&null!=AppBookBusinessID?_sharing.BusinessID=AppBookBusinessID:_sharing.BusinessID=businessID),setTimeout(function(){_sharing.parentPage=_shareListing.parentPage,1==t?_sharing.ShowFriendFamilyPopup():2==t?_sharing.GetUserFamilyAndFriendDetailsById(i,n):3==t?_sharing.deleteUserFamilyAndFriend(i,n,o,a,s):4==t&&_sharing.resendInvitation(i,n,a,3)},300)},function(e){_shareListing.ShowHideLoadingPanel(!1),_shareListing.ShowHidePassiveAlert(3,"Something Went Wrong.")},!1,!0)},100)}else 1==t?_sharing.ShowFriendFamilyPopup():2==t?_sharing.GetUserFamilyAndFriendDetailsById(i,n):3==t?_sharing.deleteUserFamilyAndFriend(i,n,o,a,s):4==t&&_sharing.resendInvitation(i,n,a,3)},_shareListing.BindFamilyFriendInUserProfile=function(t){if(_shareListing.IsOnlineCall=_shareListing.IsCallFromOnlinePage(),void 0!==t&&null!=t&&t.length>0){var i=e("#familyListID"),n=e("#FriendlistID");i.html(""),n.html("");var o=e.grep(t,function(e){return"Friend"==e.Relation}).sort(function(e,t){return e.FullName.localeCompare(t.FullName)}),a=e.grep(t,function(e){return"Friend"!=e.Relation}).sort(function(e,t){return e.FullName.localeCompare(t.FullName)});e("#tmplFamilyFriend").tmpl(a).appendTo(i),e("#tmplFamilyFriend").tmpl(o).appendTo(n),e("#addFamilyDiv").hide(),e("#familyListDiv").show(),a.length>0?e("#txtFamily").show():e("#txtFamily").hide(),o.length>0?e("#txtFriends").show():e("#txtFriends").hide(),e("._3-circle-menu-pkg",_shareListing.listDiv).off(),e("._3-circle-menu-pkg",_shareListing.listDiv).click(function(){e(".dots-dropdown",e(this).parent()).toggle(),e(".dots-dropdown",_shareListing.listDiv).not(e(this).parent().find(".dots-dropdown")).hide();var t=e(this).parent().find(".dots-dropdown").height(),i=e(window).height();t+(_shareListing.IsCallFromOnlinePage()?e(this).offset().top-e(window).scrollTop():e(this).offset().top)+50>i?e(".dots-dropdown").addClass("ffdropdownbottom"):e(".dots-dropdown").removeClass("ffdropdownbottom")})}else e("#familyListDiv").hide(),e("#addFamilyDiv").show();_shareListing.IsOnlineCall?(e("#divFamilyFriendListingContainer .span-addnewfamily-plussign").show(),e("#divEmptyFamilyFriendTitle").hide()):(e("#divFamilyFriendListingContainer .span-addnewfamily-plussign").hide(),e("#divEmptyFamilyFriendTitle").show())},_shareListing.ajaxCall=function(e,t,i,n,o,a){var s=new vagaro.ajax;s.datamodel.Token=e,s.datamodel.data=t,s.datamodel.callback=i,s.datamodel.Error=n,!1===a&&(s.datamodel.async=!1),!0===o?s.PostQue():s.Post()},_shareListing.ShowHideLoadingPanel=function(e){_shareListing.IsSpecificParentPage("onlinemyaccount")||_shareListing.IsSpecificParentPage("onlineclassbook")||_shareListing.IsSpecificParentPage("onlineshoppingcart")||_shareListing.IsSpecificParentPage("booknowupsell")?ShowLoader(e):ShowLoadingPanel(e)},_shareListing.ShowHidePassiveAlert=function(e,t,i){_shareListing.IsSpecificParentPage("onlinemyaccount")?1==e?_common.PassiveAlertSuccessgreen(t):2==e?_common.PassiveAlertwarning(t,i):3==e&&_common.PassiveAlertfail(t):"undefined"!=typeof isCustomerHistoryPage&&null!=isCustomerHistoryPage&&(1==isCustomerHistoryPage||"undefined"!=typeof isCustomerHistoryonLiveStreamPage&&1==isCustomerHistoryonLiveStreamPage)?1==e&&void 0!==window.parent.ShowHideDoneMessageCommon?window.parent.ShowHideDoneMessageCommon(t):2==e&&void 0!==window.parent.ShowHideWarningMessageCommon?window.parent.ShowHideWarningMessageCommon(t):3==e&&void 0!==window.parent.ShowHideFailedMessageCommon?window.parent.ShowHideFailedMessageCommon(t):1==e?ShowHideDoneMessage(t):2==e?ShowHideWarningMessage(t):3==e&&ShowHideFailedMessage(t):1==e?ShowHideDoneMessage(t):2==e?ShowHideWarningMessage(t):3==e&&ShowHideFailedMessage(t)},_shareListing.IsCallFromOnlinePage=function(){return void 0!==_shareListing.parentPage&&null!=_shareListing.parentPage&&("onlinemyaccount"==_shareListing.parentPage.toLowerCase()||"onlineclassbook"==_shareListing.parentPage.toLowerCase()||"onlineshoppingcart"==_shareListing.parentPage.toLowerCase()||"booknowupsell"==_shareListing.parentPage.toLowerCase())},_shareListing.IsSpecificParentPage=function(e){var t=!1;return void 0!==e&&null!=e&&""!=e.trim()&&(t=void 0!==_shareListing.parentPage&&null!=_shareListing.parentPage&&""!=_shareListing.parentPage.trim()&&_shareListing.parentPage.toLowerCase()==e.toLowerCase()),t},_shareListing.IsHasCustomerModifyRights=function(e){var t=!1;return _shareListing.IsSpecificParentPage("OfflineCustomerManagement")&&"undefined"!=typeof GetCustomerRight?t="2"==GetCustomerRight():(_shareListing.IsSpecificParentPage("onlinemyaccount")||_shareListing.IsSpecificParentPage("onlineclassbook")||_shareListing.IsSpecificParentPage("onlineshoppingcart")||_shareListing.IsSpecificParentPage("booknowupsell"))&&(t=!0),t||_shareListing.ShowHidePassiveAlert(2,"Sorry you don`t have permission.",e),t}}(jQuery,window,document),Date.prototype.formatFullYear=function(){var e=this;return e.getDate()+"-"+e.getMonth()+"-"+e.getFullYear()},function(e){var t=e.mobiscroll,i=new Date,n={dateFormat:"mm/dd/yy",dateOrder:"mmddy",timeWheels:"hhiiA",timeFormat:"hh:ii A",startYear:i.getFullYear()-100,endYear:i.getFullYear()+1,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortYearCutoff:"+10",monthText:"Month",dayText:"Day",yearText:"Year",hourText:"Hours",minuteText:"Minutes",secText:"Seconds",ampmText:"&nbsp;",nowText:"Now",showNow:!1,stepHour:1,stepMinute:1,stepSecond:1,separator:" ",mergeDate:!0,mergeTime:!0},o=function(i){var o,a=e(this),s={};if(a.is("input")){switch(a.attr("type")){case"date":o="yy-mm-dd";break;case"datetime":o="yy-mm-ddTHH:ii:ssZ";break;case"datetime-local":o="yy-mm-ddTHH:ii:ss";break;case"month":o="yy-mm",s.dateOrder="mmyy";break;case"time":o="HH:ii:ss"}var r=a.attr("min"),l=a.attr("max");r&&(s.minDate=t.parseDate(o,r)),l&&(s.maxDate=t.parseDate(o,l))}var c,d,u,p,h,m,g,v=e.extend({},i.settings),f=e.extend(i.settings,n,s,v),C=0,S=[],y=[],b={},k={y:f.mergeDate?"formatFullYear":"getFullYear",m:"getMonth",d:"getDate",h:f.mergeTime?function(e){var t=e.getHours(),i=q(t,F)+":"+z(e)+":"+X(e);return i}:function(e){var t=e.getHours();return t=A&&t>=12?t-12:t,q(t,F)},i:z,s:function(e){return q(e.getSeconds(),O)},a:X},_=f.preset,D=f.dateOrder,I=f.timeWheels,w=D.match(/D/),P=I.match(/a/i),A=I.match(/h/),T="datetime"==_?f.dateFormat+f.separator+f.timeFormat:"time"==_?f.timeFormat:f.dateFormat,x=new Date,F=f.stepHour,$=f.stepMinute,O=f.stepSecond,M=f.minDate||new Date(f.startYear,0,1),B=f.maxDate||new Date(f.endYear,11,31,23,59,59);if(o=o||T,_.match(/date/i)){if(e.each(["y","m","d"],function(e,t){(c=D.search(new RegExp(t,"i")))>-1&&y.push({o:c,v:t})}),y.sort(function(e,t){return e.o>t.o?1:-1}),e.each(y,function(e,t){b[t.v]=e}),h=[],f.mergeDate){for(p=[],u=[],m=M.getFullYear(),g=B.getFullYear(),C++,c=m;c<=g;c++)for(j=0;j<12;j++)for(d=1;d<32;d++){f.monthNamesShort[j];var E=c,L=32-new Date(c,j,32).getDate(),N=new Date(c,j,d,M.getHours(),M.getMinutes(),M.getSeconds(),M.getMilliseconds());L>=d&&(1==f.unavailableShowDate&&void 0!==f.validDates&&null!=f.validDates&&f.validDates.length>0&&-1==e.inArray(moment(N).format("MMM DD,YYYY"),f.validDates)?p.push(f.dayNamesShort[N.getDay()]+", "+f.monthNamesShort[j]+" "+d+", "+E+" - Unavailable"):p.push(f.dayNamesShort[N.getDay()]+", "+f.monthNamesShort[j]+" "+d+", "+E),u.push(d+"-"+j+"-"+c))}Y(h,u,p,"Date")}else for(d=0;d<3;d++)if(d==b.y){for(C++,p=[],u=[],m=M.getFullYear(),g=B.getFullYear(),c=m;c<=g;c++)u.push(c),p.push(D.match(/yy/i)?c:(c+"").substr(2,2));Y(h,u,p,f.yearText)}else if(d==b.m){for(C++,p=[],u=[],c=0;c<12;c++){var U=D.replace(/[dy]/gi,"").replace(/mm/,c<9?"0"+(c+1):c+1).replace(/m/,c+1);u.push(c),p.push((U.match(/MM/)?U.replace(/MM/,'<span class="dw-mon">'+f.monthNames[c]+"</span>"):U.replace(/M/,'<span class="dw-mon">'+f.monthNamesShort[c]+"</span>"))+(c+1<10?"0":"")+(c+1))}Y(h,u,p,f.monthText)}else if(d==b.d){for(C++,p=[],u=[],c=1;c<32;c++)u.push(c),p.push(D.match(/dd/i)&&c<10?"0"+c:c);Y(h,u,p,f.dayText)}S.push(h)}if(_.match(/time/i)){if(y=[],e.each(["h","i","s","a"],function(e,t){(e=I.search(new RegExp(t,"i")))>-1&&y.push({o:e,v:t})}),y.sort(function(e,t){return e.o>t.o?1:-1}),e.each(y,function(e,t){b[t.v]=C+e}),h=[],f.mergeTime){C++,p=[],u=[];var R=[];if(A)R=I.match(/A/)?["AM","PM"]:["am","pm"];for(c=0;c<(A?R.length:1);c++)for(j=0;j<(A?12:24);j+=F)for(d=0;d<60;d+=$){A&&R[c];var W=A&&0==j?12:j<10?"0"+j:j,G=(d<10?"0":"")+d,V=parseInt(W);0==c&&12==V?V=0:c>0&&V<12&&(V+=12),u.push(V+":"+d),p.push(W+":"+G+" "+R[c])}Y(h,u,p,f.hourText)}else for(d=C;d<C+4;d++)if(d==b.h){for(C++,p=[],u=[],c=0;c<(A?12:24);c+=F)u.push(c),p.push(A&&0==c?12:I.match(/hh/i)&&c<10?"0"+c:c);Y(h,u,p,f.hourText)}else if(d==b.i){for(C++,p=[],u=[],c=0;c<60;c+=$)u.push(c),p.push(I.match(/ii/)&&c<10?"0"+c:c);Y(h,u,p,f.minuteText)}else if(d==b.s){for(C++,p=[],u=[],c=0;c<60;c+=O)u.push(c),p.push(I.match(/ss/)&&c<10?"0"+c:c);Y(h,u,p,f.secText)}else if(d==b.a){C++,Y(h,[0,1],I.match(/A/)?["AM","PM"]:["am","pm"],f.ampmText)}S.push(h)}function H(e,t,i){var n;return void 0!==b[t]?f.mergeDate&&"y"==t?(n=e[b[t]].split("-"))[0]+"-"+parseInt(n[1])+"-"+n[2]:f.mergeTime&&"h"==t?(n=e[b[t]].split(":"))[0]+":"+n[1]:+e[b[t]]:void 0!==i?i:x[k[t]]?x[k[t]]():k[t](x)}function Y(e,t,i,n){e.push({values:i,keys:t,label:n})}function q(e,t){return Math.floor(e/t)*t}function z(e){return q(e.getMinutes(),$)}function X(e){return P&&e.getHours()>11?1:0}function Z(e){if(f.mergeDate){var t=H(e,"y").split("-"),i=[0,0];return"date"!=f.preset&&(i=H(e,"h",0).split(":")),new Date(t[2],t[1],t[0],i[0],i[1],H(e,"s",0))}i=H(e,"h",0);return new Date(H(e,"y"),H(e,"m"),H(e,"d",1),H(e,"a")?i+12:i,H(e,"i",0),H(e,"s",0))}function J(t){var i=!0;return null!=f.invalid&&null!=f.invalid.dates&&e.each(f.invalid.dates,function(e,n){n.getFullYear()==t.getFullYear()&&n.getMonth()==t.getMonth()&&n.getDate()==t.getDate()&&(i=!1)}),null!=f.validDates&&(i=!1,e.each(f.validDates,function(e,n){(n=moment(n)._d).getFullYear()==t.getFullYear()&&n.getMonth()==t.getMonth()&&n.getDate()==t.getDate()&&(i=!0)})),i}function Q(t){var i=!0;return null!=f.disabledWeekDays&&(i=!1,e.each(f.disabledWeekDays,function(e,n){n==t.getDay()&&(i=!0)})),i}function K(e,t){var i=t.split(":");if(i.length>1){if(-1!=i[1].toLowerCase().indexOf("am"))12==parseInt(i[0])?e.setHours(0):e.setHours(parseInt(i[0]));else if(-1!=i[1].toLowerCase().indexOf("pm")){12==(n=parseInt(i[0],10))||(n+=12),e.setHours(n)}else e.setHours(parseInt(i[0]));e.setMinutes(parseInt(i[1])),e.setSeconds(0),e.setMilliseconds(0)}else{if(-1!=i[0].toLowerCase().indexOf("am"))12==parseInt(i[0])?e.setHours(0):e.setHours(parseInt(i[0]));else if(-1!=i[0].toLowerCase().indexOf("pm")){var n;12==(n=parseInt(i[0],10))||(n+=12),e.setHours(n)}else e.setHours(parseInt(i[0]));e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)}return e}return i.setDate=function(e,t,n,o){var a;for(a in b)i.temp[b[a]]=e[k[a]]?e[k[a]]():k[a](e);i.setValue(i.temp,t,n,o)},i.getDate=function(e){return Z(e?i.temp:i.values)},{button3Text:f.showNow?f.nowText:void 0,button3:f.showNow?function(){i.setDate(new Date,!1,.3,!0)}:void 0,wheels:S,headerText:function(e){return t.formatDate(T,Z(i.temp),f)},formatResult:function(e){return t.formatDate(o,Z(e),f)},parseValue:function(e){var i,n=new Date,a=[];try{n=t.parseDate(o,e,f)}catch(e){}for(i in b)a[b[i]]=n[k[i]]?n[k[i]]():k[i](n);return a},validate:function(t,n){var o=i.temp,a={y:M.getFullYear(),m:0,d:1,h:0,i:0,s:0,a:0},s={y:B.getFullYear(),m:11,d:31,h:q(A?11:23,F),i:q(59,$),s:q(59,O),a:1},r=!0,l=!0;(f.mergeDate||f.mergeTime)&&(a={y:M.getFullYear(),m:M.getMonth(),d:M.getDate(),h:M.getHours(),i:M.getMinutes(),s:0,a:0},s={y:B.getFullYear(),m:11,d:31,h:q(23),i:q(59,$),s:q(59,O),a:1}),e.each(["y","m","d","a","h","i","s"],function(i,n){if(void 0!==b[n]){var c,d,u,p=a[n],h=s[n],m=31,g=H(o,n),v=e(".dw-ul",t).eq(b[n]);if(c=H(o,"y"),d=H(o,"m"),u=H(o,"d"),"d"==n&&(h=m=32-new Date(c,d,32).getDate(),w&&e(".dw-li",v).each(function(){var t=e(this),i=t.data("val"),n=new Date(c,d,i).getDay(),o=D.replace(/[my]/gi,"").replace(/dd/,i<10?"0"+i:i).replace(/d/,i);e(".dw-i",t).html(o.match(/DD/)?o.replace(/DD/,'<span class="dw-day">'+f.dayNames[n]+"</span>"):o.replace(/D/,'<span class="dw-day">'+f.dayNamesShort[n]+"</span>"))})),r&&M&&(p=M[k[n]]?M[k[n]]():k[n](M)),l&&B&&(h=B[k[n]]?B[k[n]]():k[n](B)),"y"!=n&&(!f.mergeTime||"h"!=n)){var C=e(".dw-li",v).index(e('.dw-li[data-val="'+p+'"]',v)),S=e(".dw-li",v).index(e('.dw-li[data-val="'+h+'"]',v));e(".dw-li",v).removeClass("dw-v").slice(C,S+1).addClass("dw-v"),"d"!=n&&"y"!=n||e(".dw-li",v).removeClass("dw-h").slice(m).addClass("dw-h")}if(f.mergeTime&&"h"==n){var y=o[0].split("-"),_=o[1].split(":"),I=new Date(y[2],y[1],y[0],_[0],_[1]);if(I<M&&(I=M),I>B&&(I=B),null!=f.disabledMobileTimePicker&&void 0!==f.disabledMobileTimePicker)if(f.disabledMobileTimePicker.length>0){var P=I.getDay()+1,A=f.disabledMobileTimePicker.filter(function(e){return e.DayID===P})[0];if(null!=typeof A&&null!=A){var T,x,F=new Date(I);T=new Date(K(F,A.FromTime)),g=I>(x=new Date(K(F,A.ToTime)))?x.getHours()+":"+x.getMinutes():T>I?T.getHours()+":"+T.getMinutes():I.getHours()+":"+I.getMinutes()}else g=I.getHours()+":"+I.getMinutes()}else g=I.getHours()+":"+I.getMinutes();else g=I.getHours()+":"+I.getMinutes()}else if(f.mergeDate&&"y"==n){var $=new Date(parseInt(g.split("-")[2]),parseInt(g.split("-")[1]),parseInt(g.split("-")[0]));$<new Date(parseInt(p.split("-")[2]),parseInt(p.split("-")[1]),parseInt(p.split("-")[0]))&&(g=p),$>new Date(parseInt(h.split("-")[2]),parseInt(h.split("-")[1]),parseInt(h.split("-")[0]))&&(g=h)}else g<p&&(g=p),g>h&&(g=h);if(r&&(r=g==p),l&&(l=g==h),null!=f.invalid)if(f.mergeDate&&"y"==n){var O=new Date(parseInt(g.split("-")[2]),parseInt(g.split("-")[1]),parseInt(g.split("-")[0])),E=!0;if(e.each(f.invalid.dates,function(e,t){t.getFullYear()==tedateToSelectmpDate.getFullYear()&&t.getMonth()==O.getMonth()&&t.getDate()==O.getDate()&&(E=!1)}),!E){var L=!1,N=new Date(O);for(intI=1;intI<=31&&(e(".dw-li",v).eq(N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear()).removeClass("dw-v"),N.setDate(N.getDate()-1),!(N<M||N>B));intI++)if(J(N)){g=N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear(),L=!0;break}if(!L){var N=new Date(O);for(intI=1;intI<=31&&(e(".dw-li",v).eq(N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear()).removeClass("dw-v"),N.setDate(N.getDate()+1),!(N<M||N>B));intI++)if(J(N)){g=N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear(),L=!0;break}}if(!L)g=(N=new Date).getDate()+"-"+N.getMonth()+"-"+N.getFullYear()}}else if(!f.mergeDate&&"d"==n){var U=[];if(f.invalid.dates&&e.each(f.invalid.dates,function(e,t){t.getFullYear()==c&&t.getMonth()==d&&U.push(t.getDate()-1)}),f.invalid.daysOfWeek){var R,W=new Date(c,d,1).getDay();e.each(f.invalid.daysOfWeek,function(e,t){for(R=t-W;R<m;R+=7)R>=0&&U.push(R)})}f.invalid.daysOfMonth&&e.each(f.invalid.daysOfMonth,function(e,t){(t=(t+"").split("/"))[1]?t[0]-1==d&&U.push(t[1]-1):U.push(t[0]-1)}),e.each(U,function(t,i){e(".dw-li",v).eq(i).removeClass("dw-v")})}if(null!=f.validDates)if(f.mergeDate&&"y"==n){E=!1,O=new Date(parseInt(g.split("-")[2]),parseInt(g.split("-")[1]),parseInt(g.split("-")[0]));if(e.each(f.validDates,function(e,t){(t=moment(t)._d).getFullYear()==O.getFullYear()&&t.getMonth()==O.getMonth()&&t.getDate()==O.getDate()&&(E=!0)}),!E){L=!1,N=new Date(O);for(intI=1;intI<=186&&(e(".dw-li",v).eq(N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear()).removeClass("dw-v"),N.setDate(N.getDate()-1),!(N<M||N>B));intI++)if(J(N)){g=N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear(),L=!0;break}if(!L){N=new Date(O);for(intI=1;intI<=186;intI++)if(e(".dw-li",v).eq(N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear()).removeClass("dw-v"),N.setDate(N.getDate()+1),J(N)){g=N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear(),L=!0;break}}if(!L)g=(N=new Date).getDate()+"-"+N.getMonth()+"-"+N.getFullYear();e(".dw-li",v).eq(g).removeClass("dw-v")}}else if(!f.mergeDate&&"d"==n&&f.validDates.length>0){E=!1,O=new Date(c,d,u);var G=new Date(O);if(e.each(f.validDates,function(e,t){(t=moment(t)._d).getFullYear()==O.getFullYear()&&t.getMonth()==O.getMonth()&&t.getDate()==O.getDate()&&(E=!0)}),!E){L=!1,N=new Date(O);for(intI=1;intI<=186;intI++){var V=e(".dw-ul",t).eq(b.y);e(".dw-li",V).eq(N.getFullYear()).removeClass("dw-v");var j=e(".dw-ul",t).eq(b.m);e(".dw-li",j).eq(N.getMonth()+1).removeClass("dw-v");var Y=e(".dw-ul",t).eq(b.d);if(e(".dw-li",Y).eq(N.getDate()).removeClass("dw-v"),N.setDate(N.getDate()-1),N<M||N>B)break;if(J(N)){G=new Date(N),L=!0;break}}if(!L){N=new Date(O);for(intI=1;intI<=186;intI++){V=e(".dw-ul",t).eq(b.y);e(".dw-li",V).eq(N.getFullYear()).removeClass("dw-v");j=e(".dw-ul",t).eq(b.m);e(".dw-li",j).eq(N.getMonth()+1).removeClass("dw-v");Y=e(".dw-ul",t).eq(b.d);if(e(".dw-li",Y).eq(N.getDate()).removeClass("dw-v"),N.setDate(N.getDate()+1),N<M||N>B)break;if(J(N)){G=new Date(N),L=!0;break}}}L||(G=new Date),O!=G&&(o[b.y]=G.getFullYear(),o[b.m]=G.getMonth(),g=G.getDate())}}if(null==f.validDates&&null!=f.disabledWeekDays&&void 0!==f.disabledWeekDays&&f.mergeDate&&"y"==n){E=!0;var q=(O=new Date(parseInt(g.split("-")[2]),parseInt(g.split("-")[1]),parseInt(g.split("-")[0]))).getDay();if(e.each(f.disabledWeekDays,function(e,t){t==q&&(E=!1)}),!E){L=!1,N=new Date(O);for(intI=1;intI<=186&&(e(".dw-li",v).eq(N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear()).removeClass("dw-v"),N.setDate(N.getDate()-1),!(N<M||N>B));intI++)if(!Q(N)){g=N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear(),L=!0;break}if(!L){N=new Date(O);for(intI=1;intI<=186&&(e(".dw-li",v).eq(N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear()).removeClass("dw-v"),N.setDate(N.getDate()+1),!(N<M||N>B));intI++)if(!Q(N)){g=N.getDate()+"-"+N.getMonth()+"-"+N.getFullYear(),L=!0;break}}if(!L)g=(N=new Date).getDate()+"-"+N.getMonth()+"-"+N.getFullYear();e(".dw-li",v).eq(g).removeClass("dw-v")}}o[b[n]]=g}})}}};e.each(["date","time","datetime"],function(e,i){t.presets[i]=o,t.presetShort(i)}),t.formatDate=function(t,i,o){if(!i)return null;var a,s=e.extend({},n,o),r=function(e){for(var i=0;a+1<t.length&&t.charAt(a+1)==e;)i++,a++;return i},l=function(e,t,i){var n=""+t;if(r(e))for(;n.length<i;)n="0"+n;return n},c=function(e,t,i,n){return r(e)?n[t]:i[t]},d="",u=!1;for(a=0;a<t.length;a++)if(u)"'"!=t.charAt(a)||r("'")?d+=t.charAt(a):u=!1;else switch(t.charAt(a)){case"d":d+=l("d",i.getDate(),2);break;case"D":d+=c("D",i.getDay(),s.dayNamesShort,s.dayNames);break;case"o":d+=l("o",(i.getTime()-new Date(i.getFullYear(),0,0).getTime())/864e5,3);break;case"m":d+=l("m",i.getMonth()+1,2);break;case"M":d+=c("M",i.getMonth(),s.monthNamesShort,s.monthNames);break;case"y":d+=r("y")?i.getFullYear():(i.getYear()%100<10?"0":"")+i.getYear()%100;break;case"h":var p=i.getHours();d+=l("h",p>12?p-12:0==p?12:p,2);break;case"H":d+=l("H",i.getHours(),2);break;case"i":d+=l("i",i.getMinutes(),2);break;case"s":d+=l("s",i.getSeconds(),2);break;case"a":d+=i.getHours()>11?"pm":"am";break;case"A":d+=i.getHours()>11?"PM":"AM";break;case"'":r("'")?d+="'":u=!0;break;default:d+=t.charAt(a)}return d},t.parseDate=function(t,i,o){var a=new Date;if(!t||!i)return a;i="object"==typeof i?i.toString():i+"";var s,r=e.extend({},n,o),l=r.shortYearCutoff,c=a.getFullYear(),d=a.getMonth()+1,u=a.getDate(),p=-1,h=a.getHours(),m=a.getMinutes(),g=0,v=-1,f=!1,C=function(e){var i=s+1<t.length&&t.charAt(s+1)==e;return i&&s++,i},S=function(e){C(e);var t=new RegExp("^\\d{1,"+("@"==e?14:"!"==e?20:"y"==e?4:"o"==e?3:2)+"}"),n=i.substr(k).match(t);return n?(k+=n[0].length,parseInt(n[0],10)):0},y=function(e,t,n){var o,a=C(e)?n:t;for(o=0;o<a.length;o++)if(i.substr(k,a[o].length).toLowerCase()==a[o].toLowerCase())return k+=a[o].length,o+1;return 0},b=function(){k++},k=0;for(s=0;s<t.length;s++)if(f)"'"!=t.charAt(s)||C("'")?b():f=!1;else switch(t.charAt(s)){case"d":u=S("d");break;case"D":y("D",r.dayNamesShort,r.dayNames);break;case"o":p=S("o");break;case"m":d=S("m");break;case"M":d=y("M",r.monthNamesShort,r.monthNames);break;case"y":c=S("y");break;case"H":h=S("H");break;case"h":h=S("h");break;case"i":m=S("i");break;case"s":g=S("s");break;case"a":v=y("a",["am","pm"],["am","pm"])-1;break;case"A":v=y("A",["am","pm"],["am","pm"])-1;break;case"'":C("'")?b():f=!0;break;default:b()}if(c<100&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=("string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10))?0:-100)),p>-1)for(d=1,u=p;;){var _=32-new Date(c,d-1,32).getDate();if(u<=_)break;d++,u-=_}h=-1==v?h:v&&h<12?h+12:v||12!=h?h:0;var D=new Date(c,d-1,u,h,m,g);if(D.getFullYear()!=c||D.getMonth()+1!=d||D.getDate()!=u)throw"Invalid date";return D}}(jQuery),"undefined"==typeof _siteBuilderSocialMedia&&(_siteBuilderSocialMedia={}),_siteBuilderSocialMedia.htmlDecode=function(e){return $("<div/>").html(e).text()},_siteBuilderSocialMedia.businessID=$("#hdnSiteBuilderBusinessID").val();var ApiURLEnumSocialMedia={sharesporstyle:(ApiPath="websiteapi/homepage/")+"sharesporstyle",getstyleimagecommaseparated:ApiPath+"getstyleimagecommaseparated"};_siteBuilderSocialMedia.iosDevices=/iPad|iPhone|iPod|iTouch/.test(navigator.userAgent)&&!window.MSStream,_siteBuilderSocialMedia.InPageWidget_Ios=self!==top&&_siteBuilderSocialMedia.iosDevices,_siteBuilderSocialMedia.InPageWidget_Ios?ScrollTarget=$("body"):ScrollTarget=$(window),_siteBuilderSocialMedia.getscrollTop=function(e){$(e).scrollTop();return _siteBuilderSocialMedia.InPageWidget_Ios?-1*$("#page-wrapper").position().top:$(window).scrollTop()},_siteBuilderSocialMedia.shareBusiness=function(e){switch(e.toLowerCase()){case"facebook":var t={BusinessName:_siteBuilderSocialMedia.htmlDecode(businessName),vagaroUrl:vagaroUrl,imageUrl:$("#dvBusinessImage").attr("data-original")};_siteBuilderSocialMedia.PostonFacebook(null,"BusinessDetail",t);break;case"twitter":var i=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+vagaroUrl:""),n=escape(i+"&text=Check out this business on Vagaro: "+_siteBuilderSocialMedia.htmlDecode(businessName)+"&related=vagaro");_siteBuilderSocialMedia.PostOnTwitter(n);break;case"pinterest":i=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+vagaroUrl:"");var o=$("#dvBusinessImage").attr("data-original"),a="";1==$("#pbusinessDescription").length&&(a=$("#pbusinessDescription").text());n=i+"?"+new URLSearchParams({text:_siteBuilderSocialMedia.htmlDecode(businessName),media:o,description:_siteBuilderSocialMedia.htmlDecode(a).substring(0,500)}).toString();_siteBuilderSocialMedia.PostOnPint(n);break;case"email":_siteBuilderSocialMedia.MailClick(null,null,"BusinessDetail")}_siteBuilderSocialMedia.showHideSharingOptions()},_siteBuilderSocialMedia.PostonFacebook=function(e,t,i){var n;if(_siteBuilderSocialMedia.curtemp=$(e).closest(".brick"),_siteBuilderSocialMedia.Spname="",_siteBuilderSocialMedia.Address="",_siteBuilderSocialMedia.BusinessUrl="",_siteBuilderSocialMedia.image="",_siteBuilderSocialMedia.BusinessName="",_siteBuilderSocialMedia.Servicetitle="",_siteBuilderSocialMedia.Styletitle="",_siteBuilderSocialMedia.msg="","Stylist"==t?(_siteBuilderSocialMedia.Spname=$("#spnProviderName",_siteBuilderSocialMedia.curtemp).html(),_siteBuilderSocialMedia.BusinessName=$(_siteBuilderSocialMedia.curtemp).find("#spnAddress").data().businessname,_siteBuilderSocialMedia.Address=$(_siteBuilderSocialMedia.curtemp).find("#spnAddress").data().address,_siteBuilderSocialMedia.BusinessUrl=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+$("#arating",_siteBuilderSocialMedia.curtemp).attr("href"):""),_siteBuilderSocialMedia.image=$("#imgServiceProvider_"+_siteBuilderDetail.businessID+"_"+_siteBuilderSocialMedia.curtemp.data().spid,_siteBuilderSocialMedia.curtemp).attr("src"),_siteBuilderSocialMedia.msg="Service Provider has been posted."):"Photos"==t?(_siteBuilderSocialMedia.curtemp=$(e).parents(".cust-img-popup-slider"),(void 0===_siteBuilderSocialMedia.curtemp||null==_siteBuilderSocialMedia.curtemp||_siteBuilderSocialMedia.curtemp.length<=0)&&(_siteBuilderSocialMedia.curtemp=$(e).parents(".gallery-solo-image")),_siteBuilderSocialMedia.image=$("#imgServiceImage_"+_siteBuilderSocialMedia.curtemp.data().styleid,_siteBuilderSocialMedia.curtemp).attr("src"),_siteBuilderSocialMedia.BusinessName=$("#divSalonName_"+_siteBuilderSocialMedia.curtemp.data().styleid,_siteBuilderSocialMedia.curtemp).html(),_siteBuilderSocialMedia.Servicetitle=_siteBuilderSocialMedia.curtemp.data().servicetitle,_siteBuilderSocialMedia.Styletitle=_siteBuilderSocialMedia.curtemp.data().styletitle,_siteBuilderSocialMedia.BusinessUrl=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+_siteBuilderSocialMedia.curtemp.data().vagarourl.toLowerCase():"")+"/styles",_siteBuilderSocialMedia.msg="Portfolio has been posted."):"Deals"==t?(_siteBuilderSocialMedia.BusinessName=$("#lblPromotionTitleHome").text(),_siteBuilderSocialMedia.titletimestamp=$("#hdnScTitletimestamp").val(),_siteBuilderSocialMedia.vagaroURL=$("#hdnScVagarourl").val(),_siteBuilderSocialMedia.Styletitle=$("#promotionDesHome",".deals-text-cont").text(),_siteBuilderSocialMedia.image=$("#imgPromotion").attr("src"),_siteBuilderSocialMedia.BusinessUrl=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+_siteBuilderSocialMedia.vagaroURL:"")+"/deals/"+_siteBuilderSocialMedia.titletimestamp,_siteBuilderSocialMedia.msg="Deals has been posted."):"BusinessDetail"==t&&(_siteBuilderSocialMedia.image=i.imageUrl,_siteBuilderSocialMedia.BusinessName=i.BusinessName,_siteBuilderSocialMedia.BusinessUrl=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+i.vagaroUrl.toLowerCase():""),_siteBuilderSocialMedia.msg="Business has been posted."),n=_siteBuilderSocialMedia,"undefined"!=typeof isWindowsApp&&isWindowsApp)try{window.external.notify("promotionsharefacebook|"+_siteBuilderSocialMedia.BusinessUrl+"|"+_siteBuilderSocialMedia.Servicetitle)}catch(e){}else _siteBuilderSocialMedia.CheckFacebookControllRenders(n,t)},_siteBuilderSocialMedia.CheckFacebookControllRenders=function(e,t){if($("#dvFaceBookControl").length>0)e.FacebookLoader(e,t);else{ShowLoader(!0),objReqFacebookData={},objReqFacebookData.UserControlPath="~/UserControls/General/ucFacebookLoader.ascx",objReqFacebookData.PageNamePath="~/Home.aspx",objReqFacebookData.isRemoveFormTag=!0;var i=new vagaro.ajax;i.datamodel.IsNewVagaroAPI=!0,i.datamodel.Token="websiteapi/homepage/loadusercontrol",i.datamodel.data=objReqFacebookData,i.datamodel.callback=function(i){ShowLoader(!1),$("body").append(i),$("#dvFaceBookControl").length>0&&null!=t&&e.FacebookLoader(e,t)},i.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert({message:"An Error Has Occurred",title:"Oops!"})},i.Post()}},_siteBuilderSocialMedia.FacebookLoader=function(e,t){"products"==t?e.LoadProductonFacebook():"inventory"==t?e.LoadInventoryonFacebook():$FacebookLoader(function(){FBAPP.funcPostfeature(unescape(e.BusinessName),e.Spname,e.Address,e.BusinessUrl,e.Servicetitle,e.Styletitle,e.image,t,function(t){null!=t&&null!=t&&null!=t.id&&null!=t.id&&vagaro.alertsmall(e.msg)})})},_siteBuilderSocialMedia.PostOnTwitter=function(e){if(e=unescape(e).replace(/<br *\/?>/gi,"\n"),_siteBuilderSocialMedia.TwitterURL="https://twitter.com/intent/tweet?url="+e,_siteBuilderSocialMedia.TwitterURL=encodeURI(_siteBuilderSocialMedia.TwitterURL),"undefined"!=typeof isWindowsApp&&isWindowsApp)try{window.external.notify("promotionsharetwitter|"+_siteBuilderSocialMedia.TwitterURL)}catch(e){}else _siteBuilderSocialMedia.left=screen.width/2-300,_siteBuilderSocialMedia.top=screen.height/2-160,_siteBuilderSocialMedia.targetWin=window.open(_siteBuilderSocialMedia.TwitterURL,"shareWindow","toolbar=no,location=no,status=no, menubar=no,scrollbars=yes,resizable=no,width=600,height=320,left="+_siteBuilderSocialMedia.left+",top="+_siteBuilderSocialMedia.top),_siteBuilderSocialMedia.targetWin&&!_siteBuilderSocialMedia.targetWin.closed&&void 0!==_siteBuilderSocialMedia.targetWin&&void 0!==_siteBuilderSocialMedia.targetWin.closed||_siteBuilderSocialMedia.alert("Window cannot be opened as popup is blocked in your browser");return!1},_siteBuilderSocialMedia.PostOnPint=function(e){e=(e=unescape(e).replace(/<br *\/?>/gi,"\n")).replace(/#/g,"%23");var t=encodeURIComponent(e);if(_siteBuilderSocialMedia.PinUrl="https://www.pinterest.com/pin/create/button/?url="+t,"undefined"!=typeof isWindowsApp&&isWindowsApp)try{window.external.notify("pinterestpage|"+_siteBuilderSocialMedia.PinUrl)}catch(e){console.error("Error notifying external window:",e)}else _siteBuilderSocialMedia.left=screen.width/2-300,_siteBuilderSocialMedia.top=screen.height/2-140,_siteBuilderSocialMedia.targetWin=window.open(_siteBuilderSocialMedia.PinUrl,"Pinterest","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=280, top="+_siteBuilderSocialMedia.top+", left="+_siteBuilderSocialMedia.left),_siteBuilderSocialMedia.targetWin&&!_siteBuilderSocialMedia.targetWin.closed&&void 0!==_siteBuilderSocialMedia.targetWin&&void 0!==_siteBuilderSocialMedia.targetWin.closed||vagaro.alertsmall("Window cannot be opened as popup is blocked in your browser");return!1},_siteBuilderSocialMedia.MailClick=function(e,t,i,n){if("undefined"==typeof UserID||null==UserID||""==UserID||parseInt(UserID)<=0)return vagaro.alertmidium("Login is required to send message."),!1;$("#divSpEmail").length<=0?_siteBuilderSocialMedia.LoadSocialMediaSendEmail(e,t,i,n):(_siteBuilderSocialMedia.validator=$("#mailValidateSharing").validate(),$("#divSPpopupcontent").find("input:text,textarea").each(function(){$(this).val(""),$(this).removeClass("loginInput errorInput"),$("#"+$(this).attr("id")+"-error").css("display","none")}),"Stylelist"==i?(_siteBuilderSocialMedia.SPblock=$(t).attr("id","divSpEmailBody").css("position","relative").css("top","0px").css("opacity","1").css("left","0").css("height","auto"),scrollPos=_siteBuilderSocialMedia.getscrollTop(ScrollTarget),$("#divSpEmail").modal("show"),$("html, body").addClass("hide-bgscrollappoint"),$("#hdnUrl").val(location.protocol+"//"+location.host+$("#arating",_siteBuilderSocialMedia.SPblock).attr("href")+"/book-now"),$("#lblSMPName").val(e),$("#divtemplate").html(_siteBuilderSocialMedia.SPblock),$("#arating","#divtemplate").remove(),$("#divDistance","#divtemplate").remove(),$(".galler-caption","#divtemplate").remove(),$("#btnsendEmail").attr("onclick","_siteBuilderSocialMedia.SendMail('Stylist')")):"Photos"==i?($("#txtSenderEmailerror").css("display","none"),$("#txtReceiverEmailerror").css("display","none"),_siteBuilderSocialMedia.styleblock=$(t).clone(),_siteBuilderSocialMedia.styleblock.removeClass("gallery-solo-image"),_siteBuilderSocialMedia.styleblock.show(),_siteBuilderSocialMedia.styleblock.attr("class","gallerydetail w-inline-block"),_siteBuilderSocialMedia.styleblock.find("div#imgServiceImage_"+_siteBuilderSocialMedia.styleblock.data().styleid).attr("style",""),_siteBuilderSocialMedia.styleblock.find("div#imgServiceImage_"+_siteBuilderSocialMedia.styleblock.data().styleid).attr("class",""),_siteBuilderSocialMedia.styleblock.find(".more-photos-text").remove(),_siteBuilderSocialMedia.styleblock.find("#imgLike").remove(),_siteBuilderSocialMedia.styleblock.find(".imgstyles1").addClass("gallery-image-alt"),_siteBuilderSocialMedia.styleblock.find("#forMailDescription").show(),_siteBuilderSocialMedia.imgURL=_siteBuilderSocialMedia.styleblock.find(".imgstyles1").attr("data-original"),_siteBuilderSocialMedia.styleblock.find(".imgstyles1").attr("src",_siteBuilderSocialMedia.imgURL),_siteBuilderSocialMedia.styleblock.find(".imgstyles1").show(),$("#imgServiceImage1",_siteBuilderSocialMedia.styleblock).removeAttr("onclick"),$("#imgServiceImage_"+_siteBuilderSocialMedia.styleblock.data().styleid,_siteBuilderSocialMedia.styleblock).removeAttr("onclick"),_siteBuilderSocialMedia.styleblock.attr("id","divSpEmailBody").removeAttr("onmouseleave").css("position","relative").css("top","0px").css("opacity","1").css("left","0").css("height","auto"),$("#divSpEmail").modal("show"),scrollPos=_siteBuilderSocialMedia.getscrollTop(ScrollTarget),$("html, body").addClass("hide-bgscrollappoint"),_siteBuilderSocialMedia.header="<div class='homegallerypopup flamingo-button bottom-radius-none' style='width:"+_siteBuilderSocialMedia.styleblock.css("width")+"'>"+e+"</div>",$("#divtemplate").html(""),$("#divtemplate").append(_siteBuilderSocialMedia.header),$("#divtemplate").append(_siteBuilderSocialMedia.styleblock),$(".gallery-hover-div",$(_siteBuilderSocialMedia.styleblock)).remove(),$("#divtemplate").html($("#divtemplate").html()),$("#btnsendEmail").attr("onclick","_siteBuilderSocialMedia.SendMail('Photos','"+e.toString().replace(/'/g,"\\'")+"');")):"Deals"==i?($("#divSpEmail").modal("show"),scrollPos=_siteBuilderSocialMedia.getscrollTop(ScrollTarget),$("html, body").addClass("hide-bgscrollappoint"),$("#divtemplate").html(""),BusinessName=$("#lblSalonName").text(),_siteBuilderSocialMedia.titletimestamp=$("#hdnScTitletimestamp").val(),_siteBuilderSocialMedia.vagaroURL=$("#hdnScVagarourl").val(),_siteBuilderSocialMedia.promotionTitle=$("#lblPromotionTitleHome").text(),image=$("#imgPromotion").attr("src"),_siteBuilderSocialMedia.promoUrl=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+_siteBuilderSocialMedia.vagaroURL:"")+"/deals/"+_siteBuilderSocialMedia.titletimestamp,_siteBuilderSocialMedia.objPromotionImage=$("#divPromoImage").clone(),$("#divDealSharingMobile",_siteBuilderSocialMedia.objPromotionImage).remove(),_siteBuilderSocialMedia.SPblock=$("<div>",{id:"divSpEmailBody"}).css("position","relative").css("top","0px").css("opacity","1").css("left","0").css("height","auto"),_siteBuilderSocialMedia.SPblock.append('<h1 class="daily-deal-large-header flamingo-background-color"><span id="lblPromotionTitleHome" class="text-capitalize">'+_siteBuilderSocialMedia.promotionTitle+"</span></h1>"),_siteBuilderSocialMedia.SPblock.append('<div class="daily-deal-bus-and-distance-div flamingo-background-color"><div class="bus-name-daily"><span id="lblSalonName">'+BusinessName+"</span></div></div>"),_siteBuilderSocialMedia.SPblock.append('<a class="text-decoration-none" aria-hidden="true" href="'+_siteBuilderSocialMedia.promoUrl+'"><div class="pos-relative">'+_siteBuilderSocialMedia.objPromotionImage.html()+"</div></a>"),$("#divtemplate").append(_siteBuilderSocialMedia.SPblock),$("#btnsendEmail").attr("onclick","_siteBuilderSocialMedia.SendMail('Deals')"),msg="Deals has been posted."):"BusinessDetail"==i&&($("#divSpEmail").modal("show"),scrollPos=_siteBuilderSocialMedia.getscrollTop(ScrollTarget),$("html, body").addClass("hide-bgscrollappoint"),$("#divtemplate").html(""),_siteBuilderSocialMedia.SPblock=$("<div>",{id:"divSpEmailBody"}).css("position","relative").css("top","0px").css("opacity","1").css("left","0").css("height","auto"),_siteBuilderSocialMedia.SPblock.append('<h1 class="daily-deal-large-header"><span id="lblPromotionTitleHome" class="text-capitalize">'+businessName+"</span></h1>"),_siteBuilderSocialMedia.SPblock.append('<a class="text-decoration-none" aria-hidden="true" href="'+vagaroUrl+'"><div class="pos-relative"><img class="lazy daily-detail-banner" src="'+$("#dvBusinessImage").attr("data-original")+'" /></div></a>'),$("#divtemplate").append(_siteBuilderSocialMedia.SPblock),$("#btnsendEmail").attr("onclick","_siteBuilderSocialMedia.SendMail('BusinessDetail')"),_siteBuilderSocialMedia.msg="Business has been posted."))},_siteBuilderSocialMedia.LoadSocialMediaSendEmail=function(e,t,i,n){ShowLoader(!0),objReqSendEmailData={},objReqSendEmailData.UserControlPath="~/UserControls/ucSocialMediaSendEmail.ascx",objReqSendEmailData.PageNamePath="~/Home.aspx",objReqSendEmailData.isRemoveFormTag=!0,objReqSendEmailData.UserControlID="SocialControlStartTag";var o=new vagaro.ajax;o.datamodel.IsNewVagaroAPI=!0,o.datamodel.Token=ApiURLEnumCommon.loadusercontrol,o.datamodel.data=objReqSendEmailData,o.datamodel.callback=function(o){ShowLoader(!1),null!=o&&($("body").append(o),$("#divSpEmail").length>0&&_siteBuilderSocialMedia.MailClick(e,t,i,n))},o.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert({message:"An Error Has Occurred",title:"Oops!"})},o.Post()},_siteBuilderSocialMedia.SendMail=function(e,t){if(_siteBuilderSocialMedia.validate=$("#mailValidateSharing").valid(),1==_siteBuilderSocialMedia.validate){ShowLoader(!0);var i=$("#divtemplate"),n=$("#txtBody",$("#mailValidateSharing")).val(),o=$("#txtSenderName",$("#mailValidateSharing")).val(),a=$("#txtSenderEmail",$("#mailValidateSharing")).val(),s=$("#txtReceiverName",$("#mailValidateSharing")).val(),r=$("#txtReceiverEmail",$("#mailValidateSharing")).val(),l=$("#txtSubject",$("#mailValidateSharing")).val(),c=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,10}(?:\.[a-z]{2})?)$/i,d=!1;if(c.test(r)?$("#txtReceiverEmailerror").css("display","none"):($("#txtReceiverEmailerror").css("display","block"),$("#txtReceiverEmailerror").text("invalid email address"),ShowLoader(!1),d=!0),c.test(a)?$("#txtSenderEmailerror").css("display","none"):($("#txtSenderEmailerror").css("display","block"),$("#txtSenderEmailerror").text("invalid email address"),ShowLoader(!1),d=!0),1!=d){var u,p,h,m,g,v,f="",C="",S="",y=0,b=!0,k="",_="",D="",I=_siteBuilderSocialMedia.businessID;if("Stylist"==e)u=$("#imgServiceProvider",i).attr("src"),p=$("#spnProviderName",i).html(),h=$("#spnAddress",i).html(),m=$("#hdnUrl").val(),g="VagaroUser","none"===$("#btnsave",i).css("display")&&(b=!1);else if("Photos"==e){f=$("#divSpEmailBody").data();u=$("#imgServiceImage_"+f.styleid,i).attr("src"),S=$("#divSalonName_"+f.styleid,i).html(),h=$("#divAddress_"+f.styleid,i).html(),g="Portfolio Sharing",y=$("#hdnLikeCount_"+f.styleid,i).val(),null!=(k="true"==f.isonlineservice.toString().toLowerCase()&&"true"==f.isshowpriceonline.toString().toLowerCase()?f.price.toString():"")&&null!=k&&k.length>0&&(k=("Detail"==BasePage?_shopdetail.currencySymbol:currencysymbol)+k),v="true"==f.isonlineservice.toString().toLowerCase()?f.servicetitle+" "+k:"",C=t,m=IsVagaroDomain()?"/"+f.vagarourl:""}else if("Deals"==e){f=$("#divSpEmailBody").data();u=$("#imgPromotion",i).attr("src"),S=$("#lblSalonName",i).html(),g="Deals Sharing";var w=$("#hdnOldPriceEmail").val();null!=w&&null!=w&&w.length>0&&(_=w),D=$("#hdnPriceEmail").val(),C=$("#lblPromotionTitleHome",i).html(),h=$("#hdnAddress").val(),v=$("#lblmile").html(),m=(IsVagaroDomain()?"/"+$("#hdnScVagarourl").val():"")+"/deals/"+$("#hdnScTitletimestamp").val()}else"BusinessDetail"==e&&(S=businessName,u=$("#dvBusinessImage").attr("data-original"),g="Business Sharing",h="undefined"!=typeof businessAddress?_siteBuilderSocialMedia.htmlDecode(businessAddress):"",m=IsVagaroDomain()?"/"+("undefined"!=typeof vagaroUrl?vagaroUrl:""):"");$("#btnsendEmail","#divSpEmail").attr("disabled",!0);var P={};P.ReceiverName=s,P.SenderName=o,P.Mailto=r,P.Mailfrom=a,P.Subject=l,P.Body=n,P.Image=u,P.SpName=p,P.StyleTitle=C,P.SpAddress=h,P.BusinessUrl=m,P.BusinessName=S,P.MailHeader=g,P.service=v,P.callFrom=e,P.UserLikeCount=y,P.isShowBook=b,P.businessPrice="",P.promotionBeforePrice=_,P.promotionAfterPrice=D,P.UserPhoto="",P.UserCDNUrl="",P.UserName="",P.businessID=I,P.loginUserID=UserID,vagaro.ajaxCall(ApiURLEnumSocialMedia.sharesporstyle,P,_siteBuilderSocialMedia.vgSpEmail_Success,_siteBuilderSocialMedia.vgSpEmail_CallFailed,!1,!0)}}},_siteBuilderSocialMedia.vgSpEmail_Success=function(e){null!=e&&vagaro.alertsmall({message:"Your email sent successfully.",title:"Alert",callback:function(){$("#divSpEmail").modal("hide"),$("html, body").removeClass("hide-bgscrollappoint"),iosDevices&&$("html, body").scrollTop(scrollPos),$("#btnsendEmail","#divSpEmail").attr("disabled",!1)}}),ShowLoader(!1)},_siteBuilderSocialMedia.vgSpEmail_CallFailed=function(e){$("#divSpEmail").modal("hide"),$("html, body").removeClass("hide-bgscrollappoint"),iosDevices&&$("html, body").scrollTop(scrollPos),$("#btnsendEmail","#divSpEmail").attr("disabled",!1),ShowLoader(!1)},_siteBuilderSocialMedia.showHideSharingOptions=function(e){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){_siteBuilderSocialMedia.businessUrl=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+vagaroUrl:"");var t="Check out this business on Vagaro: "+htmlDecode(businessName);void 0!==e&&null!=e?(_siteBuilderSocialMedia.position=e.getBoundingClientRect(),CallbackforMobileApp(0,0,"","","0",'18|~|{\\"message\\": \\"'+t.replace(/"/g,'\\"')+'\\", \\"url\\": \\"'+_siteBuilderSocialMedia.businessUrl+'\\", \\"screenX\\": \\"'+_siteBuilderSocialMedia.position.left+'\\", \\"screenY\\": \\"'+_siteBuilderSocialMedia.position.top+'\\"}')):CallbackforMobileApp(0,0,"","","0",'18|~|{\\"message\\": \\"'+t.replace(/"/g,'\\"')+'\\", \\"url\\": \\"'+_siteBuilderSocialMedia.businessUrl+'\\"}')}else $(".mobile-share-model").is(":visible")?$("#mobile-check").is(":visible")?$(".mobile-share-model").fadeOut():$(".mobile-share-model").slideUp():$("#mobile-check").is(":visible")?$(".mobile-share-model").fadeIn():$(".mobile-share-model").slideDown();event.stopPropagation(),event.preventDefault()},_siteBuilderSocialMedia.showHidedealSharingOptions=function(e){if("undefined"!=typeof vgAppicationType&&1==vgAppicationType){var t=$("#hdnScTitletimestamp").val(),i=$("#hdnScVagarourl").val(),n=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+i:"")+"/deals/"+t,o="Check out this deal on Vagaro to for this business: "+htmlDecode(businessName)+"<br />"+promotionTitle;if(void 0!==e&&null!=e){var a=e.getBoundingClientRect();CallbackforMobileApp(0,0,"","","0",'18|~|{\\"message\\": \\"'+o.replace(/"/g,'\\"')+'\\", \\"url\\": \\"'+n+'\\", \\"screenX\\": \\"'+a.left+'\\", \\"screenY\\": \\"'+a.top+'\\"}')}else CallbackforMobileApp(0,0,"","","0",'18|~|{\\"message\\": \\"'+o.replace(/"/g,'\\"')+'\\", \\"url\\": \\"'+n+'\\"}')}else{var s=$("#dvDailyDealsDetail");$("#pageSection").is(":visible")&&(s=$("#pageSection")),$("#mobile-check").is(":visible")?$("#divSharingOptionsMobile",s).is(":visible")?$("#divSharingOptionsMobile",s).fadeOut():$("#divSharingOptionsMobile",s).fadeIn():$("#divSharingOptions",s).is(":visible")?$("#divSharingOptions",s).slideUp():$("#divSharingOptions",s).slideDown()}event.stopPropagation(),event.preventDefault()},_siteBuilderSocialMedia.fetchStylistName=function(e,t){if(_siteBuilderSocialMedia.curDivBlock=e,_siteBuilderSocialMedia.vagaroURL=escape(location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.VagaroURL.toLowerCase():"")+"/styles"),""==_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.StylistName||null==_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.StylistName||null==_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.StylistName){var i={};i.StyleID=_siteBuilderSocialMedia.curDivBlock.data().styleid;var n=new vagaro.ajax;n.datamodel.Token=ApiURLEnumSocialMedia.getstyleimagecommaseparated,n.datamodel.data=i,n.datamodel.IsNewVagaroAPI=!0,n.datamodel.callback=function(e){_siteBuilderSocialMedia.fetchStylistName_Success(e,t)},n.datamodel.Error=_siteBuilderSocialMedia.fetchStylistName_CallFailed,n.Post()}else _siteBuilderSocialMedia.curDivBlock.hasClass("active")?(_siteBuilderSocialMedia.curDivBlock.find(".share-popup").hide(),_siteBuilderSocialMedia.curDivBlock.removeClass("active")):(_siteBuilderSocialMedia.curDivBlock.addClass("active"),$(".share-popup").hide(),_siteBuilderSocialMedia.curDivBlock.find(".share-popup").show()),_siteBuilderSocialMedia.curDivBlock.find(".facebook").unbind(),_siteBuilderSocialMedia.curDivBlock.find(".twitter").unbind(),_siteBuilderSocialMedia.curDivBlock.find(".pinterest").unbind(),_siteBuilderSocialMedia.curDivBlock.find(".email-share-div").unbind(),_siteBuilderSocialMedia.TwitterURL=_siteBuilderSocialMedia.vagaroURL+"&text=Check out what I found @"+unescape(escape(_siteBuilderSocialMedia.curDivBlock.data().businessname))+" - "+_siteBuilderSocialMedia.curDivBlock.data().stylistname+"&related=vagaro",_siteBuilderSocialMedia.curDivBlock.find(".twitter").click(function(){_siteBuilderSocialMedia.PostOnTwitter(_siteBuilderSocialMedia.TwitterURL)}),_siteBuilderSocialMedia.curDivBlock.find(".facebook").click(function(){_siteBuilderSocialMedia.PostonFacebook(t,"Photos")}),_siteBuilderSocialMedia.PinUrl=_siteBuilderSocialMedia.vagaroURL+"&text="+unescape(_siteBuilderSocialMedia.curDivBlock.data().businessname)+" - "+_siteBuilderSocialMedia.curDivBlock.data().styletitle+"&media="+_siteBuilderSocialMedia.curDivBlock.data().image+"&description="+_siteBuilderSocialMedia.curDivBlock.data().servicetitle+_siteBuilderSocialMedia.curDivBlock.data().styledesc,_siteBuilderSocialMedia.curDivBlock.find(".pinterest").click(function(){_siteBuilderSocialMedia.PostOnPint(_siteBuilderSocialMedia.PinUrl)}),_siteBuilderSocialMedia.curDivBlock.find(".email-share-div").click(function(){_siteBuilderSocialMedia.MailClick(_siteBuilderSocialMedia.curDivBlock.data().styletitle,_siteBuilderSocialMedia.curDivBlock,"Photos")})},_siteBuilderSocialMedia.fetchStylistName_Success=function(e,t){$("#divGalleryImageLoader").hide(),null!=e&&null!=e&&(_siteBuilderSocialMedia.curDivBlock.data().stylistname=e.split("|##|")[1],_siteBuilderSocialMedia.curDivBlock.hasClass("active")?(_siteBuilderSocialMedia.curDivBlock.find(".share-popup").hide(),_siteBuilderSocialMedia.curDivBlock.removeClass("active")):(_siteBuilderSocialMedia.curDivBlock.addClass("active"),$(".share-popup").hide(),_siteBuilderSocialMedia.curDivBlock.find(".share-popup").show(),_siteBuilderSocialMedia.curDivBlock.find(".facebook").unbind(),_siteBuilderSocialMedia.curDivBlock.find(".twitter").unbind(),_siteBuilderSocialMedia.curDivBlock.find(".pinterest").unbind(),_siteBuilderSocialMedia.curDivBlock.find(".email-share-div").unbind(),_siteBuilderSocialMedia.TwitterURL=_siteBuilderSocialMedia.vagaroURL+"&text=Check out what I found @"+unescape(escape(_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.BusinessName))+" - "+_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.StylistName+"&related=vagaro",_siteBuilderSocialMedia.curDivBlock.find(".twitter").click(function(){_siteBuilderSocialMedia.PostOnTwitter(_siteBuilderSocialMedia.TwitterURL)}),_siteBuilderSocialMedia.curDivBlock.find(".facebook").click(function(){_siteBuilderSocialMedia.PostonFacebook(t,"Photos")}),_siteBuilderSocialMedia.PinUrl=_siteBuilderSocialMedia.vagaroURL+"&text="+unescape(_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.BusinessName)+" - "+_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.StyleTitle+"&media="+_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.DefaultStyleImagePath+"&description="+_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.ServiceTitle+_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.StyleDesc,_siteBuilderSocialMedia.curDivBlock.find(".pinterest").click(function(){_siteBuilderSocialMedia.PostOnPint(_siteBuilderSocialMedia.PinUrl)}),_siteBuilderSocialMedia.curDivBlock.find(".email-share-div").click(function(){_siteBuilderSocialMedia.MailClick(_siteBuilderSocialMedia.curDivBlock.data().tmplItem.data.StyleTitle,_siteBuilderSocialMedia.curDivBlock,"Photos")})))},_siteBuilderSocialMedia.fetchStylistName_CallFailed=function(e){$("#divGalleryImageLoader").hide()},_siteBuilderSocialMedia.ShowHideSocialIcons=function(e){$(e).parent().parent().parent().find(".share-popup").toggleClass("show"),_siteBuilderSocialMedia.curDivBlock=$(e).parent().parent().parent().closest(".gallery-solo-image"),_siteBuilderSocialMedia.fetchStylistName(_siteBuilderSocialMedia.curDivBlock,e)},_siteBuilderSocialMedia.OpenPin=function(){var e=$(".description").text(),t=screen.width/2-300,i=screen.height/2-140;void 0!==_shopdetail.vagaroUrl&&null!=_shopdetail.vagaroUrl&&""!=_shopdetail.vagaroUrl&&(_shopdetail.vagaroUrl=_shopdetail.vagaroUrl.toLowerCase());var n=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+_shopdetail.vagaroUrl:"");"true"==_shopdetail.isCustomWebsite.toString().toLowerCase()&&(n+="/products");var o="http://www.pinterest.com/pin/create/button/?url="+n+"&text="+$("#lblBrandName").html()+" - "+$(".clsproductname").text()+"&media="+$("#hdndefaultimg").val()+"&description="+e,a=window.open(o,"Pintrest","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=280, top="+i+", left="+t);a&&!a.closed&&void 0!==a&&void 0!==a.closed||vagaro.alertsmall("Window cannot be opened as popup is blocked in your browser")},_siteBuilderSocialMedia.OpenTwitter=function(){void 0!==_shopdetail.vagaroUrl&&null!=_shopdetail.vagaroUrl&&""!=_shopdetail.vagaroUrl&&(_shopdetail.vagaroUrl=_shopdetail.vagaroUrl.toLowerCase());var e=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+_shopdetail.vagaroUrl:"");"true"==_shopdetail.isCustomWebsite.toString().toLowerCase()&&(e+="/products");var t="https://twitter.com/intent/tweet?url="+e+"&text=Check out what I found @"+_shopdetail.businessName;$("#lblBrandName").html(),$(".clsproductname").text(),t=encodeURI(t);var i=screen.width/2-300,n=screen.height/2-160,o=window.open(t,"shareWindow","toolbar=no,location=no,status=no, menubar=no,scrollbars=yes,resizable=no,width=600,height=320,left="+i+",top="+n);o&&!o.closed&&void 0!==o&&void 0!==o.closed||vagaro.alertsmall("Window cannot be opened as popup is blocked in your browser")},_siteBuilderSocialMedia.OpenPostonFacebook=function(){$("#dvFaceBookControl").length>0?_siteBuilderSocialMedia.LoadProductonFacebook():_siteBuilderSocialMedia.CheckFacebookControllRenders(_siteBuilderSocialMedia,"products")},_siteBuilderSocialMedia.LoadProductonFacebook=function(){$FacebookLoader(function(){var e=_shopdetail.businessName,t=$("#lblBrandName").html()+" - "+$(".clsproductname").text(),i=$(".description").text(),n=$("#hdndefaultimg").val();void 0!==_shopdetail.vagaroUrl&&null!=_shopdetail.vagaroUrl&&""!=_shopdetail.vagaroUrl&&(_shopdetail.vagaroUrl=_shopdetail.vagaroUrl.toLowerCase());var o=location.protocol+"//"+location.host+(IsVagaroDomain()?"/"+_shopdetail.vagaroUrl:"");"true"==_shopdetail.isCustomWebsite.toString().toLowerCase()&&(o+="/products"),$("#divShoppingcartpopup").modal("hide"),FBAPP.funcPostProduct(e,t,i,n,o,function(e){"connected"==FBAPI.status&&vagaro.alertsmall("Product details have been post.")})})},_siteBuilderSocialMedia.LoadInventoryonFacebook=function(){"undefined"!=typeof _siteBuilderDetail&&void 0!==_siteBuilderDetail.variantForCheckout&&null!=_siteBuilderDetail.variantForCheckout&&$FacebookLoader(function(){var e=_shopdetail.businessName,t=_siteBuilderDetail.customersProductDetailsCache.inventory.brand+" - "+_siteBuilderDetail.customersProductDetailsCache.inventory.productName,i=_siteBuilderDetail.customersProductDetailsCache.inventory.description,n=_siteBuilderDetail.customersProductDetailsCache.inventory.defaultImage;void 0!==_shopdetail.vagaroUrl&&null!=_shopdetail.vagaroUrl&&""!=_shopdetail.vagaroUrl&&(_shopdetail.vagaroUrl=_shopdetail.vagaroUrl.toLowerCase());var o=_siteBuilderDetail.customersProductDetailsCache.inventory.productURL;FBAPP.funcPostProduct(e,t,i,n,o,function(e){"connected"==FBAPI.status&&vagaro.alertsmall("Product details have been post.")})})},_siteBuilderSocialMedia.InventoryOpenPin=function(){var e=_siteBuilderDetail.customersProductDetailsCache.inventory.description,t=screen.width/2-300,i=screen.height/2-140,n="http://www.pinterest.com/pin/create/button/?url="+_siteBuilderDetail.customersProductDetailsCache.inventory.productURL+"&text="+_siteBuilderDetail.customersProductDetailsCache.inventory.brand+" - "+_siteBuilderDetail.customersProductDetailsCache.inventory.productName+"&media="+_siteBuilderDetail.customersProductDetailsCache.inventory.defaultImage+"&description="+e,o=window.open(n,"Pintrest","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=600, height=280, top="+i+", left="+t);o&&!o.closed&&void 0!==o&&void 0!==o.closed||vagaro.alertsmall("Window cannot be opened as popup is blocked in your browser")},_siteBuilderSocialMedia.InventoryOpenTwitter=function(){var e="https://twitter.com/intent/tweet?url="+_siteBuilderDetail.customersProductDetailsCache.inventory.productURL+"&text=Check out what I found @"+_shopdetail.businessName;$("#lblBrandName").html(),$(".clsproductname").text(),e=encodeURI(e);var t=screen.width/2-300,i=screen.height/2-160,n=window.open(e,"shareWindow","toolbar=no,location=no,status=no, menubar=no,scrollbars=yes,resizable=no,width=600,height=320,left="+t+",top="+i);n&&!n.closed&&void 0!==n&&void 0!==n.closed||vagaro.alertsmall("Window cannot be opened as popup is blocked in your browser")};var NoOfLoginAttempt=0,NoOfLoginAttemptemail=0,fpDeviceId="",PageType="",isWindowsPhone=navigator.userAgent.match(/windows phone/i)||!1,AndroidMobile=null!=navigator.userAgent.match(/Android/i)&&null!=navigator.userAgent.match(/Mobile/i)&&null==navigator.userAgent.match(/Windows/i),isiPhone=null!=navigator.userAgent.match(/iphone/i);_twoFactor={isMobileDevice:0==(/iPad/.test(navigator.userAgent)&&!window.MSStream)&&(isiPhone||isWindowsPhone||AndroidMobile),WillDoLater:"I’ll do this later",Model:{isFromInvalidEmailCell:!1,DialingCode:""},PageType:{BusinessSignup:"BusinessSignup",ProfilePage:"ProfilePage",CustomerSignup:"CustomerSignup",CustomerSignIn:"CustomerSignIn",MultiLocation:"MultiLocation",PaymentMethods:"PaymentMethods",CovidClean:"CovidClean",ShoppingBag:"ShoppingBag"},ApiURLEnum:{TwoFactorAuthenticationCustomer:"websiteapi/homepage/twofactorauthenticationcustomer",AddBusinessTwoFactorAuthentication:"addbusiness/twofactorauthentication",SaveFilterrequestForCardValidate:"websiteapi/homepage/savefilterrequestforcardvalidate",GetLogDataonBackClick:"addbusiness/getlogdataonbackclick"},AuthCodeReceiveMode:{Email:1,Cell:2,EmailAndCell:3},EmailAndCell2FScreen:{None:0,EmailOrPhone:1,EmailAndPhone:2,EmailOrPhoneNew:3},VarificationType:{None:0,Email:1,Cell:2,EmailAndCell:3,EmailOrPhone:4},ScreenType:{EmailInput:1,EmailVerify:2,EmailInput:3,EmailVerify:4,SuccessScreen:5},ValidationMessages:{FailedErrorMessage:"Something went wrong, please try again.",FailedUserSaveMsg:"User detail not saved",InvalidEmailIdMsg:"Email address is invalid. Please enter valid email address."},SuccessMessage:{EmailVerified:"Email verified",PhoneVerified:"Mobile number verified",ResendCode:"New verification code sent."},AmplitudeEvent:{SignupEmailVerificationTriggered:53,SignupPhoneVerificationTriggered:54,SignupStep1Completed:55,SignupVerificationTriggered:106},FailOTPMessage:function(e,t=!1){if(t)return void 0!==e&&null!=e&&""!=e?"Please contact support at "+e+" or support@vagaro.com.":"Please contact support at support@vagaro.com.";var i='<a href="mailto:support@vagaro.com" class="questions link" style="font-size:14px"> support@vagaro.com</a>';return void 0!==e&&null!=e&&""!=e?'Please contact support at <a href="tel:'+e+'" class="questions link" style="font-size:14px">'+e+"</a> or "+i+".":"Please contact support at "+i+"."},LoadTwoFactorControlForInput:function(e){PageType=currentPage;var t={UserControlPath:"~/UserControls/ucTwoFactor.ascx",PageNamePath:"~/detail1.aspx",isRemoveFormTag:!0,Parameters:{}},i=new vagaro.ajax;i.datamodel.Token="websiteapi/homepage/loadusercontrol",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(t){if($("#dvtwostepemailcodeinfo").html(""),$("#dvtwostepemailcodeinfo").append(t),void 0!==getCookie&&void 0!==ProximityCookieName&&null!=typeof ProximityCookieName&&""!=typeof ProximityCookieName&&(cookie=getCookie(ProximityCookieName)),twoFactorCellPhone=$("#txtCellInputCode").PhonePlugin({UserRole:"1"==e.UserType?2:1,IsPhoneNoRequire:!0,ControlText:"Mobile Phone",CountryId:parseInt(e.CountryID),CurrentLocationCountryID:"undefined"!=typeof cookie&&null!=cookie?parseInt(cookie.countryid):1}),_twoFactor.isMobileDevice?$("input[type=tel]").attr("autocomplete","one-time-code"):$("input[type=tel]").attr("autocomplete","off"),currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag)$("#divtwofactorauthentication .modal-window").addClass("myaccount-popup");else if(currentPage==_twoFactor.PageType.BusinessSignup){var i=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase();(null!=i&&/com.vagaro.iospro/i.test(i)||/com.vagaro.androidpro/i.test(i))&&$(".previous-btn").hide()}else $("#divtwofactorauthentication .modal-window").removeClass("myaccount-popup");e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email||e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.EmailAndCell?_twoFactor.AppendEmailInputScreen(e):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell&&_twoFactor.AppendCellInputScreen(e)},i.datamodel.data=t,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post()},SendTowFactorAuthenticationCode:function(e){PageType=currentPage;var t={UserControlPath:"~/UserControls/ucTwoFactor.ascx",PageNamePath:"~/detail1.aspx",isRemoveFormTag:!0,Parameters:{}},i=new vagaro.ajax;i.datamodel.Token="websiteapi/homepage/loadusercontrol",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(t){try{if(currentPage==_twoFactor.PageType.BusinessSignup){vm.CurrentstepsCompleted=_twoFactor.AmplitudeEvent.SignupVerificationTriggered;var i={},n=JSON.parse(localStorage.getItem("BusinessSignupStep1Data"));if(i.FirstName=n.firstName,i.LastName=n.lastName,i.UserId=n.userId,i.Email=n.email,i.Step=_twoFactor.AmplitudeEvent.SignupVerificationTriggered,i.BusinessName=n.businessname,i.UserName=localStorage.getItem("eventusername"),i.PageURL=window.location.href,i.PromoCode=n.promotioncode,i.Address1=n.businessaddress+","+n.city+","+n.statename+","+n.businesszip,i.Address2=n.suit,i.Phone=n.phone,i.BusinessPhone=n.OwnerPhone,i.SignupType=n.userType,i.HearAboutVagaro=n.aboutyou,i.Licence=localStorage.getItem("NoOfLicences"),i.City=n.city,i.State=n.statename,i.Country=n.Country,"0"==n.IsMobileServiceMandatory?i.MobileService="PhysicalLocation":"1"==n.IsMobileServiceMandatory?i.MobileService="MobileBusiness":i.MobileService="Both",i.UserAgent=null!=navigator.userAgent.toLowerCase()?navigator.userAgent.toLowerCase():"","undefined"!=typeof amplitude)i.AmplitudeDeviceId=amplitude.getInstance().getDeviceId();else try{i.AmplitudeDeviceId=vm.GetAmplitudeDeviceId()}catch(e){i.AmplitudeDeviceId=""}var o={};o.AddLogInAmplitude=i,vm.AjaxOld("AddLogInAmplitudeV2",o,vm.AddLogInAmplitudeSuccess,vm.AddLogInAmplitudeSuccessFail)}}catch(e){console.log(e)}if($("#dvtwostepemailcodeinfo").html(""),$("#dvtwostepemailcodeinfo").append(t),void 0!==getCookie&&void 0!==ProximityCookieName&&null!=typeof ProximityCookieName&&""!=typeof ProximityCookieName&&(cookie=getCookie(ProximityCookieName)),twoFactorCellPhone=$("#txtCellInputCode").PhonePlugin({UserRole:1,IsPhoneNoRequire:!0,ControlText:"Mobile Phone",CountryId:parseInt(e.CountryID),CurrentLocationCountryID:parseInt(e.CountryID)}),_twoFactor.isMobileDevice?$("input[type=tel]").attr("autocomplete","one-time-code"):$("input[type=tel]").attr("autocomplete","off"),currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag)$("#divtwofactorauthentication").removeAttr("style");else if(currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignup){if(currentPage==_twoFactor.PageType.CustomerSignup&&$(".signup-loader-height").length>0){var a=e.authenticationMode==_twoFactor.AuthCodeReceiveMode.Cell?"phone":"email";$(".signup-loader-height").addClass(a)}currentPage==_twoFactor.PageType.CustomerSignup&&(_twoFactor.isMobileDevice&&$("#btnCreateAccount",parent.document).hide(),$("#iFrameSignUp",parent.document).parents().find("body").removeClass("signupiframe"));var s=(navigator.userAgent||navigator.vendor||window.opera).toLowerCase();(null!=s&&/customerios/i.test(s)||/customerandroid amazon/i.test(s)||/customerandroid/i.test(s)||/com.vagaro.iospro/i.test(s)||/com.vagaro.androidpro/i.test(s))&&$(".previous-btn").hide()}else $("#divtwofactorauthentication .modal-window").removeClass("myaccount-popup");_twoFactor.SendTwoFactorCode(e)},i.datamodel.data=t,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post()},SendTwoFactorCode:function(e){if(e.isFromCookieLessWidget=_twoFactor.IsFromCookieLessWidget(),currentPage==_twoFactor.PageType.BusinessSignup&&$("#AuthEmailNextbtn").length>0&&$("#AuthEmailNextbtn").addClass("flamingo-button").text("Next"),currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignIn||currentPage==_twoFactor.PageType.CustomerSignup||currentPage==_twoFactor.PageType.MultiLocation){var t=new vagaro.ajax;e.EmailCellAppSetting=$("#hdnEmailAndCell2FScreen").val(),e.IsTwoFactorSignupLoadData=currentPage==_twoFactor.PageType.BusinessSignup,currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignup||currentPage==_twoFactor.PageType.MultiLocation?t.datamodel.Token=_twoFactor.ApiURLEnum.AddBusinessTwoFactorAuthentication:(currentPage==_twoFactor.PageType.CustomerSignIn&&$("#hdnUserType").length>0&&(e.UserType=$("#hdnUserType").val()),t.datamodel.Token=_twoFactor.ApiURLEnum.TwoFactorAuthenticationCustomer),t.datamodel.IsNewVagaroAPI=!0,t.datamodel.callback=function(t){if(void 0!==t&&null!=t)if(t.IsAlreadyVarified&&currentPage!=_twoFactor.PageType.CustomerSignup)currentPage==_twoFactor.PageType.BusinessSignup?(ShowLoader(!1),vm.SkipTwoFactorStep()):currentPage==_twoFactor.PageType.CustomerSignIn&&(ShowLoadingPanelLogin(!1),isNullOrUndefineOrBlank(SkipTwoFactoFromSignIn)||SkipTwoFactoFromSignIn());else{if(NoOfLoginAttempt=t.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=t.TwoFactorRequest,currentPage==_twoFactor.PageType.CustomerSignup?t.formattedPhone=$.trim($("#txtCell").val()):currentPage==_twoFactor.PageType.BusinessSignup?t.formattedPhone=$.trim($("#txtOwnerPhone").val()):currentPage==_twoFactor.PageType.CustomerSignIn?t.formattedPhone=$.trim($("#txtCellInputCode").val()):currentPage==_twoFactor.PageType.MultiLocation&&(t.formattedPhone=$.trim($("#txtTelephone").val())),t.IsSucess)void 0!==t.WidgetUserID&&null!=t.WidgetUserID&&""!=t.WidgetUserID&&(widgetcookievalue=t.WidgetUserID),e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.AppendEmailScreen(t):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell?_twoFactor.AppendCellScreen(t):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.EmailAndCell&&_twoFactor.AppendEmailScreen(t);else if(currentPage==_twoFactor.PageType.BusinessSignup)if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){var i={};isNullOrUndefineOrBlank(fpDeviceId)||(i.UserAgent=navigator.userAgent,i.VisitorID=fpDeviceId),i.UserName=$("#txtEmail").val(),i.UserEmail=$("#txtEmail").val(),i.State=vm.addressData.state,i.City=vm.addressData.city,i.Country=$("#ddlcountry").val(),i.NoofAttempt=vm.NoOfLoginAttemptemail,i.IP=$("#hdnIPAddress").val(),i.DeviceFullName=vm.deviceFrom;var n=$("#txtOwnerPhone").val().replace(/([()-\s])+/g,"");2==i.Country&&0==n[0]?i.OwnersPhone=n.substring(1):i.OwnersPhone=n,i.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),i.IsBlock=1,_twoFactor.SaveFilterRequestForCardValidate(i),_twoFactor.showErrorDiv(e.AuthenticationMode,!0),vm.resetTimer=!1}else{var o=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/signup-1";window.setTimeout(function(){window.location.href=o},4300)}else if(currentPage==_twoFactor.PageType.CustomerSignup)if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){$("#hdnIsBlocked").val(1),IsBlocked=!0,_twoFactor.showErrorDiv(twoStepEmail.AuthenticationMode),i={},isNullOrUndefineOrBlank(fpDeviceId)?isNullOrUndefineOrBlank($("#fpId").val())||(i.UserAgent=navigator.userAgent,i.VisitorID=$("#fpId").val()):(i.UserAgent=navigator.userAgent,i.VisitorID=fpDeviceId),i.UserName=$("#txtEmail").val(),i.UserEmail=$("#txtEmail").val(),i.Country=$("#divCountryCode").attr("data-countryid"),i.NoofAttempt=NoOfLoginAttemptemail,i.IP=$("#hdnIPAddress").val(),i.DeviceFullName="";var a=$("#txtCell").val().replace(/([()-\s])+/g,"");2==i.Country&&0==a[0]?i.OwnersPhone=a.substring(1):i.OwnersPhone=a,i.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),i.IsBlock=1,_twoFactor.SaveFilterRequestForCardValidate(i),isResetTimer=!1}else window.setTimeout(function(){$("#divAuth").hide(),$("#pnlSignup").show(),$("#iFrameSignUp",parent.document).parents().find("#signupheaderpart").show()},4300);else if(currentPage==_twoFactor.PageType.CustomerSignIn)if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){$("#hdnIsBlocked").val(1),IsBlocked=!0,_twoFactor.showErrorDiv(twoStepEmail.AuthenticationMode),i={},isNullOrUndefineOrBlank(fpDeviceId)?isNullOrUndefineOrBlank($("#fpId").val())||(i.UserAgent=navigator.userAgent,i.VisitorID=$("#fpId").val()):(i.UserAgent=navigator.userAgent,i.VisitorID=fpDeviceId),i.UserName=isNullOrUndefineOrBlank(userccattemptdata.EmailId)?$.trim($("#txtEmailInputCode").val()):$.trim(userccattemptdata.EmailId),i.UserEmail=isNullOrUndefineOrBlank(userccattemptdata.EmailId)?$.trim($("#txtEmailInputCode").val()):$.trim(userccattemptdata.EmailId),i.Country="5"==$("#selectedCountrydiv").attr("data-countryid")?"2":$("#selectedCountrydiv").attr("data-countryid"),i.NoofAttempt=NoOfLoginAttemptemail,i.IP=$("#hdnIPAddress").val(),i.DeviceFullName="";var s=isNullOrUndefineOrBlank(userccattemptdata.PhoneNo)?$("#txtCellInputCode").val().replace(/([()-\s])+/g,""):$.trim(userccattemptdata.PhoneNo);2==i.Country&&0==s[0]?i.OwnersPhone=s.substring(1):i.OwnersPhone=s,i.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),i.IsBlock=1,_twoFactor.SaveFilterRequestForCardValidate(i),isResetTimer=!1}else window.setTimeout(function(){},4300);currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.MultiLocation?ShowLoader(!1):ShowLoadingPanelLogin(!1)}else currentPage==_twoFactor.PageType.BusinessSignup?ShowLoader(!1):ShowLoadingPanelLogin(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},t.datamodel.data=e,t.datamodel.Error=function(){currentPage==_twoFactor.PageType.MultiLocation&&ShowLoader(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},t.Post()}else currentPage!=_twoFactor.PageType.ProfilePage&&currentPage!=_twoFactor.PageType.CovidClean&&currentPage!=_twoFactor.PageType.ShoppingBag||($("#hdnUserType").length>0&&(e.UserType=$("#hdnUserType").val()),e.EmailCellAppSetting=currentPage!=_twoFactor.PageType.ProfilePage||"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType?$("#hdnEmailAndCell2FScreenVPL").val():$("#hdnEmailAndCell2FScreen").val(),(t=new vagaro.ajax).datamodel.Token=currentPage==_twoFactor.PageType.ProfilePage?ApiURLEnumMyAccount.TwoFactorAuthenticationCustomer:_twoFactor.ApiURLEnum.TwoFactorAuthenticationCustomer,t.datamodel.IsNewVagaroAPI=!0,t.datamodel.callback=function(t){if(void 0!==t&&null!=t)if(t.IsAlreadyVarified)currentPage==_twoFactor.PageType.ProfilePage?"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?_myAccount.SaveVPLUSerDetailProfile():_myAccount.SaveProfile():currentPage==_twoFactor.PageType.CovidClean?_vgCovidCleanCheckout.SaveVPLUSerDetailProfile():currentPage==_twoFactor.PageType.ShoppingBag&&_onlineCheckout.SaveVPLUSerDetailProfile();else{if(NoOfLoginAttempt=t.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=t.TwoFactorRequest,currentPage==_twoFactor.PageType.ProfilePage?t.formattedPhone=MyAccountMobilePhone.getphoneformat(t.cellDisplay,e.CountryID):t.formattedPhone=$.trim($("#txtCell").val()),t.IsSucess)$("#divtwofactorauthentication").modal("show"),$("#divtwofactorauthentication .modal-backdrop").css("pointer-events","none"),$("#AuthCellBackbtn").text("Close"),$("#AutCellhBackbtn").text("Close"),$("#closed").show(),$("#divtwofactorauthentication").addClass("mobile-popup-myaccount"),$("#mobile-popup-myaccount-inner").addClass("mobile-popup-myaccount-inner"),$("#divModalWindow").addClass("myaccount-popup"),e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.AppendEmailScreen(t):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell?_twoFactor.AppendCellScreen(t):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.EmailAndCell&&_twoFactor.AppendEmailScreen(t);else{if($("#divtwofactorauthentication").modal("show"),NoOfLoginAttempt>=$("#hdnFraudNoOfAttemptCustomer").val()){var i={};isNullOrUndefineOrBlank(fpDeviceId)||(i.UserAgent=navigator.userAgent,i.VisitorID=fpDeviceId),i.UserName=$("#txtEmail").val(),i.UserEmail=$("#txtEmail").val(),i.State=$("#txtState").val(),i.City=$("#txtCity").val(),i.Country=$("#ddlcountry").val(),i.NoofAttempt=NoOfLoginAttemptemail,i.IP=$("#hdnIPAddress").val(),i.DeviceFullName="";var n=$("#txtCell").val().replace(/([()-\s])+/g,"");2==i.Country&&0==n[0]?i.OwnersPhone=n.substring(1):i.OwnersPhone=n,i.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),i.IsBlock=1,currentPage==_twoFactor.PageType.ProfilePage||(i.UserID=parseInt(UserID)),_twoFactor.SaveFilterRequestForCardValidate(i),$("#divtwofactorauthentication").modal("show"),_twoFactor.showErrorDiv(e.AuthenticationMode,!0)}$("#divtwofactorauthentication .modal-backdrop").css("pointer-events","none")}ShowLoader(!1)}else ShowLoader(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},t.datamodel.data=e,t.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},t.Post())},SendTwoFactorCodeForCell:function(e,t=!1){if(currentPage==_twoFactor.PageType.BusinessSignup&&$("#AuthCellNextbtn").length>0&&$("#AuthCellNextbtn").addClass("flamingo-button").text("Next"),e.isFromCookieLessWidget=_twoFactor.IsFromCookieLessWidget(),void 0!==ShowLoader&&ShowLoader(!0),currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignup||currentPage==_twoFactor.PageType.CustomerSignIn||currentPage==_twoFactor.PageType.MultiLocation)e.EmailCellAppSetting=$("#hdnEmailAndCell2FScreen").val(),e.IsTwoFactorSignupLoadData=currentPage==_twoFactor.PageType.BusinessSignup,(i=new vagaro.ajax).datamodel.Token=currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignup||currentPage==_twoFactor.PageType.MultiLocation?_twoFactor.ApiURLEnum.AddBusinessTwoFactorAuthentication:_twoFactor.ApiURLEnum.TwoFactorAuthenticationCustomer,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(i){if(void 0!==ShowLoader&&ShowLoader(!0),void 0!==i&&null!=i)if(i.formattedPhone=e.formattedPhone,currentPage==_twoFactor.PageType.BusinessSignup)if(3==i.IsAlreadyVarified)ShowLoader(!1),vm.SkipTwoFactorStep();else{if(NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest,i.IsSucess)e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.AppendEmailScreen(i,currentPage):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell&&_twoFactor.AppendCellScreen(i,t);else{if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){_twoFactor.showErrorDiv(e.AuthenticationMode);var n={};isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),n.State=vm.addressData.state,n.City=vm.addressData.city,n.Country=$("#ddlcountry").val(),n.NoofAttempt=NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName=vm.deviceFrom;var o=$("#txtOwnerPhone").val().replace(/([()-\s])+/g,"");return 2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,_twoFactor.SaveFilterRequestForCardValidate(n),void ShowLoader(!1)}if(currentPage==_twoFactor.PageType.BusinessSignup){var a=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/signup-1";window.setTimeout(function(){window.location.href=a},4300)}}ShowLoader(!1)}else if(currentPage==_twoFactor.PageType.CustomerSignup){if(NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest,i.IsSucess)void 0!==i.WidgetUserID&&null!=i.WidgetUserID&&""!=i.WidgetUserID&&(widgetcookievalue=i.WidgetUserID),e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.AppendEmailScreen(i,currentPage):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell&&_twoFactor.AppendCellScreen(i,t);else if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){_twoFactor.showErrorDiv(e.AuthenticationMode),n={},isNullOrUndefineOrBlank(fpDeviceId)?isNullOrUndefineOrBlank($("#fpId").val())||(n.UserAgent=navigator.userAgent,n.VisitorID=$("#fpId").val()):(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),n.Country=$("#divCountryCode").attr("data-countryid"),n.NoofAttempt=vm.NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="";var s=$("#txtCell").val().replace(/([()-\s])+/g,"");return 2==n.Country&&0==s[0]?n.OwnersPhone=s.substring(1):n.OwnersPhone=s,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,_twoFactor.SaveFilterRequestForCardValidate(n),isResetTimer=!1,void ShowLoadingPanelLogin(!1)}ShowLoadingPanelLogin(!1)}else if(currentPage==_twoFactor.PageType.CustomerSignIn){if(NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest,i.IsSucess)e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.AppendEmailScreen(i,currentPage):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell&&_twoFactor.AppendCellScreen(i,t);else if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(e.AuthenticationMode),n={},isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=isNullOrUndefineOrBlank(userccattemptdata.EmailId)?$.trim($("#txtEmailInputCode").val()):$.trim(userccattemptdata.EmailId),n.UserEmail=isNullOrUndefineOrBlank(userccattemptdata.EmailId)?$.trim($("#txtEmailInputCode").val()):$.trim(userccattemptdata.EmailId),n.Country="5"==$("#selectedCountrydiv").attr("data-countryid")?"2":$("#selectedCountrydiv").attr("data-countryid"),n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="",o=isNullOrUndefineOrBlank(userccattemptdata.EmailId)?$("#txtCellInputCode").val().replace(/([()-\s])+/g,""):$.trim(userccattemptdata.EmailId),2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,_twoFactor.SaveFilterRequestForCardValidate(n),void ShowLoadingPanelLogin(!1);ShowLoadingPanelLogin(!1)}else currentPage==_twoFactor.PageType.MultiLocation&&(NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest,i.IsSucess&&(e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.AppendEmailScreen(i,currentPage):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell&&_twoFactor.AppendCellScreen(i,t)),ShowLoader(!1));else currentPage==_twoFactor.PageType.CustomerSignup||currentPage==_twoFactor.PageType.CustomerSignIn?ShowLoadingPanelLogin(!1):currentPage==_twoFactor.PageType.BusinessSignup&&ShowLoader(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.datamodel.data=e,i.datamodel.Error=function(){currentPage==_twoFactor.PageType.MultiLocation&&ShowLoader(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post();else if(currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag){var i;e.EmailCellAppSetting=currentPage!=_twoFactor.PageType.ProfilePage||"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType?$("#hdnEmailAndCell2FScreenVPL").val():$("#hdnEmailAndCell2FScreen").val(),(i=new vagaro.ajax).datamodel.Token=currentPage==_twoFactor.PageType.ProfilePage?ApiURLEnumMyAccount.TwoFactorAuthenticationCustomer:_twoFactor.ApiURLEnum.TwoFactorAuthenticationCustomer,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(i){if(void 0!==i&&null!=i)if(currentPage==_twoFactor.PageType.ProfilePage?i.formattedPhone=MyAccountMobilePhone.getphoneformat(i.cellDisplay,twoStepEmail.CountryID):i.formattedPhone=e.formattedPhone,3==i.IsAlreadyVarified)currentPage==_twoFactor.PageType.ProfilePage?"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?_myAccount.SaveVPLUSerDetailProfile():_myAccount.SaveProfile():currentPage==_twoFactor.PageType.CovidClean?_vgCovidCleanCheckout.SaveVPLUSerDetailProfile():currentPage==_twoFactor.PageType.ShoppingBag&&_onlineCheckout.SaveVPLUSerDetailProfile();else{if(NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest,i.IsSucess)e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.AppendEmailScreen(i,currentPage):e.AuthenticationMode==_twoFactor.AuthCodeReceiveMode.Cell&&_twoFactor.AppendCellScreen(i,t);else if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){_twoFactor.showErrorDiv(e.AuthenticationMode);var n={};isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),n.State=vm.addressData.state,n.City=vm.addressData.city,n.Country=$("#ddlcountry").val(),n.NoofAttempt=vm.NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName=vm.deviceFrom;var o=$("#txtOwnerPhone").val().replace(/([()-\s])+/g,"");return 2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,currentPage==_twoFactor.PageType.ProfilePage||(n.UserID=parseInt(UserID)),_twoFactor.SaveFilterRequestForCardValidate(n),void ShowLoader(!1)}ShowLoader(!1)}else ShowLoader(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.datamodel.data=e,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post()}},AppendEmailInputScreen:function(e){$(".signup-verify").hide(),currentPage==_twoFactor.PageType.CustomerSignIn&&(void 0!==e.emailid&&null!=e.emailid&&""!=e.emailid&&$("#txtEmailInputCode").val(e.emailid),$(".previous-btn").text(_twoFactor.WillDoLater),1==userccattemptdata.IsNewBusiness&&$(".previous-btn").hide(),$("#pnlLogin").hide(),$("#dvAuth").show(),$("#divtwofactorauthentication").show(),$(".signup-user-found").hasClass("w-hiddenstrict")||($(".signup-user-found").addClass(" w-hiddenstrict"),$(".sign-in-btn-divinner").removeClass(" w-hiddenstrict"),$(".sign-in-logo-div").removeClass(" w-hiddenstrict")),ShowLoadingPanelLogin(!1)),$("#dvAddEmailCode").show(),$("#txtEmailInputCode").focus()},AppendCellInputScreen:function(e,t=!1){$(".signup-verify").hide(),currentPage==_twoFactor.PageType.CustomerSignIn&&(void 0!==e.phone&&null!=e.phone&&""!=e.phone&&($("#txtCellInputCode").val(e.phone),setTimeout(function(){$("#txtCellInputCode").blur()},5e3),_twoFactor.Phone_format("#txtCellInputCode","#dvCellInputCodeError")),$(".previous-btn").text(_twoFactor.WillDoLater),1==userccattemptdata.IsNewBusiness&&$(".previous-btn").hide(),$("#pnlLogin").hide(),$("#dvAuth").show(),void 0!==e.CountryID&&""!=e.CountryID&&($("#selectedCountrydiv").attr("data-countryId",e.CountryID),_twoFactor.Phone_format("#txtCellInputCode","#dvCellInputCodeError",e.CountryID),2==e.CountryID?$("#selectedCountrydiv").removeClass().addClass("selectedcountry uk-f"):3==e.CountryID?$("#selectedCountrydiv").removeClass().addClass("selectedcountry canada-f"):4==e.CountryID&&$("#selectedCountrydiv").removeClass().addClass("selectedcountry aus-f")),$("#divtwofactorauthentication").show(),$(".signup-user-found").hasClass("w-hiddenstrict")||($(".signup-user-found").addClass(" w-hiddenstrict"),$(".sign-in-btn-divinner").removeClass(" w-hiddenstrict"),$(".sign-in-logo-div").removeClass(" w-hiddenstrict")),ShowLoadingPanelLogin(!1)),$("#dvAddPhoneCode").show(),$("#txtCellInputCode").focus(),t&&currentPage==_twoFactor.PageType.CustomerSignIn&&ShowHideDoneMessage(_twoFactor.SuccessMessage.EmailVerified,GetDisplayMessageTime(_twoFactor.SuccessMessage.EmailVerified)),$("#h2VerifyPhone").attr("tabindex",-1).focus()},SendEmailCodeFromInputScreen:function(e=!1){if(e||(e=_twoFactor.validateEmail()),e)if(currentPage==_twoFactor.PageType.CustomerSignIn?ShowLoadingPanelLogin(!0):ShowLoader(!0),isNullOrUndefineOrBlank(userccattemptdata.EmailId)||userccattemptdata.EmailId.toLowerCase()==$.trim($("#txtEmailInputCode").val()).toLowerCase())twoStepEmail={},twoStepEmail.emailid=$.trim($("#txtEmailInputCode").val()),twoStepEmail.NoOfLoginAttemptemail=NoOfLoginAttemptemail,twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Email,twoStepEmail.IsFromBusinessSignup=!0,_twoFactor.SendTwoFactorCode(twoStepEmail);else{var t='"strUserName" :""';t+=',"strEmailID" :"'+$.trim($("#txtEmailInputCode").val())+'"',CallWebServicehed("MySampleService.asmx/CheckUserNameAvailabilityWithEmail",t,function(e){1*e.d==1?(ShowLoader(!1),$("#txtEmailInputCode").addClass("error"),$("#dvEmailInputError").html("This email is being used by an existing Vagaro account.").show()):(twoStepEmail={},twoStepEmail.emailid=$.trim($("#txtEmailInputCode").val()),twoStepEmail.NoOfLoginAttemptemail=NoOfLoginAttemptemail,twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Email,twoStepEmail.IsFromBusinessSignup=!0,_twoFactor.SendTwoFactorCode(twoStepEmail))},function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)})}$("#txtEmailCode").focus()},SendPhoneCodeFromInputScreen:function(e=!1){if(e||(e=_twoFactor.validatePhone("#txtCellInputCode","#dvCellInputCodeError")),e){currentPage==_twoFactor.PageType.CustomerSignIn?ShowLoadingPanelLogin(!0):ShowLoader(!0),twoStepPhone={},twoStepPhone.emailid=$.trim($("#txtEmailInputCode").val());var t={};if(!twoFactorCellPhone.validatePhoneNumber(!0)){var i=twoFactorCellPhone.getValidateMessage();return 3==i.WarningType?($("#dvCellInputCodeError").html("Phone number should be of 10 digits."),$("#dvCellInputCodeError").show()):1==i.WarningType?($("#dvCellInputCodeError").html("Enter your mobile phone"),$("#dvCellInputCodeError").show()):($("#dvCellInputCodeError").html(i.WarningMessage),$("#dvCellInputCodeError").show()),currentPage==_twoFactor.PageType.CustomerSignIn?ShowLoadingPanelLogin(!1):ShowLoader(!1),!1}$("#dvCellInputCodeError").hide(),t=twoFactorCellPhone.getPhoneData(),twoStepPhone.phone=t.phoneNo,twoStepPhone.CountryID=t.countryId,twoStepPhone.DialingCode=t.dialingCode,twoStepPhone.NoOfLoginAttemptemail=NoOfLoginAttemptemail,twoStepPhone.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,twoStepPhone.IsFromBusinessSignup=!0,_twoFactor.SendTwoFactorCode(twoStepPhone)}$("#txtCellCode").focus()},AppendEmailScreen:function(e,t){if($(".signup-verify").hide(),$("#dvEmailVerify").show(),currentPage==_twoFactor.PageType.BusinessSignup)$("#spnForMerchantSignup").show(),$("#divBusinessSteps").hide(),$("#dvAuth").show(),$("#divtwofactorauthentication").show(),vm.isResetTimer=!1;else if(currentPage==_twoFactor.PageType.MultiLocation)$("#divtwofactorauthentication").css("z-index","10001"),$find("mpeNewBusiness").hide(),showLoadingPanel(0),$("#divtwofactorauthentication").show();else if(currentPage==_twoFactor.PageType.CustomerSignup){$("#spnForMerchantSignup").show(),$("#pnlSignup").hide(),$("#iFrameSignUp",parent.document).parents().find("#signupheaderpart").hide(),$("#divAuth").show(),$("#divtwofactorauthentication").show();var i=$("#iFrameSignUp",parent.document).parents().find("#dvRegHid");i.length>0&&(i.addClass("email"),i.removeClass("phone"),i.removeClass("success"))}else currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag?$("#verificationDesc").html($("#verificationDesc").html().replace("For your security, Vagaro wants to make sure it’s really you. Enter the sent a 6-digit code we sent to ","Enter the 6-digit code we sent to ")):currentPage==_twoFactor.PageType.CustomerSignIn&&($("#spnForMerchantSignup").hide(),$(".previous-btn").text(_twoFactor.WillDoLater),1==userccattemptdata.IsNewBusiness&&$(".previous-btn").hide(),$("#pnlLogin").hide(),$("#dvAuth").show(),$("#divtwofactorauthentication").show());$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew||currentPage!=_twoFactor.PageType.BusinessSignup&&currentPage!=_twoFactor.PageType.CustomerSignup&&currentPage!=_twoFactor.PageType.MultiLocation?$("#lblEmail").text(e.emailDisplay+". "):($("#verificationTitle").text("Verify Your Email or Mobile Phone"),$("#verificationPara").show(),currentPage==_twoFactor.PageType.CustomerSignup?$("#lblEmailorCell").text($("#txtCell").val()+". "):$("#lblEmailorCell").text(e.formattedPhone+". "),$("#lblEmail").text(e.emailDisplay)),$("#txtEmailCode").focus(),$(".signup-loader-height").length>0&&$(".signup-loader-height").addClass("email")},AppendCellScreen:function(e,t=!1){if($(".signup-verify").hide(),$("#dvPhoneVerify").show(),(navigator.userAgent||navigator.vendor||window.opera).toLowerCase(),_twoFactor.CheckDevice(),t&&(currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignIn||currentPage==_twoFactor.PageType.MultiLocation?ShowHideDoneMessage(_twoFactor.SuccessMessage.EmailVerified,GetDisplayMessageTime(_twoFactor.SuccessMessage.EmailVerified)):currentPage!=_twoFactor.PageType.ProfilePage&&currentPage!=_twoFactor.PageType.CovidClean&&currentPage!=_twoFactor.PageType.ShoppingBag||(_twoFactor.AdaPassiveMessage(_twoFactor.SuccessMessage.EmailVerified),"undefined"!=typeof _common&&null!=_common&&void 0!==_common.PassiveAlertSuccess&&null!=_common.PassiveAlertSuccess&&_common.PassiveAlertSuccess(_twoFactor.SuccessMessage.EmailVerified),"undefined"!=typeof _vgCovidCleanCheckout&&null!=_vgCovidCleanCheckout&&void 0!==_vgCovidCleanCheckout.WarningMessage&&null!=_vgCovidCleanCheckout.WarningMessage&&_vgCovidCleanCheckout.WarningMessage(_twoFactor.SuccessMessage.EmailVerified),"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?$("#hdnEmailBeforeChange").val($("#paymentmethods #emailid").val()):$("#hdnEmailBeforeChange").val($("#txtEmail").val()))),currentPage==_twoFactor.PageType.BusinessSignup)$("#divBusinessSteps").hide(),$("#dvAuth").show(),$("#divtwofactorauthentication").show();else if(currentPage==_twoFactor.PageType.CustomerSignup){$("#pnlSignup").hide(),$("#iFrameSignUp",parent.document).parents().find("#signupheaderpart").hide(),$("#divAuth").show(),$("#divtwofactorauthentication").show();var i=$("#iFrameSignUp",parent.document).parents().find("#dvRegHid");i.length>0&&(i.addClass("phone"),i.removeClass("email"),i.removeClass("success")),t&&ShowHideDoneMessage(_twoFactor.SuccessMessage.EmailVerified,GetDisplayMessageTime(_twoFactor.SuccessMessage.EmailVerified))}else currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag?($("#verificationCell").html($("#verificationCell").html().replace("Next, Verify Your Mobile Phone","Verify Your Mobile Phone")),$("#enterCell").html($("#enterCell").html().replace("Enter the sent a 6-digit code we sent to ","Enter the 6-digit code we sent to "))):currentPage==_twoFactor.PageType.CustomerSignIn&&($(".previous-btn").text(_twoFactor.WillDoLater),1==userccattemptdata.IsNewBusiness&&$(".previous-btn").hide(),$("#pnlLogin").hide(),$("#dvAuth").show(),$("#divtwofactorauthentication").show());"5"==$("#selectedCountrydiv").attr("data-countryid")||$("#selectedCountrydiv").attr("data-countryid"),$("#lblCell").text(e.formattedPhone),$(".signup-loader-height").length>0&&$(".signup-loader-height").addClass("phone"),$("#txtCellCode").focus()},CheckDevice:function(){var e=navigator.userAgent;return null!=e.match(/(iPhone|iPod)/)||null!=e.match(/BlackBerry/)||null!=e.match(/Silk/)||null!=e.match(/Android/)||null!=e.match(/iPad/)},EmailCodeSuccess:function(e,t=!1){currentPage==_twoFactor.PageType.CustomerSignIn?_twoFactor.AppendCellInputScreen(e,t):_twoFactor.SendTwoFactorCodeForCell(e,t)},CellCodeSuccess:function(e=!1){_twoFactor.ShowFinalSuccessScreen(e)},ShowFinalSuccessScreen:function(e=!1){if($(".signup-verify").hide(),currentPage!=_twoFactor.PageType.BusinessSignup&&($("#AuthSuccessBackbtn").hide(),$("#AuthSuccessNextbtn").text("Done")),currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag)_twoFactor.BackFromAuth();else if(currentPage==_twoFactor.PageType.CustomerSignup){var t=$("#iFrameSignUp",parent.document).parents().find("#dvRegHid");t.length>0&&(t.removeClass("phone"),t.removeClass("email"),t.addClass("success")),$("#dvSuccessVerify").show()}else{currentPage!=_twoFactor.PageType.BusinessSignup&&$("#dvSuccessVerify").show();var i=null!=navigator.userAgent.toLowerCase()?navigator.userAgent.toLowerCase():"";"undefined"==typeof vgAppicationType||1!=vgAppicationType||isNullOrUndefineOrBlank(SkipTwoFactoFromSignIn)||isNullOrUndefineOrBlank(_securelogin.AfterSuccessfullLogin)||!(i.indexOf("com.vagaro.customerandroid")>-1||i.indexOf("com.vagaro.customerios")>-1)||setTimeout(function(){SkipTwoFactoFromSignIn()},700)}e?currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignup||currentPage==_twoFactor.PageType.CustomerSignIn||currentPage==_twoFactor.PageType.MultiLocation?(currentPage==_twoFactor.PageType.MultiLocation&&ShowLoader(!1),currentPage,_twoFactor.PageType.CustomerSignup,ShowHideDoneMessage(_twoFactor.SuccessMessage.EmailVerified,GetDisplayMessageTime(_twoFactor.SuccessMessage.EmailVerified))):currentPage!=_twoFactor.PageType.ProfilePage&&currentPage!=_twoFactor.PageType.CovidClean&&currentPage!=_twoFactor.PageType.ShoppingBag||("undefined"!=typeof _common&&null!=_common&&void 0!==_common.PassiveAlertSuccess&&null!=_common.PassiveAlertSuccess&&_common.PassiveAlertSuccess(_twoFactor.SuccessMessage.EmailVerified),"undefined"!=typeof _vgCovidCleanCheckout&&null!=_vgCovidCleanCheckout&&void 0!==_vgCovidCleanCheckout.WarningMessage&&null!=_vgCovidCleanCheckout.WarningMessage&&_vgCovidCleanCheckout.WarningMessage(_twoFactor.SuccessMessage.EmailVerified),currentPage==_twoFactor.PageType.ProfilePage?"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?($("#hdnEmailBeforeChange").val($("#paymentmethods #emailid").val()),_myAccount.SaveVPLUSerDetailProfile()):($("#hdnEmailBeforeChange").val($("#txtEmail").val()),_myAccount.SaveProfile()):currentPage==_twoFactor.PageType.CovidClean?_vgCovidCleanCheckout.SaveVPLUSerDetailProfile():currentPage==_twoFactor.PageType.ShoppingBag&&_onlineCheckout.SaveVPLUSerDetailProfile()):currentPage==_twoFactor.PageType.BusinessSignup||currentPage==_twoFactor.PageType.CustomerSignIn||currentPage==_twoFactor.PageType.MultiLocation?(currentPage==_twoFactor.PageType.MultiLocation&&ShowLoader(!1),currentPage==_twoFactor.PageType.BusinessSignup?(ShowLoader(!0),_twoFactor.SuccessTwoFactor()):ShowHideDoneMessage(_twoFactor.SuccessMessage.PhoneVerified)):currentPage==_twoFactor.PageType.CustomerSignup?ShowHideDoneMessage(_twoFactor.SuccessMessage.PhoneVerified):currentPage!=_twoFactor.PageType.ProfilePage&&currentPage!=_twoFactor.PageType.CovidClean&&currentPage!=_twoFactor.PageType.ShoppingBag||("undefined"!=typeof _common&&null!=_common&&void 0!==_common.PassiveAlertSuccess&&null!=_common.PassiveAlertSuccess&&_common.PassiveAlertSuccess(_twoFactor.SuccessMessage.PhoneVerified),"undefined"!=typeof _vgCovidCleanCheckout&&null!=_vgCovidCleanCheckout&&void 0!==_vgCovidCleanCheckout.WarningMessage&&null!=_vgCovidCleanCheckout.WarningMessage&&_vgCovidCleanCheckout.WarningMessage(_twoFactor.SuccessMessage.PhoneVerified),currentPage==_twoFactor.PageType.ProfilePage?"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?($("#hdnCellNoBeforeChange").val(MyAccountVPLCell.getPhoneData().phoneNo),_myAccount.SaveVPLUSerDetailProfile()):($("#hdnCellNoBeforeChange").val($("#txtCell").val().replace(/([()-\s])+/g,"")),_myAccount.SaveProfile()):currentPage==_twoFactor.PageType.CovidClean?_vgCovidCleanCheckout.SaveVPLUSerDetailProfile():currentPage==_twoFactor.PageType.ShoppingBag&&_onlineCheckout.SaveVPLUSerDetailProfile())},SuccessTwoFactor:function(){if(currentPage==_twoFactor.PageType.BusinessSignup){if(vm.buttonClicked=!0,!isNullOrUndefineOrBlank(vm)&&!isNullOrUndefineOrBlank(vm.SkipTwoFactorStep)){var e=parseInt($("#ddlcountry option:selected").val());localStorage.setItem("CountryId",e),localStorage.setItem("isFromTwoFactor",!0),localStorage.setItem("VarificationType",$("#hdnEmailAndCellAPIValidationSignup").val()),vm.SkipTwoFactorStep()}}else if(currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag)$("#divtwofactorauthentication").modal("hide");else if(currentPage==_twoFactor.PageType.CustomerSignup){var t=$("#iFrameSignUp",parent.document).parents().find("#dvRegHid");t.length>0&&(t.removeClass("phone"),t.removeClass("email"),t.removeClass("success")),$("#hdnIsCheckCapcha").val("0"),$("#btnRegister").click(),$(t).hide(),window.parent.ShowLoadingPanelLogin(!0)}else if(currentPage==_twoFactor.PageType.CustomerSignIn)isNullOrUndefineOrBlank(SkipTwoFactoFromSignIn)||isNullOrUndefineOrBlank(_securelogin.AfterSuccessfullLogin)||SkipTwoFactoFromSignIn();else if(currentPage==_twoFactor.PageType.MultiLocation&&(showLoadingPanel(1),$("#divtwofactorauthentication").css("z-index","0"),$("#divtwofactorauthentication").hide(),$("#hdnIsFromMFA").val("true"),$("#btnAddBusinessInfoContinue").click(),null!=typeof _mlMultiLocation.controls.txtTelephone&&null!=_mlMultiLocation.controls.txtTelephone&&null!=typeof _mlMultiLocation.model.LastVerifiedCell&&null!=_mlMultiLocation.model.LastVerifiedCell)){var i=$(_mlMultiLocation.controls.txtTelephone).val().replace(/([()-\s])+/g,"");2==parseInt(e)&&0==i[0]&&(i=i.substring(1)),_mlMultiLocation.model.LastVerifiedCell=i}},resendcodestartloader:function(){var e=1*$("#hdnAuthCodeExpireTime").val()*60;$("#txtfirstcode").focus(),$("#twostepcountdown").show(),$("#divtwostepcountdown").show(),interval=setInterval(function(){--e<=35&&($("#twostepcountdown").fadeOut(500),$("#twostepcountdown").fadeIn(500),$("#twostepcountdown").css({color:"red"})),d=Number(e);var t=Math.floor(d%3600/60),i=Math.floor(d%3600%60);if(i<10&&(i="0"+i),$("#twostepcountdown").text(t+":"+i),e<=0)return $("#dvCodeError").hide(),$("#dvCodeErrorExpire").hide(),$("#dvCodeErrorTimeOut").show(),clearInterval(interval),void setTimeout(function(){$("#twostepcountdown").hide(),$("#divtwostepcountdown").hide()},500)},1e3)},AllowOnlyNumber:function(e){null!=e&&(thisnumberCtrl=$("#"+e),1==thisnumberCtrl.val().length?"txtsixcode"!=!thisnumberCtrl[0].id&&$(thisnumberCtrl).next(".inputcode").focus():"txtsixcode"==e?($("#txtfivecode").val(""),$("#txtfivecode").focus()):"txtfivecode"==e?($("#txtfourcode").val(""),$("#txtfourcode").focus()):"txtfourcode"==e?($("#txtthirdcode").val(""),$("#txtthirdcode").focus()):"txtthirdcode"==e?($("#txtsecondcode").val(""),$("#txtsecondcode").focus()):"txtsecondcode"==e&&($("#txtfirstcode").val(""),$("#txtfirstcode").focus())),$("#dvCodeError").hide(),$("#dvCodeErrorExpire").hide(),$("#dvCodeErrorTimeOut").hide()},ReSendTowFactorAuthenticationCode:function(e,t){if($(t).addClass("active"),$("#txtEmailCode").removeClass("error"),$("#txtCellCode").removeClass("error"),$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew||(e=_twoFactor.AuthCodeReceiveMode.EmailAndCell),currentPage==_twoFactor.PageType.BusinessSignup){ShowLoader(!0);var i={},n={};isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),n.State=vm.addressData.state,n.City=vm.addressData.city,n.Country=$("#ddlcountry").val(),n.NoofAttempt=vm.NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName=vm.deviceFrom;var o=$("#txtOwnerPhone").val().replace(/([()-\s])+/g,"");if(2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,$("#dvEmailCodeError").html(""),$("#dvEmailCodeError").hide(),$("#dvCellCodeError").html(""),$("#dvCellCodeError").hide(),NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(e),_twoFactor.SaveFilterRequestForCardValidate(n),void ShowLoader(!1);_twoFactor.cleartwofactortextboxwithoutfocus(e),i.emailid=$.trim($("#txtEmail").val()),i.phone=$.trim($("#txtOwnerPhone").val().replace(/([()-\s])+/g,"")),i.fullname=$.trim($("#txtFirstName").val())+" "+$.trim($("#txtLastName").val()),i.CountryID=$("#ddlcountry option:selected").val(),i.IP=$("#hdnIPAddress").val(),i.IsEmailPhoneChanges=vm.IsEmailPhoneChanged,i.NoOfLoginAttemptemail=vm.NoOfLoginAttemptemail,i.AuthenticationMode=e,i.IsFromBusinessSignup=!0,i.IsFromCustomerSignup=!0,i.isFromCookieLessWidget=_twoFactor.IsFromCookieLessWidget(),i.codetype="resend",i.DialingCode=vm.DialingCode,i.IsTwoFactorSignupLoadData=!0,(s=new vagaro.ajax).datamodel.Token=_twoFactor.ApiURLEnum.AddBusinessTwoFactorAuthentication,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=function(o){void 0!==o&&null!=o&&(o.IsSucess&&(_twoFactor.resendcodestartloader(),_twoFactor.AdaPassiveMessage(_twoFactor.SuccessMessage.ResendCode,e),ShowHideDoneMessage(_twoFactor.SuccessMessage.ResendCode,GetDisplayMessageTime(_twoFactor.SuccessMessage.ResendCode))),NoOfLoginAttempt=o.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=o.TwoFactorRequest,NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()&&(_twoFactor.showErrorDiv(i.AuthenticationMode),PageType==_twoFactor.PageType.BusinessSignup&&_twoFactor.SaveFilterRequestForCardValidate(n))),$(t).removeClass("active"),ShowLoader(!1)},s.datamodel.data=i,s.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage),ShowLoader(!1)},s.Post()}else if(currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag){ShowLoader(!0),i={},n={},isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId);var a="";if(currentPage==_twoFactor.PageType.ProfilePage?"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?(n.UserName=$("#paymentmethods #emailid").val(),n.UserEmail=$("#paymentmethods #emailid").val(),a=MyAccountVPLCell.getPhoneData().phoneNo,n.Country=MyAccountVPLCell.getPhoneData().countryId):(n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),a=$("#txtCell").val().replace(/([()-\s])+/g,""),n.Country=MyAccountMobilePhone.getPhoneData().countryId):currentPage==_twoFactor.PageType.CovidClean?(n.UserName=$("#emailid").val(),n.UserEmail=$("#emailid").val(),a=MyAccountVPLCell.getPhoneData().phoneNo,n.Country=MyAccountVPLCell.getPhoneData().countryId):currentPage==_twoFactor.PageType.ShoppingBag&&(n.UserName=$("#emailid").val(),n.UserEmail=$("#emailid").val(),a=ShoppingBagVPLCell.getPhoneData().phoneNo,n.Country=ShoppingBagVPLCell.getPhoneData().countryId),2==n.Country&&0==a[0]?n.OwnersPhone=a.substring(1):n.OwnersPhone=a,n.State=$("#txtState").val(),n.City=$("#txtCity").val(),n.NoofAttempt=NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="",n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,currentPage==_twoFactor.PageType.ProfilePage||(n.UserID=parseInt(UserID)),$("#dvEmailCodeError").html(""),$("#dvEmailCodeError").hide(),$("#dvCellCodeError").html(""),$("#dvCellCodeError").hide(),$("#txtCellCode").removeClass("error"),$("#txtEmailCode").removeClass("error"),NoOfLoginAttempt>=$("#hdnFraudNoOfAttemptCustomer").val())return _twoFactor.showErrorDiv(e),_twoFactor.SaveFilterRequestForCardValidate(n),void ShowLoader(!1);_twoFactor.cleartwofactortextboxwithoutfocus(e),currentPage==_twoFactor.PageType.ProfilePage?("undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?(i.emailid=$("#paymentmethods #emailid").val(),i.phone=MyAccountVPLCell.getPhoneData().phoneNo,i.CountryID=MyAccountVPLCell.getPhoneData().countryId):(i.emailid=$.trim($("#txtEmail").val()),i.phone=MyAccountMobilePhone.getPhoneData().phoneNo,i.CountryID=MyAccountMobilePhone.getPhoneData().countryId),i.fullname=$.trim($("#txtFName").val())+" "+$.trim($("#txtLName").val())):currentPage==_twoFactor.PageType.CovidClean?(i.emailid=$("#emailid").val(),i.phone=MyAccountVPLCell.getPhoneData().phoneNo,i.CountryID=MyAccountVPLCell.getPhoneData().countryId,i.fullname=_vgCovidCleanCheckout.model.VplUserDetails.Fullname):currentPage==_twoFactor.PageType.ShoppingBag&&(i.emailid=$("#emailid").val(),i.phone=ShoppingBagVPLCell.getPhoneData().phoneNo,i.CountryID=ShoppingBagVPLCell.getPhoneData().countryId,i.fullname=_onlineCheckout.CustomerDetails.FirstName+" "+_onlineCheckout.CustomerDetails.LastName),i.IP=$("#hdnIPAddress").val(),i.IsEmailPhoneChanges="false",i.NoOfLoginAttemptemail=NoOfLoginAttemptemail,i.AuthenticationMode=e,i.IsFromBusinessSignup=!0,i.isFromCookieLessWidget=_twoFactor.IsFromCookieLessWidget(),i.codetype="resend",$("#hdnUserType").length>0&&(i.UserType=$("#hdnUserType").val());var s=new vagaro.ajax;currentPage==_twoFactor.PageType.ShoppingBag?s.datamodel.Token=_twoFactor.ApiURLEnum.TwoFactorAuthenticationCustomer:s.datamodel.Token=_twoFactor.ApiURLEnum.AddBusinessTwoFactorAuthentication,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=function(n){void 0!==n&&null!=n&&(n.IsSucess&&(_twoFactor.resendcodestartloader(),_twoFactor.AdaPassiveMessage(_twoFactor.SuccessMessage.ResendCode,e),"undefined"!=typeof _common&&null!=_common&&void 0!==_common.PassiveAlertSuccess&&null!=_common.PassiveAlertSuccess&&_common.PassiveAlertSuccess(_twoFactor.SuccessMessage.ResendCode),"undefined"!=typeof _vgCovidCleanCheckout&&null!=_vgCovidCleanCheckout&&void 0!==_vgCovidCleanCheckout.WarningMessage&&null!=_vgCovidCleanCheckout.WarningMessage&&_vgCovidCleanCheckout.WarningMessage(_twoFactor.SuccessMessage.ResendCode)),NoOfLoginAttempt=n.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=n.TwoFactorRequest,NoOfLoginAttempt>=$("#hdnFraudNoOfAttemptCustomer").val()&&(_twoFactor.showErrorDiv(i.AuthenticationMode),currentPage==_twoFactor.PageType.ProfilePage?(_twoFactor.BackFromAuth(),_myAccount.showConfirmbox(_twoFactor.FailOTPMessage(),"","Error Code: XJ140",!1,!1)):currentPage==_twoFactor.PageType.ShoppingBag?($("#divConfirmBox").find(".w-button-default").attr("value","Ok"),_twoFactor.BackFromAuth(),_onlineCheckout.hideConfirmbox()):currentPage==_twoFactor.PageType.CovidClean&&($("#divConfirmBox").find(".w-button-default").attr("value","Ok"),_twoFactor.BackFromAuth(),_vgCovidCleanCheckout.showConfirmbox(_twoFactor.FailOTPMessage(),"","Error Code: XJ140",!1,!1)))),$(t).removeClass("active"),ShowLoader(!1)},s.datamodel.data=i,s.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage),ShowLoader(!1)},s.Post()}else if(currentPage==_twoFactor.PageType.CustomerSignIn){if(ShowLoader(!0),i={},n={},isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmailInputCode").val(),n.UserEmail=$("#txtEmailInputCode").val(),twoStepPhonedata=twoFactorCellPhone.getPhoneData(),n.CountryID=twoStepPhonedata.countryId,n.NoofAttempt=NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="",o=isNullOrUndefineOrBlank($("#txtCellInputCode").val())||$("#txtCellInputCode").val().replace(/([()-\s])+/g,"")==userccattemptdata.PhoneNo?userccattemptdata.PhoneNo:$("#txtCellInputCode").val().replace(/([()-\s])+/g,""),2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,$("#dvEmailCodeError").html(""),$("#dvEmailCodeError").hide(),$("#dvCellCodeError").html(""),$("#dvCellCodeError").hide(),NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(e),_twoFactor.SaveFilterRequestForCardValidate(n),void ShowLoader(!1);_twoFactor.cleartwofactortextboxwithoutfocus(e),i.emailid=$.trim($("#txtEmailInputCode").val()),i.phone=twoStepPhonedata.phoneNo,i.CountryID=twoStepPhonedata.countryId,i.DialingCode=twoStepPhonedata.dialingCode,i.fullname=userccattemptdata.FullName,i.IP=$("#hdnIPAddress").val(),i.AuthenticationMode=e,i.IsFromBusinessSignup=!0,i.isFromCookieLessWidget=_twoFactor.IsFromCookieLessWidget(),i.codetype="resend",$("#hdnUserType").length>0&&(i.UserType=$("#hdnUserType").val()),i.EmailCellAppSetting=$("#hdnEmailAndCell2FScreen").val(),(s=new vagaro.ajax).datamodel.Token=_twoFactor.ApiURLEnum.TwoFactorAuthenticationCustomer,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=function(o){void 0!==o&&null!=o&&(o.IsSucess&&(_twoFactor.AdaPassiveMessage(_twoFactor.SuccessMessage.ResendCode,e),ShowHideDoneMessage(_twoFactor.SuccessMessage.ResendCode,GetDisplayMessageTime(_twoFactor.SuccessMessage.ResendCode))),NoOfLoginAttempt=o.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=o.TwoFactorRequest,NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()&&(_twoFactor.showErrorDiv(i.AuthenticationMode),_twoFactor.SaveFilterRequestForCardValidate(n))),$(t).removeClass("active"),ShowLoader(!1)},s.datamodel.data=i,s.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage),ShowLoader(!1)},s.Post()}else if(currentPage==_twoFactor.PageType.CustomerSignup){if(ShowLoadingPanelLogin(!0),i={},n={},isNullOrUndefineOrBlank(fpDeviceId)?isNullOrUndefineOrBlank($("#fpId").val())||(n.UserAgent=navigator.userAgent,n.VisitorID=$("#fpId").val()):(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),n.Country=$("#divCountryCode").attr("data-countryid"),n.NoofAttempt=NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="",a=$("#txtCell").val().replace(/([()-\s])+/g,""),2==n.Country&&0==a[0]?n.OwnersPhone=a.substring(1):n.OwnersPhone=a,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.IsBlock=1,$("#dvEmailCodeError").html(""),$("#dvEmailCodeError").hide(),$("#dvCellCodeError").html(""),$("#dvCellCodeError").hide(),NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(e),_twoFactor.SaveFilterRequestForCardValidate(n),void ShowLoadingPanelLogin(!1);_twoFactor.cleartwofactortextboxwithoutfocus(e),i.emailid=$.trim($("#txtEmail").val());var r=custSignupCellPhone.getPhoneData();i.phone=r.phoneNo,i.fullname=$.trim($("#txtFirstname").val())+" "+$.trim($("#txtLastname").val()),i.CountryID=r.countryId,i.IP="",i.IsEmailPhoneChanges=IsEmailPhoneChanged,i.NoOfLoginAttemptemail=NoOfLoginAttemptemail,i.AuthenticationMode=e,i.IsFromBusinessSignup=!0,i.IsFromCustomerSignup=!0,i.isFromCookieLessWidget=_twoFactor.IsFromCookieLessWidget(),i.codetype="resend",IsEmailPhoneChanged=!1,(s=new vagaro.ajax).datamodel.Token=_twoFactor.ApiURLEnum.AddBusinessTwoFactorAuthentication,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=function(o){void 0!==o&&null!=o&&(o.IsSucess&&(void 0!==o.WidgetUserID&&null!=o.WidgetUserID&&""!=o.WidgetUserID&&(widgetcookievalue=o.WidgetUserID),_twoFactor.resendcodestartloader(),_twoFactor.AdaPassiveMessage(_twoFactor.SuccessMessage.ResendCode,e),ShowHideDoneMessage(_twoFactor.SuccessMessage.ResendCode,GetDisplayMessageTime(_twoFactor.SuccessMessage.ResendCode))),NoOfLoginAttempt=o.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=o.TwoFactorRequest,NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()&&(_twoFactor.showErrorDiv(i.AuthenticationMode),_twoFactor.SaveFilterRequestForCardValidate(n))),$(t).removeClass("active"),1==i.AuthenticationMode?$("#txtEmailCode").focus():2==i.AuthenticationMode&&$("#txtCellCode").focus(),ShowLoadingPanelLogin(!1)},s.datamodel.data=i,s.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage),ShowLoader(!1)},s.Post()}else currentPage==_twoFactor.PageType.MultiLocation&&(ShowLoader(!0),$("#dvEmailCodeError").html(""),$("#dvEmailCodeError").hide(),$("#dvCellCodeError").html(""),$("#dvCellCodeError").hide(),_twoFactor.cleartwofactortextboxwithoutfocus(e),(s=new vagaro.ajax).datamodel.Token=_twoFactor.ApiURLEnum.AddBusinessTwoFactorAuthentication,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.callback=function(i){void 0!==i&&null!=i&&(i.IsSucess&&(_twoFactor.resendcodestartloader(),_twoFactor.AdaPassiveMessage(_twoFactor.SuccessMessage.ResendCode,e),ShowHideDoneMessage(_twoFactor.SuccessMessage.ResendCode,GetDisplayMessageTime(_twoFactor.SuccessMessage.ResendCode))),NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest),$(t).removeClass("active"),ShowLoader(!1)},s.datamodel.data=twoStepEmail,s.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage),ShowLoader(!1)},s.Post())},cleartwofactortextbox:function(e){e==_twoFactor.AuthCodeReceiveMode.Email||e==_twoFactor.AuthCodeReceiveMode.EmailAndCell?$("#txtEmailCode").val("").focus():$("#txtCellCode").val("").focus()},cleartwofactortextboxwithoutfocus:function(e){e==_twoFactor.AuthCodeReceiveMode.Email||e==_twoFactor.AuthCodeReceiveMode.EmailAndCell?$("#txtEmailCode").val(""):$("#txtCellCode").val("")},disabletwofactortextbox:function(e){$(e).attr("disabled","disabled");var t=5;interval=setInterval(function(){if(--t<=0){var e=$("#spnCountryPhoneNo").text();currentPage==_twoFactor.PageType.CustomerSignup?($("#divConfirmBox").find(".w-button-default").attr("value","Cancel"),e=$("#spnCountryPhoneNo").text(),showConfirmbox(_twoFactor.FailOTPMessage(e),vm.OnBlockConfirm,"Error Code: XJ140",!1,!0)):currentPage==_twoFactor.PageType.BusinessSignup&&vm.showConfirmbox(_twoFactor.FailOTPMessage(e),vm.OnBlockConfirm,"Error Code: XJ140",!1,!0)}},3e3)},VerifyEmailCode:function(){try{void 0!==vm.SignupStepsClicklog&&"function"==typeof vm.SignupStepsClicklog&&currentPage==_twoFactor.PageType.BusinessSignup&&vm.SignupStepsClicklog(1.1)}catch(e){}if(void 0===$("#txtEmailCode").val()||""==$("#txtEmailCode").val())return $("#dvEmailCodeError").show(),$("#txtEmailCode").addClass("error"),$("#dvEmailCodeError").text("Please enter verification code."),$("#txtEmailCode").focus(),!1;if($("#txtEmailCode").val().length<=5)return $("#dvEmailCodeError").show(),$("#txtEmailCode").addClass("error"),$("#dvEmailCodeError").text("Invalid code, try again."),!1;if(currentPage==_twoFactor.PageType.BusinessSignup){vm.buttonClicked=!0,$("#dvEmailCodeError").hide();var e="Unknown",t={};if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){_twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Email);var i=$("#spnCountryPhoneNo").text();return void vm.showConfirmbox(_twoFactor.FailOTPMessage(i),vm.OnBlockConfirm,"Error Code: XJ140",!1,!0)}if(t.Code=$("#txtEmailCode").val(),""!=t.Code){ShowLoader(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux");var n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2);t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,parseInt($("#ddlcountry option:selected").val()),$("#hdnEmailAndCellAPIValidationSignup").val()==_twoFactor.VarificationType.Email&&$("#hdnEmailAndCell2FScreen").val(_twoFactor.EmailAndCell2FScreen.EmailOrPhone),t.AuthenticationMode=$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailOrPhone||$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew?_twoFactor.AuthCodeReceiveMode.EmailAndCell:_twoFactor.AuthCodeReceiveMode.Email,t.IsFromBusinessSignup=!0,t.IsSignupLoadData=!0,_twoFactor.verifytwostepAuthenticationCode(t,t.AuthenticationMode)}}else if(currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag){if($("#dvEmailCodeError").hide(),e="Unknown",t={},NoOfLoginAttempt>=$("#hdnFraudNoOfAttemptCustomer").val())return _twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Email),void(currentPage==_twoFactor.PageType.ProfilePage?(_twoFactor.BackFromAuth(),_myAccount.showConfirmbox(_twoFactor.FailOTPMessage(),"","Error Code: XJ140",!1,!1)):currentPage==_twoFactor.PageType.ShoppingBag?(_twoFactor.BackFromAuth(),_onlineCheckout.hideConfirmbox()):currentPage==_twoFactor.PageType.CovidClean&&(_twoFactor.BackFromAuth(),$("#divConfirmBox").find(".w-button-default").attr("value","Ok"),_vgCovidCleanCheckout.showConfirmbox(_twoFactor.FailOTPMessage(),"","Error Code: XJ140",!1,!1)));if(t.Code=$("#txtEmailCode").val(),""!=t.Code){ShowLoader(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Email,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,t.AuthenticationMode)}}else if(currentPage==_twoFactor.PageType.CustomerSignup){if(buttonClicked=!0,$("#dvEmailCodeError").hide(),e="Unknown",t={},NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Email),void(PageType==_twoFactor.PageType.BusinessSignup&&(i=$("#spnCountryPhoneNo").text()));if(t.Code=$("#txtEmailCode").val(),""!=t.Code){ShowLoadingPanelLogin(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailOrPhone?_twoFactor.AuthCodeReceiveMode.EmailAndCell:_twoFactor.AuthCodeReceiveMode.Email,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,t.AuthenticationMode)}}else if(currentPage==_twoFactor.PageType.CustomerSignIn){if($("#dvEmailCodeError").hide(),e="Unknown",t={},NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Email),void bootbox.alert({className:"vagaro-midium-popup",message:_twoFactor.FailOTPMessage(),title:"Error Code: XJ140"});if(t.Code=$("#txtEmailCode").val(),""!=t.Code){ShowLoadingPanelLogin(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Email,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,t.AuthenticationMode)}}else if(currentPage==_twoFactor.PageType.MultiLocation&&($("#dvEmailCodeError").hide(),e="Unknown",(t={}).Code=$("#txtEmailCode").val(),""!=t.Code)){ShowLoader(!0);try{var o;-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailOrPhone?_twoFactor.AuthCodeReceiveMode.EmailAndCell:_twoFactor.AuthCodeReceiveMode.Email,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,t.AuthenticationMode)}},VerifyCellCode:function(){try{void 0!==vm.SignupStepsClicklog&&"function"==typeof vm.SignupStepsClicklog&&currentPage==_twoFactor.PageType.BusinessSignup&&vm.SignupStepsClicklog(1.2)}catch(e){}if(void 0===$("#txtCellCode").val()||""==$("#txtCellCode").val())return $("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("Please enter verification code."),$("#dvCellCodeError").focus(),!1;if($("#txtCellCode").val().length<=5)$("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("Invalid code, try again.");else if(currentPage==_twoFactor.PageType.BusinessSignup){vm.buttonClicked=!0,vm.buttonClicked=!0,$("#dvCellCodeError").hide();var e="Unknown",t={};if(NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){_twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Cell);var i=$("#spnCountryPhoneNo").text();return void vm.showConfirmbox(_twoFactor.FailOTPMessage(i),vm.OnBlockConfirm,"Error Code: XJ140",!1,!0)}if(t.Code=$("#txtCellCode").val(),""!=t.Code){ShowLoader(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux");var n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2);t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,t.IsFromBusinessSignup=!0,t.IsSignupLoadData=!0,_twoFactor.verifytwostepAuthenticationCode(t,_twoFactor.AuthCodeReceiveMode.Cell)}}else if(currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag){if(void 0===$("#txtCellCode").val()||""==$("#txtCellCode").val()||$("#txtCellCode").val().length<=5)return $("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),"undefined"==$("#txtCellCode").val()||""==$("#txtCellCode").val()?($("#dvCellCodeError").text("Please enter verification code."),$("#txtCellCode").focus()):$("#dvCellCodeError").text("Invalid code, try again."),!1;if($("#dvCellCodeError").hide(),e="Unknown",t={},NoOfLoginAttempt>=$("#hdnFraudNoOfAttemptCustomer").val())return _twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Cell),void(currentPage==_twoFactor.PageType.ProfilePage?(_twoFactor.BackFromAuth(),_myAccount.showConfirmbox(_twoFactor.FailOTPMessage(),"","Error Code: XJ140",!1,!1)):currentPage==_twoFactor.PageType.ShoppingBag?(_twoFactor.BackFromAuth(),_onlineCheckout.hideConfirmbox()):currentPage==_twoFactor.PageType.CovidClean&&(_twoFactor.BackFromAuth(),$("#divConfirmBox").find(".w-button-default").attr("value","Ok"),_vgCovidCleanCheckout.showConfirmbox(_twoFactor.FailOTPMessage(),"","Error Code: XJ140",!1,!1)));if(t.Code=$("#txtCellCode").val(),""!=t.Code){ShowLoader(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,_twoFactor.AuthCodeReceiveMode.Cell)}}else if(currentPage==_twoFactor.PageType.CustomerSignup){if(buttonClicked=!0,$("#dvCellCodeError").hide(),e="Unknown",t={},NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Cell),$("#divConfirmBox").find(".w-button-default").attr("value","Cancel"),i=$("#spnCountryPhoneNo").text(),void showConfirmbox(_twoFactor.FailOTPMessage(i),OnBlockConfirm,"Error Code: XJ140",!1,!0);if(t.Code=$("#txtCellCode").val(),""!=t.Code){ShowLoadingPanelLogin(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,_twoFactor.AuthCodeReceiveMode.Cell)}}else if(currentPage==_twoFactor.PageType.CustomerSignIn){if($("#dvCellCodeError").hide(),e="Unknown",t={},NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Cell),void vagaro.alertsmall({message:_twoFactor.FailOTPMessage(),title:"Error Code: XJ140"});if(t.Code=$("#txtCellCode").val(),""!=t.Code){ShowLoader(!0);try{-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,_twoFactor.AuthCodeReceiveMode.Cell)}}else if(currentPage==_twoFactor.PageType.MultiLocation&&($("#dvCellCodeError").hide(),e="Unknown",(t={}).Code=$("#txtCellCode").val(),""!=t.Code)){ShowLoader(!0);try{var o;-1!=navigator.appVersion.indexOf("Win")?e="Windows":-1!=navigator.appVersion.indexOf("Mac")?e="Mac/iOS":-1!=navigator.appVersion.indexOf("X11")?e="UNIX":-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),n=(o=new Date).getFullYear()+"-"+("0"+(o.getMonth()+1)).slice(-2)+"-"+("0"+o.getDate()).slice(-2)+" "+("0"+o.getHours()).slice(-2)+":"+("0"+o.getMinutes()).slice(-2)+":"+("0"+o.getSeconds()).slice(-2),t.OSName=e,t.clientDate=n}catch(i){t.operatingSystem=e,t.clientDate=""}t.NoOfLoginAttempt=NoOfLoginAttempt++,t.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,t.IsFromBusinessSignup=!0,_twoFactor.verifytwostepAuthenticationCode(t,_twoFactor.AuthCodeReceiveMode.Cell)}},verifytwostepAuthenticationCode:function(e,t){if(e.isFromCookieLessWidget=_twoFactor.IsFromCookieLessWidget(),currentPage==_twoFactor.PageType.BusinessSignup)(i=new vagaro.ajax).datamodel.Token="websiteapi/homepage/verifytwofactorauthentication",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=e,i.datamodel.callback=function(e){if(void 0!==e&&null!=e){var i=e;NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest;var n={};isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),n.State=vm.addressData.state,n.City=vm.addressData.city,n.Country=$("#ddlcountry").val(),n.NoofAttempt=vm.NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName=vm.deviceFrom;var o=$("#txtOwnerPhone").val().replace(/([()-\s])+/g,"");if(2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),ShowLoader(!1),NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(t),sessionStorage.clear(),n.IsBlock=1,void _twoFactor.SaveFilterRequestForCardValidate(n);if("Valid"==i.Verifyresponce||"EmailValid"==i.Verifyresponce||"CellValid"==i.Verifyresponce){if(currentPage==_twoFactor.PageType.BusinessSignup&&($("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Cell&&i.VarificationType==_twoFactor.VarificationType.Email?(n.IsEmailPhoneVerified=_twoFactor.VarificationType.EmailAndCell,$("#hdnTwoFactorVerified").val(_twoFactor.VarificationType.EmailAndCell)):($("#hdnTwoFactorVerified").val(i.VarificationType),n.IsEmailPhoneVerified=i.VarificationType),_twoFactor.SaveFilterRequestForCardValidate(n),$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailAndPhone?t==_twoFactor.AuthCodeReceiveMode.Email&&$("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Email?(twoStepEmail={},twoStepEmail.emailid=$.trim($("#txtEmail").val()),twoStepEmail.phone=$.trim($("#txtOwnerPhone").val().replace(/([()-\s])+/g,"")),twoStepEmail.formattedPhone=$("#txtOwnerPhone").val(),twoStepEmail.fullname=$.trim($("#txtFirstName").val())+" "+$.trim($("#txtLastName").val()),twoStepEmail.CountryID=$("#ddlcountry option:selected").val(),twoStepEmail.IP=$("#hdnIPAddress").val(),twoStepEmail.IsEmailPhoneChanges=vm.IsEmailPhoneChanged,twoStepEmail.NoOfLoginAttemptemail=vm.NoOfLoginAttemptemail,twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,twoStepEmail.IsFromBusinessSignup=!0,twoStepEmail.DialingCode=vm.DialingCode,_twoFactor.EmailCodeSuccess(twoStepEmail,!0)):$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email||"EmailValid"==i.Verifyresponce?_twoFactor.CellCodeSuccess(!0):_twoFactor.CellCodeSuccess()):$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew||$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Email&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email||"EmailValid"==i.Verifyresponce?_twoFactor.CellCodeSuccess(!0):(parseInt($("#ddlcountry option:selected").val()),_twoFactor.CellCodeSuccess(!1))),i.VarificationType==_twoFactor.VarificationType.Cell||i.VarificationType==_twoFactor.VarificationType.EmailAndCell)){var a={step:1,isNextClick:1},s=new vagaro.ajax;s.datamodel.Token=_twoFactor.ApiURLEnum.GetLogDataonBackClick,s.datamodel.IsNewVagaroAPI=!0,s.datamodel.data=a,s.datamodel.callback=function(e){},s.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},s.Post()}}else"Invalid"==i.Verifyresponce?(t==_twoFactor.AuthCodeReceiveMode.Email||t==_twoFactor.AuthCodeReceiveMode.EmailAndCell?($("#txtEmailCode").addClass("error"),$("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("Invalid code, try again.")):($("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("Invalid code, try again.")),_twoFactor.cleartwofactortextbox(t)):"Expired"==i.Verifyresponce&&(t==_twoFactor.AuthCodeReceiveMode.Email?($("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("This code is expired, please resend code.")):($("#dvCellCodeError").show(),$("#dvCellCodeError").text("This code is expired, please resend code.")),_twoFactor.cleartwofactortextbox(t))}},i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post();else if(currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag)(i=new vagaro.ajax).datamodel.Token="websiteapi/homepage/verifytwofactorauthentication",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=e,i.datamodel.callback=function(e){if(void 0!==e&&null!=e){var i=e;NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest;var n={};isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId);var o="";if(currentPage==_twoFactor.PageType.ProfilePage?"undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?(n.UserName=$("#paymentmethods #emailid").val(),n.UserEmail=$("#paymentmethods #emailid").val(),o=MyAccountVPLCell.getPhoneData().phoneNo,n.Country=MyAccountVPLCell.getPhoneData().countryId):(n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),o=$("#txtCell").val().replace(/([()-\s])+/g,""),n.Country=MyAccountMobilePhone.getPhoneData().countryId):currentPage==_twoFactor.PageType.CovidClean?(n.UserName=$("#emailid").val(),n.UserEmail=$("#emailid").val(),o=MyAccountVPLCell.getPhoneData().phoneNo,n.Country=MyAccountVPLCell.getPhoneData().countryId):currentPage==_twoFactor.PageType.ShoppingBag&&(n.UserName=$("#emailid").val(),n.UserEmail=$("#emailid").val(),o=ShoppingBagVPLCell.getPhoneData().phoneNo,n.Country=ShoppingBagVPLCell.getPhoneData().countryId),2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.State=$("#txtState").val(),n.City=$("#txtCity").val(),n.NoofAttempt=NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="",n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),currentPage==_twoFactor.PageType.ProfilePage||(n.UserID=parseInt(UserID)),ShowLoader(!1),NoOfLoginAttempt>=$("#hdnFraudNoOfAttemptCustomer").val())return _twoFactor.showErrorDiv(t),sessionStorage.clear(),n.IsBlock=1,void _twoFactor.SaveFilterRequestForCardValidate(n);"Valid"==i.Verifyresponce||"EmailValid"==i.Verifyresponce||"CellValid"==i.Verifyresponce?($("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Cell&&i.VarificationType==_twoFactor.VarificationType.Email?(n.IsEmailPhoneVerified=_twoFactor.VarificationType.EmailAndCell,$("#hdnTwoFactorVerified").val(_twoFactor.VarificationType.EmailAndCell)):($("#hdnTwoFactorVerified").val(i.VarificationType),n.IsEmailPhoneVerified=i.VarificationType),_twoFactor.SaveFilterRequestForCardValidate(n),t==_twoFactor.AuthCodeReceiveMode.Email&&$("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Email&&1==IsEmailPhoneChanged?(twoStepEmail={},currentPage==_twoFactor.PageType.ProfilePage?("undefined"!=typeof TwoFactorPageType&&null!=TwoFactorPageType&&""!=TwoFactorPageType&&TwoFactorPageType==_twoFactor.PageType.PaymentMethods?(twoStepEmail.emailid=$("#paymentmethods #emailid").val(),twoStepEmail.phone=MyAccountVPLCell.getPhoneData().phoneNo,twoStepEmail.CountryID=MyAccountVPLCell.getPhoneData().countryId,twoStepEmail.formattedPhone=MyAccountVPLCell.getphoneformat(MyAccountVPLCell.getPhoneData().phoneNo,MyAccountVPLCell.getPhoneData().countryId)):(twoStepEmail.emailid=$.trim($("#txtEmail").val()),twoStepEmail.phone=MyAccountMobilePhone.getPhoneData().phoneNo,twoStepEmail.CountryID=MyAccountMobilePhone.getPhoneData().countryId,twoStepEmail.formattedPhone=MyAccountMobilePhone.getphoneformat(MyAccountMobilePhone.getPhoneData().phoneNo,MyAccountMobilePhone.getPhoneData().countryId)),twoStepEmail.fullname=$.trim($("#txtFName").val())+" "+$.trim($("#txtLName").val())):currentPage==_twoFactor.PageType.CovidClean?(twoStepEmail.emailid=$("#emailid").val(),twoStepEmail.phone=MyAccountVPLCell.getPhoneData().phoneNo,twoStepEmail.CountryID=MyAccountVPLCell.getPhoneData().countryId,twoStepEmail.fullname=_vgCovidCleanCheckout.model.VplUserDetails.Fullname,twoStepEmail.formattedPhone=MyAccountVPLCell.getphoneformat(MyAccountVPLCell.getPhoneData().phoneNo,MyAccountVPLCell.getPhoneData().countryId)):currentPage==_twoFactor.PageType.ShoppingBag&&(twoStepEmail.emailid=$("#emailid").val(),twoStepEmail.phone=ShoppingBagVPLCell.getPhoneData().phoneNo,twoStepEmail.CountryID=ShoppingBagVPLCell.getPhoneData().countryId,twoStepEmail.fullname=_onlineCheckout.CustomerDetails.FirstName+" "+_onlineCheckout.CustomerDetails.LastName,twoStepEmail.formattedPhone=ShoppingBagVPLCell.getphoneformat(ShoppingBagVPLCell.getPhoneData().phoneNo,ShoppingBagVPLCell.getPhoneData().countryId)),twoStepEmail.IP=$("#hdnIPAddress").val(),twoStepEmail.IsEmailPhoneChanges=IsEmailPhoneChanged,twoStepEmail.NoOfLoginAttemptemail=NoOfLoginAttemptemail,twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,twoStepEmail.IsFromBusinessSignup=!0,_twoFactor.EmailCodeSuccess(twoStepEmail,!0),IsEmailPhoneChanged):$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Email&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email||"EmailValid"==i.Verifyresponce?_twoFactor.CellCodeSuccess(!0):_twoFactor.CellCodeSuccess())):"Invalid"==i.Verifyresponce?(t==_twoFactor.AuthCodeReceiveMode.Email||t==_twoFactor.AuthCodeReceiveMode.EmailAndCell?($("#txtEmailCode").addClass("error"),$("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("Invalid code, try again.")):($("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("Invalid code, try again.")),_twoFactor.cleartwofactortextbox(t)):"Expired"==i.Verifyresponce&&(t==_twoFactor.AuthCodeReceiveMode.Email?($("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("This code is expired, please resend code.")):($("#dvCellCodeError").show(),$("#dvCellCodeError").text("This code is expired, please resend code.")),_twoFactor.cleartwofactortextbox(t))}},i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post();else if(currentPage==_twoFactor.PageType.CustomerSignup)(i=new vagaro.ajax).datamodel.Token="websiteapi/homepage/verifytwofactorauthentication",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=e,i.datamodel.callback=function(e){if(void 0!==e){var i=e;NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest;var n={};isNullOrUndefineOrBlank(fpDeviceId)?isNullOrUndefineOrBlank($("#fpId").val())||(n.UserAgent=navigator.userAgent,n.VisitorID=$("#fpId").val()):(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=$("#txtEmail").val(),n.UserEmail=$("#txtEmail").val(),n.Country=$("#divCountryCode").attr("data-countryId"),n.NoofAttempt=NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="",n.IsPolicyAck=_twoFactor.Model.IsPolicyAck;var o=$("#txtCell").val().replace(/([()-\s])+/g,"");if(2==n.Country&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),ShowLoadingPanelLogin(!1),NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val()){sessionStorage.clear(),n.IsBlock=1,$("#hdnIsBlocked").val(1),IsBlocked=!0,_twoFactor.showErrorDiv(_twoFactor.AuthCodeReceiveMode.Cell),_twoFactor.SaveFilterRequestForCardValidate(n),$("#divConfirmBox").find(".w-button-default").attr("value","Cancel");var a=$("#spnCountryPhoneNo").text();return void showConfirmbox(_twoFactor.FailOTPMessage(a),OnBlockConfirm,"Error Code: XJ140",!1,!0)}if("Valid"==i.Verifyresponce||"EmailValid"==i.Verifyresponce||"CellValid"==i.Verifyresponce)if($("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Cell&&i.VarificationType==_twoFactor.VarificationType.Email?(n.IsEmailPhoneVerified=_twoFactor.VarificationType.EmailAndCell,$("#hdnTwoFactorVerified").val(_twoFactor.VarificationType.EmailAndCell)):($("#hdnTwoFactorVerified").val(i.VarificationType),n.IsEmailPhoneVerified=i.VarificationType),_twoFactor.SaveFilterRequestForCardValidate(n),$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailAndPhone)if(t==_twoFactor.AuthCodeReceiveMode.Email&&$("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Email){var s=custSignupCellPhone.getPhoneData();twoStepEmail={},twoStepEmail.emailid=$.trim($("#txtEmail").val()),twoStepEmail.phone=s.phoneNo,twoStepEmail.formattedPhone=$("#txtCell").val(),twoStepEmail.fullname=$.trim($("#txtFirstname").val())+" "+$.trim($("#txtLastname").val()),twoStepEmail.CountryID=s.countryId,twoStepEmail.IP=$("#hdnIPAddress").val(),twoStepEmail.IsEmailPhoneChanges=IsEmailPhoneChanged,twoStepEmail.NoOfLoginAttemptemail=NoOfLoginAttemptemail,twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,twoStepEmail.IsFromBusinessSignup=!0,twoStepEmail.IsFromCustomerSignup=!0,_twoFactor.EmailCodeSuccess(twoStepEmail,!0)}else $("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email||"EmailValid"==i.Verifyresponce?_twoFactor.CellCodeSuccess(!0):_twoFactor.CellCodeSuccess());else $("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew||$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Email&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email||"EmailValid"==i.Verifyresponce?_twoFactor.CellCodeSuccess(!0):_twoFactor.CellCodeSuccess());else"Invalid"==i.Verifyresponce?(t==_twoFactor.AuthCodeReceiveMode.Email||t==_twoFactor.AuthCodeReceiveMode.EmailAndCell?($("#txtEmailCode").addClass("error"),$("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("Invalid code, try again.")):($("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("Invalid code, try again.")),_twoFactor.cleartwofactortextbox(t)):"Expired"==i.Verifyresponce&&(t==_twoFactor.AuthCodeReceiveMode.Email?($("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("This code is expired, please resend code.")):($("#dvCellCodeError").show(),$("#dvCellCodeError").text("This code is expired, please resend code.")),_twoFactor.cleartwofactortextbox(t))}ShowLoadingPanelLogin(!1)},i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post();else if(currentPage==_twoFactor.PageType.CustomerSignIn)(i=new vagaro.ajax).datamodel.Token="websiteapi/homepage/verifytwofactorauthentication",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=e,i.datamodel.callback=function(e){if(void 0!==e&&null!=e){var i=e;NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest;var n={};isNullOrUndefineOrBlank(fpDeviceId)||(n.UserAgent=navigator.userAgent,n.VisitorID=fpDeviceId),n.UserName=isNullOrUndefineOrBlank($("#txtEmailInputCode").val())||$("#txtEmailInputCode").val()==userccattemptdata.EmailId?userccattemptdata.EmailId:$("#txtEmailInputCode").val(),n.UserEmail=isNullOrUndefineOrBlank($("#txtEmailInputCode").val())||$("#txtEmailInputCode").val()==userccattemptdata.EmailId?userccattemptdata.EmailId:$("#txtEmailInputCode").val(),n.NoofAttempt=NoOfLoginAttemptemail,n.IP=$("#hdnIPAddress").val(),n.DeviceFullName="";var o=isNullOrUndefineOrBlank($("#txtCellInputCode").val())||$("#txtCellInputCode").val().replace(/([()-\s])+/g,"")==userccattemptdata.PhoneNo?userccattemptdata.PhoneNo:$("#txtCellInputCode").val().replace(/([()-\s])+/g,"");if(2==("5"==$("#selectedCountrydiv").attr("data-countryid")?"2":$("#selectedCountrydiv").attr("data-countryid"))&&0==o[0]?n.OwnersPhone=o.substring(1):n.OwnersPhone=o,n.IsEmailPhoneVerified=$("#hdnTwoFactorVerified").val(),n.UserId=userccattemptdata.UserID,NoOfLoginAttempt>=$("#hdnFraudNoOfAttempt").val())return _twoFactor.showErrorDiv(t),sessionStorage.clear(),n.IsBlock=1,void _twoFactor.SaveFilterRequestForCardValidate(n);if(ShowLoadingPanelLogin(!1),"Valid"==i.Verifyresponce){$("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Cell&&i.VarificationType==_twoFactor.VarificationType.Email?(n.IsEmailPhoneVerified=_twoFactor.VarificationType.EmailAndCell,$("#hdnTwoFactorVerified").val(_twoFactor.VarificationType.EmailAndCell)):($("#hdnTwoFactorVerified").val(i.VarificationType),n.IsEmailPhoneVerified=i.VarificationType),_twoFactor.SaveFilterRequestForCardValidate(n);var a=0==isNullOrUndefineOrBlank($("#txtEmailInputCode").val())&&userccattemptdata.EmailId!=$("#txtEmailInputCode").val(),s=0==isNullOrUndefineOrBlank($("#txtCellInputCode").val().replace(/([()-\s])+/g,""))&&userccattemptdata.PhoneNo!=$("#txtCellInputCode").val().replace(/([()-\s])+/g,"");if(a||s){vgSaveUserProfiledata={},vgSaveUserProfiledata.UserID=userccattemptdata.UserID,vgSaveUserProfiledata.EmailID=a?$.trim($("#txtEmailInputCode").val()):userccattemptdata.EmailId;var r=s?$.trim($("#txtCellInputCode").val().replace(/([()-\s])+/g,"")):userccattemptdata.PhoneNo.replace(/([()-\s])+/g,"");2==("5"==$("#selectedCountrydiv").attr("data-countryid")?"2":$("#selectedCountrydiv").attr("data-countryid"))&&0==r[0]?vgSaveUserProfiledata.Cell=r.substring(1):vgSaveUserProfiledata.Cell=r;var l=new vagaro.ajax;l.datamodel.Token="websiteapi/homepage/saveuseremailphonefortwofactor",l.datamodel.data=vgSaveUserProfiledata,l.datamodel.IsNewVagaroAPI=!0,l.datamodel.callback=function(e){null!=e&&e?$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailAndPhone||!isNullOrUndefineOrBlank(userccattemptdata.IsTwoStepForSP)&&userccattemptdata.IsTwoStepForSP?t==_twoFactor.AuthCodeReceiveMode.Email&&$("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Email?(twoStepEmail={},twoStepEmail.emailid=isNullOrUndefineOrBlank($("#txtEmailInputCode").val())||$("#txtEmailInputCode").val()==userccattemptdata.EmailId?userccattemptdata.EmailId:$("#txtEmailInputCode").val(),twoStepEmail.phone=isNullOrUndefineOrBlank($("#txtCellInputCode").val())||$("#txtCellInputCode").val().replace(/([()-\s])+/g,"")==userccattemptdata.PhoneNo?userccattemptdata.PhoneNo:$("#txtCellInputCode").val().replace(/([()-\s])+/g,""),twoStepEmail.formattedPhone=isNullOrUndefineOrBlank($("#txtCellInputCode").val())||$("#txtCellInputCode").val().replace(/([()-\s])+/g,"")==userccattemptdata.PhoneNo?userccattemptdata.PhoneNo:$("#txtCellInputCode").val().replace(/([()-\s])+/g,""),twoStepEmail.fullname=userccattemptdata.FullName,twoStepEmail.IP=$("#hdnIPAddress").val(),twoStepEmail.NoOfLoginAttemptemail=NoOfLoginAttemptemail,twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,twoStepEmail.IsFromBusinessSignup=!0,_twoFactor.EmailCodeSuccess(twoStepEmail,!0)):$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.Model.IsPolicyAck?TwoStepAuth.init("privacypolicy",void 0,void 0,void 0,void 0,void 0,void 0,void 0,_twoFactor.Model.IsPolicyAck,_twoFactor.Model.UserType,_twoFactor.Model.UserID):_twoFactor.CellCodeSuccess(!0):_twoFactor.Model.IsPolicyAck?TwoStepAuth.init("privacypolicy",void 0,void 0,void 0,void 0,void 0,void 0,void 0,_twoFactor.Model.IsPolicyAck,_twoFactor.Model.UserType,_twoFactor.Model.UserID):_twoFactor.CellCodeSuccess()):$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew||$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Email&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.CellCodeSuccess(!0):_twoFactor.CellCodeSuccess()):vagaro.alert(_twoFactor.ValidationMessages.FailedUserSaveMsg)},l.datamodel.Error=function(e){ShowLoader(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},l.Post()}else $("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailAndPhone||!isNullOrUndefineOrBlank(userccattemptdata.IsTwoStepForSP)&&userccattemptdata.IsTwoStepForSP?t==_twoFactor.AuthCodeReceiveMode.Email&&$("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Email?(twoStepEmail={},twoStepEmail.emailid=isNullOrUndefineOrBlank($("#txtEmailInputCode").val())||$("#txtEmailInputCode").val()==userccattemptdata.EmailId?userccattemptdata.EmailId:$("#txtEmailInputCode").val(),twoStepEmail.phone=isNullOrUndefineOrBlank($("#txtCellInputCode").val())||$("#txtCellInputCode").val().replace(/([()-\s])+/g,"")==userccattemptdata.PhoneNo?userccattemptdata.PhoneNo:$("#txtCellInputCode").val().replace(/([()-\s])+/g,""),twoStepEmail.formattedPhone=isNullOrUndefineOrBlank($("#txtCellInputCode").val())||$("#txtCellInputCode").val().replace(/([()-\s])+/g,"")==userccattemptdata.PhoneNo?userccattemptdata.PhoneNo:$("#txtCellInputCode").val().replace(/([()-\s])+/g,""),twoStepEmail.fullname=userccattemptdata.FullName,twoStepEmail.CountryID=userccattemptdata.CountryID,twoStepEmail.IP=$("#hdnIPAddress").val(),twoStepEmail.NoOfLoginAttemptemail=NoOfLoginAttemptemail,twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,twoStepEmail.IsFromBusinessSignup=!0,_twoFactor.EmailCodeSuccess(twoStepEmail,!0)):$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email?_twoFactor.Model.IsPolicyAck?TwoStepAuth.init("privacypolicy",void 0,void 0,void 0,void 0,void 0,void 0,void 0,_twoFactor.Model.IsPolicyAck,_twoFactor.Model.UserType,_twoFactor.Model.UserID):_twoFactor.CellCodeSuccess(!0):_twoFactor.Model.IsPolicyAck?TwoStepAuth.init("privacypolicy",void 0,void 0,void 0,void 0,void 0,void 0,void 0,_twoFactor.Model.IsPolicyAck,_twoFactor.Model.UserType,_twoFactor.Model.UserID):_twoFactor.CellCodeSuccess()):$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew||$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Email&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(_twoFactor.AuthCodeReceiveMode.Email,_twoFactor.Model.IsPolicyAck?TwoStepAuth.init("privacypolicy",void 0,void 0,void 0,void 0,void 0,void 0,void 0,_twoFactor.Model.IsPolicyAck,_twoFactor.Model.UserType,_twoFactor.Model.UserID):_twoFactor.CellCodeSuccess())}else"Invalid"!=i.Verifyresponce&&"Expired"!=i.Verifyresponce||("Invalid"==i.Verifyresponce?t==_twoFactor.AuthCodeReceiveMode.Email?($("#txtEmailCode").addClass("error"),$("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("Invalid code, try again.")):($("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("Invalid code, try again.")):"Expired"==i.Verifyresponce&&(t==_twoFactor.AuthCodeReceiveMode.Email?($("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("This code is expired, please resend code.")):($("#dvCellCodeError").show(),$("#dvCellCodeError").text("This code is expired, please resend code."))),t==_twoFactor.AuthCodeReceiveMode.Email||t==_twoFactor.EmailAndCell2FScreen.EmailOrPhone||t==_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew?$("#txtEmailCode").focus():$("#txtCellCode").focus())}},i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post();else if(currentPage==_twoFactor.PageType.MultiLocation){var i;(i=new vagaro.ajax).datamodel.Token="websiteapi/homepage/verifytwofactorauthentication",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.data=e,i.datamodel.callback=function(e){if(void 0!==e&&null!=e){var i=e;NoOfLoginAttempt=i.TwoFactorVerifyAttempt,NoOfLoginAttemptemail=i.TwoFactorRequest,"Valid"==i.Verifyresponce||"EmailValid"==i.Verifyresponce||"CellValid"==i.Verifyresponce?($("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Cell&&i.VarificationType==_twoFactor.VarificationType.Email?$("#hdnTwoFactorVerified").val(_twoFactor.VarificationType.EmailAndCell):$("#hdnTwoFactorVerified").val(i.VarificationType),$("#hdnEmailAndCell2FScreen").val()==_twoFactor.EmailAndCell2FScreen.EmailAndPhone?t==_twoFactor.AuthCodeReceiveMode.Email&&$("#hdnTwoFactorVerified").val()==_twoFactor.VarificationType.Email?(twoStepEmail.AuthenticationMode=_twoFactor.AuthCodeReceiveMode.Cell,_twoFactor.EmailCodeSuccess(twoStepEmail,!0)):$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email||"EmailValid"==i.Verifyresponce?_twoFactor.CellCodeSuccess(!0):_twoFactor.CellCodeSuccess()):$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhone&&$("#hdnEmailAndCell2FScreen").val()!=_twoFactor.EmailAndCell2FScreen.EmailOrPhoneNew||$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Email&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.Cell&&$("#hdnTwoFactorVerified").val()!=_twoFactor.VarificationType.EmailAndCell||(t==_twoFactor.AuthCodeReceiveMode.Email||"EmailValid"==i.Verifyresponce?_twoFactor.CellCodeSuccess(!0):_twoFactor.CellCodeSuccess())):"Invalid"==i.Verifyresponce?(t==_twoFactor.AuthCodeReceiveMode.Email||t==_twoFactor.AuthCodeReceiveMode.EmailAndCell?($("#txtEmailCode").addClass("error"),$("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("Invalid code, try again.")):($("#txtCellCode").addClass("error"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("Invalid code, try again.")),ShowLoader(!1),_twoFactor.cleartwofactortextbox(t)):"Expired"==i.Verifyresponce&&(t==_twoFactor.AuthCodeReceiveMode.Email?($("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("This code is expired, please resend code.")):($("#dvCellCodeError").show(),$("#dvCellCodeError").text("This code is expired, please resend code.")),ShowLoader(!1),_twoFactor.cleartwofactortextbox(t))}},i.datamodel.Error=function(){ShowLoader(!1),vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post()}},resetTimer:function(){var e=1*$("#hdnAuthCodeExpireTime").val()*60;if(e>0){d=Number(e);var t=Math.floor(d%3600/60),i=Math.floor(d%3600%60);i<10&&(i="0"+i),$("#twostepcountdown").text(t+":"+i)}},SaveFilterRequestForCardValidate:function(e,t=""){if(currentPage==_twoFactor.PageType.BusinessSignup)ShowLoader(!0),e.IsFromSignup=!0,(i=new vagaro.ajax).datamodel.Token="addbusiness/savefilterrequestforcardvalidate",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(i){if(null!=i&&(ShowLoader(!1),currentPage==_twoFactor.PageType.BusinessSignup)){if(i.Step=e.Step,vm.userccattemptdata=i,!isNullOrUndefineOrBlank(vm.userccattemptdata)&&(vm.userccattemptdata.IsBlock||vm.userccattemptdata.NoOfAttempt>=10)){var n=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/signup-1";window.setTimeout(function(){window.location.href=n},4300)}""!=t&&3==vm.userccattemptdata.Step&&(ShowLoader(!1),swal({title:t,text:"",type:"error",showCancelButton:!1,closeOnConfirm:!0,confirmButtonText:"OK",html:!0},function(e){"true"==$("#hdnIsShowBusinessCaptcha").val()&&0==isNullOrUndefineOrBlank(vm.userccattemptdata)&&vm.userccattemptdata.NoOfAttempt>=3?($("#zs_paymentframe").html(""),$("#zs_paymentframe").hide(),vm.ShowCustomCaptcha(),ShowLoader(!1)):vm.LoadCCFrame()}))}},i.datamodel.data=e,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post();else if(currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag){ShowLoader(!0);var i=new vagaro.ajax;currentPage==_twoFactor.PageType.ProfilePage?i.datamodel.Token=ApiURLEnumMyAccount.SaveFilterRequestForCardValidate:i.datamodel.Token=_twoFactor.ApiURLEnum.SaveFilterrequestForCardValidate,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(e){if(null!=e){ShowLoader(!1);var t=e;!isNullOrUndefineOrBlank(t)&&t.IsBlock&&(CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed),CallbackforMobileApp(0,0,"","",0,6))}},i.datamodel.data=e,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post()}else currentPage==_twoFactor.PageType.CustomerSignup?(ShowLoadingPanelLogin(!0),(i=new vagaro.ajax).datamodel.Token="addbusiness/savefilterrequestforcardvalidate",i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(e){null!=e&&(ShowLoadingPanelLogin(!1),!isNullOrUndefineOrBlank(userccattemptdata=e)&&(userccattemptdata.IsBlock||userccattemptdata.NoOfAttempt>=$("#hdnFraudNoOfAttempt").val())&&window.setTimeout(function(){$("#divAuth").hide(),$("#pnlSignup").show(),$("#iFrameSignUp",parent.document).parents().find("#signupheaderpart").show(),$("#divConfirmBox").find(".w-button-default").attr("value","Cancel");var e=$("#spnCountryPhoneNo").text();showConfirmbox(_twoFactor.FailOTPMessage(e),"","Error Code: XJ140",!1,!1)},4300))},i.datamodel.data=e,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post()):currentPage==_twoFactor.PageType.CustomerSignIn?(ShowLoadingPanelLogin(!0),(i=new vagaro.ajax).datamodel.Token=_twoFactor.ApiURLEnum.SaveFilterrequestForCardValidate,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(e){void 0!==e&&null!=e&&(ShowLoadingPanelLogin(!1),(e.IsBlock||e.NoOfAttempt>=3)&&window.setTimeout(function(){bootbox.alert({className:"vagaro-midium-popup",message:_twoFactor.FailOTPMessage(),title:"Error Code: XJ140",callback:function(){window.location.reload()}})},4300))},i.datamodel.data=e,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post()):currentPage==_twoFactor.PageType.ProfilePage&&(ShowLoader(!0),(i=new vagaro.ajax).datamodel.Token=ApiURLEnumMyAccount.SaveFilterRequestForCardValidate,i.datamodel.IsNewVagaroAPI=!0,i.datamodel.callback=function(e){if(null!=e){ShowLoader(!1);var t=e;!isNullOrUndefineOrBlank(t)&&t.IsBlock&&(CallWebServicehed("MySampleService.asmx/DoLogout","",CallSuccessLogout,CallFailed),CallbackforMobileApp(0,0,"","",0,6))}},i.datamodel.data=e,i.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},i.Post())},AllowNumberOnly:function(e){if(69==event.keyCode)return event.preventDefault(),!1;var t=$(e);t.removeClass("error"),t.next("span").hide(),13==event.keyCode&&("txtEmailCode"==$(e).attr("id")?_twoFactor.VerifyEmailCode():_twoFactor.VerifyCellCode()),/\D/g.test(t.val())&&t.val(t.val().replace(/\D/g,""));var i=t.val(),n=i.length;if(n<=0)return t.removeClass("filled"),!1;if(n>6)return t.val(i.substring(0,6)),!1;var o=/^\d+$/;if(currentPage==_twoFactor.PageType.CustomerSignup){if(!isNullOrUndefineOrBlank(i)&&!o.test(i))return event.preventDefault(),!1}else if(!isNullOrUndefineOrBlank(i)&&!o.test(i))return event.preventDefault(),!1;return"txtCellCode"!=e.id&&"txtEmailCode"!=e.id||t.addClass("filled"),!0},showErrorDiv:function(e,t=!1){var i=$("#spnCountryPhoneNo").text();e==_twoFactor.AuthCodeReceiveMode.Email?(t&&_twoFactor.AppendEmailScreen(ReturnValue,currentPage),_twoFactor.disabletwofactortextbox("#txtEmailCode"),$("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("You have reached your limit of attempts. "+_twoFactor.FailOTPMessage(i,!0))):e==_twoFactor.AuthCodeReceiveMode.Cell?(t&&_twoFactor.AppendCellScreen(ReturnValue),_twoFactor.disabletwofactortextbox("#txtCellCode"),$("#dvCellCodeError").show(),$("#dvCellCodeError").text("You have reached your limit of attempts. "+_twoFactor.FailOTPMessage(i,!0))):e==_twoFactor.AuthCodeReceiveMode.EmailAndCell&&(_twoFactor.disabletwofactortextbox("#txtEmailCode"),$("#dvEmailCodeError").show(),$("#dvEmailCodeError").text("You have reached your limit of attempts. "+_twoFactor.FailOTPMessage(i,!0)))},validateEmail:function(){var e=$("#txtEmailInputCode").val();return""!=e?null==e.match(/^[A-Za-z0-9_\+-]+(\.[A-Za-z0-9_\+-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.([A-Za-z]{2,10})$/g)?($("#txtEmailInputCode").addClass("error").focus(),$("#dvEmailInputError").html("Invalid email address").show(),ShowLoadingPanelLogin(!1),!1):($("#txtEmailInputCode").removeClass("error"),$("#dvEmailInputError").html("").hide(),ShowLoadingPanelLogin(!1),13==event.keyCode&&_twoFactor.SendEmailCodeFromInputScreen(!0),!0):($("#txtEmailInputCode").addClass("error").focus(),$("#dvEmailInputError").html("Enter your email").show(),ShowLoadingPanelLogin(!1),!1)},BackFromAuth:function(e){if(e==_twoFactor.PageType.CustomerSignup){isResetTimer=!1;var t=$("#iFrameSignUp").contents();$("#pnlSignup",t).show(),$("#signupheaderpart").show(),$("#divAuth",t).hide(),$("#hdnIsResetCode",t).val("0"),(i=$("#dvRegHid")).length>0&&(i.removeClass("email"),i.removeClass("phone"),i.removeClass("success")),_twoFactor.isMobileDevice&&$("#btnCreateAccount",parent.document).show(),$("#iFrameSignUp",parent.document).parents().find("body").addClass("signupiframe")}else if(currentPage==_twoFactor.PageType.CustomerSignIn)ShowLoadingPanelLogin(!0),null!=typeof _twoFactor.Model.IsPolicyAck&&void 0!==_twoFactor.Model.IsPolicyAck&&_twoFactor.Model.IsPolicyAck?TwoStepAuth.init("privacypolicy",void 0,void 0,void 0,void 0,void 0,void 0,void 0,_twoFactor.Model.IsPolicyAck,_twoFactor.Model.UserType,_twoFactor.Model.UserID,!0):isNullOrUndefineOrBlank(SkipTwoFactoFromSignIn)||SkipTwoFactoFromSignIn();else if(currentPage==_twoFactor.PageType.ProfilePage||currentPage==_twoFactor.PageType.CovidClean||currentPage==_twoFactor.PageType.ShoppingBag)$("#dvPhoneVerify").hide(),$("#dvEmailVerify").hide(),$("#divtwofactorauthentication").modal("hide");else if(currentPage==_twoFactor.PageType.CustomerSignup){var i;isResetTimer=!1,$("#pnlSignup").show(),$("#iFrameSignUp",parent.document).parents().find("#signupheaderpart").show(),$("#divAuth").hide(),(i=$("#iFrameSignUp",parent.document).parents().find("#dvRegHid")).length>0&&(i.removeClass("email"),i.removeClass("phone"),i.removeClass("success")),_twoFactor.isMobileDevice&&$("#btnCreateAccount",parent.document).show(),$("#iFrameSignUp",parent.document).parents().find("body").addClass("signupiframe")}else if(currentPage==_twoFactor.PageType.BusinessSignup){1==_twoFactor.Model.isFromInvalidEmailCell&&($("#hdnEmailAndCell2FScreen").val(_twoFactor.EmailAndCell2FScreen.None),_twoFactor.Model.isFromInvalidEmailCell=!1),vm.ISfromgetmailphonevalidated=!1,vm.isResetTimer=!1,$("#dvAuth").hide(),$("#divBusinessSteps").show();var n={step:-11,isNextClick:0},o=new vagaro.ajax;o.datamodel.Token=_twoFactor.ApiURLEnum.GetLogDataonBackClick,o.datamodel.IsNewVagaroAPI=!0,o.datamodel.data=n,o.datamodel.callback=function(e){},o.datamodel.Error=function(){vagaro.alert(_twoFactor.ValidationMessages.FailedErrorMessage)},o.Post()}else currentPage==_twoFactor.PageType.MultiLocation&&($find("mpeNewBusiness").show(),$("#divtwofactorauthentication").css("z-index","0"),$("#divtwofactorauthentication").hide())},validatePhone:function(e,t,i){if(currentPage==_twoFactor.PageType.CustomerSignIn)var n=$("#selectedCountrydiv").attr("data-countryid");else currentPage==_twoFactor.PageType.ProfilePage&&(n=$("#temphdncountryid").val());void 0!==i&&null!=i&&""!=i&&(n=i);var o=$(e),a=o.val().replace(/([()-\s])+/g,""),s=a.length;if(s<=0)return"#revtxtnightphoneCust"==t||"#revtxtdayphoneCust"==t||"#divInvalidMobileMessage"==t?$(t).hide():($(t).show(),$(t).html("Enter your mobile phone")),o.addClass("error").focus(),ShowLoadingPanelLogin(!1),!1;if(!isNullOrUndefineOrBlank(a)&&!/^\d+$/.test(a))return event.preventDefault(),ShowLoadingPanelLogin(!1),!1;if(2!=n&&11==s&&0==a[0]&&(s=(a=a.substring(1)).length),1==n||3==n){if(10!=s)return o.val(a),$(t).show(),"#revtxtnightphoneCust"==t?($("#revtxtnightphoneCust").attr("style","display:inline"),$(t).html("Night phone should be of 10 digits.")):"#revtxtdayphoneCust"==t?($("#revtxtdayphoneCust").attr("style","display:inline"),$(t).html("Day phone should be of 10 digits.")):("#divInvalidMobileMessage"==t&&$("#divInvalidMobileMessage").attr("style","display:inline"),$(t).html("Phone number should be of 10 digits")),o.addClass("error").focus(),!1}else if(2==n){if(s<10||s>11)return o.val(a),$(t).show(),"#revtxtnightphoneCust"==t?($("#revtxtnightphoneCust").attr("style","display:inline"),$(t).html("Night phone should be of 10 or 11 digits.")):"#revtxtdayphoneCust"==t?($("#revtxtdayphoneCust").attr("style","display:inline"),$(t).html("Day phone should be of 10 or 11 digits.")):("#divInvalidMobileMessage"==t&&$("#divInvalidMobileMessage").attr("style","display:inline"),$(t).html("Phone number should be of 10 or 11 digits")),o.addClass("error").focus(),!1;10==s&&0!=a[0]?s=(a=0+a).length:(s<=10||12==s)&&0==a[0]&&(s=(a=a.substring(1)).length),o.val(a.replace(/(\d{3})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3"))}else if(4==n||5==n){if(s<9||s>10)return o.val(a),$(t).show(),"#revtxtnightphoneCust"==t?($("#revtxtnightphoneCust").attr("style","display:inline"),$(t).html("Night phone should be of 9 or 10 digits.")):"#revtxtdayphoneCust"==t?($("#revtxtdayphoneCust").attr("style","display:inline"),$(t).html("Day phone should be of 9 or 10 digits.")):("#divInvalidMobileMessage"==t&&$("#divInvalidMobileMessage").attr("style","display:inline"),$(t).html("Phone number should be of 9 or 10 digits")),o.addClass("error").focus(),!1;9==s&&0!=a[0]?s=(a=0+a).length:(s<=9||s>10)&&0==a[0]&&(s=(a=a.substring(1)).length),o.val(a.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3"))}return $(t).hide(),13==event.keyCode&&_twoFactor.SendPhoneCodeFromInputScreen(!0),!0},ShowCountry:function(){return $(".countryselectoption").is(":visible")?void $(".countryselectoption").hide():void $(".countryselectoption").show()},selectCountry:function(e,t){$("#selectedCountrydiv").removeClass().addClass("selectedcountry "+t),$("#selectedCountrydiv").attr("data-countryId",e),_twoFactor.Phone_format("#txtCellInputCode","#dvCellInputCodeError",e),_twoFactor.ShowCountry(),$("#txtCellInputCode").attr("tabindex",-1).focus(),_twoFactor.Model.DialingCode=2==e||5==e?2==e?"44":"353":""},Phone_format:function(e,t,i){if(currentPage==_twoFactor.PageType.CustomerSignIn)var n=$("#selectedCountrydiv").attr("data-countryId");else currentPage==_twoFactor.PageType.ProfilePage&&(n=$("#temphdncountryid").val());null!=typeof i&&null!=i&&""!=i&&(n=i);var o=$(e);/\D/g.test(o.val())&&o.val(o.val().replace(/\D/g,"")),1==n?o.removeClass("cntry-ca cntry-ie").addClass("cntry-us"):3==n?o.removeClass("cntry-us cntry-ie").addClass("cntry-ca"):5==n?o.removeClass("cntry-ca cntry-us").addClass("cntry-ie"):o.removeClass("cntry-ca cntry-us cntry-ie");var a=o.val().replace(/([()-\s])+/g,""),s=a.length;if(!(s<=0))return o.removeClass("error"),isNullOrUndefineOrBlank(a)||/^\d+$/.test(a)?($(t).hide(),2!=n&&11==s&&0==a[0]&&(s=(a=a.substring(1)).length),1!=n&&3!=n||10!=s?2==n?(10==s&&0!=a[0]?s=(a=0+a).length:(s<=10||12==s)&&0==a[0]&&(s=(a=a.substring(1)).length),10==s||11==s?o.val(a.replace(/(\d{3})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3")):o.val(a)):4==n||5==n?(9==s&&0!=a[0]?s=(a=0+a).length:(s<=9||s>10)&&0==a[0]&&(s=(a=a.substring(1)).length),9==s||10==s?o.val(a.replace(5==n?/(\d{3})\-?(\d{3})\-?(\d{4})/:/(\d{2})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3")):o.val(a)):o.val(a):3==n?o.val(a.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"$1-$2-$3")):o.val(a.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"($1) $2-$3")),ShowLoadingPanelLogin(!1),!0):(event.preventDefault(),ShowLoadingPanelLogin(!1),!1);ShowLoadingPanelLogin(!1)},formatEmail:function(e){var t=e.split("@");return 2==t.length&&(e=_twoFactor.formatCell(t[0],!0)+"@"+t[1]),e},formatCell:function(e,t=!1,i=0){var n="",o=3;e.length<=3&&(o=1);for(var a=0;a<e.length-o;a++)n+="*";if(0==t){switch(i){case"4":phoneNumHidden="(**) **** *";break;case"3":phoneNumHidden="***-***-*";break;case"2":phoneNumHidden="*** **** *";case"1":phoneNumHidden="(***) ***-*";break;default:phoneNumHidden=n}e=phoneNumHidden+e.substring(e.length-o,e.length)}else e=n+e.substring(e.length-o,e.length);return e},AdaPassiveMessage:function(e,t){$("#spnEmailCellcode").html(e),setTimeout(function(){$("#spnEmailCellcode").html("")},5e3),void 0!==t&&null!=t&&(t==_twoFactor.AuthCodeReceiveMode.Email||t==_twoFactor.AuthCodeReceiveMode.EmailAndCell?$("#txtEmailCode").focus():$("#txtCellCode").focus())},IsFromCookieLessWidget:function(){var e=!1;if("undefined"!=typeof _common&&void 0!==_common.IsCookieLessWidget&&_common.IsCookieLessWidget())e=!("undefined"==typeof _common||void 0===_common.IsCookieLessWidget||!_common.IsCookieLessWidget());else try{void 0!==window.parent._common&&void 0!==window.parent._common.IsCookieLessWidget&&window.parent._common.IsCookieLessWidget()&&(e=!(void 0===window.parent._common||void 0===window.parent._common.IsCookieLessWidget||!window.parent._common.IsCookieLessWidget()))}catch(e){}return e},AjaxOld:function(e,t,i,n){var o=new vagaro.ajax;o.datamodel.Token=e,o.datamodel.data=t,o.datamodel.callback=i,o.datamodel.Error=n,o.Post()}};var intRegex=/^\d+$/;function pasteValues(e){var t=e.split("");$(t).each(function(e){var i="txtfirstcode";switch(e){case 1:i="txtsecondcode";break;case 2:i="txtthirdcode";break;case 3:i="txtfourcode";break;case 4:i="txtfivecode";break;case 5:i="txtsixcode";break;default:i="txtfirstcode"}$('.inputcode[name="'+i+'"]').val(t[e]),"txtfirstcode"==i&&$("#txtsixcode").focus()})}function ShowHideDoneMessage(e,t){if(currentPage==_twoFactor.PageType.MultiLocation)$(".multilocation-Success .text-block-28").html(e),$(".multilocation-Success").addClass("showmsgTop").css("display",""),setTimeout(function(){window.scrollTo({top:0,behavior:"smooth"})},200),setTimeout(function(){$(".multilocation-Success").removeClass("showmsgTop").css("display","")},3200);else if(currentPage==_twoFactor.PageType.CustomerSignup)window.parent.$(".banner-success-master.customerSignup .text-block-28").html(e),window.parent.$(".banner-success-master.customerSignup").addClass("showmsgTop").css("display",""),setTimeout(function(){window.scrollTo({top:0,behavior:"smooth"})},200),setTimeout(function(){window.parent.$(".banner-success-master").removeClass("showmsgTop").css("display","")},3200);else{$(".banner-success-master .text-block-28").html(e);var i=$(".banner-success-master");i.addClass("showmsgTop").css("display",""),e!=_twoFactor.SuccessMessage.EmailVerified&&e!=_twoFactor.SuccessMessage.PhoneVerified||setTimeout(function(){i.removeAttr("role").attr("aria-label",e).attr("tabindex",-1).focus()},300),setTimeout(function(){window.scrollTo({top:0,behavior:"smooth"})},200),setTimeout(function(){var t=$(".banner-success-master");t.removeClass("showmsgTop").css("display",""),e!=_twoFactor.SuccessMessage.EmailVerified&&e!=_twoFactor.SuccessMessage.PhoneVerified||(t.removeAttr("aria-label").attr("role","none"),setTimeout(function(){$("#h2AccountVerified").is(":visible")?$("#h2AccountVerified").attr("tabindex",-1).focus():($("#h2VerifyPhone").is(":visible")||e==_twoFactor.SuccessMessage.PhoneVerified)&&$("#h2VerifyPhone").attr("tabindex",-1).focus()},500))},3200)}}function GetDisplayMessageTime(e){var t=2e3;return""!=e&&e.length>0&&(e.length<50?t=2e3:e.length<100?t=3e3:e.length<200?t=4e3:e.length>200&&(t=7e3)),t}function isNullOrUndefineOrBlank(e){return void 0===e||null==e||""==e||null==e}$(document).on("input.fromManual",".inputcode",function(){intRegex.test($(this).val())||$(this).val("")}),$(document).on("focus","#twostepemailcodeinfo input",function(){(isiPhone||/iPad/.test(navigator.userAgent))&&setTimeout(function(){isNullOrUndefineOrBlank(currentPage)||currentPage!=_twoFactor.PageType.CustomerSignup?$("html").scrollTop("0"):$("html",parent.document).scrollTop("0")},100)}),$(document).on("focusin","#txtEmailInputCode,#txtEmailCode,#txtCellInputCode,#txtCellCode",function(){currentPage==_twoFactor.PageType.CustomerSignup&&_twoFactor.isMobileDevice&&$("body.customer-signup-body").addClass("keyboradopen")}),$(document).on("focusout","#txtEmailInputCode,#txtEmailCode,#txtCellInputCode,#txtCellCode",function(){currentPage==_twoFactor.PageType.CustomerSignup&&_twoFactor.isMobileDevice&&$("body.customer-signup-body").removeClass("keyboradopen")}),$(document).on("paste",".inputcode",function(){var e=$(this),t=e.val();e.val(""),e.one("input.fromPaste",function(){$currentInputBox=$(this);var i=$currentInputBox.val();6==i.length&&intRegex.test(i)?pasteValues(i):e.val(t),$(".inputcode").attr("maxlength",1)}),$(".inputcode").attr("maxlength",6)}),$.fn.GoogleAddressPlugin=function(e){var t=$.extend({Control:this,ControlId:this.attr("id"),Address2Control:"",CurrentLocationCountryID:1,AddressData:{},CountryDropDownRole:2,AddressFor:1,IsLiveStreamAddress:!1,IsDisabled:!1,ScrollType:2,IsAddManualAddress:!1,IsSaveManualAddress:!1,IsAddressRequired:!1,DisabledCountry:!1,IsReturnCountryID:!1,IsDistance:!1},e),i={model:{countryFlag:{1:"us-f",2:"uk-f",3:"canada-f",4:"aus-f"},countryMapForAPI:{1:"US",2:"GB",3:"CA",4:"AU"},countryName:{1:"United States of America",2:"United Kingdom",3:"Canada",4:"Australia"},stateList:{},CountryId:void 0!==t.AddressData.country?t.AddressData.country:"undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail&&""!=countryIdBusDetail?parseInt(countryIdBusDetail,10):t.CurrentLocationCountryID,errorMessage:"Something went wrong, Try Again.",addressPlaceHolder:"Address Line 1",addressPlaceHolderUKOnly:"E.g. Post Code 'CR0 3RL' or 1st line '36 Factory Lane'",lableLanguage:[{CountryId:0,Zip:"Postal Code",City:"City",State:"State",IsStateDropDown:0,IsStateless:0,IsZipless:0},{CountryId:1,Zip:"ZIP Code",City:"City",State:"State",IsStateDropDown:1,IsStateless:0,IsZipless:0},{CountryId:2,Zip:"Postcode",City:"City",State:"County",IsStateDropDown:1,IsStateless:0,IsZipless:0},{CountryId:3,Zip:"Postal Code",City:"City",State:"Province",IsStateDropDown:1,IsStateless:0,IsZipless:0},{CountryId:4,Zip:"Postcode",City:"Suburb",State:"State/Territory",IsStateDropDown:1,IsStateless:0,IsZipless:0},{CountryId:194,Zip:"Postal Code",City:"City",State:"State",IsStateDropDown:0,IsStateless:1,IsZipless:0},{CountryId:236,Zip:"Postal Code",City:"City",State:"State",IsStateDropDown:0,IsStateless:0,IsZipless:1},{CountryId:12,Zip:"Postal Code",City:"City",State:"State",IsStateDropDown:0,IsStateless:0,IsZipless:1}],lblRow:{},IsStateless:0,IsZipless:0},ApiURLEnum:{getState:"address/getstatesbymultiplecountryid",getStateCode:"address/GetCityByZipCodeWithStatecode",getPlaceDetailByPlaceId:"address/GetPlaceDetailByPlaceId",getLocationOrPlaceDetail:"address/GetLocationOrPlaceDetail"},ControlsPrefix:{addressControl:"#"+t.ControlId,countrySelectOption:"#countryselectoption"+t.ControlId,addressPopup:"#addressPopup"+t.ControlId,AddressControllerCountry:"#AddressControllerCountry"+t.ControlId,myCountryPopup:"#mycountryPopup"+t.ControlId,countrySelectoptionPopup:"#countryselectoptionpopup"+t.ControlId,btnPopupClose:"#btnPopupClose"+t.ControlId,popUpCntryDropDownID:"#popUpCntryDropDownID"+t.ControlId,ddlState:"#ddlState"+t.ControlId,lblZipCodePopup:"#lblZipCodePopup"+t.ControlId,txtZip:"#txtZip"+t.ControlId,lblStatePopup:"#lblStatePopup"+t.ControlId,lblCityPopup:"#lblCityPopup"+t.ControlId,txtCity:"#txtCity"+t.ControlId,txtStreet:"#txtStreet"+t.ControlId,txtStreet1:"#txtStreet1"+t.ControlId,txtState:"#txtState"+t.ControlId,btnCancelGetAddress:"#btnCancelGetAddress"+t.ControlId,btnGetAddress:"#btnGetAddress"+t.ControlId,dvDdlState:"#dvDdlState"+t.ControlId,ddlMainCountry:"#ddlMainCountry"+t.ControlId,ddlPopupCountry:"#ddlPopupCountry"+t.ControlId,dvWrap:"#dvWrap"+t.ControlId}},n=()=>{searchTextBox=t.ControlId,$("#"+searchTextBox).wrap('<div id="dvWrap'+searchTextBox+'" class="select-country-mar address-phone-plugin">').parent().wrap('<div class="addresswithcountry clearfix">');var e="",n=document.getElementById(searchTextBox).tabIndex;e+=' <div class="w-custom-dropdown countrydropdown allflag-show">';i.ControlsPrefix.countrySelectOption;e+='<div id="AddressControllerCountry'+searchTextBox+'" class="selectedcountry" tabindex="-1"></div > ',e+='<select id="ddlMainCountry'+searchTextBox+'" class="form-control" tabindex="'+n+'">  </select>',e+="</div>",e+='<ul id="countryselectoption'+searchTextBox+'" class="countryselectoption" style="display: none">',e+=" </ul>",0!=t.CountryDropDownRole&&$(i.ControlsPrefix.countrySelectOption).length<=0&&(null!=$("#"+searchTextBox).parent()?$("#"+searchTextBox).parent().before(e):$("#"+searchTextBox).before(e),$(i.ControlsPrefix.AddressControllerCountry).bind("click",function(){t.IsDisabled||$(i.ControlsPrefix.countrySelectOption).is(":visible")||$(".countryselectoption").hide()}));var o='<div id="addressPopup'+searchTextBox+'" class="general-addresspopup verifyAddressPopup address-phone-plugin" style="display:none">';o+='<div class="general-addresspopup-container ">',o+='<div class="general-addresspopup-body">',o+='<div class="pop-model-body settingnew-design addresspopup-billing">',o+='<div class="loginWrap loginContentwrap-addbus">',o+="<header>",o+="<a id="+i.ControlsPrefix.btnPopupClose.replace("#","")+' class="popupCloseImg" href="javascript:void(0)" >',o+="&#xf00d;",o+="</a>",o+='<h4 id="mycountryPopupTitle'+searchTextBox+'">Verify Address</h4>',o+="</header>",o+='<div class="modal-body">',o+='<div class="popContainWrapper clearfix">',o+='<div class="loginContainer clearfix">',o+='<div class="loginContentwrap">',o+='<div class="formlayout1" id="divMain'+searchTextBox+'">',o+='<p class="discription-location" id="mycountryPopupsubTitle'+searchTextBox+'">',o+="Our system doesn’t recognize your address. Please provide the following information.",o+="</p>",o+="</div>",o+="<ul>",o+='<li class="addressDropdownBox">',o+="<label>Address Line 1</label>";var a="'"+i.ControlsPrefix.countrySelectoptionPopup+"'";o+='<div class="addresswithcountry clearfix" >',o+=' <div class="w-custom-dropdown countrydropdown allflag-show">',o+='<div id="mycountryPopup'+searchTextBox+'" class="selectedcountry us-f" '+(0==t.CountryDropDownRole?" disabled=true ":"")+' onclick="$('+a+').toggle()"></div>',o+='<select id="ddlPopupCountry'+searchTextBox+'" class="form-control" '+(0==t.CountryDropDownRole?" disabled=true ":"")+">  </select>",o+="</div>",o+='<ul id="countryselectoptionpopup'+searchTextBox+'" class="countryselectoption selectoptionpopup" style="display: none">',o+=" </ul>",o+=' <div class="select-country-mar">',o+='<input name="txtStreet" type="text" maxlength="500" id="txtStreet'+searchTextBox+'" class="inputbox-type1 validAddress'+searchTextBox+'" autocomplete="off" placeholder="Address Line 1">',o+=" </div>",o+="</div>",o+="</li>",o+="<li>",o+="<label>Address Line 2</label>",o+='<input name="txtStreet1" type="text" maxlength="100" id="txtStreet1'+searchTextBox+'" class="inputbox-type1" autocomplete="off" placeholder="Address Line 2 (Optional)">',o+="</li>",o+="</ul>",o+='<ul class="location-city-row">',o+="<li>",o+='<label id="lblCityPopup'+searchTextBox+'">City:</label>',o+='<input name="txtCity" type="text" maxlength="48" id="txtCity'+searchTextBox+'" class="inputbox-type1 validAddress'+searchTextBox+'" autocomplete="off" placeholder="City">',o+="</li>",o+="<li>",o+='<label id="lblStatePopup'+searchTextBox+'">State/Province:</label>',o+='<input name="txtState" type="text" maxlength="50" id="txtState'+searchTextBox+'" class="inputbox-type1" autocomplete="off" style="display:none" placeholder="State" />',o+='<div class="dropdowndiv" id="dvDdlState'+searchTextBox+'">',o+='<select id="ddlState'+searchTextBox+'" class="" style="width: 100%;"></select>',o+="</div>",o+="</li>",o+="<li>",o+='<label id="lblZipCodePopup'+searchTextBox+'">Zip/Postal Code:</label>',o+='<input name="txtZip" type="text" maxlength="10" placeholder="Zip" id="txtZip'+searchTextBox+'" title="Zipcode is mandatory because it will help your customer to find shop using google map." class="inputbox-type1 validAddress'+searchTextBox+'" autocomplete="off" />',o+='<div class="smallloading" id="divsmallloading'+searchTextBox+'" style="display:none;"></div>',o+="</li>",o+="</ul>",o+="</div>",o+="</div>",o+="</div>",o+="</div>",o+='<div class="popupBtnContainer clearfix modal-footer">',o+='<input type="button" name="btnCancelGetAddress" value="Cancel" id="btnCancelGetAddress'+searchTextBox+'" class="btn btn-default" tabindex="-1" />',o+='<input type="button" name="btnGetAddress" value="Save" id="btnGetAddress'+searchTextBox+'" class=" btn btn-primary" tabindex="-1" />',o+="</div>",o+="</div>",o+="</div>",o+="</div>",o+="</div>",o+="</div>",$(i.ControlsPrefix.addressPopup).length>0&&$(i.ControlsPrefix.addressPopup).remove(),$(i.ControlsPrefix.addressPopup).length<=0&&($("body").prepend(o),s(),$(i.ControlsPrefix.btnPopupClose).bind("click",function(){y()}),$(i.ControlsPrefix.btnCancelGetAddress).bind("click",function(){y()}),$(i.ControlsPrefix.btnGetAddress).bind("click",function(){return t.IsSaveManualAddress=!0,D(!0)}),$(i.ControlsPrefix.addressControl).bind("change",function(){h()})),$(".validAddress"+t.ControlId).on("blur",function(){""==$(this).val().trim()&&(!this.id.includes("txtZip")||this.id.includes("txtZip")&&0==i.model.IsZipless)?0==$(this).siblings("span").length&&($(this).addClass("errorInput"),$(this).after('<span id="rfv'+$(this).attr("id")+'" class="requiredErrorText" style="color:Red;">required</span>')):($(this).removeClass("errorInput"),$(this).next("span").remove())}),$(i.ControlsPrefix.txtState).on("blur",function(){""!=$(this).val().trim()&&($(this).removeClass("errorInput"),$(this).next("span").remove())})},o=()=>{var e=location.protocol+"//"+location.hostname+(location.port&&":"+location.port)+"/";if($.ajax({url:e+"WebServices/MySampleService.asmx/GetLocation",type:"POST",contentType:"application/json; charset=utf-8"}).success(function(e){ipLocation=e.lat+","+e.lon}),"undefined"==typeof keepAlive&&$("#IsWaitforKeepALive").length>0&&void 0!==$("#IsWaitforKeepALive").val()&&"true"===$("#IsWaitforKeepALive").val().toLowerCase())setTimeout(function(){o()},500);else{var n=t.Control.select2({searchInputPlaceholder:i.model.addressPlaceHolder,minimumInputLength:1,combobox:!0,dropdownCssClass:"select2DD select2borderbox",selectOnClick:!1,multiple:!1,closeOnSelect:!0,allowClear:!0,ajax:{url:m(i.ApiURLEnum.getLocationOrPlaceDetail),dataType:"json",quietMillis:250,params:{},data:function(){var e={};return e.searchText=t.Control.val(),e.countryFilter=null==i.model.countryMapForAPI[i.model.CountryId]?"":i.model.countryMapForAPI[i.model.CountryId],e.Location=ipLocation,e.IsCallNewAddressAPI=!t.IsLiveStreamAddress,e},results:function(e,t){return{results:e.Data}},cache:!1},formatNoMatches:function(){return $("#select2-drop").css("display","block"),$("#select2-drop").css("z-index","100002"),"No matches found"},formatSearching:function(){return $("#select2-drop").css("display","block"),$("#select2-drop").css("z-index","100002"),"Searching…"},formatInputTooShort:function(e,t){return $("#select2-drop").css("display","none"),$("#select2-drop").css("z-index","100002"),""},initSelection:function(e,i){var n={id:t.Control.val(),text:t.Control.val()};$("#select2-drop").css("z-index","100002"),i(n)},formatResult:function(e){$("#select2-drop").css("display","block"),$("#select2-drop").css("z-index","100002");return'<div data-placeid="'+e.place_id+'"><img  style="vertical-align:middle" src="https://vagaro.azureedge.net/static-content/Images/flamingo-map-newicon-new@2x.png" width="12" /><span class="fullocation">'+e.FormattedAddress+"</span></div>"}});n.on("select2-loaded",function(e){$(".select2-result-unselectable").addClass("select2-result-selectable").removeClass("select2-result-unselectable")}),n.on("select2-blur",function(e){e.preventDefault()}),n.on("select2-focus",function(e){$(this).find(".select2-input").select()}),n.on("selected",function(e){$(e.currentTarget).select2("val",e.choice.CityState),$(e.currentTarget).data("selectedid",e.choice.CityState);var t={};t.placeId=e.choice.place_id,t.description=e.choice.CityState,t.CountryID=parseInt(i.model.CountryId),t.IsStateless=1==i.model.IsStateless,t.CountryCode=i.model.countryMapForAPI[i.model.CountryId],t.IsCallNewAddressAPI=e.choice.IsCallNewAddressAPI,a(m(i.ApiURLEnum.getPlaceDetailByPlaceId),t,s,placeDetailFail,!1,!1,!0)});var s=function(e){if(1e3==e.ResponseCode){$(i.ControlsPrefix.addressControl).removeClass("errorInput");var n=null!=(e=e.Data)&&null==e.CityState?"":e.CityState.split(",")[0],o=null==e.State?"":e.State;o=o.trim(),addressData={},addressData.address=e.Address,addressData.address2=e.Address2,addressData.state=o,addressData.zip=e.ZipCode,addressData.country=i.model.CountryId,addressData.statecode=e.StateCode;var a=addressData.address;2==e.CountryID&&(""==e.State||""==e.StateCode?(n=e.City,i.model.IsStateless=1):i.model.IsStateless=0),addressData.city=n,t.AddressData=addressData,a=a+(""!=a?", ":"")+addressData.city,0==i.model.IsStateless&&(a=a+(""!=a&&""!=addressData.state?", ":"")+(1==i.model.CountryId?addressData.statecode:addressData.state)),a=a+(""!=a&&""!=addressData.zip?", ":"")+addressData.zip,u(a)?(t.Control.select2("data",{id:null,text:null}),swal({title:"Address is not valid.",text:"",type:"",timer:6e3,showCancelButton:!1,confirmButtonColor:"#eb6663",customClass:"sweet-alert-model auto-footer-btton "},function(e){$(i.ControlsPrefix.addressControl).focus(),$(i.ControlsPrefix.addressControl).select2("open")})):t.Control.select2("val",a),u(t.Address2Control)||$(t.Address2Control).val(t.AddressData.address2);var s=e.GetCityByZipString;if(!u(s)){var r=s.split("|")[0],l=1*s.split("|")[1],c=s.split("|")[2];u(r)||$(i.ControlsPrefix.txtCity).val(r),u(c)||(t.AddressData.state=c,t.AddressData.stateId=l,$(i.ControlsPrefix.ddlState).val(l))}t.IsLiveStreamAddress&&_shopdetail.ChangeCustomerStartTime(e.TimeZoneOffSet,e.CountryID,e.IsSupportDayLight)}};placeDetailFail=function(e){console.log(e)},T()}},a=(e,t,i,n,o,a,s)=>{var r=new vagaro.ajax;r.datamodel.Token=e,r.datamodel.data=t,r.datamodel.callback=i,r.datamodel.Error=n,void 0!==s&&null!=s&&1==s&&(r.datamodel.IsNewVagaroAPI=!0),void 0!==a&&1==a&&(r.datamodel.ErrorMessage=""),o?r.PostQue():r.Post()},s=()=>{if(A())r(_glbPluginCountryList);else{var e={},t={businessID:0,loginUserID:0};e.RegisterDeviceRequest=t,a("GetAllCountryList",e,r,c,!1,!1,!1)}},r=e=>{if(void 0!==e&&null!=e&&e.length>0){A()||(_glbPluginCountryList=e),i.model.countryMapForAPI={},i.model.countryFlag={},i.model.countryName={};var n='<optgroup label="Current Location">',o='<optgroup label="Other Locations">';e.sort((e,t)=>{var i=e.CountryName.toUpperCase(),n=t.CountryName.toUpperCase();return i<n?-1:i>n?1:0}),$.each(e,function(e,a){if(2==t.AddressFor||1==t.AddressFor&&!u(a.IsBusinessUseOnly)&&1==a.IsBusinessUseOnly){var s="liFront"+t.ControlId+e,r="<li  id='"+s+"' class="+a.CSSClass+" >"+a.CountryName+" </li>";$(i.ControlsPrefix.countrySelectOption).append(r),$("#"+s).bind("click",function(){p(a.CountryID)}),r="<li id='"+(s="liPopup"+t.ControlId+e)+"' class="+a.CSSClass+" >"+a.CountryName+" </li>",$(i.ControlsPrefix.countrySelectoptionPopup).append(r),$("#"+s).bind("click",function(){C(a.CountryID)}),i.model.countryMapForAPI[a.CountryID]=a.CountryCode,i.model.countryFlag[a.CountryID]=a.CSSClass,i.model.countryName[a.CountryID]=a.CountryName,a.CountryID==("undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail&&""!=countryIdBusDetail?parseInt(countryIdBusDetail,10):t.CurrentLocationCountryID)?n+=' <option class="'+a.CSSClass+'" value="'+a.CountryID+'">'+a.CountryName+"</option> </optgroup >":o+=' <option class="'+a.CSSClass+'" value="'+a.CountryID+'">'+a.CountryName+"</option>"}}),o+="</optgroup >",$(i.ControlsPrefix.ddlMainCountry).append(n+o),$(i.ControlsPrefix.ddlMainCountry).select2({searchInputPlaceholder:"Search for a Country",closeOnSelect:!1,formatResult:d,dropdownCssClass:"all-country-flag"}).on("select2-selected",function(e){i.model.CountryId=parseInt(e.choice.id),p(i.model.CountryId),$(i.ControlsPrefix.addressControl).select2("open")}).on("select2-opening",function(e){!1===$(e.target).is(".select2-container")&&$(".select2-dropdown-open").select2("close"),$(i.ControlsPrefix.ddlMainCountry).select2("data",{id:i.model.CountryId})}).on("select2-open",function(e){if(("undefined"==typeof IsMobileDevice||u(IsMobileDevice))&&(isiPhone=null!=navigator.userAgent.match(/iphone/i),isWindowsPhone=navigator.userAgent.match(/windows phone/i)||!1,AndroidMobile=null!=navigator.userAgent.match(/Android/i)&&null!=navigator.userAgent.match(/Mobile/i)&&null==navigator.userAgent.match(/Windows/i),IsMobileDevice=/iPad/.test(navigator.userAgent)||isiPhone||isWindowsPhone||AndroidMobile||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&($(window).width()<=850||$(window).height()<=850)),1==IsMobileDevice&&l(),this.selectedIndex>0){var i=$("#select2-drop .select2-results"),n=i.find(".select2-highlighted").position().top;1==t.ScrollType?i.scrollTop(n+i.scrollTop()):i.scrollTop(n)}}),$(i.ControlsPrefix.ddlPopupCountry).append(n+o),$(i.ControlsPrefix.ddlPopupCountry).select2({searchInputPlaceholder:"Search for a Country",closeOnSelect:!1,formatResult:d,dropdownCssClass:"all-country-flag"}).on("select2-selected",function(e){i.model.CountryId=parseInt(e.choice.id),C(i.model.CountryId),t.Control.select2("data",{id:null,text:null}),h(),setTimeout(function(){$(i.ControlsPrefix.txtStreet).focus()},100)}).on("select2-opening",function(e){$(i.ControlsPrefix.ddlPopupCountry).select2("data",{id:i.model.CountryId})}).on("select2-open",function(e){if(("undefined"==typeof IsMobileDevice||u(IsMobileDevice))&&(isiPhone=null!=navigator.userAgent.match(/iphone/i),isWindowsPhone=navigator.userAgent.match(/windows phone/i)||!1,AndroidMobile=null!=navigator.userAgent.match(/Android/i)&&null!=navigator.userAgent.match(/Mobile/i)&&null==navigator.userAgent.match(/Windows/i),IsMobileDevice=/iPad/.test(navigator.userAgent)||isiPhone||isWindowsPhone||AndroidMobile||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&($(window).width()<=850||$(window).height()<=850)),1==IsMobileDevice&&l(),this.selectedIndex>0){var i=$("#select2-drop .select2-results"),n=i.find(".select2-highlighted").position().top;1==t.ScrollType?i.scrollTop(n+i.scrollTop()):i.scrollTop(n)}}),p(i.model.CountryId,"0")}},l=()=>{$(".select2-input text-primary demo, :focus,input").prop("focus",!1).blur()},c=e=>{p(i.model.CountryId,"0"),swal({title:i.model.errorMessage,text:"",timer:4e3,type:"error",showConfirmButton:!1,customClass:"swal-nobutton swal-white-greenbtn"},function(e){swal.close()})},d=e=>$('<span class="'+e.css+'" >'+e.text+"</span>"),u=e=>void 0===e||null==e||""==e||null==e,p=(e,n)=>{i.model.CountryId=e,T();var o=i.model.countryFlag[e];u(o)&&(i.model.CountryId=t.CurrentLocationCountryID,o=i.model.countryFlag[i.model.CountryId],n=""),"0"!=n&&($(".select2-results").empty(),t.Control.select2("data",{id:null,text:null}),$(".select2-results").empty(),h()),$(i.ControlsPrefix.AddressControllerCountry).removeClass(),$(i.ControlsPrefix.AddressControllerCountry).addClass("selectedcountry "+o),$(i.ControlsPrefix.myCountryPopup).removeClass(),$(i.ControlsPrefix.myCountryPopup).addClass("selectedcountry "+o),$(i.ControlsPrefix.countrySelectOption).removeAttr("style").attr("style","display:none"),$(i.ControlsPrefix.countrySelectOption).removeClass("active"),$(i.ControlsPrefix.dvWrap).removeClass(),$(i.ControlsPrefix.dvWrap).addClass("select-country-mar vg-select-icon-mar add-input-focus-relative "),("undefined"==typeof lblRow||0==Object.keys(lblRow).length||"undefined"!=typeof lblRow&&Object.keys(lblRow).length>0&&lblRow.CountryId!=i.model.CountryId)&&($.grep(i.model.lableLanguage,function(e,t){e.CountryId==i.model.CountryId&&(lblRow=i.model.lableLanguage[t])}),"undefined"!=typeof lblRow&&0!=Object.keys(lblRow).length&&lblRow.CountryId==i.model.CountryId||(lblRow=i.model.lableLanguage[0])),i.model.IsStateless=lblRow.IsStateless,i.model.IsZipless=lblRow.IsZipless},h=()=>{t.AddressData={}},m=(e,t)=>{try{var i=VagaroCorePublicAPIURLV2;if(void 0===window.parent.VagaroCorePublicAPIURLV2||u(window.parent.VagaroCorePublicAPIURLV2)||(i=window.parent.VagaroCorePublicAPIURLV2),u(i))return void console.log("Core API URL not found.");var n="",o=i.split("/");if(void 0!==t&&null!=t&&""!=t)o[3]=t,n=o.join("/")+e;else if("undefined"!=typeof myAccountUserGroupID&&null!=myAccountUserGroupID&&""!=myAccountUserGroupID){var a=myAccountUserGroupID.split(",");a.length>0&&(o[3]=a[0],n=o.join("/")+e)}return""==n&&(n=i+e),n}catch(t){return i+e}},g=()=>{i.model.stateList.length>0&&($(i.ControlsPrefix.ddlState).html(""),$(i.ControlsPrefix.ddlState).html('<option value="0">Select</option>'),$.grep(i.model.stateList,function(e){e.CountryID==i.model.CountryId&&$(i.ControlsPrefix.ddlState).append($("<option></option>").val(e.StateID).html(e.DisplayStateCode))}),void 0===t.AddressData.statecode||u(t.AddressData.statecode)||$.grep(i.model.stateList,function(e){e.StateCode==t.AddressData.statecode&&e.CountryID==i.model.CountryId&&$(i.ControlsPrefix.ddlState).val(e.StateID)}))},v=e=>{1e3==e.ResponseCode&&(i.model.stateList=e.Data,g())},f=e=>{swal({title:i.model.errorMessage,text:"",timer:4e3,type:"error",showConfirmButton:!1,customClass:"swal-nobutton swal-white-greenbtn"},function(e){swal.close()})},C=e=>{var t;$(".countryflag").removeClass("active"),i.model.CountryId=e,("undefined"==typeof lblRow||0==Object.keys(lblRow).length||"undefined"!=typeof lblRow&&Object.keys(lblRow).length>0&&lblRow.CountryId!=e)&&($.grep(i.model.lableLanguage,function(t,n){t.CountryId==e&&(lblRow=i.model.lableLanguage[n])}),"undefined"!=typeof lblRow&&0!=Object.keys(lblRow).length&&lblRow.CountryId==e||(lblRow=i.model.lableLanguage[0])),$(i.ControlsPrefix.lblZipCodePopup).text(lblRow.Zip),$(i.ControlsPrefix.txtZip).attr("placeholder",lblRow.Zip),$(i.ControlsPrefix.lblStatePopup).text(lblRow.State),$(i.ControlsPrefix.lblCityPopup).text(lblRow.City),$(i.ControlsPrefix.txtCity).attr("placeholder",lblRow.City),i.model.IsStateless=lblRow.IsStateless,i.model.IsZipless=lblRow.IsZipless,0==lblRow.IsStateDropDown?($(i.ControlsPrefix.txtState).show(),$(i.ControlsPrefix.ddlState).hide(),$(i.ControlsPrefix.dvDdlState).removeClass()):($(i.ControlsPrefix.txtState).hide(),$(i.ControlsPrefix.ddlState).show(),$(i.ControlsPrefix.dvDdlState).addClass("dropdowndiv")),t=i.model.countryFlag[e],$(".flag-"+t).addClass("active"),g(),$(i.ControlsPrefix.AddressControllerCountry).removeClass().addClass("selectedcountry "+t),$(i.ControlsPrefix.myCountryPopup).removeClass(),$(i.ControlsPrefix.myCountryPopup).addClass("selectedcountry "+t),$(".selectoptionpopup").css("display","none"),$(".selectoptionpopup").removeClass("active"),$(i.ControlsPrefix.txtZip).val(""),$(i.ControlsPrefix.txtCity).val(""),$(i.ControlsPrefix.txtStreet).val(""),$(i.ControlsPrefix.txtStreet1).val(""),$(i.ControlsPrefix.txtState).val("")},S=(e,t)=>{t?($(e).fadeIn("fast"),$("html").addClass("popupscroll"),$("body").css("overflow","hidden"),$(e).addClass("in"),$("#pnlCustomer").length&&"none"!==$("#pnlCustomer").css("display")&&$("#pnlCustomer").removeAttr("tabindex"),$(i.ControlsPrefix.txtStreet).focus()):($(e).fadeOut("fast"),$(e).removeClass("in"),$("html").removeClass("popupscroll"),$("body").css("overflow","auto"),$("#pnlCustomer").length&&"none"!==$("#pnlCustomer").css("display")&&$("#pnlCustomer").attr("tabindex","-1"))},y=e=>{if(1==e){if($(i.ControlsPrefix.txtCity).removeClass("errorInput").val(t.AddressData.city),$(i.ControlsPrefix.txtZip).removeClass("errorInput").val(t.AddressData.zip),$(i.ControlsPrefix.txtStreet).attr("maxlength",500).removeClass("errorInput").val(t.AddressData.address),$(i.ControlsPrefix.txtState).val(t.AddressData.state),u(t.Address2Control)||(t.AddressData.address2=$(t.Address2Control).val()),$(i.ControlsPrefix.txtStreet1).val(t.AddressData.address2),""!=t.AddressData.zip&&t.AddressData.country>0){var n={};n.CountryID=parseInt(t.AddressData.country),n.StrZipCode=$.trim(t.AddressData.zip),n.CountryCode=i.model.countryMapForAPI[i.model.CountryId],a(m(i.ApiURLEnum.getStateCode),n,b,k,!1,!1,!0)}return void 0!==setPopupPosi&&void 0!==getQueryStringData&&"Builder"==getQueryStringData("Type")&&($(i.ControlsPrefix.addressPopup).addClass("wb-general-addresspopup"),$(i.ControlsPrefix.addressPopup).after('<div class="wbgeneraladdresspopup-backdrop"></div>'),setPopupPosi(i.ControlsPrefix.addressPopup)),S(i.ControlsPrefix.addressPopup,!0),!1}return void 0!==setPopupPosi&&void 0!==getQueryStringData&&"Builder"==getQueryStringData("Type")&&($(i.ControlsPrefix.addressPopup).css({top:"",bottom:""}),$(".wbgeneraladdresspopup-backdrop").remove(),$(i.ControlsPrefix.addressPopup).removeClass("wb-general-addresspopup")),S(i.ControlsPrefix.addressPopup,!1),"undefined"!=typeof SelectedOption&&"2"==SelectedOption&&$("#txtCalAppointmentAddress").val(""),!1},b=e=>{if(1e3==e.ResponseCode){res=e.Data;var t=res.split("|")[0],n=u(res)?0:1*res.split("|")[1],o=res.split("|")[2];$(i.ControlsPrefix.txtCity).val(t),$(i.ControlsPrefix.txtState).val(o),$(i.ControlsPrefix.ddlState).val(n)}},k=e=>{swal({title:"Failed to validate address details.",text:"",timer:4e3,type:"error",showConfirmButton:!1,customClass:"swal-nobutton swal-white-greenbtn"},function(e){swal.close()})},_=e=>{if(Object.keys(t.AddressData).length>0){t.AddressData.state=null==t.AddressData.state?"":t.AddressData.state,t.AddressData.zip=null==t.AddressData.zip?"":t.AddressData.zip;var n=t.AddressData.address;n=n+(""!=n?", ":"")+t.AddressData.city,2==t.AddressData.country&&(u(t.AddressData.state)?i.model.IsStateless=1:i.model.IsStateless=0),0==i.model.IsStateless&&(n=n+(""!=n&&""!=t.AddressData.state?", ":"")+t.AddressData.state),n=n+(""!=n&&""!=t.AddressData.zip?", ":"")+t.AddressData.zip,e?(t.Control.select2("val",n),$(".select2-results").empty(),void 0===t.AddressData.address2||u(t.Address2Control)||$(t.Address2Control).val(t.AddressData.address2)):t.Control.select2("val",n),1==t.IsAddManualAddress&&1==t.IsSaveManualAddress&&(t.IsAddManualAddress=!1,t.IsSaveManualAddress=!1,SaveAddressData()),1==t.IsSaveManualAddress&&(t.IsDistance=!0,t.IsSaveManualAddress=!1),1==t.IsDistance&&"undefined"!=typeof GetDistance&&(GetDistance(n),t.IsDistance=!1)}},D=e=>{if("undefined"!=typeof isFromVagaroProduct&&null!=isFromVagaroProduct&&1==isFromVagaroProduct)for(var n=$(".general-addresspopup").length,o=1;o<n;o++)null!=$(".general-addresspopup")[o]&&null!=$(".general-addresspopup")[o]&&$(".general-addresspopup")[o].remove();var a=!1;return $(".validAddress"+t.ControlId).each(function(){""==$(this).val().trim()&&(!this.id.includes("txtZip")||this.id.includes("txtZip")&&0==i.model.IsZipless)?(0==$(this).siblings("span").length&&($(this).addClass("errorInput"),$(this).after('<span id="rfv'+$(this).attr("id")+'" class="requiredErrorText" style="color:Red;">required</span>')),a=!0):0!=$(this).siblings("span").length&&($(this).next("span").remove(),$(this).removeClass("errorInput"))}),a?($(i.ControlsPrefix.addressPopup).find(".errorInput:first").focus(),!1):($(i.ControlsPrefix.txtState).is(":visible")||$(i.ControlsPrefix.txtState).val($(i.ControlsPrefix.ddlState+" option:selected").text()),0!=i.model.IsStateless||""!=$(i.ControlsPrefix.txtState).val().trim()&&"Select"!=$(i.ControlsPrefix.txtState).val().trim()?(1==i.model.IsZipless&&$(i.ControlsPrefix.txtZip).val(""),I(),!1):($(i.ControlsPrefix.txtState).next("span").remove(),$(i.ControlsPrefix.txtState).removeClass("errorInput"),0==i.model.IsZipless?($(i.ControlsPrefix.txtZip).addClass("errorInput"),swal({title:"System can't find State based on entered zipcode.Please enter valid zip.",text:"",timer:4e3,type:"error",showConfirmButton:!1,customClass:"swal-nobutton swal-white-greenbtn googlecontrolalert"},function(e){swal.close()})):($(i.ControlsPrefix.txtState).addClass("errorInput"),$(i.ControlsPrefix.txtState).after('<span id="rfv'+i.ControlsPrefix.txtState.replace("#","")+'" class="requiredErrorText" style="color:Red;">required</span>')),!1))},I=()=>{var e=$(i.ControlsPrefix.txtZip).val(),t=i.model.CountryId;if((""!=e||1==i.model.IsZipless)&&t>0){var n={};n.CountryID=parseInt(i.model.CountryId),n.StrZipCode=$(i.ControlsPrefix.txtZip).val().trim(),n.City=$(i.ControlsPrefix.txtCity).val().trim(),n.StateName=$(i.ControlsPrefix.txtState).val().trim(),n.Address=$(i.ControlsPrefix.txtStreet).val().trim()+" "+$(i.ControlsPrefix.txtCity).val().trim()+" "+$(i.ControlsPrefix.txtState).val().trim()+" "+$(i.ControlsPrefix.txtZip).val().trim(),n.IsStateless=1==i.model.IsStateless,n.CountryCode=i.model.countryMapForAPI[i.model.CountryId],a(m(i.ApiURLEnum.getStateCode),n,w,P,!1,!1,!0)}},w=e=>{if(1e3==e.ResponseCode){var n=e.Data;if(u(n))swal({title:"Wrong Address.",text:"",type:"",timer:6e3,showCancelButton:!1,confirmButtonColor:"#eb6663",customClass:"sweet-alert-model auto-footer-btton "});else{$(i.ControlsPrefix.ddlState).html(""),$(i.ControlsPrefix.ddlState).html('<option value="0">Select</option>'),t.AddressData={},t.AddressData.address=$(i.ControlsPrefix.txtStreet).val().trim(),t.AddressData.city=$(i.ControlsPrefix.txtCity).val().trim(),t.AddressData.state=$(i.ControlsPrefix.txtState).val().trim(),t.AddressData.zip=$(i.ControlsPrefix.txtZip).val().trim(),t.AddressData.country=i.model.CountryId,t.AddressData.address2=$(i.ControlsPrefix.txtStreet1).val().trim(),y();var o=n.split("|")[0],a=1*n.split("|")[1],s=n.split("|")[2];""!=o&&(t.AddressData.city=o,$(i.ControlsPrefix.txtCity).removeClass("errorInput").val(o),$(i.ControlsPrefix.txtCity).next("span").css("display","none")),0==u(s)&&(t.AddressData.state=s,t.AddressData.stateId=a,$(i.ControlsPrefix.ddlState).val(a),t.AddressData.statecode=n.split("|")[3]),_(!0)}}},P=e=>{swal({title:i.model.errorMessage,text:"",timer:4e3,type:"",showConfirmButton:!1,customClass:"swal-nobutton sweet-alert-model auto-footer-btton"},function(e){swal.close()})},A=()=>"undefined"!=typeof _glbPluginCountryList&&null!=_glbPluginCountryList&&0!=Object.keys(_glbPluginCountryList).length,T=()=>{2==i.model.CountryId?$(i.ControlsPrefix.dvWrap+" :input[type='text']").prop("placeholder",i.model.addressPlaceHolderUKOnly):$(i.ControlsPrefix.dvWrap+" :input[type='text']").prop("placeholder",i.model.addressPlaceHolder)};n(),o();var x={setAddressData:function(e){t.AddressData=e,(()=>{var e=t.AddressData.country,n=t.AddressData.address,o=t.AddressData.address2,a=t.AddressData.city,s=t.AddressData.state,r=t.AddressData.zip,l=!1;null!=e&&null==s&&p(e,"0"),u(s)?$(i.ControlsPrefix.txtState).val(""):($(i.ControlsPrefix.txtState).val(s),l=!0),u(n)?($(i.ControlsPrefix.txtStreet).val(""),t.AddressData.address=""):($(i.ControlsPrefix.txtStreet).val(n),l=!0),u(a)?($(i.ControlsPrefix.txtCity).val(""),t.AddressData.city=""):($(i.ControlsPrefix.txtCity).val(a),l=!0),u(r)?$(i.ControlsPrefix.txtZip).val(""):($(i.ControlsPrefix.txtZip).val(r),l=!0),u(o)?($(i.ControlsPrefix.txtStreet1).val(""),t.AddressData.address2=""):($(i.ControlsPrefix.txtStreet1).val(o),l=!0),p(e,"0"),_(),0==l&&(t.Control.select2("data",{id:null,text:null}),h())})()},getAddressData:function(){return 0==Object.keys(t.AddressData).length&&(t.AddressData.country=i.model.CountryId,t.AddressData.address="",t.AddressData.address2="",t.AddressData.city="",t.AddressData.state="",t.AddressData.zip=""),t.AddressData.IsReturnCountryID=t.IsReturnCountryID,u(t.AddressData.country)||(t.AddressData.countryName=i.model.countryName[t.AddressData.country],t.AddressData.countryCode=i.model.countryMapForAPI[t.AddressData.country]),t.AddressData},validateAddressData:function(e=!1,n=!1){if(u(n)||(t.IsDistance=n),""!=t.Control.val().trim()||1==e){if(0==Object.keys(t.AddressData).length||u(t.AddressData.city)||u(t.AddressData.state)&&0==i.model.IsStateless||u(t.AddressData.zip)&&0==i.model.IsZipless||u(t.AddressData.address)||1==e)return 1==e&&($("#mycountryPopupsubTitle"+t.ControlId).html(""),$("#mycountryPopupTitle"+t.ControlId).html("Change Address"),t.IsAddManualAddress=e),""!=t.Control.val()&&(null==typeof t.AddressData||""!=t.AddressData.address&&null!=t.AddressData.address||(t.AddressData.address=t.Control.val().trim())),a(m(i.ApiURLEnum.getState),{},v,f,!1,!1,!0),C(i.model.CountryId),y(1),!1}else{if(t.IsAddressRequired)return $(i.ControlsPrefix.addressControl).addClass("errorInput"),!1;t.AddressData={},$(i.ControlsPrefix.txtZip).val(""),$(i.ControlsPrefix.txtCity).val(""),$(i.ControlsPrefix.txtStreet).val(""),$(i.ControlsPrefix.txtStreet1).val(""),$(i.ControlsPrefix.txtState).val("")}return!0},setDisabledControl:function(e){t.IsDisabled=e,$(i.ControlsPrefix.addressControl).attr("disabled",e),$(i.ControlsPrefix.ddlMainCountry).attr("disabled",e),$(i.ControlsPrefix.ddlPopupCountry).attr("disabled",e);var n=i.model.countryFlag[i.model.CountryId];$(i.ControlsPrefix.AddressControllerCountry).removeClass(),$(i.ControlsPrefix.AddressControllerCountry).addClass("selectedcountry "+(1==e?"select2-container-disabled ":"")+n)},setDisabledCountry:function(e){t.DisabledCountry=e,t.IsReturnCountryID=e,$(i.ControlsPrefix.ddlMainCountry).attr("disabled",e),$(i.ControlsPrefix.ddlPopupCountry).attr("disabled",e);var n=i.model.countryFlag[i.model.CountryId];$(i.ControlsPrefix.AddressControllerCountry).removeClass(),$(i.ControlsPrefix.AddressControllerCountry).addClass("selectedcountry "+(1==e?"select2-container-disabled ":"")+n)},setAddressTwoData:function(e){t.AddressData.address2=e,$(i.ControlsPrefix.txtStreet1).val(t.AddressData.address2)}};return x},$(document).on("click",function(e){try{!1===$(e.target).is(".selectedcountry")&&$(".countryselectoption").length>0&&$(".countryselectoption").hide(),!1===$(e.target).is(".select2-container")&&$(".select2-dropdown-open").length>0&&$(".select2-dropdown-open").select2("close")}catch(e){}}),$.fn.PhonePlugin=function(e){var t=$.extend({Control:this,ControlId:this.attr("id"),CurrentLocationCountryID:1,CountryId:0,UserRole:2,ControlText:"Cell",IsPhoneNoRequire:!1,IsDisabled:!1,ScrollType:2,CellOldValue:"",ValidateReturnObject:{}},e),n={model:{countryFlag:{1:"us-f",2:"uk-f",3:"canada-f",4:"aus-f"},countryDialingCode:{1:"1",2:"44",3:"1",4:"61"},CountryId:void 0===t.CountryId||0==t.CountryId?"undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail&&""!=countryIdBusDetail?parseInt(countryIdBusDetail,10):t.CurrentLocationCountryID:t.CountryId,DialingCode:"+1",errorMessage:"Something went wrong, Try Again.",IsPaste:!1,IsSelected:!1,nDotCount:0,CountryList:{},CountryCode:"US"},ControlsPrefix:{PhoneControl:"#"+t.ControlId,PhoneControllerCountry:"#PhoneControllerCountry"+t.ControlId,countrySelectOption:"#countryselectoption"+t.ControlId,ddlMainCountry:"#ddlMainCountry"+t.ControlId,dvWrap:"#dvWrap"+t.ControlId,dvDialingCode:"#dvDialingCode"+t.ControlId},Message:{InvalidPhone:"Invalid ",InvalidLength:" should be of ",Required:" is required."},WarningType:{Required:1,InvalidPhone:2,InvalidLength:3}},o=()=>{if(w())a(_glbPluginCountryList);else{var e={},t={businessID:0,loginUserID:0};e.RegisterDeviceRequest=t,i="GetAllCountryList",n=e,o=a,s=r,l=!1,c=!0,(u=new vagaro.ajax).datamodel.Token=i,u.datamodel.data=n,u.datamodel.callback=o,u.datamodel.Error=s,void 0!==d&&null!=d&&1==d&&(u.datamodel.IsNewVagaroAPI=!0),void 0!==c&&1==c&&(u.datamodel.ErrorMessage=""),l?u.PostQue():u.Post()}var i,n,o,s,l,c,d,u},a=e=>{if(void 0!==e&&null!=e&&e.length>0){w()||(_glbPluginCountryList=e),n.model.countryFlag={},n.model.countryDialingCode={},n.model.CountryList=e;var i='<optgroup label="Current Location">',o='<optgroup label="Other Locations">';e.sort((e,t)=>{var i=e.CountryName.toUpperCase(),n=t.CountryName.toUpperCase();return i<n?-1:i>n?1:0}),$.each(e,function(e,a){if(2==t.UserRole||1==t.UserRole&&!l(a.IsBusinessUseOnly)&&1==a.IsBusinessUseOnly){var s="liFront"+t.ControlId+e;a.CSSClass,a.CountryName,a.DialingCode;$("#"+s).bind("click",function(){n.model.CountryId=a.CountryID,n.model.DialingCode=a.DialingCode,c()}),n.model.countryFlag[a.CountryID]=a.CSSClass,n.model.countryDialingCode[a.CountryID]=a.DialingCode,a.CountryID==("undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail&&""!=countryIdBusDetail?parseInt(countryIdBusDetail,10):t.CurrentLocationCountryID)?i+=' <option class="'+a.CSSClass+'" value="'+a.CountryID+'">'+a.CountryName+"+"+a.DialingCode+"</option> </optgroup >":o+=' <option class="'+a.CSSClass+'" value="'+a.CountryID+'">'+a.CountryName+"+"+a.DialingCode+"</option>"}}),o+="</optgroup >",$(n.ControlsPrefix.ddlMainCountry).append(i+o),$(n.ControlsPrefix.ddlMainCountry).select2({searchInputPlaceholder:"Search for a Country",closeOnSelect:!1,dropdownCssClass:"all-country-flag",formatResult:s}).on("select2-selected",function(e){n.model.CountryId=parseInt(e.choice.id),c(),k(),setTimeout(function(){$(n.ControlsPrefix.PhoneControl).focus()},100)}).on("select2-opening",function(e){!1===$(e.target).is(".select2-container")&&$(".select2-dropdown-open").select2("close"),$(n.ControlsPrefix.ddlMainCountry).select2("data",{id:n.model.CountryId})}).on("select2-open",function(e){if(("undefined"==typeof IsMobileDevice||l(IsMobileDevice))&&(isiPhone=null!=navigator.userAgent.match(/iphone/i),isWindowsPhone=navigator.userAgent.match(/windows phone/i)||!1,AndroidMobile=null!=navigator.userAgent.match(/Android/i)&&null!=navigator.userAgent.match(/Mobile/i)&&null==navigator.userAgent.match(/Windows/i),IsMobileDevice=/iPad/.test(navigator.userAgent)||isiPhone||isWindowsPhone||AndroidMobile||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&($(window).width()<=850||$(window).height()<=850)||/androidcheckin/.test(navigator.userAgent)),1==IsMobileDevice&&$(".select2-input text-primary demo, :focus,input").prop("focus",!1).blur(),this.selectedIndex>0){var i=$("#select2-drop .select2-results"),n=i.find(".select2-highlighted").position().top;1==t.ScrollType?i.scrollTop(n+i.scrollTop()):i.scrollTop(n)}}),c(),k()}},s=e=>{var t=e.text.split("+");return $('<span class="'+e.css+'" >'+t[0]+'</span><span class="country-code-text" >'+(1==l(t[1])?"":"+"+t[1])+"</span>")},r=e=>{swal({title:n.model.errorMessage,text:"",timer:4e3,type:"error",showConfirmButton:!1,customClass:"swal-nobutton swal-white-greenbtn"},function(e){swal.close()})},l=e=>void 0===e||null==e||""==e||null==e,c=()=>{0==n.model.CountryId&&(n.model.CountryId=1),void 0!==n.model.countryFlag[n.model.CountryId]&&null!=n.model.countryFlag[n.model.CountryId]||(n.model.CountryId=1),n.model.CountryId="undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail&&""!=countryIdBusDetail?parseInt(countryIdBusDetail,10):n.model.CountryId;var e=n.model.countryFlag[n.model.CountryId];l(e)&&(n.model.CountryId=t.CurrentLocationCountryID,e=n.model.countryFlag[n.model.CountryId]),n.model.DialingCode=n.model.countryDialingCode[n.model.CountryId],$(n.ControlsPrefix.PhoneControllerCountry).removeClass(),$(n.ControlsPrefix.PhoneControllerCountry).addClass("selectedcountry "+e),$(n.ControlsPrefix.myCountryPopup).removeClass(),$(n.ControlsPrefix.myCountryPopup).addClass("selectedcountry "+e),$(n.ControlsPrefix.countrySelectOption).removeAttr("style").attr("style","display:none"),$(n.ControlsPrefix.countrySelectOption).removeClass("active"),$(n.ControlsPrefix.dvWrap).removeClass(),$(n.ControlsPrefix.dvWrap).addClass("select-country-mar vg-select-icon-mar input-focus-relative "+e),$(n.ControlsPrefix.dvDialingCode).text("+"+n.model.DialingCode)},d=()=>{u(),h(3,0),S()},u=()=>{var e=t.Control,i=$(e).val().trim();$(e).val(p(i))},p=e=>(e.match(/(<([^>]+)>)/gi)&&(e=e.replace(/(<([^>]+)>)/gi,"")),e),h=(e,t)=>{var i=$(n.ControlsPrefix.PhoneControl);nDotCount=0;var o=0;if(i.val(m(g(i.val(),e),20)),1==e&&1==f(i.val())){if(i.val(Math.round(i.val()*Math.pow(10,t))/Math.pow(10,t)),0==f(i.val()))for(o=0;o<t;o++)0;else if(i.val().length-1-C(i.val())<t)for(o=i.val().length-1-C(i.val());o<t;o++)0}else if(1==e&&0==f(i.val()))for(i.val(Math.round(i.val()*Math.pow(10,t))/Math.pow(10,t)),o=0;o<t;o++)0},m=(e,t)=>{if(t>0&&t<e.length){var i=e.split(""),n="",o=0;for(o=0;o<t;o++)n+=i[o];return n}return e},g=(e,t)=>{var i="",n=e.length,o=e.split(""),a=0,s=0;for(s=0;s<n;s++)1==v(o[s],t)&&(1==t?"."==o[s]&&0==a&&1!=nDotCount?(i+=o[s],a+=1,nDotCount=1):"."!=o[s]&&(i+=o[s]):i+=o[s]);return i},v=(e,t)=>{var n;0==t?n="0123456789":1==t?n="0123456789.":2==t?n="0123456789 ":3==t&&(n="0123456789()- ");var o,a=!0;for(i=0;i<e.length&&1==a;i++)o=e.charAt(i),-1==n.indexOf(o)&&(a=!1);return a},f=e=>{var t=0,i=!1;for(t=0;t<e.length;t++)"."==e.charAt(t)&&(i=!0);return i},C=e=>{var t=0,i=0;for(t=0;t<e.length;t++)"."==e.charAt(t)&&(i=t);return i},S=(e=!1)=>{var i=$(n.ControlsPrefix.PhoneControl),o=!0,a=n.model.CountryId,s="",r=0;if(i.val().length>0){var c=i.val().replace(/[^0-9.]/g,"").trim();if("undefined"!=typeof _sharing&&null!=_sharing&&void 0!==_sharing.SelectedFFRelation&&null!=_sharing.SelectedFFRelation&&""!=_sharing.SelectedFFRelation&&"child"==_sharing.SelectedFFRelation.toLowerCase()&&""===c)return!e||{isSucess:!0,WarningMessage:"",WarningType:0};var d="";if(a<=4)Minlength=4==a||2==a?9:10,Maxlength=4==a||2==a?11:10,d=Minlength==Maxlength?" 10 ":" 9 to 11 ",""==i.val().replace(/[^0-9.]/g,"").trim()?(o=!1,s="Please enter "+t.ControlText+".",r=n.WarningType.Required):(i.val().trim().match(/\d/g).length<Minlength||i.val().trim().match(/\d/g).length>Maxlength)&&(o=!1,s=t.ControlText+n.Message.InvalidLength+d+"digits.",r=n.WarningType.InvalidLength);else{var u=new libphonenumber.AsYouType(I(n.model.CountryId).CountryCode);u.input(i.val().replace(/[^0-9.]/g,""));o=u.isValid()}}else 1==t.IsPhoneNoRequire&&(o=!1,r=n.WarningType.Required,s=t.ControlText+n.Message.Required);return o?i.removeClass("errorInput"):(i.addClass("errorInput"),0==e&&(r=l(s)?n.WarningType.InvalidPhone:r,"undefined"!=typeof Webflow&&null!=Webflow&&void 0!==Webflow.require&&null!=Webflow.require&&_(l(s)?n.Message.InvalidPhone+t.ControlText+".":s))),0==e?o:(ValidateCellNoResult={},ValidateCellNoResult.WarningMessage=l(s)?n.Message.InvalidPhone+t.ControlText+".":s,ValidateCellNoResult.isSucess=o,ValidateCellNoResult.WarningType=r,ValidateCellNoResult)},y=(e,i)=>{var o=t.Control;if("Microsoft Internet Explorer"==navigator.appName){if(n.model.IsSelected){n.model.nDotCount=0;var a=m(b(o.val(),i),11);o.val(a),n.model.IsSelected=!1}8!=e.keyCode&&46!=e.keyCode||f(o.val())||(n.model.nDotCount=0),""==o.val()&&(n.model.nDotCount=0)}else{if("keyup"==e.type&&n.model.IsPaste){n.model.nDotCount=0;a=m(b(o.val(),i),11);o.val(a),n.model.IsPaste=!1}8!=e.which&&46!=e.which||f(o.val())||(n.model.nDotCount=0),""==o.val()&&(n.model.nDotCount=0)}},b=(e,t)=>{var i="",o=e.length,a=e.split(""),s=0,r=0;for(r=0;r<o;r++)1==v(a[r],t)&&(1==t?"."==a[r]&&0==s&&1!=n.model.nDotCount?(i+=a[r],s+=1,n.model.nDotCount=1):"."!=a[r]&&(i+=a[r]):i+=a[r]);return i},k=()=>{var e=n.model.CountryId,i=$(n.ControlsPrefix.PhoneControl);if(void 0!==e&&null!=e&&""!=e){var o=i.val().replace(/([()-\s])+/g,""),a=o.length;if(a<=0)return;if(11==a&&0==o[0]&&parseInt(e)<=4&&(t.CellOldValue=o,a=(o=o.substring(1)).length),"1"!=e&&"3"!=e||10!=a)if("2"==e)a>=9&&a<=11&&(r="1"==o.substring(0,1)?o.replace(/(\d{4})\-?(\d{6})/,"$1 $2"):"2"==o.substring(0,1)?o.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3"):"7"==o.substring(0,1)?o.replace(/(\d{4})\-?(\d{3})\-?(\d{3})/,"$1 $2 $3"):o.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3"),t.CellOldValue==r&&i.val()==t.CellOldValue||(i.val(r),t.CellOldValue=r));else if("4"==e){if(a>=9&&a<=11){r=o.replace(/(\d{1})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3");10==a&&(r=o.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3")),t.CellOldValue==r&&i.val()==t.CellOldValue||(i.val(r),t.CellOldValue=r)}}else{var s=new libphonenumber.AsYouType(I(n.model.CountryId).CountryCode);r=s.input(o);!s.isValid()||t.CellOldValue==r&&i.val()==t.CellOldValue||(i.val(r),t.CellOldValue=r)}else if("3"==e){var r=o.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"$1-$2-$3");t.CellOldValue==r&&i.val()==t.CellOldValue||(i.val(r),t.CellOldValue=r)}else{var r=o.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"($1) $2-$3");t.CellOldValue==r&&i.val()==t.CellOldValue||(i.val(r),t.CellOldValue=r)}}else{r=i.val().replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"($1)-$2-$3");i.val(r)}},_=e=>{$(".banner-warning .text-block-28").html(e);var t=Webflow.require("ix"),i=$(".banner-warning"),n=D(e);if("undefined"!=typeof ver)if(ver[0]<=9){var o={type:"click",preserve3d:!0,stepsA:[{display:"-webkit-flex",transition:"transform 300ms ease 0",x:"0px",y:"50px",z:"0px"},{wait:n},{transition:"transform 300 ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]};t.run(o,i)}else{o={type:"click",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 300ms ease 0",x:"0px",y:"50px",z:"0px"},{wait:n},{transition:"transform 300 ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]};t.run(o,i)}else{o={type:"click",preserve3d:!0,stepsA:[{display:"flex",transition:"transform 300ms ease 0",x:"0px",y:"50px",z:"0px"},{wait:n},{transition:"transform 300 ease 0",x:"0px",y:"0px",z:"0px"},{display:"none"}],stepsB:[]};t.run(o,i)}},D=e=>{var t="2s";return""!=e&&e.length>0&&(e.length<50?t="2s":e.length<100?t="3s":e.length<200?t="4s":e.length>200&&(t="7s")),t},I=e=>(Country=jQuery.grep(n.model.CountryList,function(t){return t.CountryID==parseInt(e)}),Country[0]),w=()=>"undefined"!=typeof _glbPluginCountryList&&null!=_glbPluginCountryList&&0!=Object.keys(_glbPluginCountryList).length;return l(t.ControlId)||(()=>{var e=t.ControlId,i=document.getElementById(e).tabIndex;$("#"+e).wrap('<div id="dvWrap'+e+'" class="select-country-mar vg-select-icon-mar input-focus-relative address-phone-plugin">').parent().wrap('<div class="addresswithcountry vagaro-dropdown-icon clearfix">');var a=' <div class="w-custom-dropdown countrydropdown allflag-show">';n.ControlsPrefix.countrySelectOption,a+='<div id="PhoneControllerCountry'+e+'" class="selectedcountry" ></div > ',a+='<div id="dvDialingCode'+e+'" class="country-code" >+1</div > ',a+='<select id="ddlMainCountry'+e+'" class="form-control" tabindex="'+i+'">  </select>',a+="</div>",a+='<ul id="countryselectoption'+e+'" class="countryselectoption" style="display: none">',a+=" </ul>",$("#countryselectoption"+e).length<=0&&(null!=$("#"+e).parent()?$("#"+e).parent().before(a):$("#"+e).before(a),o(),$(n.ControlsPrefix.PhoneControl).on("blur",function(){d()}),$(n.ControlsPrefix.PhoneControl).on("keyup",function(e){k(),y(e,3)}),$(n.ControlsPrefix.PhoneControllerCountry).bind("click",function(){t.IsDisabled||$(n.ControlsPrefix.countrySelectOption).is(":visible")||$(".countryselectoption").hide()}))})(),{validatePhoneNumber:function(e=!1,i=null,n=null){if(0==e)return S(e);null!=typeof n&&null!=n&&(n.IsValid=!0);var o=S(e);return null!=typeof n&&null!=n&&(n.IsValid=o.isSucess),0==o.isSucess?(t.ValidateReturnObject=o,null!=i&&($(i).html(o.WarningMessage),$(i).show()),o.isSucess):(null!=i&&$(i).hide(),o.isSucess)},setPhoneData:function(e,i){return n.model.CountryId=e,t.CellOldValue="",l(i)||$(n.ControlsPrefix.PhoneControl).val(i),c(),k(),$(n.ControlsPrefix.PhoneControl).val()},getPhoneData:function(){var e={};e.countryId=parseInt(n.model.CountryId);var t="",i="";return null!=$(n.ControlsPrefix.PhoneControl).val()&&""!=$(n.ControlsPrefix.PhoneControl).val()&&(t=$(n.ControlsPrefix.PhoneControl).val().replace(/([()-\s])+/g,""),i=e.countryId>5?t:2==e.countryId?t.length>11?t.substring(1):t:t.length>10?t.substring(1):t),e.phoneNo=i,e.dialingCode=n.model.DialingCode,e.countryCode=I(n.model.CountryId).CountryCode,e},getCountryId:function(){return n.model.CountryId},setDisabledControl:function(e){t.IsDisabled=e,$(n.ControlsPrefix.PhoneControl).attr("disabled",e),$(n.ControlsPrefix.ddlMainCountry).attr("disabled",e);var i=n.model.countryFlag[n.model.CountryId];$(n.ControlsPrefix.PhoneControllerCountry).removeClass(),$(n.ControlsPrefix.PhoneControllerCountry).addClass("selectedcountry "+(1==e?"select2-container-disabled ":"")+i)},setDisabledCountry:function(e){t.IsDisabled=e,$(n.ControlsPrefix.ddlMainCountry).attr("disabled",e);var i=n.model.countryFlag[n.model.CountryId];$(n.ControlsPrefix.PhoneControllerCountry).removeClass(),$(n.ControlsPrefix.PhoneControllerCountry).addClass("selectedcountry "+(1==e?"select2-container-disabled ":"")+i)},getCountryList:function(){return n.model.CountryList},getdialingCode:function(e){return e>0?I(e).DialingCode:""},getphoneformat:function(e,i){if(void 0!==i&&null!=i&&""!=i){var n=null==e?"":e.replace(/([()-\s])+/g,""),o=n.length;if(o<=0)return;if(0==n[0]&&parseInt(i)<=4&&(t.CellOldValue=n,o=(n=n.substring(1)).length),!("1"!=i&&"3"!=i||9!=o&&10!=o))return"3"==i?n.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"$1-$2-$3"):n.replace(/(\d{3})\-?(\d{3})\-?(\d{4})/,"($1) $2-$3");if("2"==i){if(9==o||10==o)return"1"==n.substring(0,1)?n.replace(/(\d{4})\-?(\d{6})/,"$1 $2"):"2"==n.substring(0,1)?n.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3"):"7"==n.substring(0,1)?n.replace(/(\d{4})\-?(\d{3})\-?(\d{3})/,"$1 $2 $3"):n.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"$1 $2 $3")}else{if("4"!=i)return new libphonenumber.AsYouType(I(i>0?i:1).CountryCode).input(e);if(8==o||9==o)return n.replace(/(\d{1})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3");if(10==o)return n.replace(/(\d{2})\-?(\d{4})\-?(\d{4})/,"($1) $2 $3")}}return e},getValidateMessage:function(){return t.ValidateReturnObject}}},$(document).on("click",function(e){try{!1===$(e.target).is(".select2-container")&&$(".select2-dropdown-open").length>0&&$(".select2-dropdown-open").select2("close")}catch(e){}}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).libphonenumber={})}(this,function(e){"use strict";var t={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6],0,0,0,0,0,0,0,[["6[2-467]\\d{3}",[5]],["4\\d{4}",[5]],0,0,0,0,["(?:0[1-9]|[1589]\\d)\\d{4}",[6]]]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[["[78]\\d{5}",[6]],["690\\d{6}|[356]\\d{5}",[6,9]],["180[02]\\d{4}",[8]],["[19]\\d{5}",[6]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["[2-4679][2-8]\\d{6}",[8]],["5[024-68]\\d{7}",[9]],["400\\d{6}|800\\d{2,9}"],["900[02]\\d{5}",[9]],0,0,["600[25]\\d{5}",[9]],0,0,["700[05]\\d{5}",[9]]]],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:[25][0-8]|[34][0-4]|6[0-5])[2-9]\\d{6}"],["7\\d{8}"]]],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([457]\\d{6})$","268$1",0,"268",[["268(?:4(?:6[0-38]|84)|56[0-2])\\d{4}"],["268(?:464|7(?:1[3-9]|[28]\\d|3[0246]|64|7[0-689]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["26840[69]\\d{4}"],["26848[01]\\d{4}"]]],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2457]\\d{6})$","264$1",0,"264",[["264(?:292|4(?:6[12]|9[78]))\\d{4}"],["264(?:235|4(?:69|76)|5(?:3[6-9]|8[1-4])|7(?:29|72))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["264724\\d{4}"]]],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0",0,0,0,0,0,[["4505[0-2]\\d{3}|(?:[2358][16-9]\\d[2-9]|4410)\\d{4}|(?:[2358][2-5][2-9]|4(?:[2-57-9][2-9]|6\\d))\\d{5}",[8]],["6(?:[78][2-9]|9\\d)\\d{6}",[9]],["800\\d{4}",[7]],["900[1-9]\\d\\d",[6]],["700[2-9]\\d{4}",[8]],0,0,0,0,["808[1-9]\\d\\d",[6]]]],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:1[0-25]|47)\\d|2(?:2[2-46]|3[1-8]|4[2-69]|5[2-7]|6[1-9]|8[1-7])|3[12]2)\\d{5}"],["(?:33|4[1349]|55|77|88|9[13-9])\\d{6}"],["800\\d{5}"],["90[016]\\d{5}"],0,0,0,0,["60(?:2[78]|3[5-9]|4[02-9]|5[0-46-9]|[6-8]\\d|9[01])\\d{4}"],["80[1-4]\\d{5}"]]],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]],0,0,0,0,0,0,[["2\\d(?:[0134][25-9]|[25-9]\\d)\\d{5}"],["9[1-59]\\d{7}"]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1",0,0,[["3888[013-9]\\d{5}|3(?:7(?:1[15]|81)|8(?:21|4[16]|69|9[12]))[46]\\d{5}|(?:29(?:54|66)|3(?:7(?:55|77)|865))[2-8]\\d{5}|(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|(?:2(?:284|3(?:02|23)|657|920)|3(?:4(?:8[27]|92)|541|878))[2-7]\\d{5}|(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:[47]6|62|89)|564))[2-6]\\d{5}|(?:(?:11[1-8]|670)\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-7]|[235][4-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|[58][3-6])))\\d{6}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}",[10]],["93(?:7(?:1[15]|81)[46]|8(?:(?:21|4[16]|69|9[12])[46]|88[013-9]))\\d{5}|9(?:29(?:54|66)|3(?:7(?:55|77)|865))[2-8]\\d{5}|9(?:2(?:2(?:2[59]|44|52)|3(?:26|44)|473|9(?:[07]2|2[26]|34|46))|3327)[45]\\d{5}|9(?:2(?:284|3(?:02|23)|657|920)|3(?:4(?:8[27]|92)|541|878))[2-7]\\d{5}|9(?:2(?:(?:26|62)2|320|477|9(?:42|83))|3(?:329|4(?:[47]6|62|89)|564))[2-6]\\d{5}|(?:675\\d|9(?:11[1-8]\\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-7]|[235][4-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|[17][2-6]|3[4-6]|[58][3-6]))))\\d{6}|92(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|475|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\\d{5}|9(?:2(?:2(?:57|81)|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|71)|5(?:25|37|4[347]|71)|7(?:18|5[17])))[3-6]\\d{5}|9(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[03-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[145]|4[13]|5[468]|7[2-5]|8[26])|8(?:2[5-7]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\\d{5}"],["800\\d{7,8}"],["60[04579]\\d{7}",[10]],0,0,["810\\d{7}",[10]]]],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"1|([267]\\d{6})$","684$1",0,"684",[["6846(?:22|33|44|55|77|88|9[19])\\d{4}"],["684(?:2(?:48|5[2468]|72)|7(?:3[13]|70|82))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0",0,0,0,0,0,[["1(?:11\\d|[2-9]\\d{3,11})|(?:316|463|(?:51|66|73)2)\\d{3,10}|(?:2(?:1[467]|2[13-8]|5[2357]|6[1-46-8]|7[1-8]|8[124-7]|9[1458])|3(?:1[1-578]|3[23568]|4[5-7]|5[1378]|6[1-38]|8[3-68])|4(?:2[1-8]|35|7[1368]|8[2457])|5(?:2[1-8]|3[357]|4[147]|5[12578]|6[37])|6(?:13|2[1-47]|4[135-8]|5[468])|7(?:2[1-8]|35|4[13478]|5[68]|6[16-8]|7[1-6]|9[45]))\\d{4,10}"],["6(?:5[0-3579]|6[013-9]|[7-9]\\d)\\d{4,10}",[7,8,9,10,11,12,13]],["800\\d{6,10}",[9,10,11,12,13]],["(?:8[69][2-68]|9(?:0[01]|3[019]))\\d{6,10}",[9,10,11,12,13]],0,0,0,0,["5(?:0[1-9]|17|[79]\\d)\\d{2,10}|7[28]0\\d{6,10}",[5,6,7,8,9,10,11,12,13]],["8(?:10|2[018])\\d{6,10}|828\\d{5}",[8,9,10,11,12,13]]]],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"0|(183[12])",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]],0,0,0,0,0,0,[["5(?:2\\d|8[1-9])\\d{4}"],["(?:290|5[69]\\d|6(?:[03]0|22|4[0-2]|[69]\\d)|7(?:[34]\\d|7[07])|9(?:6[45]|9[4-8]))\\d{4}"],["800\\d{4}"],["900\\d{4}"],0,0,0,0,["(?:28\\d|501)\\d{4}"]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",[["18[1-8]\\d{3,6}",[6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12]428|3655[02])\\d{4}|(?:2(?:22[0-79]|63[0-28])|3654)\\d{5}|(?:(?:1[28]|46)\\d|2(?:[014-6]2|[23]3))\\d{6}"],["36554\\d{4}|(?:[16]0|4[04]|5[015]|7[07]|99)\\d{7}"],["88\\d{7}"],["900200\\d{3}"]]],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[05-79][2-9]|1[4579]|[23][24-9]|4[2-4689]|8[2457-9])|49[2-579]|5(?:0[2-49]|[13][2-9]|[268][2-4679]|4[4689]|5[2-79]|7[2-69]|9[2-4689]))\\d{5}",[8]],["6040\\d{5}|6(?:03|[1-356]|44|7\\d)\\d{6}"],["8[08]\\d{6}",[8]],["9[0246]\\d{6}",[8]],0,0,["703[235]0\\d{3}|70(?:2[0-5]|3[0146]|[56]0)\\d{4}",[8]],0,0,["8[12]\\d{6}",[8]]]],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","246$1",0,"246",[["246521[0369]\\d{3}|246(?:2(?:2[78]|7[0-4])|4(?:1[024-6]|2\\d|3[2-9])|5(?:20|[34]\\d|54|7[1-3])|6(?:2\\d|38)|7[35]7|9(?:1[89]|63))\\d{4}"],["246(?:(?:2(?:[3568]\\d|4[0-57-9])|3(?:5[2-9]|6[0-6])|4(?:46|5\\d)|69[5-7]|8(?:[2-5]\\d|83))\\d|52(?:1[147]|20))\\d{3}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:246976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"],0,["246(?:292|367|4(?:1[7-9]|3[01]|4[47-9]|67)|7(?:1[2-9]|2\\d|3[016]|53))\\d{4}"],0,["24631\\d{5}"]]],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0",0,0,0,0,0,[["(?:4(?:31\\d\\d|423)|5222)\\d{3}(?:\\d{2})?|8332[6-9]\\d\\d|(?:3(?:03[56]|224)|4(?:22[25]|653))\\d{3,4}|(?:3(?:42[47]|529|823)|4(?:027|525|65(?:28|8))|562|6257|7(?:1(?:5[3-5]|6[12]|7[156]|89)|22[589]56|32|42675|52(?:[25689](?:56|8)|[347]8)|71(?:6[1267]|75|89)|92374)|82(?:2[59]|32)56|9(?:03[23]56|23(?:256|373)|31|5(?:1|2[4589]56)))\\d{3}|(?:3(?:02[348]|22[35]|324|422)|4(?:22[67]|32[236-9]|6(?:2[46]|5[57])|953)|5526|6(?:024|6655)|81)\\d{4,5}|(?:2(?:7(?:1[0-267]|2[0-289]|3[0-29]|4[01]|5[1-3]|6[013]|7[0178]|91)|8(?:0[125]|1[1-6]|2[0157-9]|3[1-69]|41|6[1-35]|7[1-5]|8[1-8]|9[0-6])|9(?:0[0-2]|1[0-4]|2[568]|3[3-6]|5[5-7]|6[0136-9]|7[0-7]|8[014-9]))|3(?:0(?:2[025-79]|3[2-4])|181|22[12]|32[2356]|824)|4(?:02[09]|22[348]|32[045]|523|6(?:27|54))|666(?:22|53)|7(?:22[57-9]|42[56]|82[35])8|8(?:0[124-9]|2(?:181|2[02-4679]8)|4[12]|[5-7]2)|9(?:[04]2|2(?:2|328)|81))\\d{4}|(?:2(?:222|[45]\\d)\\d|3(?:1(?:2[5-7]|[5-7])|425|822)|4(?:033|1\\d|[257]1|332|4(?:2[246]|5[25])|6(?:2[35]|56|62)|8(?:23|54)|92[2-5])|5(?:02[03489]|22[457]|32[35-79]|42[46]|6(?:[18]|53)|724|826)|6(?:023|2(?:2[2-5]|5[3-5]|8)|32[3478]|42[34]|52[47]|6(?:[18]|6(?:2[34]|5[24]))|[78]2[2-5]|92[2-6])|7(?:02|21\\d|[3-589]1|6[12]|72[24])|8(?:217|3[12]|[5-7]1)|9[24]1)\\d{5}|(?:(?:3[2-8]|5[2-57-9]|6[03-589])1|4[4689][18])\\d{5}|[59]1\\d{5}"],["(?:1[13-9]\\d|644)\\d{7}|(?:3[78]|44|66)[02-9]\\d{7}",[10]],["80[03]\\d{7}",[10]],0,0,0,0,0,["96(?:0[469]|1[0-47]|3[389]|6[69]|7[78])\\d{6}",[10]]]],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0",0,0,0,0,0,[["80[2-8]\\d{5}|(?:1[0-69]|[23][2-8]|4[23]|5\\d|6[013-57-9]|71|8[1-79]|9[2-4])\\d{6}",[8]],["4[5-9]\\d{7}",[9]],["800[1-9]\\d{4}",[8]],["(?:70(?:2[0-57]|3[04-7]|44|6[569]|7[0579])|90(?:0[0-8]|1[36]|2[0-3568]|3[0-689]|[47][2-68]|5[1-68]|6[0-378]|9[34679]))\\d{4}",[8]],0,0,["78(?:0[57]|1[014-8]|2[25]|3[15-8]|48|[56]0|7[06-8]|9\\d)\\d{4}",[8]],0,0,["7879\\d{4}",[8]]]],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]],0,0,0,0,0,0,[["2(?:0(?:49|5[23]|6[5-7]|9[016-9])|4(?:4[569]|5[4-6]|6[5-7]|7[0179])|5(?:[34]\\d|50|6[5-7]))\\d{4}"],["(?:0[1-35-7]|5[1-8]|[67]\\d)\\d{6}"]]],BG:["359","00","[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["2\\d{5,7}|(?:43[1-6]|70[1-9])\\d{4,5}|(?:[36]\\d|4[124-7]|[57][1-9]|8[1-6]|9[1-7])\\d{5,6}",[6,7,8]],["(?:43[07-9]|99[69]\\d)\\d{5}|(?:8[7-9]|98)\\d{7}",[8,9]],["800\\d{5}",[8]],["90\\d{6}",[8]],0,0,0,0,0,["700\\d{5}",[8]]]],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[047]"]]],0,0,0,0,0,0,[["(?:1(?:3[1356]|6[0156]|7\\d)\\d|6(?:1[16]\\d|500|6(?:0\\d|3[12]|44|7[7-9]|88)|9[69][69])|7(?:1(?:11|78)|7\\d\\d))\\d{4}"],["(?:3(?:[1-79]\\d|8[0-47-9])\\d|6(?:3(?:00|33|6[16])|6(?:3[03-9]|[69]\\d|7[0-6])))\\d{4}"],["80\\d{6}"],["(?:87|9[014578])\\d{6}"],0,0,0,0,0,["84\\d{6}"]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]],0,0,0,0,0,0,[["(?:22|31)\\d{6}"],["(?:29|6[1257-9]|7[125-9])\\d{6}"]]],BJ:["229","00","(?:[25689]\\d|40)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]],0,0,0,0,0,0,[["2(?:02|1[037]|2[45]|3[68])\\d{5}"],["(?:40|5[1-9]|6\\d|9[013-9])\\d{6}"],0,0,0,0,["81\\d{6}"],0,["857[58]\\d{4}"]]],BL:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","441$1",0,"441",[["441(?:[46]\\d\\d|5(?:4\\d|60|89))\\d{4}"],["441(?:[2378]\\d|5[0-39])\\d{5}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["22[0-7]\\d{4}|(?:2[013-9]|[34]\\d|5[0-25-9])\\d{5}"],["(?:22[89]|[78]\\d\\d)\\d{4}"],0,0,0,0,0,0,["5[34]\\d{5}"]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?",0,0,0,[["(?:2(?:2\\d\\d|5(?:11|[258]\\d|9[67])|6(?:12|2\\d|9[34])|8(?:2[34]|39|62))|3(?:3\\d\\d|4(?:6\\d|8[24])|8(?:25|42|5[257]|86|9[25])|9(?:[27]\\d|3[2-4]|4[248]|5[24]|6[2-6]))|4(?:4\\d\\d|6(?:11|[24689]\\d|72)))\\d{4}",[8]],["[67]\\d{7}",[8]],["8001[07]\\d{4}",[9]]]],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]",[["(?:318[023]|41(?:6[023]|70)|7(?:1[578]|2[05]|50)\\d)\\d{3}"],["(?:31(?:8[14-8]|9[14578])|416[14-9]|7(?:0[01]|7[07]|8\\d|9[056])\\d)\\d{3}"]]],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",0,0,[["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}",[10]],["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])(?:7|9\\d)\\d{7}",[10,11]],["800\\d{6,7}",[9,10]],["300\\d{6}|[59]00\\d{6,7}",[9,10]],0,0,0,0,0,["(?:30[03]\\d{3}|4(?:0(?:0\\d|20)|370))\\d{4}|300\\d{5}",[8,10]]]],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([3-8]\\d{6})$","242$1",0,"242",[["242(?:3(?:02|[236][1-9]|4[0-24-9]|5[0-68]|7[347]|8[0-4]|9[2-467])|461|502|6(?:0[1-4]|12|2[013]|[45]0|7[67]|8[78]|9[89])|7(?:02|88))\\d{4}"],["242(?:3(?:5[79]|7[56]|95)|4(?:[23][1-9]|4[1-35-9]|5[1-8]|6[2-8]|7\\d|81)|5(?:2[45]|3[35]|44|5[1-46-9]|65|77)|6[34]6|7(?:27|38)|8(?:0[1-9]|1[02-9]|2\\d|[89]9))\\d{4}"],["242300\\d{4}|8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"],0,["242225\\d{4}"]]],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]],0,0,0,0,0,0,[["(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}",[7]],["(?:1[67]|77)\\d{6}",[8]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-79]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013])|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[067]))\\d{4}",[7]],["(?:321|7(?:[1-7]\\d|8[01]))\\d{5}",[8]],["(?:0800|800\\d)\\d{6}",[10]],["90\\d{5}",[7]],0,0,0,0,["79(?:1(?:[01]\\d|2[0-7])|2[0-7]\\d)\\d{3}",[8]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,[["(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}",[9]],["(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}",[9]],["800\\d{3,7}|8(?:0[13]|20\\d)\\d{7}"],["(?:810|902)\\d{7}",[10]],0,0,0,0,["249\\d{6}",[9]]],"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]],0,0,0,0,0,0,[["(?:2(?:[02]\\d|36|[68]0)|[3-58](?:[02]\\d|[68]0)|7(?:[02]\\d|32|[68]0))\\d{4}",[7]],["6[0-35-7]\\d{5}",[7]],["0800\\d{7}",[11]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|68|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-7]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["12\\d{7}|[1-6]\\d{6}"],["88\\d{5}|(?:8[0-59]|9[017-9])\\d{7}"]]],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]],0,0,0,0,0,0,[["2[12]\\d{6}"],["7[02457]\\d{6}"],0,["8776\\d{4}"]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]],0,0,0,0,0,0,[["222[1-589]\\d{5}"],["026(?:1[0-5]|6[6-9])\\d{4}|0(?:[14-6]\\d\\d|2(?:40|5[5-8]|6[07-9]))\\d{5}"],0,["80(?:0\\d\\d|120)\\d{4}"]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2[12467]|3[1-4]|4[134]|5[256]|6[12]|[7-9]1)\\d{7}"],["7[35-9]\\d{7}"],["800\\d{6}"],["90[016]\\d{6}"],["878\\d{6}"],0,["5[18]\\d{7}"],["74[0248]\\d{6}"],0,["84[0248]\\d{6}"]]],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]],0,0,0,0,0,0,[["2(?:[15]\\d{3}|7(?:2(?:0[23]|1[2357]|[23][45]|4[3-5])|3(?:06|1[69]|[2-6]7)))\\d{5}"],["0704[0-7]\\d{5}|0(?:[15]\\d\\d|7(?:0[0-37-9]|[4-9][7-9]))\\d{6}"]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]],0,0,0,0,0,0,[["(?:2\\d|3[13-7]|4[1-5])\\d{3}"],["[578]\\d{4}"]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]],0,0,0,0,0,0,[["2(?:1982[0-6]|3314[05-9])\\d{3}|(?:2(?:1(?:160|962)|3(?:2\\d\\d|3(?:[0346]\\d|1[0-35-9]|2[1-9]|5[0-24-9]|7[0-3])|600)|646[59])|80[1-9]\\d\\d|9(?:3(?:[0-57-9]\\d\\d|6(?:0[02-9]|[1-9]\\d))|6(?:[0-8]\\d\\d|9(?:[02-79]\\d|1[05-9]))|7[1-9]\\d\\d|9(?:[03-9]\\d\\d|1(?:[0235-9]\\d|4[0-24-9])|2(?:[0-79]\\d|8[0-46-9]))))\\d{4}|(?:22|3[2-5]|[47][1-35]|5[1-3578]|6[13-57]|8[1-9]|9[2458])\\d{7}",[9]],["",[9]],["(?:123|8)00\\d{6}",[9,11]],0,0,0,0,0,["44\\d{7}",[9]],["600\\d{7,8}",[10,11]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]],0,0,0,0,0,0,[["2(?:22|33)\\d{6}",[9]],["(?:24[23]|6[25-9]\\d)\\d{6}",[9]],["88\\d{6,7}"]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","(?:10|2[0-57-9])(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"0|(1(?:[12]\\d|79)\\d\\d)",0,0,0,[["(?:10(?:[02-79]\\d\\d|[18](?:0[1-9]|[1-9]\\d))|21(?:[18](?:0[1-9]|[1-9]\\d)|[2-79]\\d\\d))\\d{5}|(?:43[35]|754)\\d{7,8}|8(?:078\\d{7}|51\\d{7,8})|(?:10|(?:2|85)1|43[35]|754)(?:100\\d\\d|95\\d{3,4})|(?:2[02-57-9]|3(?:11|7[179])|4(?:[15]1|3[12])|5(?:1\\d|2[37]|3[12]|51|7[13-79]|9[15])|7(?:[39]1|5[57]|6[09])|8(?:71|98))(?:[02-8]\\d{7}|1(?:0(?:0\\d\\d(?:\\d{3})?|[1-9]\\d{5})|[1-9]\\d{6})|9(?:[0-46-9]\\d{6}|5\\d{3}(?:\\d(?:\\d{2})?)?))|(?:3(?:1[02-9]|35|49|5\\d|7[02-68]|9[1-68])|4(?:1[02-9]|2[179]|3[46-9]|5[2-9]|6[47-9]|7\\d|8[23])|5(?:3[03-9]|4[36]|5[02-9]|6[1-46]|7[028]|80|9[2-46-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[17]\\d|2[248]|3[04-9]|4[3-6]|5[0-3689]|6[2368]|9[02-9])|8(?:1[236-8]|2[5-7]|3\\d|5[2-9]|7[02-9]|8[36-8]|9[1-7])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:[02-8]\\d{6}|1(?:0(?:0\\d\\d(?:\\d{2})?|[1-9]\\d{4})|[1-9]\\d{5})|9(?:[0-46-9]\\d{5}|5\\d{3,5}))",[7,8,9,10,11]],["1740[0-5]\\d{6}|1(?:[38]\\d|4[57]|[59][0-35-9]|6[25-7]|7[0-35-8])\\d{8}",[11]],["(?:(?:10|21)8|8)00\\d{7}",[10,12]],["16[08]\\d{5}",[8]],0,0,0,0,0,["400\\d{7}|950\\d{7,8}|(?:10|2[0-57-9]|3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))96\\d{3,4}",[7,8,9,10,11]]],"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["[39]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0(4(?:[14]4|56)|[579])?",0,0,0,[["60[124-8][2-9]\\d{6}",[10]],["3333(?:0(?:0\\d|1[0-5])|[4-9]\\d\\d)\\d{3}|(?:3(?:24[1-9]|3(?:00|3[0-24-9]))|9101)\\d{6}|3(?:0[0-5]|1\\d|2[0-3]|5[01]|70)\\d{7}",[10]],["1800\\d{7}",[11]],["19(?:0[01]|4[78])\\d{7}",[11]]]],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))",0,0,0,[["210[7-9]\\d{4}|2(?:[024-7]\\d|1[1-9])\\d{5}",[8]],["(?:3005\\d|6500[01])\\d{3}|(?:5[07]|6[0-4]|7[0-3]|8[3-9])\\d{6}",[8]],["800\\d{7}",[10]],["90[059]\\d{7}",[10]],0,0,0,0,["(?:210[0-6]|4\\d{3}|5100)\\d{4}",[8]]]],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["5"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:3[23]|48)\\d{4,6}|(?:31|4[36]|8(?:0[25]|78)\\d)\\d{6}|(?:2[1-4]|4[1257]|7\\d)\\d{5,6}"],["5\\d{7}",[8]],["800\\d{7}",[10]],0,0,0,0,0,0,["807\\d{7}",[10]]]],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]],0,0,0,0,0,0,[["2(?:2[1-7]|3[0-8]|4[12]|5[1256]|6\\d|7[1-3]|8[1-5])\\d{4}"],["(?:36|5[1-389]|9\\d)\\d{5}"],["800\\d{4}"],0,0,0,0,0,["(?:3[3-5]|4[356])\\d{5}"]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]",[["9(?:4(?:3[0-5]|4[14]|6\\d)|50\\d|7(?:2[014]|3[02-9]|4[4-9]|6[357]|77|8[7-9])|8(?:3[39]|[46]\\d|7[01]|8[57-9]))\\d{4}"],["953[01]\\d{4}|9(?:5[12467]|6[5-9])\\d{5}"],0,0,0,0,0,["955\\d{5}",[8]],0,["60[0-2]\\d{4}",[7]]]],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"0|([59]\\d{7})$","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:83[0-38]|93[0-6])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]],0,0,0,0,0,0,[["2[2-6]\\d{6}"],["9[4-79]\\d{6}"],["800\\d{5}"],["90[09]\\d{5}"],["700\\d{5}"],0,["(?:50|77)\\d{6}"],0,0,["80[1-9]\\d{5}"]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:2\\d|3[1257-9]|4[16-9]|5[13-9])\\d{7}"],["(?:60[1-8]|7(?:0[2-5]|[2379]\\d))\\d{6}"],["800\\d{6}"],["9(?:0[05689]|76)\\d{6}"],["70[01]\\d{6}"],0,["9(?:5\\d|7[2-4])\\d{6}"],0,["9[17]0\\d{6}"],["8[134]\\d{7}"]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[02-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|[23]1|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0",0,0,0,0,0,[["32\\d{9,11}|49[1-6]\\d{10}|322\\d{6}|49[0-7]\\d{3,9}|(?:[34]0|[68]9)\\d{3,13}|(?:2(?:0[1-689]|[1-3569]\\d|4[0-8]|7[1-7]|8[0-7])|3(?:[3569]\\d|4[0-79]|7[1-7]|8[1-8])|4(?:1[02-9]|[2-48]\\d|5[0-6]|6[0-8]|7[0-79])|5(?:0[2-8]|[124-6]\\d|[38][0-8]|[79][0-7])|6(?:0[02-9]|[1-358]\\d|[47][0-8]|6[1-9])|7(?:0[2-8]|1[1-9]|[27][0-7]|3\\d|[4-6][0-8]|8[0-5]|9[013-7])|8(?:0[2-9]|1[0-79]|2\\d|3[0-46-9]|4[0-6]|5[013-9]|6[1-8]|7[0-8]|8[0-24-6])|9(?:0[6-9]|[1-4]\\d|[589][0-7]|6[0-8]|7[0-467]))\\d{3,12}",[5,6,7,8,9,10,11,12,13,14,15]],["15[0-25-9]\\d{8}|1(?:6[023]|7\\d)\\d{7,8}",[10,11]],["800\\d{7,12}",[10,11,12,13,14,15]],["(?:137[7-9]|900(?:[135]|9\\d))\\d{6}",[10,11]],["700\\d{8}",[11]],0,["18(?:1\\d{5,11}|[2-9]\\d{8})",[8,9,10,11,12,13,14]],["16(?:4\\d{1,10}|[89]\\d{1,11})",[4,5,6,7,8,9,10,11,12,13,14]],0,["180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}",[7,8,9,10,11,12,13,14]]]],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]],0,0,0,0,0,0,[["2(?:1[2-5]|7[45])\\d{5}"],["77\\d{6}"]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]],0,0,0,0,0,0,[["(?:[2-7]\\d|8[126-9]|9[1-46-9])\\d{6}"],[""],["80\\d{6}"],["90\\d{6}"]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","767$1",0,"767",[["767(?:2(?:55|66)|4(?:2[01]|4[0-25-9])|50[0-4])\\d{4}"],["767(?:2(?:[2-4689]5|7[5-7])|31[5-7]|61[1-8]|70[1-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9",[["8(?:[04]9[2-9]\\d\\d|29(?:2(?:[0-59]\\d|6[04-9]|7[0-27]|8[0237-9])|3(?:[0-35-9]\\d|4[7-9])|[45]\\d\\d|6(?:[0-27-9]\\d|[3-5][1-9]|6[0135-8])|7(?:0[013-9]|[1-37]\\d|4[1-35689]|5[1-4689]|6[1-57-9]|8[1-79]|9[1-8])|8(?:0[146-9]|1[0-48]|[248]\\d|3[1-79]|5[01589]|6[013-68]|7[124-8]|9[0-8])|9(?:[0-24]\\d|3[02-46-9]|5[0-79]|60|7[0169]|8[57-9]|9[02-9])))\\d{4}"],["8[024]9[2-9]\\d{6}"],["8(?:00(?:14|[2-9]\\d)|(?:33|44|55|66|77|88)[2-9]\\d)\\d{5}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0",0,0,0,0,0,[["9619\\d{5}|(?:1\\d|2[013-79]|3[0-8]|4[013-689])\\d{6}"],["(?:5(?:4[0-29]|5\\d|6[0-2])|6(?:[569]\\d|7[0-6])|7[7-9]\\d)\\d{6}",[9]],["800\\d{6}",[9]],["80[3-689]1\\d{5}",[9]],0,0,0,0,["98[23]\\d{6}",[9]],["80[12]1\\d{5}",[9]]]],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["[2-7][2-7]\\d{6}",[8]],["964[0-2]\\d{5}|9(?:39|[57][89]|6[0-36-9]|[89]\\d)\\d{6}",[9]],["1800\\d{7}|1[78]00\\d{6}",[10,11]],0,0,0,0,0,["[2-7]890\\d{4}",[8]]]],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:3[23589]|4[3-8]|6\\d|7[1-9]|88)\\d{5}",[7]],["(?:5\\d{5}|8(?:1(?:0(?:000|[3-9]\\d\\d)|(?:1(?:0[236]|1\\d)|(?:23|[3-79]\\d)\\d)\\d)|2(?:0(?:000|(?:19|[2-7]\\d)\\d)|(?:(?:[124-6]\\d|3[5-9])\\d|7(?:[3679]\\d|8[13-9])|8(?:[2-6]\\d|7[01]))\\d)|[349]\\d{4}))\\d\\d|5(?:(?:[02]\\d|5[0-478])\\d|1(?:[0-8]\\d|95)|6(?:4[0-4]|5[1-589]))\\d{3}",[7,8]],["800(?:(?:0\\d\\d|1)\\d|[2-9])\\d{3}"],["(?:40\\d\\d|900)\\d{4}",[7,8]],["70[0-2]\\d{5}",[8]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[189]"],"0$1"]],"0",0,0,0,0,0,[["13[23]\\d{6}|(?:15|57)\\d{6,7}|(?:2[2-4]|3|4[05-8]|5[05]|6[24-689]|8[2468]|9[235-7])\\d{7}",[8,9]],["1[0-25]\\d{8}",[10]],["800\\d{7}",[10]],["900\\d{7}",[10]]]],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]",[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1[12568]|[24]0|55|6[146])|8\\d\\d)\\d{4}"],["(?:17[1-3]|7\\d\\d)\\d{4}"]]],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]],0,0,0,0,0,0,[["96906(?:0[0-8]|1[1-9]|[2-9]\\d)\\d\\d|9(?:69(?:0[0-57-9]|[1-9]\\d)|73(?:[0-8]\\d|9[1-9]))\\d{4}|(?:8(?:[1356]\\d|[28][0-8]|[47][1-9])|9(?:[135]\\d|[268][0-8]|4[1-9]|7[124-9]))\\d{6}"],["(?:590[16]00\\d|9(?:6906(?:09|10)|7390\\d\\d))\\d\\d|(?:6\\d|7[1-48])\\d{7}"],["[89]00\\d{6}"],["80[367]\\d{6}"],["70\\d{7}"],0,["51\\d{7}"],0,0,["90[12]\\d{6}"]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0",0,0,0,0,0,[["11667[01]\\d{3}|(?:11(?:1(?:1[124]|2[2-7]|3[1-5]|5[5-8]|8[6-8])|2(?:13|3[6-8]|5[89]|7[05-9]|8[2-6])|3(?:2[01]|3[0-289]|4[1289]|7[1-4]|87)|4(?:1[69]|3[2-49]|4[0-3]|6[5-8])|5(?:1[578]|44|5[0-4])|6(?:1[78]|2[69]|39|4[5-7]|5[1-5]|6[0-59]|8[015-8]))|2(?:2(?:11[1-9]|22[0-7]|33\\d|44[1467]|66[1-68])|5(?:11[124-6]|33[2-8]|44[1467]|55[14]|66[1-3679]|77[124-79]|880))|3(?:3(?:11[0-46-8]|(?:22|55)[0-6]|33[0134689]|44[04]|66[01467])|4(?:44[0-8]|55[0-69]|66[0-3]|77[1-5]))|4(?:6(?:119|22[0-24-7]|33[1-5]|44[13-69]|55[14-689]|660|88[1-4])|7(?:(?:11|22)[1-9]|33[13-7]|44[13-6]|55[1-689]))|5(?:7(?:227|55[05]|(?:66|77)[14-8])|8(?:11[149]|22[013-79]|33[0-68]|44[013-8]|550|66[1-5]|77\\d)))\\d{4}"],["7001\\d{5}|(?:7(?:0[1-9]|1[01]|77|86|99)|9\\d\\d)\\d{6}"]]],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",[["(?:1[3-79][1-8]|[235689][1-8]\\d)\\d{2,6}",[5,6,7,8,9]],["4946\\d{2,6}|(?:4[0-8]|50)\\d{4,8}",[6,7,8,9,10]],["800\\d{4,6}",[7,8,9]],["[67]00\\d{5,6}",[8,9]],0,0,["20\\d{4,8}|60[12]\\d{5,6}|7(?:099\\d{4,5}|5[03-9]\\d{3,7})|20[2-59]\\d\\d|(?:606|7(?:0[78]|1|3\\d))\\d{7}|(?:10|29|3[09]|70[1-5]\\d)\\d{4,8}"]],"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,[["603\\d{4}|(?:3[0-5]|6[25-7]|8[58])\\d{5}",[7]],["(?:[279]\\d|45|5[01568]|8[034679])\\d{5}",[7]],["0800\\d{7}",[11]]],"00"],FK:["500","00","[2-7]\\d{4}",[5],0,0,0,0,0,0,0,[["[2-47]\\d{4}"],["[56]\\d{4}"]]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]],0,0,0,0,0,0,[["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-6]\\d)\\d)\\d{3}"],["31(?:00[67]|208|309)\\d\\d|(?:3(?:[2357]0[1-9]|602|804|905)|(?:820|9[2-7]\\d)\\d)\\d{3}"]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))",0,0,0,[["(?:20|[34]\\d|8[19])\\d{4}"],["(?:[27][1-9]|5\\d|9[16])\\d{4}"],["80[257-9]\\d{3}"],["90(?:[13-5][15-7]|2[125-7]|9\\d)\\d\\d"],0,0,0,0,["(?:6[0-36]|88)\\d{4}"]]],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0",0,0,0,0,0,[["(?:[1-35]\\d|4[1-9])\\d{7}"],["(?:6(?:[0-24-8]\\d|3[0-8]|9[589])|7(?:00|[3-9]\\d))\\d{6}"],["80[0-5]\\d{6}"],["836(?:0[0-36-9]|[1-9]\\d)\\d{4}|8(?:1[2-9]|2[2-47-9]|3[0-57-9]|[569]\\d|8[0-35-9])\\d{6}"],0,0,["80[6-9]\\d{6}"],0,["9\\d{8}"],["8(?:1[01]|2[0156]|4[02]|84)\\d{6}"]]],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1",0,0,[["[01]1\\d{6}",[8]],["(?:(?:0[2-7]|7[467])\\d|6(?:0[0-4]|10|[256]\\d))\\d{5}|[2-7]\\d{6}"]]],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[01359])|(?:5[0-26-9]|[78][0-49])\\d\\d|6(?:[0-4]\\d\\d|50[0-79]))|2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d\\d|1(?:[0-7]\\d\\d|8(?:[02]\\d|1[0-26-9])))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","473$1",0,"473",[["473(?:2(?:3[0-2]|69)|3(?:2[89]|86)|4(?:[06]8|3[5-9]|4[0-49]|5[5-79]|73|90)|63[68]|7(?:58|84)|800|938)\\d{4}"],["473(?:4(?:0[2-79]|1[04-9]|2[0-5]|58)|5(?:2[01]|3[3-8])|901)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:[256]\\d|4[124-9]|7[0-4])|4(?:1\\d|2[2-7]|3[1-79]|4[2-8]|7[239]|9[1-7]))\\d{6}"],["5(?:(?:0555|1(?:[17]77|555))[5-9]|757(?:7[7-9]|8[01]))\\d{3}|5(?:0070|11(?:33|51)|[25]222|3333)[0-4]\\d{3}|5(?:00(?:0\\d|5[05])|11(?:00|[124]\\d|3[01])|5200|75(?:00|[57]5)|8(?:0(?:[01]\\d|2[0-4])|58[89]|8(?:55|88)))\\d{4}|(?:5(?:[14]4|5[0157-9]|68|7[0147-9]|9[1-35-9])|790)\\d{6}"],["800\\d{6}"],0,0,0,0,0,["70[67]\\d{6}"]]],GF:["594","00","(?:[56]94|80\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["594(?:[023]\\d|1[0-2]|4[03-9]|5[6-9]|6[0-3]|80|9[0-8])\\d{4}"],["694(?:[0-249]\\d|3[0-48])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976\\d{6}"]]],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"0|([25-9]\\d{5})$","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0",0,0,0,0,0,[["3082[0-5]\\d{4}|3(?:0(?:[237]\\d|8[01])|[167](?:2[0-6]|7\\d|80)|2(?:2[0-5]|7\\d|80)|3(?:2[0-3]|7\\d|80)|4(?:2[013-9]|3[01]|7\\d|80)|5(?:2[0-7]|7\\d|80)|8(?:2[0-2]|7\\d|80)|9(?:[28]0|7\\d))\\d{5}",[9]],["(?:2(?:[0346-9]\\d|5[67])|5(?:[0457]\\d|6[01]|9[1-9]))\\d{6}",[9]],["800\\d{5}",[8]]]],GI:["350","00","(?:[25]\\d\\d|606)\\d{5}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]],0,0,0,0,0,0,[["21(?:6[24-7]\\d|90[0-2])\\d{3}|2(?:00|2[25])\\d{5}"],["(?:5[146-8]\\d|606)\\d{5}"]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]],0,0,0,0,0,0,[["(?:19|3[1-7]|6[14689]|70|8[14-79]|9\\d)\\d{4}"],["[245]\\d{5}"],["80\\d{4}"],0,0,0,0,0,["3[89]\\d{4}"]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:4(?:[23]\\d\\d|4(?:1[024679]|[6-9]\\d))|5(?:5(?:3\\d|4[0-7])|6[67]\\d|7(?:1[04]|2[035]|3[58]|48))|8\\d{3})\\d{3}"],["(?:[23679]\\d|5[0-389])\\d{5}"]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]],0,0,0,0,0,0,[["3(?:0(?:24|3[12]|4[1-35-7]|5[13]|6[189]|[78]1|9[1478])|1\\d\\d)\\d{4}",[8]],["6[0-356]\\d{7}",[9]],0,0,0,0,0,0,["722\\d{6}",[9]]]],GP:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1289]|5[3-579]|6[0-289]|7[08]|8[0-689]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]],0,0,0,0,0,0,[["33[0-24-9]\\d[46]\\d{4}|3(?:33|5\\d)\\d[7-9]\\d{4}"],["(?:222|55\\d)\\d{6}"],["80\\d[1-9]\\d{5}"],["90\\d[1-9]\\d{5}"]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:1\\d\\d|2(?:2[1-46-9]|[36][1-8]|4[1-7]|5[1-4]|7[1-5]|[89][1-9])|3(?:1\\d|2[1-57]|[35][1-3]|4[13]|7[1-7]|8[124-6]|9[1-79])|4(?:1\\d|2[1-8]|3[1-4]|4[13-5]|6[1-578]|9[1-5])|5(?:1\\d|[29][1-4]|3[1-5]|4[124]|5[1-6])|6(?:1\\d|[269][1-6]|3[1245]|4[1-7]|5[13-9]|7[14]|8[1-5])|7(?:1\\d|2[1-5]|3[1-6]|4[1-7]|5[1-57]|6[135]|9[125-7])|8(?:1\\d|2[1-5]|[34][1-4]|9[1-57]))\\d{6}",[10]],["68[57-9]\\d{7}|(?:69|94)\\d{8}",[10]],["800\\d{7,9}"],["90[19]\\d{7}",[10]],["70\\d{8}",[10]],0,["5005000\\d{3}",[10]],0,0,["8(?:0[16]|12|[27]5|50)\\d{7}",[10]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["[267][2-9]\\d{6}",[8]],["[3-5]\\d{7}",[8]],["18[01]\\d{8}",[11]],["19\\d{9}",[11]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"1|([3-9]\\d{6})$","671$1",0,"671",[["671(?:3(?:00|3[39]|4[349]|55|6[26])|4(?:00|56|7[1-9]|8[0236-9])|5(?:55|6[2-5]|88)|6(?:3[2-578]|4[24-9]|5[34]|78|8[235-9])|7(?:[0479]7|2[0167]|3[45]|8[7-9])|8(?:[2-57-9]8|6[48])|9(?:2[29]|6[79]|7[1279]|8[7-9]|9[78]))\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]],0,0,0,0,0,0,[["443\\d{6}",[9]],["9(?:5\\d|6[569]|77)\\d{6}",[9]],0,0,0,0,0,0,["40\\d{5}",[7]]]],GY:["592","001","9008\\d{3}|(?:[2-467]\\d\\d|862)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-46-9]"]]],0,0,0,0,0,0,[["(?:2(?:1[6-9]|2[0-35-9]|3[1-4]|5[3-9]|6\\d|7[0-24-79])|3(?:2[25-9]|3\\d)|4(?:4[0-24]|5[56])|77[1-57])\\d{4}"],["(?:6\\d\\d|70[015-7])\\d{4}"],["(?:289|862)\\d{4}"],["9008\\d{3}"]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,[["(?:38[45][0-8]|58(?:0[1-8]|1[2-9]))\\d{4}|(?:2(?:[13-9]\\d|2[013-9])|3(?:[1569][0-24-9]|4[0-246-9]|7[0-24-69]|89))\\d{5}",[8]],["(?:4(?:44[5-9]|6(?:0[0-7]|1[0-6]|4[0-57-9]|6[0-4]|7[0-8]))|573[0-6]|6(?:26[013-8]|66[0-3])|70(?:7[1-5]|8[0-4])|848[015-9]|9(?:29[013-9]|59[0-4]))\\d{4}|(?:4(?:4[01]|6[2358])|5(?:[1-59][0-46-9]|6[0-4689]|7[0-246-9])|6(?:0[1-9]|[13-59]\\d|[268][0-57-9]|7[0-79])|84[09]|9(?:0[1-9]|1[02-9]|[2358][0-8]|[467]\\d))\\d{5}",[8]],["800\\d{6}",[9]],["900(?:[0-24-9]\\d{7}|3\\d{1,4})",[5,6,7,8,11]],["8(?:1[0-4679]\\d|2(?:[0-36]\\d|7[0-4])|3(?:[034]\\d|2[09]|70))\\d{4}",[8]],0,["30(?:0[1-9]|[15-7]\\d|2[047]|89)\\d{4}",[8]],["7(?:1(?:0[0-38]|1[0-3679]|3[013]|69|9[0136])|2(?:[02389]\\d|1[18]|7[27-9])|3(?:[0-38]\\d|7[0-369]|9[2357-9])|47\\d|5(?:[178]\\d|5[0-5])|6(?:0[0-7]|2[236-9]|[35]\\d)|7(?:[27]\\d|8[7-9])|8(?:[23689]\\d|7[1-9])|9(?:[025]\\d|6[0-246-8]|7[0-36-9]|8[238]))\\d{4}",[8]]],"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]],0,0,0,0,0,0,[["2(?:2(?:0[0-359]|1[1-367]|[23]\\d|4[03-6]|5[57]|6[245]|7[0135689]|8[01346-9]|9[0-2])|4(?:0[78]|2[3-59]|3[13-9]|4[0-68]|5[1-35])|5(?:0[7-9]|16|4[03-5]|5\\d|6[014-6]|7[04]|80)|6(?:[056]\\d|17|2[067]|3[04]|4[0-378]|[78][0-8]|9[01])|7(?:6[46-9]|7[02-9]|8[034]|91)|8(?:79|8[0-357-9]|9[1-57-9]))\\d{4}",[8]],["[37-9]\\d{7}",[8]],["8002\\d{7}",[11]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[0-3]|3[1-5]|4[02-47-9]|5[1-3])\\d{6,7}",[8,9]],["98\\d{6,7}|975(?:1\\d|9[67])\\d{4}|9(?:0[1-9]|[1259]\\d|7[0679])\\d{6}",[8,9]],["80[01]\\d{4,6}",[7,8,9]],["6[01459]\\d{6}|6[01]\\d{4,5}",[6,7,8]],["7[45]\\d{6}",[8]],0,["62\\d{6,7}|72\\d{6}",[8,9]]]],HT:["509","00","[2-489]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-489]"]]],0,0,0,0,0,0,[["2(?:2\\d|5[1-5]|81|9[149])\\d{5}"],["[34]\\d{7}"],["8\\d{7}"],0,0,0,0,0,["9(?:[67][0-4]|8[0-3589]|9\\d)\\d{5}"]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06",0,0,0,0,0,[["(?:1\\d|[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6[23689]|8[2-57-9]|9[2-69])\\d{6}",[8]],["(?:[257]0|3[01])\\d{7}",[9]],["(?:[48]0\\d|680[29])\\d{5}"],["9[01]\\d{6}",[8]],0,0,["38\\d{7}",[9]],0,["21\\d{7}",[9]]]],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0",0,0,0,0,0,[["2[124]\\d{7,8}|619\\d{8}|2(?:1(?:14|500)|2\\d{3})\\d{3}|61\\d{5,8}|(?:2(?:[35][1-4]|6[0-8]|7[1-6]|8\\d|9[1-8])|3(?:1|[25][1-8]|3[1-68]|4[1-3]|6[1-3568]|7[0-469]|8\\d)|4(?:0[1-589]|1[01347-9]|2[0-36-8]|3[0-24-68]|43|5[1-378]|6[1-5]|7[134]|8[1245])|5(?:1[1-35-9]|2[25-8]|3[124-9]|4[1-3589]|5[1-46]|6[1-8])|6(?:[25]\\d|3[1-69]|4[1-6])|7(?:02|[125][1-9]|[36]\\d|4[1-8]|7[0-36-9])|9(?:0[12]|1[013-8]|2[0-479]|5[125-8]|6[23679]|7[159]|8[01346]))\\d{5,8}",[7,8,9,10,11]],["8[1-35-9]\\d{7,10}",[9,10,11,12]],["00[17]803\\d{7}|(?:177\\d|800)\\d{5,7}|001803\\d{6}",[8,9,10,11,12,13]],["809\\d{7}",[10]],0,0,["(?:1500|8071\\d{3})\\d{3}",[7,10]],0,0,["804\\d{7}",[10]]]],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:1\\d|21)\\d{6,7}|(?:2[24-9]|4(?:0[24]|5\\d|7)|5(?:0[45]|1\\d|8)|6(?:1\\d|[237-9])|9(?:1\\d|[35-9]))\\d{5}|(?:23|4(?:[1-469]|8\\d)|5[23679]|6[4-6]|7[14]|9[04])\\d{7}"],["8(?:22|[35-9]\\d)\\d{6}",[9]],["1800\\d{6}",[10]],["15(?:1[2-8]|[2-8]0|9[089])\\d{6}",[10]],["700\\d{6}",[9]],0,["818\\d{6}",[9]],0,["76\\d{7}",[9]],["18[59]0\\d{6}",[10]]]],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0",0,0,0,0,0,[["153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}",[8,11,12]],["5(?:(?:[02368]\\d|[19][2-9]|4[1-9])\\d|5(?:01|1[79]|2[2-9]|3[0-3]|4[34]|5[015689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}",[9]],["1(?:255|80[019]\\d{3})\\d{3}",[7,10]],["1212\\d{4}|1(?:200|9(?:0[0-2]|19))\\d{6}",[8,10]],0,0,["1599\\d{6}",[10]],0,["7(?:380|8(?:33|55|77|81))\\d{5}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",[9]],["1700\\d{6}",[10]]]],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([25-8]\\d{5})$","1624$1",0,"74576|(?:16|7[56])24",[["1624(?:230|[5-8]\\d\\d)\\d{3}"],["76245[06]\\d{4}|7(?:4576|[59]24\\d|624[0-4689])\\d{5}"],["808162\\d{4}"],["8(?:440[49]06|72299\\d)\\d{3}|(?:8(?:45|70)|90[0167])624\\d{4}"],["70\\d{8}"],0,["3440[49]06\\d{3}|(?:3(?:08162|3\\d{4}|45624|7(?:0624|2299))|55\\d{4})\\d{4}"],0,["56\\d{8}"]]],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0",0,0,0,0,0,[["2717(?:[2-7]\\d|95)\\d{4}|(?:271[0-689]|782[0-6])[2-7]\\d{5}|(?:170[24]|2(?:(?:[02][2-79]|90)\\d|80[13468])|(?:3(?:23|80)|683|79[1-7])\\d|4(?:20[24]|72[2-8])|552[1-7])\\d{6}|(?:11|33|4[04]|80)[2-7]\\d{7}|(?:342|674|788)(?:[0189][2-7]|[2-7]\\d)\\d{5}|(?:1(?:2[0-249]|3[0-25]|4[145]|[59][14]|6[014]|7[1257]|8[01346])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568]|9[14])|3(?:26|4[13]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[014-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|2[14]|3[134]|4[47]|5[15]|[67]1)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91))[2-7]\\d{6}|(?:1(?:2[35-8]|3[346-9]|4[236-9]|[59][0235-9]|6[235-9]|7[34689]|8[257-9])|2(?:1[134689]|3[24-8]|4[2-8]|5[25689]|6[2-4679]|7[3-79]|8[2-479]|9[235-9])|3(?:01|1[79]|2[1245]|4[5-8]|5[125689]|6[235-7]|7[157-9]|8[2-46-8])|4(?:1[14578]|2[5689]|3[2-467]|5[4-7]|6[35]|73|8[2689]|9[2389])|5(?:[16][146-9]|2[14-8]|3[1346]|4[14-69]|5[46]|7[2-4]|8[2-8]|9[246])|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])|7(?:1[013-9]|2[0235-9]|3[2679]|4[1-35689]|5[2-46-9]|[67][02-9]|8[013-7]|9[089])|8(?:1[1357-9]|2[235-8]|3[03-57-9]|4[0-24-9]|5\\d|6[2457-9]|7[1-6]|8[1256]|9[2-4]))\\d[2-7]\\d{5}",[10]],["(?:61279|7(?:887[02-9]|9(?:313|79[07-9]))|8(?:079[04-9]|(?:84|91)7[02-8]))\\d{5}|(?:6(?:12|[2-47]1|5[17]|6[13]|80)[0189]|7(?:1(?:2[0189]|9[0-5])|2(?:[14][017-9]|8[0-59])|3(?:2[5-8]|[34][017-9]|9[016-9])|4(?:1[015-9]|[29][89]|39|8[389])|5(?:[15][017-9]|2[04-9]|9[7-9])|6(?:0[0-47]|1[0-257-9]|2[0-4]|3[19]|5[4589])|70[0289]|88[089]|97[02-8])|8(?:0(?:6[67]|7[02-8])|70[017-9]|84[01489]|91[0-289]))\\d{6}|(?:7(?:31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[0189]\\d|7[02-8])\\d{5}|(?:6(?:[09]\\d|1[04679]|2[03689]|3[05-9]|4[0489]|50|6[069]|7[07]|8[7-9])|7(?:0\\d|2[0235-79]|3[05-8]|40|5[0346-8]|6[6-9]|7[1-9]|8[0-79]|9[089])|8(?:0[01589]|1[0-57-9]|2[235-9]|3[03-57-9]|[45]\\d|6[02457-9]|7[1-69]|8[0-25-9]|9[02-9])|9\\d\\d)\\d{7}|(?:6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|8[124-6])\\d|7(?:[235689]\\d|4[0189]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-5])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]|881))[0189]\\d{5}",[10]],["000800\\d{7}|1(?:600\\d{6}|80(?:0\\d{4,9}|3\\d{9}))"],["186[12]\\d{9}",[13]],0,0,["140\\d{7}",[10]],0,0,["1860\\d{7}",[11]]]],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]],0,0,0,0,0,0,[["37\\d{5}"],["38\\d{5}"]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["1\\d{7}|(?:2[13-5]|3[02367]|4[023]|5[03]|6[026])\\d{6,7}",[8,9]],["7[3-9]\\d{8}",[10]]]],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])(?:[03-57]\\d{7}|[16]\\d{3}(?:\\d{4})?|[289]\\d{3}(?:\\d(?:\\d{3})?)?)|94(?:000[09]|2(?:121|[2689]0\\d)|30[0-2]\\d|4(?:111|40\\d))\\d{4}",[6,7,10]],["9(?:(?:0(?:[0-35]\\d|4[4-6])|(?:[13]\\d|2[0-3])\\d)\\d|9(?:[0-46]\\d\\d|5[15]0|8(?:1\\d|88)|9(?:0[0-3]|[19]\\d|21|77|8[7-9])))\\d{5}",[10]],0,0,0,0,["96(?:0[12]|2[16-8]|3(?:08|[14]5|[23]|66)|4(?:0|80)|5[01]|6[89]|86|9[19])",[4,5]]]],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["(?:4(?:1[0-24-69]|2[0-7]|[37][0-8]|4[0-24589]|5[0-68]|6\\d|8[0-36-8])|5(?:05|[156]\\d|2[02578]|3[0-579]|4[03-7]|7[0-2578]|8[0-35-9]|9[013-689])|872)\\d{4}",[7]],["(?:38[589]\\d\\d|6(?:1[1-8]|2[0-6]|3[026-9]|4[014679]|5[0159]|6[0-69]|70|8[06-8]|9\\d)|7(?:5[057]|[6-9]\\d)|8(?:2[0-59]|[3-69]\\d|8[238]))\\d{4}"],["80[0-8]\\d{4}",[7]],["90(?:0\\d|1[5-79]|2[015-79]|3[135-79]|4[125-7]|5[25-79]|7[1-37]|8[0-35-7])\\d{3}",[7]],0,0,["809\\d{4}",[7]],0,["49[0-24-79]\\d{4}",[7]]],"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"0|([0-24-8]\\d{5})$","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876",[["8766060\\d{3}|(?:658(?:2(?:[0-8]\\d|9[0-46-9])|[3-9]\\d\\d)|876(?:52[35]|6(?:0[1-3579]|1[02357-9]|[23]\\d|40|5[06]|6[2-589]|7[025-7]|8[04]|9[4-9])|7(?:0[2-689]|[1-6]\\d|8[056]|9[45])|9(?:0[1-8]|1[02378]|[2-8]\\d|9[2-468])))\\d{4}"],["(?:658295|876(?:2(?:0[1-9]|[13-9]\\d|2[013-9])|[348]\\d\\d|5(?:0[1-9]|[1-9]\\d)|6(?:4[89]|6[67])|7(?:0[07]|7\\d|8[1-47-9]|9[0-36-9])|9(?:[01]9|9[0579])))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["87(?:000|90[01])\\d{3}|(?:2(?:6(?:2[0-35-9]|3[0-578]|4[24-7]|5[0-24-8]|[6-8][023]|9[0-3])|7(?:0[1-79]|10|2[014-7]|3[0-689]|4[019]|5[0-3578]))|32(?:0[1-69]|1[1-35-7]|2[024-7]|3\\d|4[0-3]|[5-7][023])|53(?:0[0-3]|[13][023]|2[0-59]|49|5[0-35-9]|6[15]|7[45]|8[1-6]|9[0-36-9])|6(?:2(?:[05]0|22)|3(?:00|33)|4(?:0[0-25]|1[2-7]|2[0569]|[38][07-9]|4[025689]|6[0-589]|7\\d|9[0-2])|5(?:[01][056]|2[034]|3[0-57-9]|4[178]|5[0-69]|6[0-35-9]|7[1-379]|8[0-68]|9[0239]))|87(?:20|7[078]|99))\\d{4}",[8]],["7(?:[78][0-25-9]|9\\d)\\d{6}",[9]],["80\\d{6}",[8]],["9\\d{7}",[8]],["70\\d{7}",[9]],0,["8(?:10|8\\d)\\d{5}",[8]],["74(?:66|77)\\d{5}",[9]],0,["85\\d{6}",[8]]]],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1[235-8]|2[3-6]|3[3-9]|4[2-6]|[58][2-8]|6[2-7]|7[2-9]|9[1-9])|(?:2[2-9]|[36][1-9])\\d|4(?:[2-578]\\d|6[02-8]|9[2-59])|5(?:[2-589]\\d|6[1-9]|7[2-8])|7(?:[25-9]\\d|3[4-9]|4[02-9])|8(?:[2679]\\d|3[2-9]|4[5-9]|5[1-9]|8[03-9])|9(?:[2-58]\\d|[679][1-9]))\\d{6}",[9]],["[7-9]0[1-9]\\d{7}",[10]],["00777(?:[01]|5\\d)\\d\\d|(?:00(?:7778|882[1245])|(?:120|800\\d)\\d\\d)\\d{4}|00(?:37|66|78)\\d{6,13}"],["990\\d{6}",[9]],["60\\d{7}",[9]],0,["570\\d{6}",[9]],["20\\d{8}",[10]],["50[1-9]\\d{7}",[10]]]],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:4[245]|5[1-79]|6[01457-9])\\d{5,7}|(?:4[136]|5[08]|62)\\d{7}|(?:[24]0|66)\\d{6,7}",[7,8,9]],["(?:1(?:0[0-6]|1[0-5]|2[014]|30)|7\\d\\d)\\d{6}",[9]],["800[2-8]\\d{5,6}",[9,10]],["900[02-9]\\d{5}",[9]]]],KG:["996","00","8\\d{9}|(?:[235-8]\\d|99)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["312(?:5[0-79]\\d|9(?:[0-689]\\d|7[0-24-9]))\\d{3}|(?:3(?:1(?:2[0-46-8]|3[1-9]|47|[56]\\d)|2(?:22|3[0-479]|6[0-7])|4(?:22|5[6-9]|6\\d)|5(?:22|3[4-7]|59|6\\d)|6(?:22|5[35-7]|6\\d)|7(?:22|3[468]|4[1-9]|59|[67]\\d)|9(?:22|4[1-8]|6\\d))|6(?:09|12|2[2-4])\\d)\\d{5}",[9]],["312(?:58\\d|973)\\d{3}|(?:2(?:0[0-35]|2\\d)|5[0-24-7]\\d|7(?:[07]\\d|55)|88[08]|99[05-9])\\d{6}",[9]],["800\\d{6,7}"]]],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["23(?:4(?:[2-4]|[56]\\d)|[568]\\d\\d)\\d{4}|23[236-9]\\d{5}|(?:2[4-6]|3[2-6]|4[2-4]|[5-7][2-5])(?:(?:[237-9]|4[56]|5\\d)\\d{5}|6\\d{5,6})",[8,9]],["(?:(?:1[28]|3[18]|9[67])\\d|6[016-9]|7(?:[07-9]|[16]\\d)|8(?:[013-79]|8\\d))\\d{6}|(?:1\\d|9[0-57-9])\\d{6}|(?:2[3-6]|3[2-6]|4[2-4]|[5-7][2-5])48\\d{5}",[8,9]],["1800(?:1\\d|2[019])\\d{4}",[10]],["1900(?:1\\d|2[09])\\d{4}",[10]]]],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0",0,0,0,0,0,[["(?:[24]\\d|3[1-9]|50|65(?:02[12]|12[56]|22[89]|[3-5]00)|7(?:27\\d\\d|3100|5(?:02[12]|12[56]|22[89]|[34](?:00|81)|500))|8[0-5])\\d{3}"],["(?:63\\d{3}|73(?:0[0-5]\\d|140))\\d{3}|[67]200[01]\\d{3}",[8]],0,0,0,0,0,0,["30(?:0[01]\\d\\d|12(?:11|20))\\d\\d",[8]]]],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]],0,0,0,0,0,0,[["7[4-7]\\d{5}"],["[34]\\d{6}"],0,["8\\d{6}"]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","869$1",0,"869",[["869(?:2(?:29|36)|302|4(?:6[015-9]|70)|56[5-7])\\d{4}"],["869(?:48[89]|55[6-8]|66\\d|76[02-7])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:195|2)\\d|3[19]|4[159]|5[37]|6[17]|7[39]|85)\\d{6}"],["19[1-3]\\d{7}",[10]]]],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?",0,0,0,[["(?:2|3[1-3]|[46][1-4]|5[1-5])[1-9]\\d{6,7}|(?:3[1-3]|[46][1-4]|5[1-5])1\\d{2,3}",[5,6,8,9,10]],["1(?:05(?:[0-8]\\d|9[0-6])|22[13]\\d)\\d{4,5}|1(?:0[1-46-9]|[16-9]\\d|2[013-9])\\d{6,7}",[9,10]],["00(?:308\\d{6,7}|798\\d{7,9})|(?:00368|80)\\d{7}",[9,11,12,13,14]],["60[2-9]\\d{6}",[9]],["50\\d{8,9}",[10,11]],0,["1(?:5(?:22|33|44|66|77|88|99)|6(?:[07]0|44|6[168]|88)|8(?:00|33|55|77|99))\\d{4}",[8]],["15\\d{7,8}",[9,10]],["70\\d{8}",[10]]]],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]],0,0,0,0,0,0,[["2(?:[23]\\d\\d|4(?:[1-35-9]\\d|44)|5(?:0[034]|[2-46]\\d|5[1-3]|7[1-7]))\\d{4}",[8]],["(?:41\\d\\d|5(?:(?:[05]\\d|1[0-7]|6[56])\\d|2(?:22|5[25])|7(?:55|77)|88[58])|6(?:(?:0[034679]|5[015-9]|6\\d)\\d|111|222|333|444|7(?:0[013-9]|[67]\\d)|888|9(?:[069]\\d|3[039]))|9(?:(?:0[09]|22|[4679]\\d|8[057-9])\\d|1(?:1[01]|99)|3(?:00|33)|5(?:00|5\\d)))\\d{4}",[8]],["18\\d{5}",[7]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","345$1",0,"345",[["345(?:2(?:22|3[23]|44|66)|333|444|6(?:23|38|40)|7(?:30|4[35-79]|6[6-9]|77)|8(?:00|1[45]|[48]8)|9(?:14|4[035-9]))\\d{4}"],["345(?:32[1-9]|42[0-4]|5(?:1[67]|2[5-79]|4[6-9]|50|76)|649|82[56]|9(?:1[679]|2[2-9]|3[06-9]|90))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["(?:345976|900[2-9]\\d\\d)\\d{4}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"],0,0,["345849\\d{4}"]]],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",[["(?:33622|7(?:1(?:0(?:[23]\\d|4[0-3]|59|63)|1(?:[23]\\d|4[0-79]|59)|2(?:[23]\\d|59)|3(?:2\\d|3[0-79]|4[0-35-9]|59)|4(?:[24]\\d|3[013-9]|5[1-9])|5(?:2\\d|3[1-9]|4[0-7]|59)|6(?:[2-4]\\d|5[19]|61)|72\\d|8(?:[27]\\d|3[1-46-9]|4[0-5]))|2(?:1(?:[23]\\d|4[46-9]|5[3469])|2(?:2\\d|3[0679]|46|5[12679])|3(?:[2-4]\\d|5[139])|4(?:2\\d|3[1-35-9]|59)|5(?:[23]\\d|4[0-246-8]|59|61)|6(?:2\\d|3[1-9]|4[0-4]|59)|7(?:[2379]\\d|40|5[279])|8(?:[23]\\d|4[0-3]|59)|9(?:2\\d|3[124578]|59))))\\d{5}",[10]],["7(?:0[0-25-8]|47|6[0-4]|7[15-8]|85)\\d{7}",[10]],["8(?:00|108\\d{3})\\d{7}"],["809\\d{7}",[10]],["808\\d{7}",[10]],0,0,0,["751\\d{7}",[10]]],"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[13]|[35-7][14]|41|8[1468])\\d{6}",[8]],["(?:20(?:[239]\\d|5[24-9]|7[6-8]|88)|302\\d)\\d{6}",[10]],0,0,0,0,["30[013-9]\\d{6}",[9]]]],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0",0,0,0,0,0,[["7(?:62|8[0-7]|9[04-9])\\d{4}|(?:[14-69]\\d|2(?:[14-69]\\d|[78][1-9])|7[2-57]|8[02-9])\\d{5}"],["793(?:[01]\\d|2[0-4])\\d{3}|(?:(?:3|81)\\d|7(?:[01]\\d|6[013-9]|8[89]|9[12]))\\d{5}"],0,["9[01]\\d{6}",[8]],0,0,0,0,0,["80\\d{6}",[8]]]],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"1|([2-8]\\d{6})$","758$1",0,"758",[["758(?:234|4(?:30|5\\d|6[2-9]|8[0-2])|57[0-2]|(?:63|75)8)\\d{4}"],["758(?:28[4-7]|384|4(?:6[01]|8[4-9])|5(?:1[89]|20|84)|7(?:1[2-9]|2\\d|3[0-3])|812)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"0|(1001)",0,0,0,[["(?:2(?:01|1[27]|2[02]|3\\d|6[02-578]|96)|3(?:[24]0|33|7[0135-7]|8[048]|9[0269]))\\d{4}",[7]],["(?:6(?:(?:4[5-9]|5[0-4])\\d|6(?:[0245]\\d|[17]0|3[7-9]))\\d|7(?:[37-9]\\d|42|56))\\d{4}"],["8002[28]\\d\\d|80(?:05\\d|9)\\d{4}"],["90(?:02[258]|1(?:23|3[14])|66[136])\\d\\d",[7]],0,0,["870(?:28|87)\\d\\d",[7]]]],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:12[2-9]|602|8[12]\\d|9(?:1\\d|22|9[245]))\\d{6}|(?:11|2[13-7]|3[1-8]|4[157]|5[12457]|6[35-7])[2-57]\\d{6}"],["7(?:[0-25-8]\\d|4[0-4])\\d{6}"],0,0,0,0,["1973\\d{5}"]]],LR:["231","00","(?:2|33|5\\d|77|88)\\d{7}|[4-6]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3578]"],"0$1"]],"0",0,0,0,0,0,[["(?:2\\d{3}|33333)\\d{4}",[8,9]],["(?:(?:330|555|(?:77|88)\\d)\\d|4[67])\\d{5}|[56]\\d{6}",[7,9]],0,["332(?:02|[34]\\d)\\d{4}",[9]]]],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]],0,0,0,0,0,0,[["2\\d{7}"],["[56]\\d{7}"],["800[256]\\d{4}"]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]",0,0,0,[["(?:3[1478]|4[124-6]|52)\\d{6}"],["6\\d{7}"],["80[02]\\d{5}"],["9(?:0[0239]|10)\\d{5}"],["70[05]\\d{5}"],0,["70[67]\\d{5}"],0,["[89]01\\d{5}"],["808\\d{5}"]]],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)",0,0,0,[["(?:35[013-9]|80[2-9]|90[89])\\d{1,8}|(?:2[2-9]|3[0-46-9]|[457]\\d|8[13-9]|9[2-579])\\d{2,9}"],["6(?:[269][18]|5[1568]|7[189]|81)\\d{6}",[9]],["800\\d{5}",[8]],["90[015]\\d{5}",[8]],0,0,0,0,["20(?:1\\d{5}|[2-689]\\d{1,7})",[4,5,6,7,8,9,10]],["801\\d{5}",[8]]]],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]],0,0,0,0,0,0,[["6\\d{7}"],["2\\d{7}"],["80\\d{6}"],["90\\d{6}"],0,0,0,0,0,["81\\d{6}"]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0[56]|[1-6]\\d|7[124579]|8[124])|3(?:1\\d|2[2356])|4(?:[17]\\d|2[1-357]|5[2-4]|8[124])|5(?:[1347]\\d|2[1-469]|5[13-5]|8[1-4])|6(?:[1-479]\\d|5[2-57]|8[1-5])|7(?:[13]\\d|2[13-79])|8(?:[124]\\d|5[124]|84))\\d{6}"],["9[1-6]\\d{7}"]]],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29[89]|389)","5(?:29[89]|389)0"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:29(?:[189][05]|2[29]|3[01])|389[05])\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[08]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0",0,0,0,0,0,[["(?:870|9[2-47-9]\\d)\\d{5}",[8]],["4(?:[46]\\d|5[1-9])\\d{5}|(?:3|6\\d)\\d{7}"],["(?:800|90\\d)\\d{5}",[8]]]],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2[1-9]|3[1-79])\\d|5(?:33|5[257]))\\d{5}"],["562\\d{5}|(?:6\\d|7[16-9])\\d{6}"],["800\\d{5}"],["90[056]\\d{5}"],0,0,["803\\d{5}"],0,["3[08]\\d{6}"],["808\\d{5}"]]],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:20[2-8]|3(?:[0-2][2-7]|3[24-7])|4(?:0[2-467]|1[2467])|5(?:0[2467]|1[24-7]|2[2-467]))\\d{5}",[8]],["6(?:[07-9]\\d|3[024]|6[0-25])\\d{5}",[8]],["80(?:[0-2578]|9\\d)\\d{5}"],["9(?:4[1568]|5[178])\\d{5}",[8]],0,0,["77[1-9]\\d{5}",[8]],0,["78[1-49]\\d{5}",[8]]]],MF:["590","00","(?:590|(?:69|80)\\d|976)\\d{6}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976[01]\\d{5}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"0|([24-9]\\d{6})$","20$1",0,0,[["2072[29]\\d{4}|20(?:2\\d|4[47]|5[3467]|6[279]|7[35]|8[268]|9[245])\\d{5}"],["3[2-489]\\d{7}"],0,0,0,0,0,0,["22\\d{7}"]]],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1",0,0,0,0,0,[["(?:247|528|625)\\d{4}"],["(?:(?:23|54)5|329|45[356])\\d{4}"],0,0,0,0,0,0,["635\\d{4}"]]],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:2(?:62|77)0|3444)\\d|4[56]440)\\d{3}|(?:34|4[357])700\\d{3}|(?:2(?:[23]\\d|5[0-578]|6[01]|82)|3(?:1[3-68]|[23][2-68]|4[23568])|4(?:[23][2-68]|4[3-68]|5[2568]|6[25-8]|7[24-68]|8[4-68]))\\d{5}"],["7(?:3555|4(?:60\\d|747)|94(?:[01]\\d|2[0-4]))\\d{3}|7(?:[0-25-8]\\d|3[1-4]|42|9[23])\\d{5}"],["800\\d{5}"],["5[02-9]\\d{6}"],0,0,0,0,0,["8(?:0[1-9]|[1-9]\\d)\\d{5}"]]],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]],0,0,0,0,0,0,[["2(?:07[0-8]|12[67])\\d{4}|(?:2(?:02|1[4-689])|4(?:0[0-4]|4[1-39]))\\d{5}"],["2(?:0(?:01|79)|17\\d)\\d{4}|(?:5[01]|[679]\\d|8[2-49])\\d{6}"],["80\\d{6}"]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:2\\d|3[56]|[89][0-6])\\d|4(?:2[2-469]|39|46|6[25]|7[0-3]|83)|6)|2(?:2(?:00|8[34])|4(?:0\\d|2[246]|39|46|62|7[0-3]|83)|51\\d\\d)|4(?:2(?:2\\d\\d|48[0-3])|3(?:20\\d|4(?:70|83)|56)|420\\d|5470)|6(?:0(?:[23]|88\\d)|(?:124|[56]2\\d)\\d|247[23]|3(?:20\\d|470)|4(?:2[04]\\d|47[23])|7(?:(?:3\\d|8[01459])\\d|4(?:39|60|7[013]))))\\d{4}|5(?:2(?:2\\d{5,6}|47[023]\\d{4})|(?:347[23]|4(?:2(?:1|86)|470)|522\\d|6(?:20\\d|483)|7(?:20\\d|48[0-2])|8(?:20\\d|47[02])|9(?:20\\d|47[01]))\\d{4})|7(?:(?:0470|4(?:25\\d|470)|5(?:202|470|96\\d))\\d{4}|1(?:20\\d{4,5}|4(?:70|83)\\d{4}))|8(?:1(?:2\\d{5,6}|4(?:10|7[01]\\d)\\d{3})|2(?:2\\d{5,6}|(?:320|490\\d)\\d{3})|(?:3(?:2\\d\\d|470)|4[24-7]|5(?:2\\d|4[1-9]|51)\\d|6[23])\\d{4})|(?:1[2-6]\\d|4(?:2[24-8]|3[2-7]|[46][2-6]|5[3-5])|5(?:[27][2-8]|3[2-68]|4[24-8]|5[23]|6[2-4]|8[24-7]|9[2-7])|6(?:[19]20|42[03-6]|(?:52|7[45])\\d)|7(?:[04][24-8]|[15][2-7]|22|3[2-4])|8(?:1[2-689]|2[2-8]|[35]2\\d))\\d{4}|25\\d{5,6}|(?:2[2-9]|6(?:1[2356]|[24][2-6]|3[24-6]|5[2-4]|6[2-8]|7[235-7]|8[245]|9[24])|8(?:3[24]|5[245]))\\d{4}",[6,7,8,9]],["(?:17[01]|9(?:2(?:[0-4]|[56]\\d\\d)|(?:3(?:[0-36]|4\\d)|(?:6\\d|9[4-8])\\d|7(?:3|40|[5-9]\\d)|8(?:78|[89]\\d))\\d|4(?:(?:[0245]\\d|[1379])\\d|88)|5[0-6])\\d)\\d{4}|9[69]1\\d{6}|9(?:[68]\\d|9[089])\\d{5}",[7,8,9,10]],["80080(?:[01][1-9]|2\\d)\\d{3}",[10]],0,0,0,0,0,["1333\\d{4}|[12]468\\d{4}",[8]]]],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0",0,0,0,0,0,[["[12]2[1-3]\\d{5,6}|7(?:0[0-5]\\d|128)\\d{4}|(?:[12](?:1|27)|5[368])\\d{6}|[12](?:3[2-8]|4[2-68]|5[1-4689])\\d{6,7}"],["(?:83[01]|920)\\d{5}|(?:5[05]|6[06]|8[015689]|9[013-9])\\d{6}",[8]],0,0,0,0,0,0,["712[0-79]\\d{4}|7(?:1[013-9]|[25-8]\\d)\\d{5}",[8]]]],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]],0,0,0,0,0,0,[["(?:28[2-9]|8(?:11|[2-57-9]\\d))\\d{5}",[8]],["6800[0-79]\\d{3}|6(?:[235]\\d\\d|6(?:0[0-5]|[1-9]\\d)|8(?:0[1-9]|[14-8]\\d|2[5-9]|[39][0-4]))\\d{4}",[8]],["0800\\d{3}",[7]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","670$1",0,"670",[["670(?:2(?:3[3-7]|56|8[4-8])|32[1-38]|4(?:33|8[348])|5(?:32|55|88)|6(?:64|70|82)|78[3589]|8[3-9]8|989)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],MQ:["596","00","(?:69|80)\\d{7}|(?:59|97)6\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["596(?:[03-7]\\d|10|2[7-9]|8[09]|9[4-9])\\d{4}"],["69(?:6(?:[0-46-9]\\d|5[0-6])|727)\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["976(?:6\\d|7[0-367])\\d{4}"]]],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]],0,0,0,0,0,0,[["(?:25[08]|35\\d|45[1-7])\\d{5}"],["[2-4][0-46-9]\\d{6}"],["800\\d{5}"]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"1|([34]\\d{6})$","664$1",0,"664",[["6644(?:1[0-3]|91)\\d{4}"],["664(?:3(?:49|9[1-6])|49[2-6])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]],0,0,0,0,0,0,[["20(?:3[1-4]|6[059])\\d{4}|2(?:0[19]|[1-357]\\d|60)\\d{5}"],["(?:7(?:210|[79]\\d\\d)|9(?:[29]\\d\\d|69[67]|8(?:1[1-3]|89|97)))\\d{4}"],["800(?:02|[3467]\\d)\\d{3}"],["5(?:0(?:0(?:37|43)|(?:6\\d|70|9[0168])\\d)|[12]\\d0[1-5])\\d{3}"],0,0,["501\\d{5}"],["7117\\d{4}"],["3550\\d{4}"]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:5|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["5"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,[["(?:2(?:[0346-8]\\d|1[0-7])|4(?:[013568]\\d|2[4-7])|54(?:[3-5]\\d|71)|6\\d\\d|8(?:14|3[129]))\\d{4}",[7,8]],["5(?:4(?:2[1-389]|7[1-9])|87[15-8])\\d{4}|5(?:2[5-9]|4[3-689]|[57]\\d|8[0-689]|9[0-8])\\d{5}",[8]],["802\\d{7}|80[0-2]\\d{4}",[7,10]],["30\\d{5}",[7]],0,0,0,0,["3(?:20|9\\d)\\d{4}",[7]]],"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[3467]|9[13-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["(?:3(?:0[0-3]|3[0-59])|6(?:[57][02468]|6[024-68]|8[024689]))\\d{4}",[7]],["46[46]\\d{4}|(?:7\\d|9[13-9])\\d{5}",[7]],["800\\d{7}",[10]],["900\\d{7}",[10]],0,0,["4(?:0[01]|50)\\d{4}",[7]]],"00"],MW:["265","00","(?:[129]\\d|31|77|88)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0",0,0,0,0,0,[["(?:1[2-9]|2[12]\\d\\d)\\d{5}"],["111\\d{6}|(?:31|77|88|9[89])\\d{7}",[9]]]],MX:["52","0[09]","1(?:(?:44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[017]\\d|[235][1-9]|4[0-35-9]|6[0-46-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,[["657[12]\\d{6}|(?:2(?:0[01]|2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[25-7][1-9]|3[1-8]|4\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|6[1-9]|7[12]|8[1-8]|9\\d))\\d{7}",[10]],["657[12]\\d{6}|(?:1(?:2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[24-7][1-9]|3[1-8]|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|[69][1-9]|7[12]|8[1-8]))|2(?:2[1-9]|3[1-35-8]|4[13-9]|7[1-689]|8[1-578]|9[467])|3(?:1[1-79]|[2458][1-9]|3\\d|7[1-8]|9[1-5])|4(?:1[1-57-9]|[25-7][1-9]|3[1-8]|4\\d|8[1-35-9]|9[2-689])|5(?:[56]\\d|88|9[1-79])|6(?:1[2-68]|[2-4][1-9]|5[1-3689]|6[1-57-9]|7[1-7]|8[67]|9[4-8])|7(?:[1-467][1-9]|5[13-9]|8[1-69]|9[17])|8(?:1\\d|2[13-689]|3[1-6]|4[124-6]|6[1246-9]|7[1-378]|9[12479])|9(?:1[346-9]|2[1-4]|3[2-46-8]|5[1348]|6[1-9]|7[12]|8[1-8]|9\\d))\\d{7}"],["8(?:00|88)\\d{7}",[10]],["900\\d{7}",[10]],["500\\d{7}",[10]],0,0,0,0,["300\\d{7}",[10]]],"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0",0,0,0,0,0,[["(?:3(?:2[0-36-9]|3[0-368]|4[0-278]|5[0-24-8]|6[0-467]|7[1246-9]|8\\d|9[0-57])\\d|4(?:2[0-689]|[3-79]\\d|8[1-35689])|5(?:2[0-589]|[3468]\\d|5[0-489]|7[1-9]|9[23])|6(?:2[2-9]|3[1357-9]|[46]\\d|5[0-6]|7[0-35-9]|85|9[015-8])|7(?:[2579]\\d|3[03-68]|4[0-8]|6[5-9]|8[0-35-9])|8(?:[24][2-8]|3[2-5]|5[2-7]|6[2-589]|7[2-578]|[89][2-9])|9(?:0[57]|13|[25-7]\\d|[3489][0-8]))\\d{5}",[8,9]],["1(?:1888[689]|4400|8(?:47|8[27])[0-4])\\d{4}|1(?:0(?:[23568]\\d|4[0-6]|7[016-9]|9[0-8])|1(?:[1-5]\\d\\d|6(?:0[5-9]|[1-9]\\d)|7(?:[0134]\\d|2[1-9]|5[0-6]))|(?:[269]\\d|[37][1-9]|4[235-9])\\d|5(?:31|9\\d\\d)|8(?:1[23]|[236]\\d|4[06]|5(?:46|[7-9])|7[016-9]|8[01]|9[0-8]))\\d{5}",[9,10]],["1[378]00\\d{6}",[10]],["1600\\d{6}",[10]],0,0,0,0,["15(?:4(?:6[0-4]\\d|8(?:0[125]|[17]\\d|21|3[01]|4[01589]|5[014]|6[02]))|6(?:32[0-6]|78\\d))\\d{4}",[10]]]],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["2(?:[1346]\\d|5[0-2]|[78][12]|93)\\d{5}",[8]],["8[2-79]\\d{7}",[9]],["800\\d{6}",[9]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["64426\\d{3}|6(?:1(?:2[2-7]|3[01378]|4[0-4])|254|32[0237]|4(?:27|41|5[25])|52[236-8]|626|7(?:2[2-4]|30))\\d{4,5}|6(?:1(?:(?:0\\d|2[0189]|3[24-69]|4[5-9])\\d|17|69|7[014])|2(?:17|5[0-36-8]|69|70)|3(?:17|2[14-689]|34|6[289]|7[01]|81)|4(?:17|2[0-2]|4[06]|5[0137]|69|7[01])|5(?:17|2[0459]|69|7[01])|6(?:17|25|38|42|69|7[01])|7(?:17|2[569]|3[13]|6[89]|7[01]))\\d{4}"],["(?:60|8[1245])\\d{7}",[9]],["80\\d{7}",[9]],["8701\\d{5}",[9]],0,0,0,0,["8(?:3\\d\\d|86)\\d{5}"]]],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]],0,0,0,0,0,0,[["(?:2[03-9]|3[0-5]|4[1-7]|88)\\d{4}"],["(?:5[0-4]|[79]\\d|8[0-79])\\d{4}"],["050\\d{3}"],["36\\d{4}"]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[04]"]]],0,0,0,0,0,0,[["2(?:0(?:20|3[1-8]|4[13-5]|5[14]|6[14578]|7[1-578])|1(?:4[145]|5[14]|6[14-68]|7[169]|88))\\d{4}"],["(?:23|7[04]|[89]\\d)\\d{6}"],["08\\d{6}"],["09\\d{6}"]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1",0,0,[["(?:1(?:06|17|28|39)|3[0-2]\\d)\\d{3}"],["(?:14|3[58])\\d{4}"]]],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0",0,0,0,0,0,[["(?:(?:[1-356]\\d|4[02-8]|8[2-9])\\d|9(?:0[3-9]|[1-9]\\d))\\d{5}|7(?:0(?:[013-689]\\d|2[0-24-9])\\d{3,4}|[1-79]\\d{6})|(?:[12]\\d|4[147]|5[14579]|6[1578]|7[1-3578])\\d{5}",[7,8]],["(?:702[0-24-9]|8(?:01|19)[01])\\d{6}|(?:70[13-689]|8(?:0[2-9]|1[0-8])|9(?:0[1-9]|1[2356]))\\d{7}",[10]],["800\\d{7,11}",[10,11,12,13,14]],0,0,0,["700\\d{7,11}",[10,11,12,13,14]]]],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]],0,0,0,0,0,0,[["2\\d{7}"],["(?:5(?:5[0-7]|[78]\\d)|6(?:20|3[035]|4[045]|5[05]|77|8[1-9]|9[059])|(?:7[5-8]|8\\d)\\d)\\d{5}"],["1800\\d{4}"]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:[035]\\d|1[13-578]|6[124-8]|7[24]|8[0-467])|2(?:[0346]\\d|2[2-46-9]|5[125]|9[479])|3(?:[03568]\\d|1[3-8]|2[01]|4[1-8])|4(?:[0356]\\d|1[1-368]|7[58]|8[15-8]|9[23579])|5(?:[0358]\\d|[19][1-9]|2[1-57-9]|4[13-8]|6[126]|7[0-3578])|7\\d\\d)\\d{6}",[9]],["(?:6[1-58]|970\\d)\\d{7}",[9,11]],["800\\d{4,7}",[7,8,9,10]],["90[069]\\d{4,7}",[7,8,9,10]],0,0,["140(?:1[035]|2[0346]|3[03568]|4[0356]|5[0358]|8[458])|(?:140(?:1[16-8]|2[259]|3[124]|4[17-9]|5[124679]|7)|8[478]\\d{6})\\d",[5,6,9]],["66\\d{7}",[9]],["(?:85|91)\\d{7}",[9]]]],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[489]|59"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-7]"]]],0,0,0,0,0,"[02-689]|7[0-8]",[["(?:2[1-4]|3[1-3578]|5[1-35-7]|6[1-4679]|7[0-8])\\d{6}",[8]],["(?:4[015-8]|59|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}",[8]],0,["(?:0[2-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0",0,0,0,0,0,[["(?:1[0-6]\\d|99[02-6])\\d{5}|(?:2[13-79]|3[135-8]|4[146-9]|5[135-7]|6[13-9]|7[15-9]|8[1-46-9]|9[1-7])[2-6]\\d{5}",[8]],["9(?:6[0-3]|7[024-6]|8[0-24-68])\\d{7}",[10]],["1(?:66001|800\\d\\d)\\d{5}",[11]]]],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]],0,0,0,0,0,0,[["444\\d{4}"],["(?:55[3-9]|666|8\\d\\d)\\d{4}"]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]],0,0,0,0,0,0,[["[47]\\d{3}",[4]],["888[4-9]\\d{3}",[7]]]],NZ:["64","0(?:0|161)","[29]\\d{7,9}|50\\d{5}(?:\\d{2,3})?|6[0-35-9]\\d{6}|7\\d{7,8}|8\\d{4,9}|(?:11\\d|[34])\\d{7}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-579]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|[89]0","50(?:[0367]|88)|[89]0"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[59]|80"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7|86"],"0$1"]],"0",0,0,0,0,0,[["24099\\d{3}|(?:3[2-79]|[49][2-9]|6[235-9]|7[2-57-9])\\d{6}",[8]],["2[0-27-9]\\d{7,8}|21\\d{6}",[8,9,10]],["508\\d{6,7}|80\\d{6,8}",[8,9,10]],["(?:11\\d{5}|50(?:0[08]|30|66|77|88))\\d{3}|90\\d{6,8}",[7,8,9,10]],["70\\d{7}",[9]],0,["8(?:1[6-9]|22|3\\d|4[045]|5[459]|7[0-3579]|90)\\d{2,7}"],["[28]6\\d{6,7}",[8,9]]],"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]],0,0,0,0,0,0,[["2[2-6]\\d{6}",[8]],["1505\\d{4}|(?:7(?:[1289]\\d|7[0-4])|9(?:0[1-9]|[1-9]\\d))\\d{5}",[8]],["8007\\d{4,5}|(?:500|800[05])\\d{4}"],["900\\d{5}",[8]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["(?:1(?:0\\d|1[479]|2[37]|3[0137]|4[17]|5[05]|6[58]|7[0167]|8[258]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[089]\\d|1[0-7]|2[0-5]|33|4[0-79]|5[0-35]|6[068]|7[0-8])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[056]|7[0-24-9]|8[5-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",[7]],["(?:1[16]1|21[89]|6\\d{3}|8(?:1[01]|7[23]))\\d{4}",[7,8]],["800\\d{4,5}|(?:00800|800\\d)\\d{6}"],["(?:8(?:22|55|60|7[78]|86)|9(?:00|81))\\d{4}",[7]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:(?:4[34]|5[14])[0-8]\\d|7(?:173|3[0-8]\\d)|8(?:10[05689]|6(?:0[06-9]|1[6-9]|29)|7(?:0[569]|[56]0)))\\d{4}|(?:1[0-8]|4[12]|5[236]|6[1-7]|7[246]|8[2-4])\\d{6}",[8]],["9\\d{8}",[9]],["800\\d{5}",[8]],["805\\d{5}",[8]],["80[24]\\d{5}",[8]],0,0,0,0,["801\\d{5}",[8]]],"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["4(?:0[4-689]|9[4-68])\\d{5}",[8]],["8[7-9]\\d{6}",[8]],["80[0-5]\\d{6}",[9]],0,0,0,["44\\d{4}",[6]],0,["499\\d{5}",[8]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,[["(?:(?:3[0-2]|4[257]|5[34]|9[78])\\d|64[1-9]|85[02-46-9])\\d{4}",[7]],["(?:7\\d|8[128])\\d{6}",[8]],["180\\d{4}",[7]],0,0,0,0,["27[01]\\d{4}",[7]],["2(?:0[0-57]|7[568])\\d{4}",[7]]],"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0",0,0,0,0,0,[["(?:(?:2[3-8]|3[2-68]|4[2-9]|5[2-6]|6[2-58]|7[24578])\\d{3}|88(?:22\\d\\d|42))\\d{4}|(?:2|8[2-8]\\d\\d)\\d{5}",[6,8,9,10]],["(?:8(?:1[37]|9[5-8])|9(?:0[5-9]|1[0-24-9]|[235-7]\\d|4[2-9]|8[135-9]|9[1-9]))\\d{7}",[10]],["1800\\d{7,9}",[11,12,13]]]],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:(?:21|42)[2-9]|58[126])\\d{7}|(?:2[25]|4[0146-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\\d{6,7}|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8]))[2-9]\\d{5,6}",[9,10]],["3(?:[0-24]\\d|3[0-7]|55|64)\\d{7}",[10]],["800\\d{5}(?:\\d{3})?",[8,11]],["900\\d{5}",[8]],["122\\d{6}",[9]],0,["(?:2(?:[125]|3[2358]|4[2-4]|9[2-8])|4(?:[0-246-9]|5[3479])|5(?:[1-35-7]|4[2-467])|6(?:0[468]|[1-8])|7(?:[14]|2[236])|8(?:[16]|2[2-689]|3[23578]|4[3478]|5[2356])|9(?:1|22|3[27-9]|4[2-6]|6[3569]|9[2-7]))111\\d{6}",[11,12]]]],PL:["48","00","6\\d{5}(?:\\d{2})?|8\\d{9}|[1-9]\\d{6}(?:\\d{2})?",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]],0,0,0,0,0,0,[["47\\d{7}|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])(?:[02-9]\\d{6}|1(?:[0-8]\\d{5}|9\\d{3}(?:\\d{2})?))",[7,9]],["21(?:1(?:[145]\\d|3[1-5])|2[0-4]\\d)\\d{4}|(?:45|5[0137]|6[069]|7[2389]|88)\\d{7}",[9]],["800\\d{6,7}",[9,10]],["70[01346-8]\\d{6}",[9]],0,0,["804\\d{6}",[9]],["64\\d{4,7}",[6,7,8,9]],["39\\d{7}",[9]],["801\\d{6}",[9]]]],PM:["508","00","(?:[45]|80\\d\\d)\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:4[1-356]|50)\\d{4}",[6]],["(?:4[02-4]|5[056])\\d{4}",[6]],["80[0-5]\\d{6}",[9]]]],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939",[["(?:787|939)[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:22[2-47-9]|42[45]|82[014-68]|92[3569])\\d{5}",[8]],["5[69]\\d{7}",[9]],["1800\\d{6}",[10]],0,0,0,0,0,0,["1700\\d{6}",[10]]]],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]],0,0,0,0,0,0,[["2(?:[12]\\d|3[1-689]|4[1-59]|[57][1-9]|6[1-35689]|8[1-69]|9[1256])\\d{6}"],["6(?:[06]92(?:30|9\\d)|[35]92(?:3[03]|9\\d))\\d{3}|(?:(?:16|6[0356])93|9(?:[1-36]\\d\\d|480))\\d{5}"],["80[02]\\d{6}"],["(?:6(?:0[178]|4[68])\\d|76(?:0[1-57]|1[2-47]|2[237]))\\d{5}"],["884[0-4689]\\d{5}"],0,["70(?:7\\d|8[17])\\d{5}"],0,["30\\d{7}"],["80(?:8\\d|9[1579])\\d{5}"]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]],0,0,0,0,0,0,[["(?:2(?:55|77)|345|488|5(?:35|44|87)|6(?:22|54|79)|7(?:33|47)|8(?:24|55|76)|900)\\d{4}"],["(?:(?:46|83)[0-5]|6[2-4689]0)\\d{4}|(?:45|77|88)\\d{5}"]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,[["(?:[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36])\\d{5,7}|(?:2(?:2[4-68]|[4-68]\\d|7[15]|9[1-5])|3(?:18|3[167]|4[2357]|51|[67]\\d)|4(?:3[12]|5[13]|9[1-47])|5(?:[1-4]\\d|5[02-4])|6(?:3[1-3]|44|7[1-8])|7(?:4[0-4]|5\\d|6[1-578]|75|8[0-8])|858)\\d{5,6}",[7,8,9]],["9(?:51|6[129]|[78][1-6]|9[1-5])\\d{6}",[9]],["9800\\d{5,7}",[9,10,11]],0,0,0,["[2-9]0\\d{4,7}",[6,7,8,9]],0,["8700[0-4]\\d{4}",[9]]]],QA:["974","00","[2-7]\\d{7}|800\\d{4}(?:\\d{2})?|2\\d{6}",[7,8,9],[["(\\d{3})(\\d{4})","$1 $2",["2[126]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]]],0,0,0,0,0,0,[["414[1-4]\\d{4}|(?:23|4[04])\\d{6}",[8]],["(?:2[89]|[35-7]\\d)\\d{6}",[8]],["800\\d{4}(?:\\d{2})?",[7,9]],0,0,0,0,["2(?:[12]\\d|61)\\d{4}",[7]]]],RE:["262","00","976\\d{6}|(?:26|[68]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,"26[23]|69|[89]",[["26(?:2\\d\\d|3(?:0\\d|1[01]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:0[0-46]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|6[0-6]|7[0-27]|8[0-8]|9[0-479]))|976(?:2[27]|3[0-37]|9\\d))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,0,["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,[["[23][13-6]\\d{7}|(?:2(?:19\\d|[3-6]\\d9)|31\\d\\d)\\d\\d"],["7020\\d{5}|7(?:0[013-9]|1[0-3]|[2-7]\\d|8[03-8]|9[019])\\d{6}",[9]],["800\\d{6}",[9]],["90[0136]\\d{6}",[9]],0,0,["(?:37\\d|80[578])\\d{6}",[9]],0,0,["801\\d{6}",[9]]],0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0",0,0,0,0,0,[["(?:11[1-9]\\d|(?:2[389]|39)(?:0[2-9]|[2-9]\\d))\\d{3,8}|(?:1[02-9]|2[0-24-7]|3[0-8])[2-9]\\d{4,9}",[7,8,9,10,11,12]],["6(?:[0-689]|7\\d)\\d{6,7}",[8,9,10]],["800\\d{3,9}"],["(?:78\\d|90[0169])\\d{3,7}",[6,7,8,9,10]],0,0,["7[06]\\d{4,10}"]]],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",[["(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15]|6[1-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]]],"0",0,0,0,0,0,[["(?:06|2[23568]\\d)\\d{6}"],["7[2389]\\d{7}",[9]],["800\\d{6}",[9]],["900\\d{6}",[9]]]],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0",0,0,0,0,0,[["1(?:1\\d|2[24-8]|3[35-8]|4[3-68]|6[2-5]|7[235-7])\\d{6}",[9]],["579[01]\\d{5}|5(?:[013-689]\\d|7[0-35-8])\\d{6}",[9]],["800\\d{7}",[10]],["925\\d{6}",[9]],0,0,["811\\d{7}",[10]],0,0,["920\\d{6}",[9]]]],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]],0,0,0,0,0,0,[["(?:1[4-79]|[23]\\d|4[0-2]|5[03]|6[0-37])\\d{3}",[5]],["48\\d{3}|(?:(?:7[1-9]|8[4-9])\\d|9(?:1[2-9]|2[013-9]|3[0-2]|[46]\\d|5[0-46-9]|7[0-689]|8[0-79]|9[0-8]))\\d{4}"],["1[38]\\d{3}",[5]],0,0,0,0,0,["5[12]\\d{3}",[5]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,[["4[2-46]\\d{5}"],["2[125-8]\\d{5}"],["800[08]\\d{3}"],0,0,0,0,0,["971\\d{4}|(?:64|95)\\d{5}"]],"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1(?:5\\d|8[35-7])\\d{6}"],["(?:1[0-2]|9[0-3569])\\d{7}"]]],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0",0,0,0,0,0,[["(?:(?:[12][136]|3[356]|4[0246]|6[03]|8\\d)\\d|90[1-9])\\d{4,6}|(?:1(?:2[0-35]|4[0-4]|5[0-25-9]|7[13-6]|[89]\\d)|2(?:2[0-7]|4[0136-8]|5[0138]|7[018]|8[01]|9[0-57])|3(?:0[0-4]|1\\d|2[0-25]|4[056]|7[0-2]|8[0-3]|9[023])|4(?:1[013-8]|3[0135]|5[14-79]|7[0-246-9]|8[0156]|9[0-689])|5(?:0[0-6]|[15][0-5]|2[0-68]|3[0-4]|4\\d|6[03-5]|7[013]|8[0-79]|9[01])|6(?:1[1-3]|2[0-4]|4[02-57]|5[0-37]|6[0-3]|7[0-2]|8[0247]|9[0-356])|9(?:1[0-68]|2\\d|3[02-5]|4[0-3]|5[0-4]|[68][01]|7[0135-8]))\\d{5,6}",[7,8,9]],["7[02369]\\d{7}",[9]],["20\\d{4,7}",[6,7,8,9]],["649\\d{6}|99[1-59]\\d{4}(?:\\d{3})?|9(?:00|39|44)[1-8]\\d{3,6}",[7,8,9,10]],["75[1-8]\\d{6}",[9]],0,["10[1-8]\\d{6}",[9]],["74[02-9]\\d{6}",[9]],0,["77[0-7]\\d{6}",[9]]]],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-5]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[["662[0-24-9]\\d{4}|6(?:[0-578]\\d|6[013-57-9]|9[0-35-9])\\d{5}",[8]],["8(?:05[0-3]|95[0-2])\\d{4}|(?:8(?:0[1-4]|[1-8]\\d|9[0-4])|9[0-8]\\d)\\d{5}",[8]],["(?:18|8)00\\d{7}",[10,11]],["1900\\d{7}",[11]],0,0,["7000\\d{7}",[11]],0,["(?:3[12]\\d|666)\\d{5}",[8]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]",[["2(?:[0-57-9]\\d|6[4-9])\\d\\d"],["[56]\\d{4}",[5]],0,0,0,0,0,0,["262\\d\\d",[5]]]],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,[["(?:[1-357][2-8]|4[24-8])\\d{6}",[8]],["65(?:1\\d|55|6[01]|70)\\d{4}|(?:[37][01]|4[0139]|51|6[489])\\d{6}",[8]],["80\\d{4,6}",[6,7,8]],["89[1-3]\\d{2,5}|90\\d{4,6}"],0,0,0,0,["(?:59\\d\\d|8(?:1(?:[67]\\d|8[0-589])|2(?:0\\d|2[0-37-9]|8[0-2489])|3[389]\\d))\\d{4}",[8]]],"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|[57]9)\\d{6}",[5,8],0,0,0,0,0,0,"79",[["79\\d{6}",[8]],["(?:4[015-8]|59|9\\d)\\d{6}",[8]],["80[01]\\d{5}",[8]],["82[09]\\d{5}",[8]],["880\\d{5}",[8]],0,["(?:0[2-9]|81(?:0(?:0[7-9]|1\\d)|5\\d\\d))\\d{3}"],0,["85[0-5]\\d{5}",[8]],["810(?:0[0-6]|[2-8]\\d)\\d{3}",[8]]]],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:16|[2-9]\\d{3})|(?:(?:[3-5][1-8]\\d|819)\\d|601[1-5])\\d)\\d{4}|(?:2|[3-5][1-8])1[67]\\d{3}|[3-5][1-8]16\\d\\d"],["909[1-9]\\d{5}|9(?:0[1-8]|1[0-24-9]|4[03-57-9]|5\\d)\\d{6}",[9]],["800\\d{6}",[9]],["9(?:00|[78]\\d)\\d{6}",[9]],0,0,["96\\d{7}",[9]],["9090\\d{3}",[7]],["6(?:02|5[0-4]|9[0-6])\\d{6}",[9]],["8[5-9]\\d{7}",[9]]]],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0",0,0,0,0,0,[["22[2-4][2-9]\\d{4}"],["(?:25|3[0-5]|66|7[2-9]|8[08]|9[09])\\d{6}"]]],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1",0,0,[["0549(?:8[0157-9]|9\\d)\\d{4}",[10]],["6[16]\\d{6}",[8]],0,["7[178]\\d{6}",[8]],0,0,0,0,["5[158]\\d{6}",[8]]]],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]],0,0,0,0,0,0,[["3(?:0(?:1[0-2]|80)|282|3(?:8[1-9]|9[3-9])|611)\\d{5}"],["75(?:01|[38]3)\\d{5}|7(?:[06-8]\\d|21|5[4-7]|90)\\d{6}"],["800\\d{6}"],["88[4689]\\d{6}"],0,0,0,0,["(?:3(?:392|9[01]\\d)\\d|93(?:3[13]0|929))\\d{4}"],["81[02468]\\d{6}"]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["24|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3478]|64|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6(?:0[5-7]|[1-35-9])|9[2-9]"]]],"0",0,0,0,0,0,[["(?:1\\d|2[0-79]|3[0-46-8]|4[0-7]|5[57-9])\\d{5}|(?:[134]\\d|8[125])\\d{4}",[6,7]],["(?:(?:15|(?:3[59]|4[89]|79|8[08])\\d|6(?:0[5-7]|[1-9]\\d)|9(?:0\\d|[2-9]))\\d|2(?:4\\d|8))\\d{5}|(?:6\\d|7[1-9])\\d{6}",[7,8,9]]]],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]],0,0,0,0,0,0,[["(?:2[1-3]|3[0-7]|(?:4|68)\\d|5[2-58])\\d{4}"],["(?:7[124-7]|8[124-9])\\d{5}",[7]],0,0,0,0,0,0,["56\\d{4}",[6]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0",0,0,0,0,0,[["1[89]\\d{7}"],["(?:12|9[1257-9])\\d{7}"]]],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]],0,0,0,0,0,0,[["22\\d{5}"],["900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}"]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,[["2(?:[1-6]\\d{3}|[79]90[034]|890[0245])\\d{3}",[8]],["66(?:[02-9]\\d\\d|1(?:[02-9]\\d|16))\\d{3}|(?:6[0-57-9]|7\\d)\\d{6}",[8]],["800\\d{4}(?:\\d{4})?",[7,11]],["900\\d{4}(?:\\d{4})?",[7,11]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|(5\\d{6})$","721$1",0,"721",[["7215(?:4[2-8]|8[239]|9[056])\\d{4}"],["7215(?:1[02]|2\\d|5[034679]|8[014-8])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0",0,0,0,0,0,[["21\\d{6,7}|(?:1(?:[14]\\d|[2356])|2[235]|3(?:[13]\\d|4)|4[134]|5[1-3])\\d{6}"],["9[1-689]\\d{7}",[9]]]],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]],0,0,0,0,0,0,[["[23][2-5]\\d{6}",[8]],["7[6-9]\\d{6}",[8]],["0800\\d{4}",[8]],["900\\d{6}",[9]],0,0,0,0,["70\\d{6}",[8]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8",[["8\\d{3}"]]],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"1|([2-479]\\d{6})$","649$1",0,"649",[["649(?:266|712|9(?:4\\d|50))\\d{4}"],["649(?:2(?:3[129]|4[1-79])|3\\d\\d|4[34][1-3])\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["649(?:71[01]|966)\\d{4}"]]],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,[["22(?:[37-9]0|5[0-5]|6[89])\\d{4}"],["(?:6[023568]|77|9\\d)\\d{6}"]],"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]],0,0,0,0,0,0,[["2(?:2[2-7]|3[23]|4[45]|55|6[67]|77)\\d{5}"],["(?:7[09]|9[0-36-9])\\d{6}"]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0",0,0,0,0,0,[["(?:1[0689]|2\\d|3[2-9]|4[2-5]|5[2-6]|7[3-7])\\d{6}",[8]],["671[0-8]\\d{5}|(?:14|6[1-6]|[89]\\d)\\d{7}",[9]],["(?:001800\\d|1800)\\d{6}",[10,13]],["1900\\d{6}",[10]],0,0,0,0,["6[08]\\d{7}",[9]]]],TJ:["992","810","(?:00|[1-57-9]\\d)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[34]7|91[78]"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,[["(?:3(?:1[3-5]|2[245]|3[12]|4[24-7]|5[25]|72)|4(?:46|74|87))\\d{6}"],["41[18]\\d{6}|(?:[034]0|[17][017]|2[02]|5[05]|8[08]|9\\d)\\d{7}"]],"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7],0,0,0,0,0,0,0,[["(?:2[2-4]|[34]\\d)\\d{2,5}"],["7[2-4]\\d{2,5}"]]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]],0,0,0,0,0,0,[["(?:2[1-5]|3[1-9]|4[1-4])\\d{5}",[7]],["7[2-8]\\d{6}",[8]],["80\\d{5}",[7]],["90\\d{5}",[7]],["70\\d{5}",[7]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,[["(?:1(?:2\\d|3[1-9])|2(?:22|4[0-35-8])|3(?:22|4[03-9])|4(?:22|3[128]|4\\d|6[15])|5(?:22|5[7-9]|6[014-689]))\\d{5}"],["6\\d{7}"]],"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]],0,0,0,0,0,0,[["81200\\d{3}|(?:3[0-2]|7\\d)\\d{6}"],["3(?:001|[12]40)\\d{4}|(?:(?:[259]\\d|4[0-7])\\d|3(?:1[1-35]|6[0-4]|91))\\d{5}"],["8010\\d{4}"],["88\\d{6}"],0,0,0,0,0,["8[12]10\\d{4}"]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]],0,0,0,0,0,0,[["(?:2\\d|3[0-8]|4[0-4]|50|6[09]|7[0-24-69]|8[05])\\d{3}",[5]],["(?:55[4-6]|6(?:[09]\\d|3[02]|8[15-9])|(?:7\\d|8[46-9])\\d|999)\\d{4}",[7]],["0800\\d{3}",[7]],0,0,0,0,0,["55[0-37-9]\\d{4}",[7]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0",0,0,0,0,0,[["(?:2(?:[13][26]|[28][2468]|[45][268]|[67][246])|3(?:[13][28]|[24-6][2468]|[78][02468]|92)|4(?:[16][246]|[23578][2468]|4[26]))\\d{7}",[10]],["56161\\d{5}|5(?:0[15-7]|1[06]|24|[34]\\d|5[1-59]|9[46])\\d{7}",[10]],["8(?:00\\d{7}(?:\\d{2,3})?|11\\d{7})",[10,12,13]],["(?:8[89]8|900)\\d{7}",[10]],["592(?:21[12]|461)\\d{4}",[10]],0,["444\\d{4}",[7]],["512\\d{7}",[10]],["850\\d{7}",[10]]]],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-46-8]\\d{6})$","868$1",0,"868",[["868(?:2(?:0[13]|1[5-9]|[23]\\d|4[0-2])|6(?:0[7-9]|1[02-8]|2[1-9]|[3-69]\\d|7[0-79])|82[124])\\d{4}"],["868(?:(?:2[5-9]|3\\d)\\d|4(?:3[0-6]|[6-9]\\d)|6(?:20|78|8\\d)|7(?:0[1-9]|1[02-9]|[2-9]\\d))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["2[02-9]\\d{3}",[5]],["(?:7[01]\\d|90)\\d{4}",[6,7]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["(?:2[2-8]\\d|370|55[01]|7[1-9])\\d{6}|4(?:(?:0(?:0[1-9]|[2-48]\\d)|1[023]\\d)\\d{4,5}|(?:[239]\\d\\d|4(?:0[56]|12|49))\\d{5})|6(?:[01]\\d{7}|4(?:0[56]|12|24|4[09])\\d{4,5})|8(?:(?:2(?:3\\d|4[0-269]|[578]0|66)|36[24-9]|90\\d\\d)\\d{4}|4(?:0[56]|12|24|4[09])\\d{4,5})|(?:2(?:2(?:0\\d\\d|4(?:0[68]|[249]0|3[0-467]|5[0-25-9]|6[0235689]))|(?:3(?:[09]\\d|1[0-4])|(?:4\\d|5[0-49]|6[0-29]|7[0-5])\\d)\\d)|(?:(?:3[2-9]|5[2-8]|6[0-35-79]|8[7-9])\\d\\d|4(?:2(?:[089]\\d|7[1-9])|(?:3[0-4]|[78]\\d|9[01])\\d))\\d)\\d{3}",[8,9]],["(?:40001[0-2]|9[0-8]\\d{4})\\d{3}",[9]],["80[0-79]\\d{6}|800\\d{5}",[8,9]],["20(?:[013-9]\\d\\d|2)\\d{4}",[7,9]],["99\\d{7}",[9]],0,["50[0-46-9]\\d{6}",[9]],0,["7010(?:[0-2679]\\d|3[0-7]|8[0-5])\\d{5}|70\\d{8}",[10,11]]],0,"#"],TZ:["255","00[056]","(?:[26-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0",0,0,0,0,0,[["2[2-8]\\d{7}"],["77[2-9]\\d{6}|(?:6[1-9]|7[1-689])\\d{7}"],["80[08]\\d{6}"],["90\\d{7}"],0,0,0,0,["41\\d{7}"],["8(?:40|6[01])\\d{6}"]]],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,[["(?:3[1-8]|4[13-8]|5[1-7]|6[12459])\\d{7}",[9]],["(?:39|50|6[36-8]|7[1-3]|9[1-9])\\d{7}",[9]],["800[1-8]\\d{5,6}"],["900[239]\\d{5,6}"],0,0,0,0,["89[1-579]\\d{6}",[9]]],"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0",0,0,0,0,0,[["20(?:(?:240|30[67])\\d|6(?:00[0-2]|30[0-4]))\\d{3}|(?:20(?:[017]\\d|2[5-9]|32|5[0-4]|6[15-9])|[34]\\d{3})\\d{5}"],["726[01]\\d{5}|7(?:[01578]\\d|20|36|[46][0-4]|9[89])\\d{6}"],["800[1-3]\\d{5}"],["90[1-3]\\d{6}"]]],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5(?:05(?:[2-57-9]\\d\\d|6(?:[0-35-9]\\d|44))|82(?:2(?:0[0-3]|[268]2)|3(?:0[02]|22|33)|4(?:00|4[24]|65|82)|5(?:00|29|58|83)|6(?:00|66|82)|7(?:58|77)|8(?:00|42|5[25]|88)|9(?:00|9[89])))\\d{4}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[0-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","4\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:770|987)|(?:2\\d|4[2-7])\\d\\d)\\d{4}",[8]],["9[1-9]\\d{6}",[8]],["(?:4\\d{5}|80[05])\\d{4}|405\\d{4}",[7,10]],["90[0-8]\\d{4}",[7]]],"00"," int. "],UZ:["998","810","(?:33|55|[679]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[35-9]"],"8 $1"]],"8",0,0,0,0,0,[["(?:6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|6\\d\\d|7(?:[23]\\d|7[69])|9(?:22|4[1-8]|6[135]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|(?:1[12]|8\\d)\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|6(?:22|3[12457]|4[13-8])|9(?:22|5[1-9])))\\d{5}"],["(?:(?:33|88|9[0-57-9])\\d{3}|55(?:50[013]|90\\d)|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079]))|9(?:2(?:1[1267]|3[01]|5\\d|7[0-4])|(?:5[67]|7\\d)\\d|6(?:2[0-26]|8\\d)))|7(?:[07]\\d{3}|1(?:13[01]|6(?:0[47]|1[67]|66)|71[3-69]|98\\d)|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|6(?:2(?:2[1245]|4[2-4])|39\\d|41[179]|5(?:[349]\\d|5[0-2])|7(?:0[017]|[13]\\d|22|44|55|67|88))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}"]],"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698",[["06698\\d{1,6}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"1|([2-7]\\d{6})$","784$1",0,"784",[["784(?:266|3(?:6[6-9]|7\\d|8[0-6])|4(?:38|5[0-36-8]|8[0-8])|5(?:55|7[0-2]|93)|638|784)\\d{4}"],["784(?:4(?:3[0-5]|5[45]|89|9[0-8])|5(?:2[6-9]|3[0-4])|720)\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["78451[0-2]\\d{4}"]]],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:12|3[457-9]|[467]\\d|[58][1-9]|9[1-6])|[4-6]00)\\d{7}"],["4(?:1[24-8]|2[46])\\d{7}"],["800\\d{7}"],["90[01]\\d{7}"],0,0,["501\\d{7}"]]],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"1|([2-578]\\d{6})$","284$1",0,"284",[["284496[0-5]\\d{3}|284(?:229|4(?:22|9[45])|774|8(?:52|6[459]))\\d{4}"],["284496[6-9]\\d{3}|284(?:245|3(?:0[0-3]|4[0-7]|68|9[34])|4(?:4[0-6]|68|99)|5(?:4[0-7]|68|9[69]))\\d{4}"],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"1|([2-9]\\d{6})$","340$1",0,"340",[["340(?:2(?:0[0-38]|2[06-8]|4[49]|77)|3(?:32|44)|4(?:2[23]|44|7[34]|89)|5(?:1[34]|55)|6(?:2[56]|4[23]|77|9[023])|7(?:1[2-57-9]|2[57]|7\\d)|884|998)\\d{4}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-7]|33|44|66|77|88)[2-9]\\d{6}"]]],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[69]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[3578]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0",0,0,0,0,0,[["2(?:0[3-9]|1[0-689]|2[0-25-9]|3[2-9]|4[2-8]|5[124-9]|6[0-39]|7[0-7]|8[2-79]|9[0-4679])\\d{7}",[10]],["(?:5(?:2[238]|59)|89[6-9]|99[013-9])\\d{6}|(?:3\\d|5[689]|7[06-9]|8[1-8]|9[0-8])\\d{7}",[9]],["1800\\d{4,6}|12(?:0[13]|28)\\d{4}",[8,9,10]],["1900\\d{4,6}",[8,9,10]],0,0,["(?:[17]99|80\\d)\\d{4}|69\\d{5,6}",[7,8]],0,["672\\d{6}",[9]]]],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]],0,0,0,0,0,0,[["(?:38[0-8]|48[4-9])\\d\\d|(?:2[02-9]|3[4-7]|88)\\d{3}",[5]],["(?:[58]\\d|7[013-7])\\d{5}",[7]],["81[18]\\d\\d",[5]],0,0,0,["(?:3[03]|900\\d)\\d{3}"],0,["9(?:0[1-9]|1[01])\\d{4}",[7]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]],0,0,0,0,0,0,[["72\\d{4}",[6]],["(?:72|8[23])\\d{4}",[6]],["80[0-5]\\d{6}",[9]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]],0,0,0,0,0,0,[["6[1-9]\\d{3}|(?:[2-5]|60)\\d{4}",[5,6]],["(?:7[1-35-7]|8(?:[3-7]|9\\d{3}))\\d{5}",[7,10]],["800\\d{3}",[6]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0",0,0,0,0,0,[["(?:2[89]|39)0\\d{6}|[23][89]\\d{6}"],["4[3-9]\\d{6}",[8]],["800\\d{5}",[8]],["900\\d{5}",[8]]]],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7[24-68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,[["78[0-7]\\d{4}|17\\d{6}|(?:[12][2-68]|3[2358]|4[2-58]|5[2-6]|6[3-58]|7[24-6])\\d{5}",[7,8]],["7[0137]\\d{7}",[9]]]],YT:["262","00","80\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,"269|63",[["269(?:0[0-367]|5[0-3]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0",0,0,0,0,0,[["(?:2(?:0330|4302)|52087)0\\d{3}|(?:1[0-8]|2[1-378]|3[1-69]|4\\d|5[1346-8])\\d{7}",[9]],["(?:1(?:3492[0-25]|4495[0235]|549(?:20|5[01]))|4[34]492[01])\\d{3}|8[1-4]\\d{3,7}|(?:2[27]|47|54)4950\\d{3}|(?:1(?:049[2-4]|9[12]\\d\\d)|(?:6\\d|7[0-46-9])\\d{3}|8(?:5\\d{3}|7(?:08[67]|158|28[5-9]|310)))\\d{4}|(?:1[6-8]|28|3[2-69]|4[025689]|5[36-8])4920\\d{3}|(?:12|[2-5]1)492\\d{4}",[5,6,7,8,9]],["80\\d{7}",[9]],["(?:86[2-9]|9[0-2]\\d)\\d{6}",[9]],0,0,["861\\d{6,7}",[9,10]],0,["87(?:08[0-589]|15[0-79]|28[0-4]|31[1-9])\\d{4}|87(?:[02][0-79]|1[0-46-9]|3[02-9]|[4-9]\\d)\\d{5}",[9]],["860\\d{6}",[9]]]],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0",0,0,0,0,0,[["21[1-8]\\d{6}"],["(?:7[679]|9[5-8])\\d{7}"],["800\\d{6}"],0,0,0,0,0,["63\\d{7}"]]],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:(?:3\\d|9)\\d|[4-8])|2(?:(?:(?:0(?:2[014]|5)|(?:2[0157]|31|84|9)\\d\\d|[56](?:[14]\\d\\d|20)|7(?:[089]|2[03]|[35]\\d\\d))\\d|4(?:2\\d\\d|8))\\d|1(?:2|[39]\\d{4}))|3(?:(?:123|(?:29\\d|92)\\d)\\d\\d|7(?:[19]|[56]\\d))|5(?:0|1[2-478]|26|[37]2|4(?:2\\d{3}|83)|5(?:25\\d\\d|[78])|[689]\\d)|6(?:(?:[16-8]21|28|52[013])\\d\\d|[39])|8(?:[1349]28|523)\\d\\d)\\d{3}|(?:4\\d\\d|9[2-9])\\d{4,5}|(?:(?:2(?:(?:(?:0|8[146])\\d|7[1-7])\\d|2(?:[278]\\d|92)|58(?:2\\d|3))|3(?:[26]|9\\d{3})|5(?:4\\d|5)\\d\\d)\\d|6(?:(?:(?:[0-246]|[78]\\d)\\d|37)\\d|5[2-8]))\\d\\d|(?:2(?:[569]\\d|8[2-57-9])|3(?:[013-59]\\d|8[37])|6[89]8)\\d{3}"],["7(?:[178]\\d|3[1-9])\\d{6}",[9]],["80(?:[01]\\d|20|8[0-8])\\d{3}",[7]],0,0,0,0,0,["86(?:1[12]|22|30|44|55|77|8[368])\\d{6}",[10]]]]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|285\\d{9}|(?:[19]\\d|49)\\d{6}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["4"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[19]"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["34[57]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-3]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|3(?:2|47|7\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:(?:285\\d\\d|3(?:45|[69]\\d{3}))\\d|9[89])\\d{6}"]]],883:["883",0,"(?:210|370\\d\\d)\\d{7}|51\\d{7}(?:\\d{3})?",[9,10,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["2"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[35]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:210|(?:370[1-9]|51[013]0)\\d)\\d{7}|5100\\d{5}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function i(e,i){var n=Array.prototype.slice.call(i);return n.push(t),e.apply(this,n)}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return r(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},s(e)}function r(e,t,i){return r=l()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return i&&c(o,i.prototype),o},r.apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(r,e);var t,i,n,s=(t=r,i=l(),function(){var e,n=d(t);if(i){var a=d(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return o(this,e)});function r(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),t=s.call(this,e),Object.setPrototypeOf(a(t),r.prototype),t.name=t.constructor.name,t}return n=r,Object.defineProperty(n,"prototype",{writable:!1}),n}(s(Error)),p="".concat("-‐-―−ー－").concat("／/").concat("．.").concat("  ­​⁠　").concat("()（）［］\\[\\]").concat("~⁓∼～");function h(e,t){e=e.split("-"),t=t.split("-");for(var i=e[0].split("."),n=t[0].split("."),o=0;o<3;o++){var a=Number(i[o]),s=Number(n[o]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t,i){return t&&v(e.prototype,t),i&&v(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}var C=" ext. ",S=/^\d+$/,y=function(){function e(t){g(this,e),function(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!w(e)||!w(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(w(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+P(e)+": "+e,"."))}(t),this.metadata=t,F.call(this,t)}return f(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(e){return"001"!==e})}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&S.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new b(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new b(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var i=this.nonGeographic()[e];if(i)return i}else{var n=this.countryCallingCodes()[e];if(n&&1===n.length&&"001"===n[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),e}(),b=function(){function e(t,i){g(this,e),this.globalMetadataObject=i,this.metadata=t,F.call(this,i.metadata)}return f(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map(function(t){return new k(t,e)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return!(this.types()&&0===this.types().length||!this.types())}},{key:"type",value:function(e){if(this.hasTypes()&&I(this.types(),e))return new D(I(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?C:this.metadata[13]||C}}]),e}(),k=function(){function e(t,i){g(this,e),this._format=t,this.metadata=i}return f(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||_.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),e}(),_=/^\(?\$1\)?$/,D=function(){function e(t,i){g(this,e),this.type=t,this.metadata=i}return f(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),e}();function I(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}var w=function(e){return"object"===m(e)},P=function(e){return m(e)};function A(e,t){return(t=new y(t)).hasCountry(e)?t.country(e).ext():C}function T(e,t){if((t=new y(t)).hasCountry(e))return t.country(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function x(e,t){return void 0!==t.countries[e]}function F(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===h(t,"1.2.0")?this.v2=!0:-1===h(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var $=function(e){return"([".concat("0-9０-９٠-٩۰-۹","]{1,").concat(e,"})")};function O(e){var t="#?";return";ext="+$("20")+"|[  \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|ｅ?ｘｔｎ?|доб|anexo)[:\\.．]?[  \\t,-]*"+$("20")+"#?|[  \\t,]*(?:[xｘ#＃~～]|int|ｉｎｔ)[:\\.．]?[  \\t,-]*"+$("9")+"#?|[- ]+"+$("6")+"#|[  \\t]*(?:,{2}|;)[:\\.．]?[  \\t,-]*"+$("15")+"#?|[  \\t]*(?:,)+[:\\.．]?[  \\t,-]*"+$("9")+t}var M="[+＋]{0,1}(?:["+p+"]*[0-9０-９٠-٩۰-۹]){3,}["+p+"0-9０-９٠-٩۰-۹]*",B=new RegExp("^[+＋]{0,1}(?:["+p+"]*[0-9０-９٠-٩۰-۹]){1,2}$","i"),E=M+"(?:"+O()+")?",L=new RegExp("^[0-9０-９٠-٩۰-۹]{2}$|^"+E+"$","i");function N(e){return e.length>=2&&L.test(e)}var U=new RegExp("(?:"+O()+")$","i");function R(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var W={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","０":"0","１":"1","２":"2","３":"3","４":"4","５":"5","６":"6","７":"7","８":"8","９":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function G(e){return W[e]}function V(e){for(var t,i="",n=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return R(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?R(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;){var o=G(t.value);o&&(i+=o)}return i}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function j(e){for(var t,i="",n=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return H(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?H(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;)i+=Y(t.value,i)||"";return i}function Y(e,t){if("+"===e){if(t)return;return"+"}return G(e)}function q(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function z(e,t){return X(e,void 0,t)}function X(e,t,i){var n=i.type(t),o=n&&n.possibleLengths()||i.possibleLengths();if(!o)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!i.type("FIXED_LINE"))return X(e,"MOBILE",i);var a=i.type("MOBILE");a&&(o=function(e,t){for(var i,n=e.slice(),o=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return q(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?q(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(i=o()).done;){var a=i.value;e.indexOf(a)<0&&n.push(a)}return n.sort(function(e,t){return e-t})}(o,a.possibleLengths()))}else if(t&&!n)return"INVALID_LENGTH";var s=e.length,r=o[0];return r===s?"IS_POSSIBLE":r>s?"TOO_SHORT":o[o.length-1]<s?"TOO_LONG":o.indexOf(s,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function Z(e,t){return"IS_POSSIBLE"===z(e,t)}function J(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,o,a=[],s=!0,r=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(e){r=!0,o=e}finally{try{s||null==i.return||i.return()}finally{if(r)throw o}}return a}}(e,t)||Q(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(e,t){if(e){if("string"==typeof e)return K(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?K(e,t):void 0}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function ee(e){for(var t,i,n,o=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=Q(e))){t&&(e=t);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}((e=e.replace(/^tel:/,"tel=")).split(";"));!(n=o()).done;){var a=J(n.value.split("="),2),s=a[0],r=a[1];switch(s){case"tel":t=r;break;case"ext":i=r;break;case"phone-context":"+"===r[0]&&(t=r+t)}}if(!N(t))return{};var l={number:t};return i&&(l.ext=i),l}function te(e){var t=e.number,i=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(i?";ext="+i:"")}function ie(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var oe=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function ae(e,t,i){if(t=t||{},e.country){(i=new y(i)).selectNumberingPlan(e.country,e.countryCallingCode);var n=t.v2?e.nationalNumber:e.phone;if(ie(n,i.nationalNumberPattern())){if(se(n,"FIXED_LINE",i))return i.type("MOBILE")&&""===i.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":i.type("MOBILE")?se(n,"MOBILE",i)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var o,a=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return ne(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ne(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(oe);!(o=a()).done;){var s=o.value;if(se(n,s,i))return s}}}}function se(e,t,i){return!(!(t=i.type(t))||!t.pattern())&&!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&ie(e,t.pattern())}function re(e,t,i){return t=t||{},i=new y(i),!!e.country&&(i.selectNumberingPlan(e.country,e.countryCallingCode),i.hasTypes()?void 0!==ae(e,t,i.metadata):ie(t.v2?e.nationalNumber:e.phone,i.nationalNumberPattern()))}function le(e){return e.replace(new RegExp("[".concat(p,"]+"),"g")," ").trim()}var ce=/(\$\d)/;function de(e,t,i){var n=i.useInternationalFormat,o=i.withNationalPrefix;i.carrierCode,i.metadata;var a=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():o&&t.nationalPrefixFormattingRule()?t.format().replace(ce,t.nationalPrefixFormattingRule()):t.format());return n?le(a):a}var ue=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function he(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function me(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?he(Object(i),!0).forEach(function(t){ge(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function ge(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ve={formatExtension:function(e,t,i){return"".concat(e).concat(i.ext()).concat(t)}};function fe(e,t,i,n,o){var a=function(e,t){for(var i,n=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return pe(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?pe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(i=n()).done;){var o=i.value;if(o.leadingDigitsPatterns().length>0){var a=o.leadingDigitsPatterns()[o.leadingDigitsPatterns().length-1];if(0!==t.search(a))continue}if(ie(t,o.pattern()))return o}}(n.formats(),e);return a?de(e,a,{useInternationalFormat:"INTERNATIONAL"===i,withNationalPrefix:!a.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!o||!1!==o.nationalPrefix,carrierCode:t,metadata:n}):e}function Ce(e,t,i,n){return t?n(e,t,i):e}function Se(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function ye(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(i),!0).forEach(function(t){be(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Se(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function be(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ke(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var _e=function(){function e(t,i,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("`country` or `countryCallingCode` not passed");if(!i)throw new TypeError("`nationalNumber` not passed");if(!n)throw new TypeError("`metadata` not passed");var o=new y(n);De(t)&&(this.country=t,o.country(t),t=o.countryCallingCode()),this.countryCallingCode=t,this.nationalNumber=i,this.number="+"+this.countryCallingCode+this.nationalNumber,this.metadata=n}var t,i;return t=e,i=[{key:"setExt",value:function(e){this.ext=e}},{key:"isPossible",value:function(){return function(e,t,i){if(void 0===t&&(t={}),i=new y(i),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");i.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!i.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));i.country(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");i.selectNumberingPlan(e.countryCallingCode)}}if(i.possibleLengths())return Z(e.phone||e.nationalNumber,i);if(e.countryCallingCode&&i.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.metadata)}},{key:"isValid",value:function(){return re(this,{v2:!0},this.metadata)}},{key:"isNonGeographic",value:function(){return new y(this.metadata).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return ae(this,{v2:!0},this.metadata)}},{key:"format",value:function(e,t){return function(e,t,i,n){if(i=i?me(me({},ve),i):ve,n=new y(n),e.country&&"001"!==e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";n.selectNumberingPlan(e.countryCallingCode)}var o,a=n.countryCallingCode(),s=i.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return s?Ce(o=fe(s,e.carrierCode,"NATIONAL",n,i),e.ext,n,i.formatExtension):"";case"INTERNATIONAL":return s?(o=fe(s,null,"INTERNATIONAL",n,i),Ce(o="+".concat(a," ").concat(o),e.ext,n,i.formatExtension)):"+".concat(a);case"E.164":return"+".concat(a).concat(s);case"RFC3966":return te({number:"+".concat(a).concat(s),ext:e.ext});case"IDD":if(!i.fromCountry)return;var r=function(e,t,i,n,o){if(T(n,o.metadata)===i){var a=fe(e,t,"NATIONAL",o);return"1"===i?i+" "+a:a}var s=function(e,t,i){var n=new y(i);return n.selectNumberingPlan(e,void 0),n.defaultIDDPrefix()?n.defaultIDDPrefix():ue.test(n.IDDPrefix())?n.IDDPrefix():void 0}(n,0,o.metadata);if(s)return"".concat(s," ").concat(i," ").concat(fe(e,null,"INTERNATIONAL",o))}(s,e.carrierCode,a,i.fromCountry,n);return Ce(r,e.ext,n,i.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}(this,e,t?ye(ye({},t),{},{v2:!0}):{v2:!0},this.metadata)}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],i&&ke(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}(),De=function(e){return/^[A-Z]{2}$/.test(e)},Ie=new RegExp("([0-9０-９٠-٩۰-۹])");function we(e,t,i,n){if(t){var o=new y(n);o.selectNumberingPlan(t,i);var a=new RegExp(o.IDDPrefix());if(0===e.search(a)){var s=(e=e.slice(e.match(a)[0].length)).match(Ie);if(!(s&&null!=s[1]&&s[1].length>0&&"0"===s[1]))return e}}}function Pe(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var i=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=i.exec(e);if(n){var o,a,s,r=n.length-1,l=r>0&&n[r];if(t.nationalPrefixTransformRule()&&l)o=e.replace(i,t.nationalPrefixTransformRule()),r>1&&(a=n[1]);else{var c=n[0];o=e.slice(c.length),l&&(a=n[1])}if(l){var d=e.indexOf(n[1]);e.slice(0,d)===t.numberingPlan.nationalPrefix()&&(s=t.numberingPlan.nationalPrefix())}else s=n[0];return{nationalNumber:o,nationalPrefix:s,carrierCode:a}}}return{nationalNumber:e}}function Ae(e,t){var i=Pe(e,t),n=i.carrierCode,o=i.nationalNumber;if(o!==e){if(!function(e,t,i){return!(ie(e,i.nationalNumberPattern())&&!ie(t,i.nationalNumberPattern()))}(e,o,t))return{nationalNumber:e};if(t.possibleLengths()&&!function(e,t){switch(z(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(o,t))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:n}}function Te(e,t,i,n){var o=t?T(t,n):i;if(0===e.indexOf(o)){(n=new y(n)).selectNumberingPlan(t,i);var a=e.slice(o.length),s=Ae(a,n).nationalNumber,r=Ae(e,n).nationalNumber;if(!ie(r,n.nationalNumberPattern())&&ie(s,n.nationalNumberPattern())||"TOO_LONG"===z(r,n))return{countryCallingCode:o,number:a}}return{number:e}}function xe(e,t,i,n){if(!e)return{};if("+"!==e[0]){var o=we(e,t,i,n);if(!o||o===e){if(t||i){var a=Te(e,t,i,n),s=a.countryCallingCode,r=a.number;if(s)return{countryCallingCode:s,number:r}}return{number:e}}e="+"+o}if("0"===e[1])return{};n=new y(n);for(var l=2;l-1<=3&&l<=e.length;){var c=e.slice(1,l);if(n.hasCallingCode(c))return n.selectNumberingPlan(c),{countryCallingCode:c,number:e.slice(l)};l++}return{}}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function $e(e,t,i){var n=i.getCountryCodesForCallingCode(e);if(n)return 1===n.length?n[0]:function(e,t,i){i=new y(i);for(var n,o=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Fe(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Fe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=o()).done;){var a=n.value;if(i.country(a),i.leadingDigits()){if(t&&0===t.search(i.leadingDigits()))return a}else if(ae({phone:t,country:a},void 0,i.metadata))return a}}(n,t,i.metadata)}var Oe=new RegExp("[+＋0-9０-９٠-٩۰-۹]"),Me=new RegExp("[^0-9０-９٠-٩۰-۹#]+$");function Be(e,t,i){if(t=t||{},i=new y(i),t.defaultCountry&&!i.hasCountry(t.defaultCountry)){if(t.v2)throw new u("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var n=function(e,t,i){if(e&&0===e.indexOf("tel:"))return ee(e);var n=function(e,t,i){if(e)if(e.length>250){if(i)throw new u("TOO_LONG")}else{if(!1===t)return e;var n=e.search(Oe);if(!(n<0))return e.slice(n).replace(Me,"")}}(e,i,t);if(!n)return{};if(!N(n))return function(e){return B.test(e)}(n)?{error:"TOO_SHORT"}:{};var o=function(e){var t=e.search(U);if(t<0)return{};for(var i=e.slice(0,t),n=e.match(U),o=1;o<n.length;){if(n[o])return{number:i,ext:n[o]};o++}}(n);return o.ext?o:{number:n}}(e,t.v2,t.extract),o=n.number,a=n.ext,s=n.error;if(!o){if(t.v2){if("TOO_SHORT"===s)throw new u("TOO_SHORT");throw new u("NOT_A_NUMBER")}return{}}var r=function(e,t,i,n){var o,a=xe(j(e),t,i,n.metadata),s=a.countryCallingCode,r=a.number;if(s)n.selectNumberingPlan(s);else{if(!r||!t&&!i)return{};n.selectNumberingPlan(t,i),t&&(o=t),s=i||T(t,n.metadata)}if(!r)return{countryCallingCode:s};var l=Ae(j(r),n),c=l.nationalNumber,d=l.carrierCode,u=$e(s,c,n);return u&&(o=u,"001"===u||n.country(o)),{country:o,countryCallingCode:s,nationalNumber:c,carrierCode:d}}(o,t.defaultCountry,t.defaultCallingCode,i),l=r.country,c=r.nationalNumber,d=r.countryCallingCode,p=r.carrierCode;if(!i.hasSelectedNumberingPlan()){if(t.v2)throw new u("INVALID_COUNTRY");return{}}if(!c||c.length<2){if(t.v2)throw new u("TOO_SHORT");return{}}if(c.length>17){if(t.v2)throw new u("TOO_LONG");return{}}if(t.v2){var h=new _e(d,c,i.metadata);return l&&(h.country=l),p&&(h.carrierCode=p),a&&(h.ext=a),h}var m=!!(t.extended?i.hasSelectedNumberingPlan():l)&&ie(c,i.nationalNumberPattern());return t.extended?{country:l,countryCallingCode:d,carrierCode:p,valid:m,possible:!!m||!(!0!==t.extended||!i.possibleLengths()||!Z(c,i)),phone:c,ext:a}:m?function(e,t,i){var n={country:e,phone:t};return i&&(n.ext=i),n}(l,c,a):{}}function Ee(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function Le(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ee(Object(i),!0).forEach(function(t){Ne(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ee(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Ne(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ue(e,t,i){return Be(e,Le(Le({},t),{},{v2:!0}),i)}function Re(e){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function We(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function Ge(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function He(){var e=je(arguments);return Ue(e.text,e.options,e.metadata)}function je(e){var t,i,n,o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,o,a=[],s=!0,r=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(e){r=!0,o=e}finally{try{s||null==i.return||i.return()}finally{if(r)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ve(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ve(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Array.prototype.slice.call(e),4),a=o[0],s=o[1],r=o[2],l=o[3];if("string"!=typeof a)throw new TypeError("A text for parsing must be a string.");if(t=a,s&&"string"!=typeof s){if(!Ye(s))throw new Error("Invalid second argument: ".concat(s));r?(i=s,n=r):n=s}else l?(i=r,n=l):(i=void 0,n=r),s&&(i=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?We(Object(i),!0).forEach(function(t){Ge(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):We(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({defaultCountry:s},i));return{text:t,options:i,metadata:n}}var Ye=function(e){return"object"===Re(e)};function qe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function ze(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?qe(Object(i),!0).forEach(function(t){Xe(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):qe(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function Xe(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ze(e,t,i){t&&t.defaultCountry&&!x(t.defaultCountry,i)&&(t=ze(ze({},t),{},{defaultCountry:void 0}));try{return Ue(e,t,i)}catch(e){if(!(e instanceof u))throw e}}function Je(){var e=je(arguments);return Ze(e.text,e.options,e.metadata)}function Qe(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function Ke(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Qe(Object(i),!0).forEach(function(t){et(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Qe(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function et(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function tt(){var e=je(arguments),t=e.text,i=e.options,n=e.metadata,o=Ze(t,i=Ke(Ke({},i),{},{extract:!1}),n);return o&&o.isValid()||!1}function it(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function nt(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?it(Object(i),!0).forEach(function(t){ot(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):it(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function ot(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function at(){var e=je(arguments),t=e.text,i=e.options,n=e.metadata,o=Ze(t,i=nt(nt({},i),{},{extract:!1}),n);return o&&o.isPossible()||!1}function st(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function rt(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?st(Object(i),!0).forEach(function(t){lt(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):st(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function lt(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ct(){var e=je(arguments),t=e.text,i=e.options,n=e.metadata;i=rt(rt({},i),{},{extract:!1});try{var o=Ue(t,i,n);(n=new y(n)).selectNumberingPlan(o.countryCallingCode);var a=z(o.nationalNumber,n);if("IS_POSSIBLE"!==a)return a}catch(e){if(e instanceof u)return e.message;throw e}}function dt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ut(e,t,i){return t&&dt(e.prototype,t),i&&dt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var ht=ut(function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;pt(this,e),this.key=t,this.value=i,this.next=n,this.prev=o}),mt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;pt(this,e),this.size=0,this.limit=t,this.head=null,this.tail=null,this.cache={}}return ut(e,[{key:"put",value:function(e,t){if(this.ensureLimit(),this.head){var i=new ht(e,t,this.head);this.head.prev=i,this.head=i}else this.head=this.tail=new ht(e,t);this.cache[e]=this.head,this.size++}},{key:"get",value:function(e){if(this.cache[e]){var t=this.cache[e].value;return this.remove(e),this.put(e,t),t}console.log("Item not available in cache for key ".concat(e))}},{key:"ensureLimit",value:function(){this.size===this.limit&&this.remove(this.tail.key)}},{key:"remove",value:function(e){var t=this.cache[e];null!==t.prev?t.prev.next=t.next:this.head=t.next,null!==t.next?t.next.prev=t.prev:this.tail=t.prev,delete this.cache[e],this.size--}},{key:"clear",value:function(){this.head=null,this.tail=null,this.size=0,this.cache={}}}]),e}();function gt(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var vt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cache=new mt(t)}var t,i;return t=e,(i=[{key:"getPatternForRegExp",value:function(e){var t=this.cache.get(e);return t||(t=new RegExp("^"+e),this.cache.put(e,t)),t}}])&&gt(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ft(e,t){if(e<0||t<=0||t<e)throw new TypeError;return"{".concat(e,",").concat(t,"}")}function Ct(e,t){var i=t.search(e);return i>=0?t.slice(0,i):t}var St="   ᠎ - \u2028\u2029  　",yt="[".concat(St,"]"),bt="[^".concat(St,"]"),kt="[".concat("0-9٠-٩۰-۹߀-߉०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉႐-႙០-៩᠐-᠙᥆-᥏᧐-᧙᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙꘠-꘩꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹０-９","]"),_t="A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎↃↄⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々〆〱-〵〻〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛥꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ﬀ-ﬆﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼＡ-Ｚａ-ｚｦ-ﾾￂ-ￇￊ-ￏￒ-ￗￚ-ￜ",Dt="[".concat(_t,"]"),It=new RegExp(Dt),wt="[".concat("$¢-¥֏؋৲৳৻૱௹฿៛₠-₹꠸﷼﹩＄￠￡￥￦","]"),Pt=new RegExp(wt),At="[".concat("̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ࣾऀ-ंऺ़ु-ै्॑-ॗॢॣঁ়ু-ৄ্ৢৣਁਂ਼ੁੂੇੈੋ-੍ੑੰੱੵઁં઼ુ-ૅેૈ્ૢૣଁ଼ିୁ-ୄ୍ୖୢୣஂீ்ా-ీె-ైొ-్ౕౖౢౣ಼ಿೆೌ್ೢೣു-ൄ്ൢൣ්ි-ුූัิ-ฺ็-๎ັິ-ູົຼ່-ໍཱ༹༘༙༵༷-ཾྀ-྄྆྇ྍ-ྗྙ-ྼ࿆ိ-ူဲ-့္်ွှၘၙၞ-ၠၱ-ၴႂႅႆႍႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴឵ិ-ួំ៉-៓៝᠋-᠍ᢩᤠ-ᤢᤧᤨᤲ᤹-᤻ᨘᨗᩖᩘ-ᩞ᩠ᩢᩥ-ᩬᩳ-᩿᩼ᬀ-ᬃ᬴ᬶ-ᬺᬼᭂ᭫-᭳ᮀᮁᮢ-ᮥᮨᮩ᯦᮫ᯨᯩᯭᯯ-ᯱᰬ-ᰳᰶ᰷᳐-᳔᳒-᳢᳠-᳨᳭᳴᷀-ᷦ᷼-᷿⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〭꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠥꠦ꣄꣠-꣱ꤦ-꤭ꥇ-ꥑꦀ-ꦂ꦳ꦶ-ꦹꦼꨩ-ꨮꨱꨲꨵꨶꩃꩌꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫬꫭ꫶ꯥꯨ꯭ﬞ︀-️︠-︦","]"),Tt=new RegExp(At),xt=new RegExp("[\0--ÿĀ-ſḀ-ỿƀ-ɏ̀-ͯ]");function Ft(e){return!(!It.test(e)&&!Tt.test(e))&&xt.test(e)}function $t(e){return"%"===e||Pt.test(e)}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var Mt={POSSIBLE:function(e,t,i){return!0},VALID:function(e,t,i){return!(!re(e,void 0,i)||!Bt(e,t.toString()))},STRICT_GROUPING:function(e,t,i,n){var o=t.toString();return!(!re(e,void 0,i)||!Bt(e,o)||Lt(e,o)||!Et(e))&&Nt(e,t,i,Wt,n)},EXACT_GROUPING:function(e,t,i,n){var o=t.toString();return!(!re(e,void 0,i)||!Bt(e,o)||Lt(e,o)||!Et(e))&&Nt(e,t,i,Rt,n)}};function Bt(e,t,i){for(var n=0;n<t.length-1;n++){var o=t.charAt(n);if("x"===o||"X"===o){var a=t.charAt(n+1);if("x"===a||"X"===a){if(n++,util.isNumberMatch(e,t.substring(n))!=MatchType.NSN_MATCH)return!1}else if(V(t.substring(n))!==e.ext)return!1}}return!0}function Et(e,t){if("FROM_DEFAULT_COUNTRY"!=e.getCountryCodeSource())return!0;var i=util.getRegionCodeForCountryCode(e.getCountryCode()),n=util.getMetadataForRegion(i);if(null==n)return!0;var o=util.getNationalSignificantNumber(e),a=util.chooseFormattingPatternForNumber(n.numberFormats(),o);if(a&&a.getNationalPrefixFormattingRule().length>0){if(a.getNationalPrefixOptionalWhenFormatting())return!0;if(PhoneNumberUtil.formattingRuleHasFirstGroupOnly(a.getNationalPrefixFormattingRule()))return!0;var s=PhoneNumberUtil.normalizeDigitsOnly(e.getRawInput());return util.maybeStripNationalPrefixAndCarrierCode(s,n,null)}return!0}function Lt(e,t){var i=t.indexOf("/");if(i<0)return!1;var n=t.indexOf("/",i+1);return!(n<0)&&(!(e.getCountryCodeSource()===CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN||e.getCountryCodeSource()===CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN)||PhoneNumberUtil.normalizeDigitsOnly(t.substring(0,i))!==String(e.getCountryCode())||t.slice(n+1).indexOf("/")>=0)}function Nt(e,t,i,n,o){var a=normalizeDigits(t,!0),s=Ut(i,e,null);if(n(i,e,a,s))return!0;var r=MetadataManager.getAlternateFormatsForCountry(e.getCountryCode()),l=util.getNationalSignificantNumber(e);if(r)for(var c,d=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ot(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ot(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.numberFormats());!(c=d()).done;){var u=c.value;if((!(u.leadingDigitsPatterns().length>0)||o.getPatternForRegExp("^"+u.leadingDigitsPatterns()[0]).test(l))&&n(i,e,a,s=Ut(i,e,u)))return!0}return!1}function Ut(e,t,i){if(i){var n=util.getNationalSignificantNumber(t);return util.formatNsnUsingPattern(n,i,"RFC3966",e).split("-")}var o=formatNumber(t,"RFC3966",e),a=o.indexOf(";");a<0&&(a=o.length);var s=o.indexOf("-")+1;return o.slice(s,a).split("-")}function Rt(e,t,i,n){var o=i.split(NON_DIGITS_PATTERN),a=t.hasExtension()?o.length-2:o.length-1;if(1==o.length||o[a].contains(util.getNationalSignificantNumber(t)))return!0;for(var s,r,l=n.length-1;l>0&&a>=0;){if(o[a]!==n[l])return!1;l--,a--}return a>=0&&(s=o[a],r=n[0],s.indexOf(r,s.length-r.length)===s.length-r.length)}function Wt(e,t,i,n){var o,a=0;if(t.getCountryCodeSource()!==CountryCodeSource.FROM_DEFAULT_COUNTRY){var s=String(t.getCountryCode());a=i.indexOf(s)+s.length()}for(var r=0;r<n.length;r++){if((a=i.indexOf(n[r],a))<0)return!1;if(a+=n[r].length(),0==r&&a<i.length()){var l=util.getRegionCodeForCountryCode(t.getCountryCode());if(null!=util.getNddPrefixForRegion(l,!0)&&Character.isDigit(i.charAt(a)))return o=util.getNationalSignificantNumber(t),0===i.slice(a-n[r].length).indexOf(o)}}return i.slice(a).contains(t.getExtension())}var Gt=/[\\/] *x/;function Vt(e){return Ct(Gt,e)}var Ht=/(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/,jt=/[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/,Yt=/^:[0-5]\d/;function qt(e,t,i){if(Ht.test(e))return!1;if(jt.test(e)){var n=i.slice(t+e.length);if(Yt.test(n))return!1}return!0}var zt="(\\[（［",Xt="[^".concat(zt).concat(")\\]）］","]"),Zt="[".concat(zt).concat("+＋","]"),Jt=new RegExp("^"+Zt),Qt=ft(0,3),Kt=new RegExp("^(?:[(\\[（［])?(?:"+Xt+"+[)\\]）］])?"+Xt+"+(?:[(\\[（［]"+Xt+"+[)\\]）］])"+Qt+Xt+"*$"),ei=/\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;function ti(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function ii(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function ni(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ii(Object(i),!0).forEach(function(t){oi(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ii(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function oi(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ai(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var si=O(),ri=["\\/+(.*)/","(\\([^(]*)","(?:".concat(yt,"-|-").concat(yt,")").concat(yt,"*(.+)"),"[‒-―－]".concat(yt,"*(.+)"),"\\.+".concat(yt,"*([^.]+)"),"".concat(yt,"+(").concat(bt,"+)")],li=ft(0,2),ci=ft(0,4),di=ft(0,20),ui="[".concat(p,"]")+ci,pi=kt+ft(1,20),hi="(?:"+Zt+ui+")"+li+pi+"(?:"+ui+pi+")"+di+"(?:"+si+")?",mi=new RegExp("[^".concat("0-9²³¹¼-¾٠-٩۰-۹߀-߉०-९০-৯৴-৹੦-੯૦-૯୦-୯୲-୷௦-௲౦-౯౸-౾೦-೯൦-൵๐-๙໐-໙༠-༳၀-၉႐-႙፩-፼ᛮ-ᛰ០-៩៰-៹᠐-᠙᥆-᥏᧐-᧚᪀-᪉᪐-᪙᭐-᭙᮰-᮹᱀-᱉᱐-᱙⁰⁴-⁹₀-₉⅐-ↂↅ-↉①-⒛⓪-⓿❶-➓⳽〇〡-〩〸-〺㆒-㆕㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿꘠-꘩ꛦ-ꛯ꠰-꠵꣐-꣙꤀-꤉꧐-꧙꩐-꩙꯰-꯹０-９").concat(_t,"#]+$")),gi=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,vi=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!(i=ni(ni({},i),{},{defaultCallingCode:i.defaultCallingCode,defaultCountry:i.defaultCountry&&x(i.defaultCountry,n)?i.defaultCountry:void 0,leniency:i.leniency||i.extended?"POSSIBLE":"VALID",maxTries:i.maxTries||gi})).leniency)throw new TypeError("`Leniency` not supplied");if(i.maxTries<0)throw new TypeError("`maxTries` not supplied");if(this.text=t,this.options=i,this.metadata=n,this.leniency=Mt[i.leniency],!this.leniency)throw new TypeError("Unknown leniency: ".concat(i.leniency,"."));this.maxTries=i.maxTries,this.PATTERN=new RegExp(hi,"ig"),this.state="NOT_READY",this.searchIndex=0,this.regExpCache=new vt(32)}var t,i;return t=e,i=[{key:"find",value:function(){for(var e;this.maxTries>0&&null!==(e=this.PATTERN.exec(this.text));){var t=e[0],i=e.index;if(qt(t=Vt(t),i,this.text)){var n=this.parseAndVerify(t,i,this.text)||this.extractInnerMatch(t,i,this.text);if(n){if(this.options.v2){var o=new _e(n.country||n.countryCallingCode,n.phone,this.metadata);return n.ext&&(o.ext=n.ext),{startsAt:n.startsAt,endsAt:n.endsAt,number:o}}return n}}this.maxTries--}}},{key:"extractInnerMatch",value:function(e,t,i){for(var n,o=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return ti(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?ti(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(ri);!(n=o()).done;)for(var a=n.value,s=!0,r=void 0,l=new RegExp(a,"g");this.maxTries>0&&null!==(r=l.exec(e));){if(s){var c=Ct(mi,e.slice(0,r.index)),d=this.parseAndVerify(c,t,i);if(d)return d;this.maxTries--,s=!1}var u=Ct(mi,r[1]),p=e.indexOf(u,r.index),h=this.parseAndVerify(u,t+p,i);if(h)return h;this.maxTries--}}},{key:"parseAndVerify",value:function(e,t,i){if(function(e,t,i,n){if(Kt.test(e)&&!ei.test(e)){if("POSSIBLE"!==n){if(t>0&&!Jt.test(e)){var o=i[t-1];if($t(o)||Ft(o))return!1}var a=t+e.length;if(a<i.length){var s=i[a];if($t(s)||Ft(s))return!1}}return!0}}(e,t,i,this.options.leniency)){var n=Be(e,{extended:!0,defaultCountry:this.options.defaultCountry,defaultCallingCode:this.options.defaultCallingCode},this.metadata);if(n.possible&&this.leniency(n,e,this.metadata,this.regExpCache)){var o={startsAt:t,endsAt:t+e.length,phone:n.phone};return n.country&&"001"!==n.country?o.country=n.country:o.countryCallingCode=n.countryCallingCode,n.ext&&(o.ext=n.ext),o}}}},{key:"hasNext",value:function(){return"NOT_READY"===this.state&&(this.lastMatch=this.find(),this.lastMatch?this.state="READY":this.state="DONE"),"READY"===this.state}},{key:"next",value:function(){if(!this.hasNext())throw new Error("No next element");var e=this.lastMatch;return this.lastMatch=null,this.state="NOT_READY",e}}],i&&ai(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function fi(){var e=je(arguments);return function(e,t,i){for(var n=new vi(e,t,i),o=[];n.hasNext();)o.push(n.next());return o}(e.text,e.options,e.metadata)}function Ci(){var e=je(arguments),t=e.text,i=e.options,n=e.metadata,o=new vi(t,i,n);return function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}({},Symbol.iterator,function(){return{next:function(){return o.hasNext()?{done:!1,value:o.next()}:{done:!0}}}})}function Si(e){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Si(e)}function yi(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function bi(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?yi(Object(i),!0).forEach(function(t){ki(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):yi(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function ki(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _i(e,t,i,n){var o=Di(t,i,n);return fi(e,o.options,o.metadata)}function Di(e,t,i){return i?e&&(t=bi(bi({},t),{},{defaultCountry:e})):t?(i=t,t=e?Ii(e)?e:{defaultCountry:e}:void 0):(i=e,t=void 0),{options:bi(bi({},t),{},{v2:!0}),metadata:i}}var Ii=function(e){return"object"===Si(e)};function wi(e,t,i,n){var o=Di(t,i,n);return Ci(e,o.options,o.metadata)}function Pi(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ai=function(){function e(t){var i=t.onCountryChange,n=t.onCallingCodeChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onCountryChange=i,this.onCallingCodeChange=n}var t,i;return t=e,(i=[{key:"reset",value:function(e,t){this.international=!1,this.IDDPrefix=void 0,this.missingPlus=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(e,t)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"update",value:function(e){for(var t=0,i=Object.keys(e);t<i.length;t++){var n=i[t];this[n]=e[n]}}},{key:"initCountryAndCallingCode",value:function(e,t){this.setCountry(e),this.setCallingCode(t)}},{key:"setCountry",value:function(e){this.country=e,this.onCountryChange(e)}},{key:"setCallingCode",value:function(e){this.callingCode=e,this.onCallingCodeChange(e,this.country)}},{key:"startInternationalNumber",value:function(e,t){this.international=!0,this.initCountryAndCallingCode(e,t)}},{key:"appendDigits",value:function(e){this.digits+=e}},{key:"appendNationalSignificantNumberDigits",value:function(e){this.nationalSignificantNumber+=e}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])&&Pi(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ti(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var xi="x",Fi=new RegExp(xi);function $i(e,t){if(t<1)return"";for(var i="";t>1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function Oi(e,t){return")"===e[t]&&t++,function(e){for(var t=[],i=0;i<e.length;)"("===e[i]?t.push(i):")"===e[i]&&t.pop(),i++;var n=0,o="";t.push(e.length);for(var a=0,s=t;a<s.length;a++){var r=s[a];o+=e.slice(n,r),n=r+1}return o}(e.slice(0,t))}function Mi(e,t,i){var n=i.metadata,o=i.shouldTryNationalPrefixFormattingRule,a=i.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,i){var n=i.metadata,o=i.shouldTryNationalPrefixFormattingRule,a=i.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,o(t)){var s=Bi(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:a,metadata:n});if(s)return s}return Bi(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:a,metadata:n})}(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:o,getSeparatorAfterNationalPrefix:a})}function Bi(e,t,i){var n=i.metadata,o=i.useNationalPrefixFormattingRule,a=i.getSeparatorAfterNationalPrefix,s=de(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:o,metadata:n});if(o||(e.nationalPrefix?s=e.nationalPrefix+a(t)+s:e.complexPrefixBeforeNationalSignificantNumber&&(s=e.complexPrefixBeforeNationalSignificantNumber+" "+s)),function(e,t){return V(e)===t.getNationalDigits()}(s,e))return s}function Ei(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Li=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,i;return t=e,(i=[{key:"parse",value:function(e){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(e),1!==this.context.length)throw new Error("Non-finalized contexts left when pattern parse ended");var t=this.context[0],i=t.branches,n=t.instructions;if(i)return{op:"|",args:i.concat([Wi(n)])};if(0===n.length)throw new Error("Pattern is required");return 1===n.length?n[0]:n}},{key:"startContext",value:function(e){this.context.push(e)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(e){if(!e)throw new Error("Pattern is required");var t=e.match(Ri);if(t){var i=t[1],n=e.slice(0,t.index),o=e.slice(t.index+i.length);switch(i){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw new Error('No instructions found after "|" operator in an "or" group');var a=this.getContext().branches;a.push(Wi(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:a});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw new Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(Wi(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:Ni(n)});break;default:throw new Error("Unknown operator: ".concat(i))}o&&this.parsePattern(o)}else{if(Ui.test(e))throw new Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}])&&Ei(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ni(e){for(var t=[],i=0;i<e.length;){if("-"===e[i]){if(0===i||i===e.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(e));for(var n=e[i-1].charCodeAt(0)+1,o=e[i+1].charCodeAt(0)-1,a=n;a<=o;)t.push(String.fromCharCode(a)),a++}else t.push(e[i]);i++}return t}var Ui=/[\(\)\[\]\?\:\|]/,Ri=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function Wi(e){return 1===e.length?e[0]:e}function Gi(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Vi(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Vi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Hi(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var ji=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.matchTree=(new Li).parse(t)}var t,i;return t=e,i=[{key:"match",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!e)throw new Error("String is required");var i=Yi(e.split(""),this.matchTree,!0);if(i&&i.match&&delete i.matchedChars,!i||!i.overflow||t)return i}}],i&&Hi(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Yi(e,t,i){if("string"==typeof t){var n=e.join("");return 0===t.indexOf(n)?e.length===t.length?{match:!0,matchedChars:e}:{partialMatch:!0}:0===n.indexOf(t)?i&&e.length>t.length?{overflow:!0}:{match:!0,matchedChars:e.slice(0,t.length)}:void 0}if(Array.isArray(t)){for(var o=e.slice(),a=0;a<t.length;){var s=Yi(o,t[a],i&&a===t.length-1);if(!s)return;if(s.overflow)return s;if(!s.match){if(s.partialMatch)return{partialMatch:!0};throw new Error("Unsupported match result:\n".concat(JSON.stringify(s,null,2)))}if(0===(o=o.slice(s.matchedChars.length)).length)return a===t.length-1?{match:!0,matchedChars:e}:{partialMatch:!0};a++}return i?{overflow:!0}:{match:!0,matchedChars:e.slice(0,e.length-o.length)}}switch(t.op){case"|":for(var r,l,c=Gi(t.args);!(l=c()).done;){var d=Yi(e,l.value,i);if(d){if(d.overflow)return d;if(d.match)return{match:!0,matchedChars:d.matchedChars};if(!d.partialMatch)throw new Error("Unsupported match result:\n".concat(JSON.stringify(d,null,2)));r=!0}}return r?{partialMatch:!0}:void 0;case"[]":for(var u,p=Gi(t.args);!(u=p()).done;){var h=u.value;if(e[0]===h)return 1===e.length?{match:!0,matchedChars:e}:i?{overflow:!0}:{match:!0,matchedChars:[h]}}return;default:throw new Error("Unsupported instruction tree: ".concat(t))}}function qi(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return zi(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?zi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zi(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function Xi(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Zi=$i("9",15),Ji=/[- ]/,Qi=new RegExp("["+p+"]*\\$1["+p+"]*(\\$\\d["+p+"]*)*$"),Ki=function(){function e(t){t.state;var i=t.metadata;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metadata=i,this.resetFormat()}var t,i;return t=e,i=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(e,t){this.resetFormat(),e?(this.isNANP="1"===e.callingCode(),this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,t){var i=this;if(function(e,t){return"IS_POSSIBLE"===z(e,t)}(t.nationalSignificantNumber,this.metadata))for(var n,o=qi(this.matchingFormats);!(n=o()).done;){var a=n.value,s=Mi(t,a,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return i.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return i.getSeparatorAfterNationalPrefix(e)}});if(s)return this.resetFormat(),this.chosenFormat=a,this.setNationalNumberTemplate(s.replace(/\d/g,xi),t),this.populatedNationalNumberTemplate=s,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(xi),s}return this.formatNationalNumberWithNextDigits(e,t)}},{key:"formatNationalNumberWithNextDigits",value:function(e,t){var i=this.chosenFormat,n=this.chooseFormat(t);if(n)return n===i?this.formatNextNationalNumberDigits(e):this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(e){var t=this,i=e.nationalSignificantNumber,n=e.nationalPrefix,o=e.international,a=i,s=a.length-3;s<0&&(s=0),this.matchingFormats=this.matchingFormats.filter(function(e){return t.formatSuits(e,o,n)&&t.formatMatches(e,a,s)}),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(e,t,i){return!(i&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!i&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(e,t,i){var n=e.leadingDigitsPatterns().length;if(0===n)return!0;i=Math.min(i,n-1);var o=e.leadingDigitsPatterns()[i];if(t.length<3)try{return void 0!==new ji(o).match(t,{allowOverflow:!0})}catch(e){return console.error(e),!0}return new RegExp("^(".concat(o,")")).test(t)}},{key:"getFormatFormat",value:function(e,t){return t?e.internationalFormat():e.format()}},{key:"chooseFormat",value:function(e){for(var t,i=this,n=function(){var n=t.value;return i.chosenFormat===n?"break":Qi.test(i.getFormatFormat(n,e.international))?i.createTemplateForFormat(n,e)?(i.chosenFormat=n,"break"):(i.matchingFormats=i.matchingFormats.filter(function(e){return e!==n}),"continue"):"continue"},o=qi(this.matchingFormats.slice());!(t=o()).done;){if("break"===n())break}return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(e,t){if(!(e.pattern().indexOf("|")>=0)){var i=this.getTemplateForFormat(e,t);return i?(this.setNationalNumberTemplate(i,t),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&Ji.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var i=e.IDDPrefix,n=e.missingPlus;return i?t&&!1===t.spacing?i:i+" ":n?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,i=0,n=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";i<n.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf(xi,t+1),i++;return Oi(this.template,t+1)}}},{key:"setNationalNumberTemplate",value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,xi)+$i(xi,t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var i=t.nationalSignificantNumber,n=t.international,o=t.nationalPrefix,a=t.complexPrefixBeforeNationalSignificantNumber,s=e.pattern();s=s.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var r=Zi.match(s)[0];if(!(i.length>r.length)){var l=new RegExp("^"+s+"$"),c=i.replace(/\d/g,"9");l.test(c)&&(r=c);var d,u=this.getFormatFormat(e,n);if(this.shouldTryNationalPrefixFormattingRule(e,{international:n,nationalPrefix:o})){var p=u.replace(ce,e.nationalPrefixFormattingRule());if(V(e.nationalPrefixFormattingRule())===(o||"")+V("$1")&&(u=p,d=!0,o))for(var h=o.length;h>0;)u=u.replace(/\d/,xi),h--}var m=r.replace(new RegExp(s),u).replace(new RegExp("9","g"),xi);return d||(a?m=$i(xi,a.length)+" "+m:o&&(m=$i(xi,o.length)+this.getSeparatorAfterNationalPrefix(e)+m)),n&&(m=le(m)),m}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,i){for(var n,o=function(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return Ti(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Ti(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(i.split(""));!(n=o()).done;){var a=n.value;if(e.slice(t+1).search(Fi)<0)return;t=e.search(Fi),e=e.replace(Fi,a)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],Oi(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var i=t.international,n=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var o=e.usesNationalPrefix();if(o&&n||!o&&!i)return!0}}}],i&&Xi(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function en(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,o,a=[],s=!0,r=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(e){r=!0,o=e}finally{try{s||null==i.return||i.return()}finally{if(r)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tn(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?tn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function nn(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var on=new RegExp("^["+p+"0-9０-９٠-٩۰-۹]+$","i"),an="(?:[+＋]["+p+"0-9０-９٠-٩۰-۹]*|["+p+"0-9０-９٠-٩۰-۹]+)",sn=new RegExp("[^"+p+"0-9０-９٠-٩۰-۹]+.*$"),rn=/[^\d\[\]]/,ln=function(){function e(t){var i=t.defaultCountry,n=t.defaultCallingCode,o=t.metadata,a=t.onNationalSignificantNumberChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.defaultCountry=i,this.defaultCallingCode=n,this.metadata=o,this.onNationalSignificantNumberChange=a}var t,i;return t=e,(i=[{key:"input",value:function(e,t){var i,n=function(e){var t=en(function(e){var t=function(e){var t,i=e.search(an);if(!(i<0))return"+"===(e=e.slice(i))[0]&&(t=!0,e=e.slice(1)),e=e.replace(sn,""),t&&(e="+"+e),e}(e)||"";return"+"===t[0]?[t.slice(1),!0]:[t]}(e),2),i=t[0],n=t[1];return on.test(i)||(i=""),[i,n]}(e),o=en(n,2),a=o[0],s=o[1],r=V(a);return s&&(t.digits||(t.startInternationalNumber(),r||(i=!0))),r&&this.inputDigits(r,t),{digits:r,justLeadingPlus:i}}},{key:"inputDigits",value:function(e,t){var i=t.digits,n=i.length<3&&i.length+e.length>=3;if(t.appendDigits(e),n&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,i=e.callingCode;return t&&!i}},{key:"extractCountryCallingCode",value:function(e){var t=xe("+"+e.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=t.countryCallingCode,n=t.number;if(i)return e.setCallingCode(i),e.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&rn.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var i=Pe(e,this.metadata),n=i.nationalPrefix,o=i.nationalNumber,a=i.carrierCode;if(o!==e)return this.onExtractedNationalNumber(n,a,o,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=Pe(e,this.metadata),o=n.nationalPrefix,a=n.nationalNumber,s=n.carrierCode;if(a!==t)return this.onExtractedNationalNumber(o,s,a,e,i),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,i,n,o){var a,s,r=n.lastIndexOf(i);if(r>=0&&r===n.length-i.length){s=!0;var l=n.slice(0,r);l!==e&&(a=l)}o({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:s,complexPrefixBeforeNationalSignificantNumber:a}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,function(t){return e.update(t)})||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,i=e.IDDPrefix,n=e.digits;if(e.nationalSignificantNumber,!t&&!i){var o=we(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==o&&o!==n?(e.update({IDDPrefix:n.slice(0,n.length-o.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=Te(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=t.countryCallingCode;if(t.number,i)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(e,t){var i=t.country,n=t.callingCode;e.startInternationalNumber(i,n),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}}])&&nn(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function cn(e){return cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cn(e)}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function un(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var pn=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metadata=new y(i);var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,o,a=[],s=!0,r=!1;try{for(i=i.call(e);!(s=(n=i.next()).done)&&(a.push(n.value),!t||a.length!==t);s=!0);}catch(e){r=!0,o=e}finally{try{s||null==i.return||i.return()}finally{if(r)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return dn(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?dn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this.getCountryAndCallingCode(t),2),o=n[0],a=n[1];this.defaultCountry=o,this.defaultCallingCode=a,this.reset()}var t,i;return t=e,(i=[{key:"getCountryAndCallingCode",value:function(e){var t,i;return e&&("object"===cn(e)?(t=e.defaultCountry,i=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),[t,i]}},{key:"input",value:function(e){var t=this.parser.input(e,this.state),i=t.digits;if(t.justLeadingPlus)this.formattedOutput="+";else if(i){var n;if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(n=this.formatter.format(i,this.state)),void 0===n&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var o=this.state.getNationalDigits();o&&(n=this.formatter.format(o,this.state))}this.formattedOutput=n?this.getFullNumber(n):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var e=this;return this.state=new Ai({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,i){e.metadata.selectNumberingPlan(i,t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new Ki({state:this.state,metadata:this.metadata}),this.parser=new ln({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset(this.defaultCountry,this.defaultCallingCode),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){return this.state.country}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(e){var t=this;if(this.isInternational()){var i=this.state.callingCode;return function(e){return t.formatter.getInternationalPrefixBeforeCountryCallingCode(t.state,{spacing:!!e})+e}(i?e?"".concat(i," ").concat(e):i:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return e}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var e=this.state,t=e.nationalSignificantNumber,i=e.complexPrefixBeforeNationalSignificantNumber,n=e.nationalPrefix,o=t,a=i||n;return a&&(o=a+o),o}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(e?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,xi)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry($e(this.isInternational()?this.state.callingCode:this.defaultCallingCode,this.state.nationalSignificantNumber,this.metadata))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,i=e.callingCode,n=e.country,o=e.nationalSignificantNumber;if(t)return this.isInternational()?i?"+"+i+o:"+"+t:n||i?"+"+(n?this.metadata.countryCallingCode():i)+o:void 0}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,i=e.carrierCode,n=e.callingCode,o=this._getCountry();if(t&&(o||n)){var a=new _e(o||n,t,this.metadata.metadata);return i&&(a.carrierCode=i),a}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])&&un(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function hn(e){return new y(e).getCountries()}function mn(e,t,i){if(t[e])return new _e(e,t[e],i)}function gn(e,t,i){return i||(i=t,t=void 0),new pn(t,i).input(e)}function vn(){return i(He,arguments)}function fn(){return i(Je,arguments)}function Cn(e,i){return vi.call(this,e,i,t)}function Sn(e){return pn.call(this,e,t)}function yn(){return y.call(this,t)}Cn.prototype=Object.create(vi.prototype,{}),Cn.prototype.constructor=Cn,Sn.prototype=Object.create(pn.prototype,{}),Sn.prototype.constructor=Sn,yn.prototype=Object.create(y.prototype,{}),yn.prototype.constructor=yn,e.AsYouType=Sn,e.DIGIT_PLACEHOLDER=xi,e.Metadata=yn,e.ParseError=u,e.PhoneNumberMatcher=Cn,e.default=fn,e.findNumbers=function(){return i(fi,arguments)},e.findPhoneNumbersInText=function(){return i(_i,arguments)},e.formatIncompletePhoneNumber=function(){return i(gn,arguments)},e.formatRFC3966=te,e.getCountries=function(){return i(hn,arguments)},e.getCountryCallingCode=function(){return i(T,arguments)},e.getExampleNumber=function(){return i(mn,arguments)},e.getExtPrefix=function(){return i(A,arguments)},e.isPossiblePhoneNumber=function(){return i(at,arguments)},e.isSupportedCountry=function(){return i(x,arguments)},e.isValidPhoneNumber=function(){return i(tt,arguments)},e.parseDigits=V,e.parseIncompletePhoneNumber=j,e.parsePhoneNumber=vn,e.parsePhoneNumberCharacter=Y,e.parsePhoneNumberFromString=fn,e.parsePhoneNumberWithError=vn,e.parseRFC3966=ee,e.searchNumbers=function(){return i(Ci,arguments)},e.searchPhoneNumbersInText=function(){return i(wi,arguments)},e.validatePhoneNumberLength=function(){return i(ct,arguments)},Object.defineProperty(e,"__esModule",{value:!0})});QueryStringValue="";var iframeParent="",IsWebsiteBuilderCommunication=0,WBBusinessID=0,modalTop=0,getCenterPoint=0,modalHeight=0,isAndroidMobile=null!=navigator.userAgent.match(/Android/i)&&null!=navigator.userAgent.match(/Mobile/i)&&null==navigator.userAgent.match(/Windows/i),isMobileModalOpen=(iOS=/(iPhone)/i.test(navigator.userAgent)&&!window.MSStream,!1),lastPosition=20;function getQueryStringData(e){var t,i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("&"),n=QueryStringValue.toLowerCase();if(void 0!==n&&null!=n&&n.includes("payrollconfiguration")&&QueryStringValue.indexOf("MerchntEmployeeID")>-1&&QueryStringValue.indexOf("payrollconfiguration")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("payrollconfiguration")&&(QueryStringValue.indexOf("isfromcompanyinforeq")>-1||QueryStringValue.indexOf("gnotification")>-1)&&QueryStringValue.indexOf("payrollconfiguration")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("vagaropayroll")&&QueryStringValue.indexOf("BankUuid")>-1&&QueryStringValue.indexOf("vagaropayroll")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("vagaropayroll")&&QueryStringValue.indexOf("FormUUID")>-1&&QueryStringValue.indexOf("vagaropayroll")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("/merchants/settings/employee/profile")&&QueryStringValue.indexOf("FormUUID")>-1&&QueryStringValue.indexOf("/merchants/settings/employee/profile")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("/merchants/settings/employee/profile")&&QueryStringValue.indexOf("IsFromBankInfo")>-1&&QueryStringValue.indexOf("/merchants/settings/employee/profile")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("/merchants/settings/employee/profile")&&QueryStringValue.indexOf("gnotificationtype")>-1&&QueryStringValue.indexOf("/merchants/settings/employee/profile")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("vagaropayroll")&&QueryStringValue.indexOf("gnotificationtype")>-1&&QueryStringValue.indexOf("vagaropayroll")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&n.includes("employees/payroll")&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&decodeURIComponent(n).includes("/merchants/settings/employee/profile/user/rentcollection")&&QueryStringValue.indexOf("empnotificationtype")>-1&&decodeURIComponent(QueryStringValue).indexOf("/merchants/settings/employee/profile/user/rentcollection")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&decodeURIComponent(n).includes("/merchants/settings/employee/profile/user/payroll")&&(QueryStringValue.indexOf("IsFromBankInfo")>-1||QueryStringValue.indexOf("FormUUID")>-1)&&decodeURIComponent(QueryStringValue).indexOf("/merchants/settings/employee/profile/user/payroll")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),n.includes("builder")&&n.includes("facebookshare")&&i.length>3)for(var o=3;o<i.length;o+=1)i[2]=i[2]+"&"+i[o];void 0!==n&&null!=n&&decodeURIComponent(n).includes("/merchants/calendar")&&QueryStringValue.indexOf("isFromEmail")>-1&&QueryStringValue.indexOf("isFromVagaroAi")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?")),void 0!==n&&null!=n&&decodeURIComponent(n).includes("/merchants/settings/premiumfeature/eprescribe")&&QueryStringValue.indexOf("isFromEmail")>-1&&QueryStringValue.indexOf("isFromEprescribeEmailSMS")>-1&&(i=QueryStringValue.slice(QueryStringValue.indexOf("?")+1).split("?"));for(o=0;o<i.length;o+=1){var a=(i[o]||"").split("=");if(a[0]===e)if(a.length>2)for(o=1;o<a.length;o++)t?t+="="+a[o]:t=a[o];else t=a[1]}return void 0!==t&&null!=t&&""!=t?decodeURIComponent(t):""}function hideVagaroComponent(){$("#menuBar").length>0&&$("#menuBar").hide(),$("#topHeadSection").length>0&&$("#topHeadSection").hide(),$(".extra-toggle-nav").length>0&&$(".extra-toggle-nav").css("min-height","0"),$(".menu-normal").length>0&&($(".menu-normal").parent().hide(),$(".menu-normal").hide()),$("#footerdiv").length>0&&$("#footerdiv").hide(),$("#btnBackLogin").length>0&&$("#btnBackLogin").show(),$("#pushdiv").length>0&&$("#pushdiv").hide()}$("#btnBackLogin").on("click",function(){wbc._postMessage('{"eventType": "closeIframe","parentID": "'+iframeParent+'"}'),iframeParent=""}),$("#btnBackSignup").on("click",function(){wbc._postMessage('{"eventType": "closeIframe","parentID": "'+iframeParent+'"}'),iframeParent=""});var isFromBottom=!1,isFromTop=!1;function setBookingDataFromWebsiteBuilder(){if(null!=window.parent&&null!=window.document&&null!=window.parent.postMessage&&(QueryStringValue=""!=window.QueryStringValue?window.QueryStringValue:window.document.URL,"Builder"==getQueryStringData("Type"))){var e=getQueryStringData("Event");if("ServiceBook"==e){o=(o=getQueryStringData("Data")).replaceAll("\\","");var t=JSON.parse(o);if(void 0!==$("#hdnBuilderServiceid")&&isNotNullOrUndefinedString($("#hdnBuilderServiceid").val())&&(t.serviceid=$("#hdnBuilderServiceid").val()),1==t.AddonData)var i=setInterval(function(){if("undefined"!=typeof OnlindBookingResponse&&null!=OnlindBookingResponse&&void 0!==OnlindBookingResponse.lstOnlineServiceParent){clearInterval(i);var e=$.extend(!0,[],OnlindBookingResponse.lstOnlineServiceParent),n=_shopdetail.GetSelectedServiceDetail(e,t.serviceid);$("#txtService1").select2("onSelect",n)}},300);else _shopdetail.SetBookData(t.serviceid,t.providerID,t.styleID,t.styleName,t.bookingDateTime,t.PromotionID,t.EventType,t.isdeeplinkentry,t.PromotionProviderID)}else if("StaffServiceBook"==e){if(void 0!==$("#hdnBuilderSpid")&&isNotNullOrUndefinedString($("#hdnBuilderSpid").val()))var n=$("#hdnBuilderSpid").val();else{o=(o=getQueryStringData("Data")).replaceAll("\\","");t=JSON.parse(o)}_shopdetail.SetBookData("0",void 0!==n?n:t.providerID,"0","","","")}else if("BookNowPortfolio"==e){o=(o=getQueryStringData("Data")).replaceAll("\\","");t=JSON.parse(o);void 0!==$("#hdnBuilderServiceid")&&isNotNullOrUndefinedString($("#hdnBuilderServiceid").val())&&(t.serviceid=$("#hdnBuilderServiceid").val()),void 0!==$("#hdnBuilderSpid")&&isNotNullOrUndefinedString($("#hdnBuilderSpid").val())&&(t.spid=$("#hdnBuilderSpid").val()),void 0!==$("#hdnBuilderStyleid")&&isNotNullOrUndefinedString($("#hdnBuilderStyleid").val())&&(t.styleid=$("#hdnBuilderStyleid").val()),_shopdetail.SetBookData(t.serviceid,t.spid,t.styleid,t.styletitle,"","")}else if("DealBookNow"==e){var o;o=(o=getQueryStringData("Data")).replaceAll("\\","");t=JSON.parse(o);void 0!==$("#hdnBuilderServiceid")&&isNotNullOrUndefinedString($("#hdnBuilderServiceid").val())&&(t.serviceid=$("#hdnBuilderServiceid").val()),void 0!==$("#hdnBuilderPromotionid")&&isNotNullOrUndefinedString($("#hdnBuilderPromotionid").val())&&(t.promotionID=$("#hdnBuilderPromotionid").val()),void 0!==t.Referral&&null!=t.Referral&&isNotNullOrUndefinedString(t.Referral)&&cookieManager.setCookie("Referral","DailyDeal",.0833,cookieManager.defaultPath,cookieManager.defaultDomain,!0,!1),_shopdetail.SetBookData(t.serviceid,"","","",t.bookingDateTime,t.promotionID)}}}function mobileMoreoverlay(e){(iOS||isAndroidMobile)&&$(e).find(".vg-dropdown-child").css({"margin-top":lastPosition})}function setPopupPosi(e){isMobileModalOpen=!1;var t=modalHeight;modalHeight>document.scrollingElement.scrollHeight&&(t=document.scrollingElement.scrollHeight),document.scrollingElement.scrollHeight<$(e).height()+modalTop?$(e).height()<t?(t=$(e).height(),$(e).css({top:"auto",height:t,bottom:"0"})):$(e).css({top:"auto",height:t,bottom:"0"}):$(e).css({top:modalTop,height:t,bottom:"auto"}),wbc._postMessage('{"eventType": "modalPosition","parentID": "'+iframeParent+'"}')}$(document).on("touchstart mousedown",function(e){if(console.log("touchstart"),null!=e.target&&(0==$(".modal").is(":visible")?(console.log(e.target.getBoundingClientRect().top),isFromBottom=window.innerHeight-(e.target.getBoundingClientRect().top+e.target.getBoundingClientRect().height)<=300,isFromTop=e.target.getBoundingClientRect().top<350,lastPosition=e.target.getBoundingClientRect().top,isFromBottom&&void 0!==e.target.classList&&null!=e.target.classList&e.target.classList.contains("spanMore")&&void 0!==e.target.dataset&&null!=e.target.dataset&&void 0!==e.target.dataset.parentdiv&&null!=e.target.dataset.parentdiv&&(lastPosition=$("#"+e.target.dataset.parentdiv)[0].getBoundingClientRect().top)):e.target.getBoundingClientRect().top,"txtEventFromDate"===e.target.id&&(iOS||isAndroidMobile))){var t=setInterval(function(){var e=$(".mobile-datepicker-bottom span").filter(function(){return"Anytime"===$.trim($(this).text())});e.length&&(e.hide(),clearInterval(t))},50);setTimeout(function(){clearInterval(t)},1e3)}}),$(window).on("load",function(){if(null!=window.parent&&null!=window.document&&null!=window.parent.postMessage&&(QueryStringValue=""!=window.QueryStringValue?window.QueryStringValue:window.document.URL,"Builder"==getQueryStringData("Type"))){IsWebsiteBuilderCommunication=1;var e=getQueryStringData("Event");if("StaffClassBook"==e){if(void 0!==$("#hdnBuilderSpid")&&isNotNullOrUndefinedString($("#hdnBuilderSpid").val()))var t=$("#hdnBuilderSpid").val();_shopdetail.SetClassBookDataForClass("undefined"!=t&&""!=t&&null!=t?t:"")}else"ShoppingBag"==e&&ShoppingCartIconClick();hideVagaroComponent(),setWebsiteBuilderHeight(),$(".modal:not(#divLoginNew,#dvRegister,#divForgotPwd)").on("show.bs.modal",function(){console.log("modal-open"),iOS||isAndroidMobile?(isMobileModalOpen=!0,wbc._postMessage('{"eventType": "modalPositionFull","parentID": "'+iframeParent+'"}'),$(this).css({top:modalTop})):setPopupPosi(this),$(window).trigger("resize")}),$(".modal:not(#divLoginNew,#dvRegister,#divForgotPwd)").on("hidden.bs.modal",function(){$(this).css({top:"",bottom:""}),isMobileModalOpen=!1,(iOS||isAndroidMobile)&&wbc._postMessage('{"eventType": "modalPositionFullRemove","parentID": "'+iframeParent+'"}')}),$(".modal:not(#divLoginNew,#dvRegister,#divForgotPwd)").on("shown.bs.modal",function(){}),setInterval(function(){$(window).trigger("resize")},700)}});var isOverlayopen=!1;function SetMobileOverlayes(){(iOS||isAndroidMobile)&&($("#AppProgressModalForClass").is(":visible")||($(".vagaro-datepicker-mobile").is(":visible")||$(".modal:not(#divLoginNew):not(#dvRegister)").is(":visible")?(isMobileModalOpen=!0,wbc._postMessage('{"eventType": "modalDatePickerOpen","parentID": "'+iframeParent+'"}')):(isMobileModalOpen=!1,wbc._postMessage('{"eventType": "modalDatePickerclose","parentID": "'+iframeParent+'"}'))))}function setWebsiteBuilderHeight(){var e=500,t=getQueryStringData("Event");if($("#divLoginNew:visible").length>0||$("#dvRegister:visible").length>0){if(isAndroidMobile||iOS){var i=getQueryStringData("Type");void 0!==i&&null!=i&&"Builder"===i&&$("#divFooterPresent").css({"padding-top":"0"}),$("#btnBackLogin").hide(),$(".login-backbtn").hide(),e=$("#divLoginNew:visible").length>0?600:760,$("#dvRegister:visible").length>0&&(e=810)}else e=$("#divLoginNew:visible").length>0?635:830;$("#divFooterPresent").addClass("nopadtopRec"),$("#divFooterPresent").removeClass("reactmyprofile"),"WBFormsLogin"===t?($("#divFooterPresent").css({position:"relative",top:"-14px"}),$("#btnBackLogin").hide(),$("#btnBackSignup").hide(),wbc._postMessage('{"eventType": "setHeightFormBuilder","height" :'+e+', "width" : "100%", "parentID": "divformsiframe"} ')):wbc._postMessage('{"eventType": "setHeightBuilder","height" :'+e+', "width" : "100%", "parentID": "'+iframeParent+'"} ')}else if($("#dvProfilePage:visible").length>0){var n=[];$("#myAccTopBar ul li").each(function(e,t){var i=$(this).outerHeight();n.push(i)}),sidebarHeight=0;for(let e=0;e<n.length;e++)sidebarHeight+=n[e];var o=$("#myaccount-tab-content").outerHeight(!0),a=0;a=sidebarHeight>o?sidebarHeight+90:o,(iOS||isAndroidMobile)&&(a=o),$("#divFooterPresent").addClass("nopadtopRec"),$("#dvProfilePage").addClass("reactmyprofile"),(e=a)<=500&&(e=650),wbc._postMessage('{"eventType": "setHeightBuilder","height" :'+e+',"width" :"100%","parentID": "'+iframeParent+'"}')}else location.href.toLowerCase().indexOf("facebookpost")>=0?wbc._postMessage('{"eventType": "setFacebookFrame","height" :'+e+',"width" :"100%","parentID": "'+iframeParent+'"}'):((e=null==document.getElementById("divFooterPresent")?0:document.getElementById("divFooterPresent").offsetHeight)<=500&&(e=650),$("#servicenamepopup.modal:visible").length>0&&(e+=200,$("#servicenamepopup").addClass("wbpopupheight")),$("#divFooterPresent").removeClass("nopadtopRec"),$("#divFooterPresent").removeClass("reactmyprofile"),(iOS||isAndroidMobile)&&$(".dw-webkit.mobile-datepicker-bottom").is(":visible")&&"ShoppingBag"==t?wbc._postMessage('{"eventType": "setHeightBuilder","height" :600,"width" :"100%","parentID": "'+iframeParent+'"}'):wbc._postMessage('{"eventType": "setHeightBuilder","height" :'+e+',"width" :"100%","parentID": "'+iframeParent+'"}'));(iOS||isAndroidMobile)&&($("#AppProgressModalForClass").is(":visible")||($(".vagaro-datepicker-mobile").is(":visible")||$(".modal:not(#divLoginNew):not(#dvRegister)").is(":visible")?!0&&wbc._postMessage('{"eventType": "modalDatePickerOpen","parentID": "'+iframeParent+'"}'):wbc._postMessage('{"eventType": "modalDatePickerclose","parentID": "'+iframeParent+'"}')))}function addStyle(e,t,i){$.ajax("/assets/WebsiteBuilder/wbtheme.css",{cache:!0});var n="";n+=":root{",n+="--wbFontFamily:"+e.lblstylefontfamily+";",n+="--wbFontColor:"+e.lblstylecolor+";",n+="--wbFontSize:"+e.lblstylefontsize+";",n+="--wbFontWeight:"+e.lblstylefontweight+";",n+="--wbBtnPrimaryTxtColor: "+e.primarybuttoncolor+";",n+="--wbBtnPrimaryBgColor: "+e.primarybuttonbackgroundcolor+";",n+="--wbBtnPrimaryBdrColor: ''; ",n+="--wbBtnPrimaryRadius:"+e.primarybuttonborderradius+";",n+="--wbBtnPrimaryShadow:"+e.primarybuttonboxshadow+";",n+="--wbBtnPrimaryTxtColorHover: ''; ",n+="--wbBtnPrimaryBgColorHover:"+e.primarybuttonHoverbackgroundcolor+";",n+="--wbBtnPrimaryBdrColorHover: ''; ",n+="--wbBtnPrimaryBgImage: "+e.primarybuttonbackgroundimage+";",n+="--wbBtnSecondaryTxtColor: "+e.secondorybuttonbuttoncolor+";",n+="--wbBtnSecondaryBgColor: "+e.secondorybuttonbuttonbackgroundcolor+";",n+="--wbBtnSecondaryBdrColor: '' ;",n+="--wbBtnSecondaryRadius:"+e.secondorybuttonbuttonborderradius+";",n+="--wbBtnSecondaryShadow:"+e.secondorybuttonbuttonboxshadow+";",n+="--wbBtnSecondaryTxtColorHover: '' ;",n+="--wbBtnSecondaryBgColorHover:"+e.secondorybuttonbuttonHoverbackgroundcolor+";",n+="--wbBtnSecondaryBdrColorHover: '' ;",n+="--wbBtnSecondaryBgImage: "+e.secondorybuttonbuttonbackgroundimage+";",n+="--wbFormInputColor: '' ;",n+="--wbFormInputColorFocus: '' ;",n+="--wbStarColor: "+e.btnratingcolor+";",n+="--wbBodyBg: "+e.glbbackgroundcolor+";",n+="--glbHeadFont:"+e.glbHeadingFonts+";",n+="}",n+="html, body {font-family: var(--wbFontFamily)!important;background-color:var(--wbBodyBg)}.shoppingcart .modal-body, .shoppingcart .modal-content{background-color:var(--wbBodyBg);}.popupwidth542{max-width:100%}.shoppingcart>.popupwidth542.zs-fullwithcc .modal-content{padding:0}.popupwidth542 .modal-title, .shoppingcart ul.list-inline li>label{font-family:var(--glbHeadFont)!important}body .popupwidth542 .cciframe-addresswithcountry .cc-detail-address-input .select2-container-multi .select2-choices .select2-search-field input.select2-input{font-family: var(--wbFontFamily)!important;}.popupwidth542 .modal-footer .btn-primary{background-color: var(--wbBtnPrimaryBgColor)!important;border-color: transparent!important;color: var(--wbBtnPrimaryTxtColor)!important;}.popupwidth542 .modal-footer .btn-primary:hover{background-color: var(--wbBtnPrimaryBgColorHover)!important;border-color: transparent!important;color: var(--wbBtnPrimaryTxtColor)!important;}.popupwidth542 .modal-footer .btn-default{background-color: var(--wbBtnSecondaryBgColor)!important;border-color: transparent!important;color: var(--wbBtnSecondaryTxtColor)!important;}.popupwidth542 .modal-footer .btn-default:hover{background-color: var(--wbBtnSecondaryBgColorHover)!important;border-color: transparent!important;color: var(--wbBtnSecondaryTxtColor)!important;}",$("#hdnBuilderFrameCSS").val(n),n+=".icon-plus-img:before {content:'\\f067'}";var o="<link href='https://fonts.googleapis.com/css2?family="+e.lblstylefontfamily+"' rel='stylesheet'>";$("head").append(o);var a=document.head||document.getElementsByTagName("head")[0];style=document.createElement("style"),style.type="text/css",style.styleSheet?style.styleSheet.cssText=n:style.appendChild(document.createTextNode(n)),a.appendChild(style),$("body").append("<link href='/assets/WebsiteBuilder/wbtheme.css?v=11' rel='stylesheet'>"),iframeParent=t,WBBusinessID=i,wbc._postMessage('{"eventType": "iframeLoaded","parentID": "'+iframeParent+'"}'),$("body,html").addClass("websitebuilder-loaded"),setWebsiteBuilderHeight()}function isNotNullOrUndefinedString(e){return void 0!==e&&null!=e&&""!=e}setInterval(function(){isMobileModalOpen||isOverlayopen||setWebsiteBuilderHeight()},500),checkDivs=setInterval(SetMobileOverlayes,700),$(window).bind("orientationchange",function(e){setWebsiteBuilderHeight()}),function(e){wbc={_postMessage:function(t){try{window.parent!=e&&window.document!=e&&window.parent.postMessage!=e&&window.parent.postMessage(t,"*")}catch(e){console.log(e)}}}}();var VagaroCountryDateFormat=Object.freeze({SmallDate:1,SmallDateWithTime:2,LargeDate:3,LargeDateWithTime:4,MiniDate:5,LongMiniDate:6,ChartDate:7});function countryDateFormat(e,t,i){try{if("undefined"==e||null==e||""==e||"---"==e||"--"==e)return e;void 0!==i&&null!=i&&""!=i||(i=GetBusinessCountry()),2!=i&&(i=1);var n=_countryDateFormat.find(function(e){return e.countryId===parseInt(i)&&e.dateFormatId===t});return null!=n&&""!=n&&n&&""!==n.dateFormat.trim()?"Invalid date"==moment(e).format(n.jsDateFormat)?e:moment(e).format(n.jsDateFormat):e.format("MMM dd, yyyy")}catch(t){console.error(t);try{return e.format("MMM dd, yyyy")}catch(t){return e}}}function DatePickerFormat(e){let t=GetBusinessCountry();return 2!=t&&(t=1),_countryDateFormat.find(function(i){return i.countryId==t&&i.dateFormatId===e}).jsDateFormat}function GetBusinessCountry(){return"undefined"!=typeof bCountryID&&null!=bCountryID&&"0"!=bCountryID&&"0"!=bCountryID?bCountryID:"undefined"!=typeof glbBusinessCountryId&&null!=glbBusinessCountryId&&""!=glbBusinessCountryId&&"0"!=glbBusinessCountryId?glbBusinessCountryId:"undefined"!=typeof _businessCountryId&&null!=_businessCountryId&&""!=_businessCountryId&&"0"!=_businessCountryId?_businessCountryId:"undefined"!=typeof BusinessCountryID&&null!=BusinessCountryID&&"0"!=BusinessCountryID&&"0"!=BusinessCountryID?BusinessCountryID:"undefined"!=typeof countryIdBusDetail&&null!=countryIdBusDetail&&"0"!=countryIdBusDetail&&"0"!=countryIdBusDetail?countryIdBusDetail:void 0!==countryid&&null!=countryid&&"0"!=countryid&&"0"!=countryid?countryid:1}