PageSourceSearch

https://cdn.aaaradiatory.cz/Services/Resource.ashx?key=commonScrip…=2955970132195&domain=www.aaaradiatory.cz

js aaaradiatory.cz collected 2026-10-05 22:19:16 UTC 533,620 bytes, 6,485 lines download raw bytes

1/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */�
vendor: 89,412 bytes, lines 1-2
1
2!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(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,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,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===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]||se.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]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.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!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.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,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.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 n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,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&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.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},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.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 He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(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&&(S.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 S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},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,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.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=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.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)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.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 S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
vendor: 6,025 bytes, lines 2-9
2
3
4;/*! jQuery UI - v1.12.1 - 2016-10-24
5* http://jqueryui.com
6* Includes: widget.js, position.js, keycode.js, unique-id.js, widgets/mouse.js, widgets/slider.js, widgets/tooltip.js
7* Copyright jQuery Foundation and other contributors; Licensed MIT */
8
9(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){t.ui=t.ui||{},t.ui.version="1.12.1";var e=0,i=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var s,n,o=i.call(arguments,1),a=0,r=o.length;r>a;a++)for(s in o[a])n=o[a][s],o[a].hasOwnProperty(s)&&void 0!==n&&(e[s]=t.isPlainObject(n)?t.isPlainObject(e[s])?t.widget.extend({},e[s],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,s){var n=s.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=i.call(arguments,1),l=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(l=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):l=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new s(o,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(i,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=e++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),i),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(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(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})}
vendor: 6,709 bytes, line 9
9,_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,l=t(this),h=l.outerWidth(),c=l.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=h+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),T=e(k.my,l.outerWidth(),l.outerHeight());"right"===n.my[0]?D.left-=h:"center"===n.my[0]&&(D.left-=h/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=T[0],D.top+=T[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:h,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+T[0],u[1]+T[1]],my:n.my,at:n.at,within:b,elem:l})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-h,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:l,left:D.left,top:D.top,width:h,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};h>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>
vendor: 1,690 bytes, line 9
90?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-r-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.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},t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}})
vendor: 13,652 bytes, line 9
9,t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var s=!1;t(document).on("mouseup",function(){s=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),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(e){if(!s){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,n=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),s=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,s=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",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 e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.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=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.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(e){var i,s,n,o,a,r,l,h,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),l=o.offset(),h=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-l.left-o.width()/2,top:e.pageY-l.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(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),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(i),this.handles.css("horizontal"===i?"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(),s=n-1;s>=0;s--)this._change(null,s);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(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,l=this,h=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=100*((l.values(s)-l._valueMin())/(l._valueMax()-l._valueMin())),c["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](c,r.animate),l.options.range===!0&&("horizontal"===l.orientation?(0===s&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}})
vendor: 2,294 bytes, line 9
9,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).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,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<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=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}
9),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){h.of=t,a.is(":hidden")||a.position(h)}var o,a,r,l,h=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.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(s),this.liveRegion.children().hide(),l=t("<div>").html(a.find(".ui-tooltip-content").html()),l.removeAttr("name").find("[name]").removeAttr("name"),l.removeAttr("id").find("[id]").removeAttr("id"),l.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(h.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))
10}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip});
11
12/*!
13 * jQuery UI Touch Punch 0.2.3
14 *
15 * Copyright 2011–2014, Dave Furfero
16 * Dual licensed under the MIT or GPL Version 2 licenses.
17 *
18 * Depends:
19 *  jquery.ui.widget.js
20 *  jquery.ui.mouse.js
21 */
22!function (t) { if (t.support.touch = "ontouchend" in document, t.support.touch) { var e, o = t.ui.mouse.prototype, u = o._mouseInit, n = o._mouseDestroy; o._touchStart = function (o) { !e && this._mouseCapture(o.originalEvent.changedTouches[0]) && (e = !0, this._touchMoved = !1, c(o, "mouseover"), c(o, "mousemove"), c(o, "mousedown")) }, o._touchMove = function (o) { e && (this._touchMoved = !0, c(o, "mousemove")) }, o._touchEnd = function (o) { e && (c(o, "mouseup"), c(o, "mouseout"), this._touchMoved || c(o, "click"), e = !1) }, o._mouseInit = function () { var o = this; o.element.bind({ touchstart: t.proxy(o, "_touchStart"), touchmove: t.proxy(o, "_touchMove"), touchend: t.proxy(o, "_touchEnd") }), u.call(o) }, o._mouseDestroy = function () { var o = this; o.element.unbind({ touchstart: t.proxy(o, "_touchStart"), touchmove: t.proxy(o, "_touchMove"), touchend: t.proxy(o, "_touchEnd") }), n.call(o) } } function c(o, t) { if (!(1 < o.originalEvent.touches.length)) { o.preventDefault(); var e = o.originalEvent.changedTouches[0], u = document.createEvent("MouseEvents"); u.initMouseEvent(t, !0, !0, window, 1, e.screenX, e.screenY, e.clientX, e.clientY, !1, !1, !1, !1, 0, null), o.target.dispatchEvent(u) } } }(jQuery);
23
24// QUICK FIX: slider nefunguje na mobilních zaøízeních. Tento skript dìlá náhradu touch eventù za mouse eventy. - 131606
25!$((function () { jQuery(document).on("touchstart", ".ui-slider .ui-slider-handle", (function (e) { let t = e.touches[0] || e; jQuery(this).addClass("ui-state-hover").addClass("ui-state-active").addClass("ui-state-focus"); var r = new MouseEvent("mousedown", { screenX: t.screenX, screenY: t.screenY, clientX: t.clientX, clientY: t.clientY, relatedTarget: t.target }); Object.defineProperty(r, "target", { value: t.target, enumerable: !0 }), Object.defineProperty(r, "currentTarget", { value: t.target, enumerable: !0 }), jQuery(this).parent().slider("instance")._mouseDown(r) })), jQuery(document).on("touchend", ".ui-slider .ui-slider-handle", (function (e) { let t = e.touches[0] || e; jQuery(this).removeClass("ui-state-hover").removeClass("ui-state-active").removeClass("ui-state-focus"); var r = new MouseEvent("mouseup", { screenX: t.screenX, screenY: t.screenY, clientX: t.clientX, clientY: t.clientY, relatedTarget: t.target }); Object.defineProperty(r, "target", { value: t.target, enumerable: !0 }), Object.defineProperty(r, "currentTarget", { value: t.target, enumerable: !0 }), jQuery(this).parent().slider("instance")._mouseUp(r) })), jQuery(document).on("touchmove", ".ui-slider .ui-slider-handle", (function (e) { let t = e.touches[0] || e; var r = new MouseEvent("mousemove", { screenX: t.screenX, screenY: t.screenY, clientX: t.clientX, clientY: t.clientY, relatedTarget: t.target, bubbles: !0, cancelable: !0 }); Object.defineProperty(r, "target", { value: t.target, enumerable: !0 }), Object.defineProperty(r, "currentTarget", { value: t.target, enumerable: !0 }), jQuery(this).parent().slider("instance")._mouseMove(r) })) }));
26;/**
27 * jQuery lightBox plugin
28 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
29 * and adapted to me for use like a plugin from jQuery.
30 * @name jquery-lightbox-0.5.js
31 * @author Leandro Vieira Pinho - http://leandrovieira.com
32 * @version 0.5
33 * @date April 11, 2008
34 * @category jQuery plugin
35 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
36 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
37 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
38 */
39
40// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
41(function($) {
42	/**
43	 * $ is an alias to jQuery object
44	 *
45	 */
46	$.fn.lightBox = function(settings) {
47		// Settings to configure the jQuery lightBox plugin how you like
48		settings = jQuery.extend({
49			// Configuration related to overlay
50			overlayBgColor: 		'#000',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
51			overlayOpacity:			0.8,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
52			// Configuration related to navigation
53			fixedNavigation:		true,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.			
54			// Configuration related to container image box
55			containerBorderSize:	10,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
56			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
57			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
58			txtImage:				'Image',	// (string) Specify text "Image"
59			txtOf:					'of',		// (string) Specify text "of"
60			// Configuration related to keyboard navigation
61			keyToClose:				'c',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
62			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image
63			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.
64			// Don´t alter these variables in any way
65			imageArray:				[],
66			activeImage:            0,
67			fitToWindow:            true,       // option to fit preview to window size if the image is so big
68			printingImageID:        ''          // trickomanie - ID obrazku s potiskem
69		},settings);
70		// Caching the jQuery object with all elements matched
71		var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
72		/**
73		 * Initializing the plugin calling the start function
74		 *
75		 * @return boolean false
76		 */
77		function _initialize() {
78			_start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
79			return false; // Avoid the browser following the link
80		}
81		/**
82		 * Start the jQuery lightBox plugin
83		 *
84		 * @param object objClicked The object (link) whick the user have clicked
85		 * @param object jQueryMatchedObj The jQuery object with all elements matched
86		 */
87		function _start(objClicked,jQueryMatchedObj) {
88			// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
89			$('embed, object, select').css({ 'visibility' : 'hidden' });
90			// Call the function to create the markup structure; style some elements; assign events in some elements.
91			_set_interface();
92			// Unset total images in imageArray
93			settings.imageArray.length = 0;
94			// Unset image active information
95			settings.activeImage = 0;
96			// We have an image set? Or just an image? Let´s see it.
97			if ( jQueryMatchedObj.length == 1 ) {
98				settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));
99			} else {
100				// Add an Array (as many as we have that match the objClicked 'rel' attr), with href and title atributes, inside the Array that storage the images references		
101                for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
102	                if(jQueryMatchedObj[i].getAttribute('rel')==objClicked.getAttribute('rel')) {
103		                settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
104	                }
105                }
106			}
107		    // DH - Only unique images
108			var uniqueImages = [];
109			var imagesSorted = settings.imageArray;
110			for (var index = 0; index < imagesSorted.length; index++) {
111			    var img1 = imagesSorted[index][0]; //image name
112			    //var img2 = imagesSorted[index + 1][0];
113			    var firstImgIndex = -1;
114			    for (var index2 = imagesSorted.length-1; index2 >= 0; index2--) {
115			        if (img1 == imagesSorted[index2][0]) firstImgIndex = index2;
116			    }
117			    if (index == firstImgIndex) uniqueImages.splice(firstImgIndex, 0, imagesSorted[index]);
118			}
119			settings.imageArray = uniqueImages;
120		    // end of unique images
121		    
122			while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
123				settings.activeImage++;
124			}
125			// Call the function that prepares image exibition
126			_set_image_to_view();
127		}
128		
129		function _set_interface() {
130		    // Apply the HTML markup into body tag
131		    /// DH - additional img for printing
132		    if (settings.printingImageID != '') {
133		        $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><img id="printing-image" class="printing" src="" /><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"></a></div></div></div></div>');
134		    } else {
135		        $('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><img id="lightbox-image"><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"></a></div></div></div></div>');
136		    }
137		    // Get page sizes
138			var arrPageSizes = ___getPageSize();
139			// Style overlay and show it
140			$('#jquery-overlay').css({
141				backgroundColor:	settings.overlayBgColor,
142				opacity:			settings.overlayOpacity,
143				width:				arrPageSizes[0],
144				height:				arrPageSizes[1]
145			}).fadeIn();
146			// Get page scroll
147			var arrPageScroll = ___getPageScroll();
148			// Calculate top and left offset for the jquery-lightbox div object and show it
149			$('#jquery-lightbox').css({
150				top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
151				left:	arrPageScroll[0]
152			}).show();
153			// Assigning click events in elements to close overlay
154			$('#jquery-overlay,#jquery-lightbox').click(function() {
155				_finish();									
156			});
157			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
158			$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
159				_finish();
160				return false;
161			});
162			// If window was resized, calculate the new overlay dimensions
163			$(window).resize(function() {
164				// Get page sizes
165				var arrPageSizes = ___getPageSize();
166				// Style overlay and show it
167				$('#jquery-overlay').css({
168					width:		arrPageSizes[0],
169					height:		arrPageSizes[1]
170				});
171				// Get page scroll
172				var arrPageScroll = ___getPageScroll();
173				// Calculate top and left offset for the jquery-lightbox div object and show it
174				$('#jquery-lightbox').css({
175					top:	arrPageScroll[1] + (arrPageSizes[3] / 10),
176					left:	arrPageScroll[0]
177				});
178			});
179		}
180		/**
181		 * Prepares image exibition; doing a image´s preloader to calculate it´s size
182		 *
183		 */
184		function _set_image_to_view() { // show the loading
185			// Show the loading
186			$('#lightbox-loading').show();
187			if ( settings.fixedNavigation ) {
188				$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
189			} else {
190				// Hide some elements
191				$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
192			}
193			// Image preload process
194			var objImagePreloader = new Image();
195			objImagePreloader.onload = function() {
196			    $('#lightbox-image').attr('src', settings.imageArray[settings.activeImage][0]);
197
198			    // DH - set printing image src
199			    if (settings.printingImageID != '') {
200			        var printingImageSrc = $('#' + settings.printingImageID).attr('src');
201			        if (printingImageSrc != null && printingImageSrc != '') {
202			            $('#printing-image').attr('src', printingImageSrc);
203			        }
204			    }
205			    // Perfomance an effect in the image container resizing it
206                // 7684 - obrazek maximalne ve velikosti okna prohlizece. Misto metody _resize_container_image_box() volat _adjust_image_size()
207			    //_resize_container_image_box(objImagePreloader.width, objImagePreloader.height);
208			    _adjust_image_size(objImagePreloader);
209				//	clear onLoad, IE behaves irratically with animated gifs otherwise
210				objImagePreloader.onload=function(){};
211			};
212			objImagePreloader.src = settings.imageArray[settings.activeImage][0];
213		};
214		/**
215		 * Perfomance an effect in the image container resizing it
216		 *
217		 * @param integer intImageWidth The image´s width that will be showed
218		 * @param integer intImageHeight The image´s height that will be showed
219		 */
220		function _resize_container_image_box(intImageWidth,intImageHeight) {
221			// Get current width and height
222			var intCurrentWidth = $('#lightbox-container-image-box').width();
223			var intCurrentHeight = $('#lightbox-container-image-box').height();
224			// Get the width and height of the selected image plus the padding
225			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image´s width and the left and right padding value
226			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image´s height and the left and right padding value
227			// Diferences
228			var intDiffW = intCurrentWidth - intWidth;
229			var intDiffH = intCurrentHeight - intHeight;
230			// Perfomance the effect
231			$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
232			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
233				if ( $.browser.msie ) {
234					___pause(250);
235				} else {
236					___pause(100);	
237				}
238			} 
239			$('#lightbox-container-image-data-box').css({ width: intImageWidth });
240			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
241		};
242	    /**
243        * 
244        */
245		function _adjust_image_size(objImagePreloader) {
246		    // get image size
247		    var imgWidth = objImagePreloader.width;
248		    var imgHeight = objImagePreloader.height;
249
250		    var arrayPageSize = ___getPageSize();
251		    // calculate proportions
252		    var imageProportion = imgWidth / imgHeight;
253		    var winProportion = arrayPageSize[2] / arrayPageSize[3];
254		    if (imageProportion > winProportion) {
255		        // calculate max width base on page width
256		        var maxWidth = arrayPageSize[2] - (settings.containerBorderSize * 2) - (arrayPageSize[2] / 10);
257		        var maxHeight = Math.round(maxWidth / imageProportion);
258		    } else {
259		        // calculate max height base on page height
260		        var maxHeight = arrayPageSize[3] - (settings.containerBorderSize * 2) - (arrayPageSize[3] / 10) - 100;
261		        var maxWidth = Math.round(maxHeight * imageProportion);
262		    }
263		    if (imgWidth > maxWidth || imgHeight > maxHeight) {
264		        imgWidth = maxWidth;
265		        imgHeight = maxHeight;
266		    }
267		    $('#lightbox-image').attr('width', imgWidth);
268		    $('#lightbox-image').attr('height', imgHeight);
269		    _resize_container_image_box(imgWidth, imgHeight);
270		};
271		/**
272		 * Show the prepared image
273		 *
274		 */
275		function _show_image() {
276			$('#lightbox-loading').hide();
277			$('#lightbox-image').fadeIn(function() {
278				_show_image_data();
279				_set_navigation();
280			});
281			_preload_neighbor_images();
282		};
283		/**
284		 * Show the image information
285		 *
286		 */
287		function _show_image_data() {
288			$('#lightbox-container-image-data-box').slideDown('fast');
289			$('#lightbox-image-details-caption').hide();
290			if ( settings.imageArray[settings.activeImage][1] ) {
291				$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
292			}
293			// If we have a image set, display 'Image X of X'
294			if ( settings.imageArray.length > 1 ) {
295				$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();
296			}		
297		}
298		/**
299		 * Display the button navigations
300		 *
301		 */
302		function _set_navigation() {
303			$('#lightbox-nav').show();
304
305			// Instead to define this configuration in CSS file, we define here. And it´s need to IE. Just.
306			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext');
307			
308			// Show the prev button, if not the first image in set
309			if ( settings.activeImage != 0 ) {
310				if ( settings.fixedNavigation ) {
311					$('#lightbox-nav-btnPrev')
312						.off()
313						.on('click',function() {
314							settings.activeImage = settings.activeImage - 1;
315							_set_image_to_view();
316							return false;
317						});
318				} else {
319					// Show the images button for Next buttons
320					$('#lightbox-nav-btnPrev').off().hover(function() {
321						
322					},function() {
323						
324					}).show().on('click',function() {
325						settings.activeImage = settings.activeImage - 1;
326						_set_image_to_view();
327						return false;
328					});
329				}
330			}
331			
332			// Show the next button, if not the last image in set
333			if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
334				if ( settings.fixedNavigation ) {
335					$('#lightbox-nav-btnNext')
336						.off()
337						.on('click',function() {
338							settings.activeImage = settings.activeImage + 1;
339							_set_image_to_view();
340							return false;
341						});
342				} else {
343					// Show the images button for Next buttons
344					$('#lightbox-nav-btnNext').off().hover(function() {
345						
346					},function() {
347						
348					}).show().on('click',function() {
349						settings.activeImage = settings.activeImage + 1;
350						_set_image_to_view();
351						return false;
352					});
353				}
354			}
355			// Enable keyboard navigation
356			_enable_keyboard_navigation();
357		}
358		/**
359		 * Enable a support to keyboard navigation
360		 *
361		 */
362		function _enable_keyboard_navigation() {
363			$(document).keydown(function(objEvent) {
364				_keyboard_action(objEvent);
365			});
366		}
367		/**
368		 * Disable the support to keyboard navigation
369		 *
370		 */
371		function _disable_keyboard_navigation() {
372			$(document).off();
373		}
374		/**
375		 * Perform the keyboard actions
376		 *
377		 */
378		function _keyboard_action(objEvent) {
379			// To ie
380			if ( objEvent == null ) {
381				keycode = event.keyCode;
382				escapeKey = 27;
383			// To Mozilla
384			} else {
385				keycode = objEvent.keyCode;
386				escapeKey = objEvent.DOM_VK_ESCAPE;
387			}
388			// Get the key in lower case form
389			key = String.fromCharCode(keycode).toLowerCase();
390			// Verify the keys to close the ligthBox
391			if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
392				_finish();
393			}
394			// Verify the key to show the previous image
395			if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
396				// If we´re not showing the first image, call the previous
397				if ( settings.activeImage != 0 ) {
398					settings.activeImage = settings.activeImage - 1;
399					_set_image_to_view();
400					_disable_keyboard_navigation();
401				}
402			}
403			// Verify the key to show the next image
404			if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
405				// If we´re not showing the last image, call the next
406				if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
407					settings.activeImage = settings.activeImage + 1;
408					_set_image_to_view();
409					_disable_keyboard_navigation();
410				}
411			}
412		}
413		/**
414		 * Preload prev and next images being showed
415		 *
416		 */
417		function _preload_neighbor_images() {
418			if ( (settings.imageArray.length -1) > settings.activeImage ) {
419				objNext = new Image();
420				objNext.src = settings.imageArray[settings.activeImage + 1][0];
421			}
422			if ( settings.activeImage > 0 ) {
423				objPrev = new Image();
424				objPrev.src = settings.imageArray[settings.activeImage -1][0];
425			}
426		}
427		/**
428		 * Remove jQuery lightBox plugin HTML markup
429		 *
430		 */
431		function _finish() {
432			$('#jquery-lightbox').remove();
433			$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
434			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
435			$('embed, object, select').css({ 'visibility' : 'visible' });
436		}
437		/**
438		 / THIRD FUNCTION
439		 * getPageSize() by quirksmode.com
440		 *
441		 * @return Array Return an array with page width, height and window width, height
442		 */
443		function ___getPageSize() {
444			var xScroll, yScroll;
445			if (window.innerHeight && window.scrollMaxY) {	
446				xScroll = window.innerWidth + window.scrollMaxX;
447				yScroll = window.innerHeight + window.scrollMaxY;
448			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
449				xScroll = document.body.scrollWidth;
450				yScroll = document.body.scrollHeight;
451			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
452				xScroll = document.body.offsetWidth;
453				yScroll = document.body.offsetHeight;
454			}
455			var windowWidth, windowHeight;
456			if (self.innerHeight) {	// all except Explorer
457				if(document.documentElement.clientWidth){
458					windowWidth = document.documentElement.clientWidth; 
459				} else {
460					windowWidth = self.innerWidth;
461				}
462				windowHeight = self.innerHeight;
463			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
464				windowWidth = document.documentElement.clientWidth;
465				windowHeight = document.documentElement.clientHeight;
466			} else if (document.body) { // other Explorers
467				windowWidth = document.body.clientWidth;
468				windowHeight = document.body.clientHeight;
469			}	
470			// for small pages with total height less then height of the viewport
471			if(yScroll < windowHeight){
472				pageHeight = windowHeight;
473			} else { 
474				pageHeight = yScroll;
475			}
476			// for small pages with total width less then width of the viewport
477			if(xScroll < windowWidth){	
478				pageWidth = xScroll;		
479			} else {
480				pageWidth = windowWidth;
481			}
482			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
483			return arrayPageSize;
484		};
485		/**
486		 / THIRD FUNCTION
487		 * getPageScroll() by quirksmode.com
488		 *
489		 * @return Array Return an array with x,y page scroll values.
490		 */
491		function ___getPageScroll() {
492			var xScroll, yScroll;
493			if (self.pageYOffset) {
494				yScroll = self.pageYOffset;
495				xScroll = self.pageXOffset;
496			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
497				yScroll = document.documentElement.scrollTop;
498				xScroll = document.documentElement.scrollLeft;
499			} else if (document.body) {// all other Explorers
500				yScroll = document.body.scrollTop;
501				xScroll = document.body.scrollLeft;	
502			}
503			arrayPageScroll = new Array(xScroll,yScroll);
504			return arrayPageScroll;
505		};
506		 /**
507		  * Stop the code execution from a escified time in milisecond
508		  *
509		  */
510		 function ___pause(ms) {
511			var date = new Date(); 
512			curDate = null;
513			do { var curDate = new Date(); }
514			while ( curDate - date < ms);
515		 };
516		// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
517		return this.off('click').click(_initialize);
518	};
519})(jQuery); // Call and execute the function immediately passing the jQuery object
520;var BsTools=function(){var t=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g}
520,{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u
5201EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],n;this.removeAccent=function(i){n||(n=t);for(var r=0;r<n.length;r++)i=i.replace(n[r].letters,n[r].base);return i}},tools=new BsTools
521;/*
522* Decorator pro select verze 1.01
523*/
524
525; (function ($) {
526    var pluginName = 'bsDropdown',
527        cssPrefix = 'bs-dropdown',
528        gid = 0,
529        init = function (element, options) {
530            var options = $.extend({
531                debug: false, //v debug módu se zobrazí i původní select
532                onClosed: nop, //akce po zavření
533                onChanged: nop, //akce po změně vybrané hodnoty
534                emptyText: "", //text pokud není nic vybrané
535                allText: "(vše)",   //text pro checkbox "vybrat vše"
536                mobile: false  // mobilní verze
537            }, options);
538
539            function nop() { }
540
541            /*
542            <div class="bs-dropdown">
543                <div class="inner">
544                    <div class="label">vybraná hodnota</div>
545                    <span>&nbsp;</span>>
546                </div>
547
548                <div class='popup'>
549                    <div class='option'>hodnota A</div>
550                    <div class='option'>hodnota B</div>
551                </div>
552
553            </div>
554            */
555            if (options.mobile) cssPrefix += " mobile";
556            var id = "bsdropdown" + gid++;
557            var $original = $(element);
558            var $outer = $("<div class='" + cssPrefix + " " + $original.attr("class") + "' id='"+id+"' ></div>");
559            var $inner = $("<div class='inner'></div>").appendTo($outer);
560            var $label = $("<div class='label'></div>").appendTo($inner);
561            //$("<span>&nbsp;</span>").appendTo($inner);
562            //v případě potřeby focusu a ovládání klávesami, je možné přidat skrytý textbox
563            //$("<div style='width:1px;'><input type='text'/></div>").appendTo($inner);                        
564            var $originalOptions = $("option", $original);
565            var $popup;
566
567            //nastavíme šířku dle šířky původního selectu (než ho skryjeme)
568            //$outer.css("width", $original.css("width"));            
569
570            //pokud nejsme v debugu, skryjeme původní select
571            if (!options.debug) {
572                if (options.mobile) {
573                    // v mobilní verzi chceme používat nativní dropdown telefonu
574                    // fígl je v tom, že původní nativní dropdown napozicujeme nad javascriptový dropdown a nastavíme neprůhlednost na 0
575                    $original.css({ position: "absolute", "z-index": getZ() + 1, opacity: 0 });
576                } else {
577                    $original.hide();
578                }
579            }
580
581            //pokud se jedná o multiselect tak se v dropdownu zobrazí checkboxy
582            var isMultiple = $original.attr("multiple");
583            if (isMultiple) $outer.addClass("multiple");
584            else $outer.addClass("single");
585
586            var disabled = $original.attr("disabled");
587            if (disabled) {
588                $outer.addClass("disabled");
589            }
590
591            //do DOMu zapíšeme vygenerované html
592            $original.after($outer);
593            $original.attr("data-proxy", id); // pomocí tohoto atributu jsme schopni nalézt nový element, který tento zastupuje 
594
595            function updateLabel() {
596                /// <summary>
597                /// Zaktualizuje text, dle vybraných hodnot.
598                /// </summary>
599
600                var text = "";
601                //pokud je to multiselect
602                if (isMultiple) {
603                    //tak sestavíme text ze všech vybraných hodnot
604                    $originalOptions.each(function () {
605                        var $option = $(this);
606                        if ($option.is(":selected")) {
607                            if (text) text += ", ";
608                            text += $option.text();
609                        }
610                    });
611                }
612                    //jinak dáme to textu přímo vybranou hodnotu
613                else {
614                    text = $(":selected", $original).text();
615                }
616
617                //nastavíme tool-tip
618                // pokud text obsahuje html znaky, odebrat je pro tooltip
619                $outer.attr("title", text.replace(/<(?:.|\n)*?>/gm, ""));
620
621                //pokud je text prázdný, tak zapíšeme prázdný text dle nastavení
622                if (!text) text = options.emptyText;
623
624                //pokud je i tak text prázdný, tak zapíšeme aspoň tvrdou mezeru, jinak by se element zcuckl
625                if (!text) text = "&nbsp;";
626                $label.html(text);
627
628                //nastavíme šířku labelu, protože musí být pozicován absolutně, tak aby fungoval overflow
629                //$label.css("width", $inner.width());
630
631                // u mobilní verze nastavíme velikost originálního popupu
632                if (options.mobile) {
633                    $original.width($outer.width());
634                    $original.height($outer.height());
635                }
636            }
637
638            function createPopup() {
639                /// <summary>
640                /// Vytvoří popup, který se zobrazí po kliku.
641                /// </summary>
642                $popup = $("<div class='popup' />");
643
644                /* TODO
645                // pro mobilní zařízení přidáme hlavičku s close buttonem
646                if (options.mobile) {
647                    var $header = $("<div class='header' />").appendTo($popup);
648                }*/
649
650                $popup.appendTo($outer);
651
652                var $options = $("<div class='options' />").appendTo($popup);
653
654                // u multiselectu vytvoříme škrtátko "vše"
655                if (isMultiple && options.allText) {
656                    var $option = $("<div class='option all'></div>").appendTo($options);
657                    var id = "bs-dropdown_cb_" + gid++;
658                    var $checkbox = $("<input id='" + id + "' type='checkbox'/>");
659                    var allChecked = true;
660                    $originalOptions.each(function () {
661                        if (allChecked && !$(this).prop("selected")) allChecked = false;
662                    });
663                    if (allChecked) $checkbox.prop("checked", true);
664                    //...abychom mohli vytvořit label a label byl kliklatelný
665                    var $checkLabel = $("<label for='" + id + "'></label>");
666                    $checkbox.appendTo($option);
667                    $checkLabel.appendTo($option);
668                    $checkLabel.text(options.allText);
669                    $checkbox.change(function () {
670                        var isChecked = $(this).prop("checked");
671                        $originalOptions.prop("selected", isChecked);
672                        $originalOptions.change();
673                        updateOptionsState();
674                    });
675                }
676
677                //dle všech možností z originálního selectu vytvoříme nové
678                $originalOptions.each(function () {
679                    var $originalOption = $(this);
680                    var $option = $("<div />").appendTo($options);
681                    var css = "option";
682                    var originalClass = $originalOption.attr("class");
683                    if (originalClass) css += " " + originalClass;
684                    $option.attr("class", css);
685
686                    //do vlastních dat zapíšeme odkaz na novou položku seznamu abychom s ní mohli pracovat
687                    $originalOption.data("option", $option);
688
689                    //pokud je to multiselect, tak vytvoříme checkboxy
690                    if (isMultiple) {
691                        //vytvoříme unikátní id pro checkbox...
692                        var id = "bs-dropdown_cb_" + gid++;
693                        var $checkbox = $("<input id='" + id + "' type='checkbox'/>");
694                        //...abychom mohli vytvořit label a label byl kliklatelný
695                        var $checkLabel = $("<label for='" + id + "'></label>");
696                        $checkbox.appendTo($option);
697                        $checkLabel.appendTo($option);
698                        $checkLabel.text($originalOption.text());
699                        $option.data("checkbox", $checkbox);
700
701                        //při změně zatržení checkboxu
702                        $checkbox.change(function () {
703                            var isChecked = $(this).prop("checked");
704                            //vybereme/zrušíme hodnotu na původním selectu
705                            selectOption($option, $originalOption, isChecked, true);
706                            //a na původním selectu vyvoláme událost change, tím dojde i k aktualizaci našeho labelu
707                            $original.change();
708                            //popup necháme otevřený
709                            //close();
710                        });
711                    }
712                        //jinak zapíšeme jen text hodnoty
713                    else {
714                        // $option.text($originalOption.text()); zakomentováno viz 24348, kdyby byl problém s rozbitým html, tak je třeba řešit na úrovni Tags.AddItems, tj. přidat parametr encode
715                        $option.html($originalOption.text());
716                        //při kliknutí na hodnotu
717                        $option.click(function () {
718                            if ($originalOption.is(":disabled")) return;
719                            //vybereme/zrušíme hodnotu na původním selectu
720                            selectOption($option, $originalOption, true, true);
721                            //a na původním selectu vyvoláme událost change, tím dojde i k aktualizaci našeho labelu
722                            $original.change();
723                            //a zavřeme popup
724                            close();
725                        });
726                    }
727                });
728
729                /* TODO
730                // pro mobilní zařízení přidáme patičku se scroll buttonem
731                if (options.mobile) {
732                    var $footer = $("<div class='footer' />").appendTo($popup);
733                }*/
734
735
736                // 18007 - navigace pomocí kláves
737                // pro funkčnost je nutné, aby byl na zobrazeném popupu focus!
738                $popup.focus();
739                var searchQuery = '';
740                $(window).keydown(keyboardHandler2);
741                $(window).keypress(keyboardHandler1);
742
743                function keyboardHandler1(e) {
744
745                    // znak vzít z kódu stisknuté klávesy
746                    searchQuery += getChar(e);
747                    var $selected = $options.find(".option");
748                    var keyCode = e.which;
749                    if (!isKeyIgnored(keyCode)) {
750                        clearFiltered();
751
752                        var $filtered = $selected.filter(function () {
753                            var optValue = $(this).text().toLowerCase();
754                            return optValue.substring(0, searchQuery.length) == searchQuery.toLowerCase() || AnyWordStartsWith(optValue, searchQuery.toLowerCase());
755                        });
756
757                        scrollToFiltered($filtered);
758                    }
759
760                    // po jedné vteřině nečinnosti vyčistit hledaný řetězec
761                    setTimeout(function () { clearSearchQuery(); }, 1000);
762
763                }
764
765                function AnyWordStartsWith(text, searchQuery) {
766
767                    var words = text.split(" ");
768                    for (i = 0; i < words.length; i++) {
769                        if (words[i].substring(0, searchQuery.length) == searchQuery.toLowerCase()) return true;
770                    }
771                    return false;
772                }
773
774                function keyboardHandler2(e) {
775
776                    if (!isKeyIgnored(e.which)) return;
777
778                    var markedIndex = 0;
779                    var $filtered = null;
780                    var filteredOptions = $options.find(".filtered");
781                    var $selected = $options.find(".option");
782
783                    // šipka dolu
784                    if (e.which == 40) {
785                        // zkusit zda jsou filtrované
786                        markedIndex = $options.find(".filtered").index();
787                        if (filteredOptions.length > 1) {
788                            clearFiltered();
789                            // označit první filtrovaný
790                            $filtered = $($selected[markedIndex]);
791                        }
792                        else if (filteredOptions.length == 1) {
793                            clearFiltered();
794                            // označit další v pořadí
795                            if ($selected.length > markedIndex) {
796                                $filtered = $($selected[markedIndex + 1]);
797                            }
798                            // zůstat na posledním elementu
799                            if ($selected.length == markedIndex + 1) {
800                                $filtered = $($selected[$selected.length - 1]);
801                            }
802                        }
803
804                        scrollToFiltered($filtered);
805                        // zabránit skrolování celého okna při stisku šipky
806                        e.preventDefault();
807                        return;
808                    }
809
810                    // šipka nahoru
811                    if (e.which == 38) {
812                        // zkusit zda jsou filtrované
813                        markedIndex = $options.find(".filtered").index();
814                        if (filteredOptions.length > 1) {
815                            clearFiltered();
816                            // označit první filtrovaný
817                            $filtered = $($selected[markedIndex]);
818                        }
819                        else if (filteredOptions.length == 1) {
820                            clearFiltered();
821                            // označit další v pořadí
822                            if ($selected.length > markedIndex) {
823                                $filtered = $($selected[markedIndex - 1]);
824                            }
825                            // zůstat na prvním elementu
826                            if (markedIndex == 0) {
827                                $filtered = $($selected[0]);
828                            }
829                        }
830
831                        scrollToFiltered($filtered);
832                        // zabránit skrolování celého okna při stisku šipky
833                        e.preventDefault();
834                        return;
835                    }
836
837                    // po stisknutí enteru
838                    if (e.which == 13) {
839                        markedIndex = $options.find(".filtered").index();
840                        if (markedIndex > 0) {
841                            var $markedOption = $selected[markedIndex];
842                            var $originalSelectOption = $originalOptions[markedIndex];
843
844                            if (isMultiple) {
845                                // u multiselectu je pridany checkbox "vše"
846                                $originalSelectOption = $originalOptions[markedIndex - 1];
847                                $checkbox = $($markedOption).find("input");
848                                $($markedOption).data("checkbox", $checkbox);
849                                var isChecked = $checkbox.prop("checked");
850                                selectOption($($markedOption), $($originalSelectOption), !isChecked, true);
851                                $checkbox.change();
852                            } else {
853                                selectOption($($markedOption), $($originalSelectOption), true, true);
854                                $markedOption.click();
855                            }
856
857                            // zabránit události browseru
858                            e.preventDefault();
859                            return;
860                        }
861                    }
862
863                    // po stisku esc
864                    if (e.keyCode == 27 || e.which == 27) {
865                        // vyčistit hledaný řetězec a odebrat class pro filtrované
866                        clearSearchQuery();
867                        clearFiltered();
868                        // pokud je mutiple tak klávesou esc skryjeme popup a tím dojde k refreshi
869                        if (isMultiple) {
870                            close();
871                        }
872                    }
873                }
874
875                // odskroluje na první element z vložené kolekce
876                function scrollToFiltered($filtered) {
877                    if ($($filtered).length > 0) {
878                        $filtered.addClass('filtered');
879                        var $first = $filtered[0];
880                        $($popup).animate({
881                            scrollTop: $first.offsetTop
882                        }, 200);
883                    }
884                }
885
886                function isKeyIgnored(keyCode) {
887                    switch (keyCode) {
888                        // enter
889                        case 13:
890                            // šipka dolu
891                        case 38:
892                            // esc
893                        case 27:
894                            // šipka nahoru
895                        case 40:
896                            return true;
897
898                        default:
899                            return false;
900                    }
901                }
902
903                // událost musí být keypress
904                function getChar(event) {
905                    if (event.which == null) {
906                        return String.fromCharCode(event.keyCode); // IE
907                    } else if (event.which != 0 && event.charCode != 0) {
908                        return String.fromCharCode(event.which); // the rest
909                    } else {
910                        return ""; // special key
911                    }
912                }
913
914                function clearSearchQuery() {
915                    searchQuery = '';
916                }
917
918                function clearFiltered() {
919                    $options.find('.option.filtered').removeClass('filtered');
920                }
921
922            }
923
924            function selectOption($option, $originalOption, selected, propagateBack) {
925                /// <summary>
926                /// Nastaví/zruší vybranou hodnotu na novém případně i na původním selectu.
927                /// </summary>
928                /// <param name="$option">Nová hodnota (option).</param>
929                /// <param name="$originalOption">Původní hodnota (option).</param>
930                /// <param name="selected">Zda se má hodnota vybrat nebo zrušit.</param>
931                /// <param name="propagateBack">Zda se má hodnota nastavit i na původním selectu.</param>
932                if (selected) {
933                    $option.addClass("selected");
934                    if (isMultiple) $option.data("checkbox").prop("checked", true);
935                    if (propagateBack) $originalOption.prop("selected", true);
936                } else {
937                    $option.removeClass("selected");
938                    if (isMultiple) $option.data("checkbox").prop("checked", false);
939                    if (propagateBack) $originalOption.prop("selected", false);
940                }
941            }
942
943            function updateOptionsState() {
944                /// <summary>
945                /// Zaktualizuje stav hodnot na novém selectu dle původního.
946                /// </summary>
947                $originalOptions.each(function () {
948                    var $originalOption = $(this);
949                    var $option = $originalOption.data("option");
950                    var isSelected = $originalOption.is(":selected");
951                    var isDisabled = $originalOption.is(":disabled");
952                    if (isDisabled) {
953                        $option.addClass("disabled");
954                        if (isMultiple) $option.data("checkbox").prop("disabled", true);
955                    } else {
956                        $option.removeClass("disabled");
957                        if (isMultiple) $option.data("checkbox").prop("disabled", false);
958                    }
959                    selectOption($option, $originalOption, isSelected, false);
960                });
961            }
962
963            function hover() {
964                /// <summary>
965                /// Vrátí true, pokud je myš nad dropdownem nebo nad popupem.
966                /// Bohužel v IE8 nefunguje .is(:hover)
967                /// </summary>            	
968                return $outer.hasClass("hover");
969            }
970
971            function isOpen() {
972                /// <summary>
973                /// Vrátí true, pokud je popup rozevřený.
974                /// </summary>            	
975                if (!$popup) return false;
976                return $popup.is(":visible");
977            }
978
979            function getZ() {
980                //todo vypocitat
981                return 1000;
982            }
983
984            function open() {
985                /// <summary>
986                /// Otevře popup.
987                /// </summary>
988
989                //popup vytváříme při prvním otevření (optimalizace).
990                if (!$popup) {
991                    createPopup();
992                }
993
994                //zaktualizujeme hodnoty dle původního selectu
995                updateOptionsState();
996
997                //zaktualizujeme pozici
998                var top = $outer.offset().top;
999                top -= $(window).scrollTop();
1000                top += $outer.outerHeight();
1001                var left = $outer.offset().left;
1002                $popup.css("top", top);
1003                $popup.css("left", left);
1004                $popup.css("position", "fixed");
1005                $popup.css("z-index", getZ());
1006                $popup.css("min-width", $outer.outerWidth());
1007
1008                //zobrazíme popup
1009                $popup.show();
1010
1011                //zaktualizujeme pozici pro případ, že bude potřeba popup zobrazit směrem nahoru
1012                if ($popup.offset().top + $popup.outerHeight() > $(window).height() + $(document).scrollTop()) {
1013                    top = $outer.offset().top - $popup.outerHeight() - $(window).scrollTop();
1014                    $popup.css("top", top);
1015                }
1016
1017                //zaktualizujeme šířku pro případ, že se zobrazil horizontální scrollbar
1018          
1018      var hasHorizontalScroll = $popup.get(0).scrollWidth > $popup.get(0).clientWidth;
1019                if (hasHorizontalScroll) {
1020                    $popup.width($popup.outerWidth() + $popup.get(0).scrollWidth - $popup.get(0).clientWidth);
1021                }
1022
1023                //pokud provedeme scroll okna, tak popup zavřeme (abychom nemuseli přepočítávat pozici), ale jen pro desktopovou verzi
1024                if (!options.mobile) {
1025                    $(window).one('scroll', function () {
1026                        close();
1027                    });
1028                }
1029            }
1030
1031            function close() {
1032                /// <summary>
1033                /// Zavře popup pokud je otevřený.
1034                /// </summary>                                
1035                if ($popup && $popup.is(":visible")) {
1036                    //skryjeme popup
1037                    $popup.hide();
1038                    //a vyvoláme uživatelský handler
1039                    options.onClosed();
1040                }
1041            }
1042
1043            $original.change(function () {
1044                /// <summary>
1045                /// pokud se změní hodnota na původním selectu.
1046                /// </summary>
1047
1048                //zaktualizujeme label
1049                updateLabel();
1050                //hodnoty v popupu aktualizovat nemusíme, ty se aktualizují vždy při otevření
1051                //updateOptionsState();
1052
1053                //a vyvoláme uživatelský handler
1054                options.onChanged();
1055            });
1056
1057            $inner.mousedown(function () {
1058                /// <summary>
1059                /// pokud klikneme do dropdownu
1060                /// </summary>
1061
1062                if (disabled) return;
1063
1064                //pokud je popup již otevřený
1065                if (isOpen()) {
1066                    //tak ho zavřeme
1067                    close();
1068                }
1069                    //pokud je zavřený
1070                else {
1071                    //tak ho otevřeme
1072                    open();
1073                }
1074            });
1075
1076            $outer.mouseenter(function () {
1077                /// <summary>
1078                /// Pokud do dropdownu najedeme myší, přidáme třídu hover.
1079                /// Je nutné pro správnou funkci metody hover().
1080                /// </summary>                
1081
1082                if (disabled) return;
1083
1084                $outer.addClass("hover");
1085            });
1086
1087            $outer.mouseleave(function () {
1088                /// <summary>
1089                /// Pokud z dropdownu vyjedeme myší, odebereme třídu hover
1090                /// Je nutné pro správnou funkci metody hover().
1091                /// </summary>  
1092
1093                if (disabled) return;
1094
1095                $outer.removeClass("hover");
1096            });
1097
1098            $(document).mousedown(function () {
1099                /// <summary>
1100                /// Při kliknutí mimo dropdown zavře popup.                
1101                /// </summary>                
1102
1103                if (disabled) return;
1104
1105                //pokud nejsme myší nad dropdownem
1106                if (!hover()) {
1107                    //zavřeme popup
1108                    close();
1109                }
1110            });
1111
1112            //při inicializaci zaktualizujeme label
1113            updateLabel();
1114
1115        };
1116
1117    $.fn[pluginName] = function (args, options) {
1118        /// <summary>
1119        /// Zaregistruje plugin do jquery.
1120        /// </summary>    	
1121        return this.each(function () {
1122            //pokud ve vlastních datech není žádná hodnota pod klíčem pluginName, znamená to, že tento element ještě nebyl dekorován
1123            if (!$(this).data(pluginName)) {
1124                //označíme si element jako odekorovaný
1125                $(this).data(pluginName, true);
1126                //a provedeme inicializaci
1127                init(this, args || options);
1128            }
1129                //v opačném případě je tento element již odekorován, takže
1130            else if ('' + args === args) {
1131                //pouze aktualizujeme pomocí zadaných argumentů
1132                $(this).trigger(args);
1133            }
1134        });
1135    };
1136}(jQuery));
1137;(function($) {
1138
1139    var init = function(element) {
1140        var $original = $(element);
1141        var type = $original.attr("type");
1142        var css = "";
1143        if (type == "checkbox") {
1144            css = "bs-check";
1145        } else if (type === "radio") {
1146            css = "bs-radio";
1147        } else {
1148            return;
1149        }
1150        $original.data("bsOnChangeFunc", null); // odebereme obecnou implementaci indeterminated checkboxů (používanou hlavně v RWD)
1151        $original.data("bsCheckInstance", this);
1152        var $check = $('<div class="' + css + '">&nbsp;</div>');
1153        $original.hide();
1154        $original.after($check);
1155        $check.addClass($original.attr("class"));
1156        $original.data("bsCheck", true);
1157
1158        $original.change(function () {
1159            updateCheckState();
1160        });
1161        
1162        $original.click(function () {
1163            updateCheckState(true);
1164        });
1165
1166        $check.mouseover(function() {
1167            $check.addClass("hover");
1168        });
1169
1170        $check.mouseleave(function() {
1171            $check.removeClass("hover");
1172        });        
1173
1174        $check.change(function () {
1175            updateCheckState();
1176        });
1177        
1178        $check.click(function () {
1179            updateCheckState();
1180        });
1181
1182        $check.click(function () {
1183            if (isDisabled()/*$original.is(":disabled")*/) return;
1184            // pokud již bs-check je v labelu, pak se o kliknutí postará label
1185            if ($check.parents("label").length > 0) return;
1186
1187            //hack pro IE8-- click nevyvolá událost change, takže vyvoláme click a pokud do určité doby nedojde k události change, tak ji explicitně vyvoláme
1188            var chageRaised = false;
1189            $original.one("change", function () {
1190                chageRaised = true;
1191                updateCheckState();
1192            });
1193            
1194            $original.click();
1195            
1196            setTimeout(function() {
1197                if (!chageRaised) $original.change();
1198            }, 200);
1199            
1200            updateCheckState(true);           
1201        });
1202
1203        $original.on("bsUpdateCheckState", function() {
1204            updateCheckState(false);
1205        });
1206
1207        $original.on("bsUpdateChildState", function() {
1208            updateCheckState(-1); // jedná se o update směrem dolů
1209        });
1210
1211        $original.on("bsUpdateParentState", function () {
1212            updateCheckState(1); // jedná se o update směrem nahoru
1213        });
1214
1215        function updateCheckState(updateOthers) {
1216            var checked = isChecked();
1217            var disabled = isDisabled();
1218            var indeterminate = isIndeterminated();
1219            
1220            if ($check.hasClass("indeterminate") && !checked && updateOthers === true) {
1221                // pokud byl checkbox v polozaškrtnutém stavu, pak zaškrtneme všechny potomky
1222                $original[0].checked = true;
1223                checked = true;
1224            }
1225
1226            //pokud je to radio, tak musíme aktualizovat stav ostatních radií ve stejné grupě
1227            if (updateOthers === true && $original.attr("type") === "radio") {
1228                $("input[type='radio']").each(function () {                    
1229                    $(this).trigger("bsUpdateCheckState");
1230                }); 
1231            }
1232
1233            var children = $original.data("bs-check-children");
1234            if (updateOthers !== undefined && children && children.length > 0) {
1235                var $children = $(children).map(function () { return this.toArray(); });
1236                if (updateOthers !== 1) {
1237                    // propagování události dětem
1238                    $children.each(function (i, el) {
1239                        el.checked = checked;
1240                        var $child = $(el);
1241                        $child.trigger("bsUpdateChildState");
1242                    });
1243                }
1244                else {
1245                    // zaškrtnutí rodiče podle stavu jeho dětí
1246                    var childChecked = false;
1247                    var childUnchecked = false;
1248                    $children.each(function (i, el) {
1249                        if (el.checked) childChecked = true;
1250                        else childUnchecked = true;
1251                        if (el.indeterminate) childUnchecked = true; // polozaškrtnutý stav dětí budeme propagovat dál
1252                    });
1253
1254                    $original[0].indeterminate = (childChecked && childUnchecked);
1255                    indeterminate = (childChecked && childUnchecked);
1256                    $original[0].checked = childChecked;
1257                    checked = childChecked;
1258                }
1259            }
1260
1261            var $parent = $original.data("bs-check-parent");
1262            if (updateOthers !== undefined && $parent && $parent.length > 0 && updateOthers !== -1) {
1263                // propagování události rodiči
1264                $parent.trigger("bsUpdateParentState");
1265            }
1266            
1267            updateClass(indeterminate, "indeterminate");
1268            updateClass(checked, "checked");
1269            updateClass(disabled, "disabled");
1270        }
1271
1272        function updateClass(set, clazz) {
1273            if (set) $check.addClass(clazz);
1274            else $check.removeClass(clazz);
1275        }
1276
1277        function isChecked() {
1278            return $original.is(":checked");
1279        }
1280
1281        function isDisabled() {
1282            return $original.is(":disabled");
1283        }
1284
1285        function isIndeterminated() {
1286            return $original.is(":indeterminate");
1287        }
1288
1289        updateCheckState();
1290    };
1291
1292    $.fn["bsCheck"] = function (args, options) {
1293        return this.each(function () {
1294            if (!$(this).data("bsCheck")) {                
1295                init(this, args || options);
1296            } else if ("" + args === args) {
1297                $(this).trigger(args);
1298            }
1299        });
1300    };
1301}(jQuery));
1302
1303function bsCheckBindChild(childId, parentId) {
1304    /// <summary>Přiřadí potomka k rodiči. Zaškrtáváním se tak budou ovlivňovat navzájem.</summary>
1305    var $child = $("#" + childId);
1306    var $parent = $("#" + parentId);
1307    $child.data("bs-check-parent", $parent);
1308    var $siblings = $parent.data("bs-check-children");
1309    if (!$siblings) {
1310        $siblings = new Array();
1311    }
1312    $siblings.push($child);
1313    $parent.data("bs-check-children", $siblings);
1314
1315    initBsCheck($child);
1316    initBsCheck($parent);
1317
1318    function initBsCheck($input) {
1319        if ($input.data("bsCheck")) {
1320            // ve starém MVC frameworku je vlastní implementace indeterminate checkboxů
1321            return;
1322        }
1323        if ($input.data("bsOnChangeFunc")) {
1324            // funkce na ošetření indeterminate checkboxů již byla nastavena
1325            return;
1326        }
1327
1328        $input.data("bsOnChangeFunc", bsOnChange);
1329        $input.on("change",
1330            function (e) {
1331                var func = $input.data("bsOnChangeFunc");
1332                if (func) func(e);
1333            });
1334    }
1335
1336    function bsOnChange(e) {
1337        var input = e.target;
1338        var bsUpdate = input.bsChangeUpdate;
1339        var $input = $(input);
1340        var $parent = $input.data("bs-check-parent");
1341        var $children = $input.data("bs-check-children");
1342        if (bsUpdate) {
1343            // jedná se o změnu vyvolanou při přepočítání indeterminate checkboxů
1344            if (bsUpdate === "parent") updateParent($parent);
1345            if (bsUpdate === "children") updateChildren($children, input.checked);
1346            return;
1347        }
1348        updateParent($parent);
1349        updateChildren($children, input.checked);
1350    }
1351
1352    function updateParent($parent) {
1353        /// <summary> Provede update stavu checkboxů směrem k předkům. </summary>
1354        if (!$parent || $parent.length === 0) return;
1355        var parent = $parent[0];
1356        parent.bsChangeUpdate = "parent";
1357        var childrenStates = getChildrenStates($parent);
1358        if (childrenStates === 1) { // indetermante
1359            parent.checked = false;
1360            parent.indeterminate = true;
1361        } else if (childrenStates === 2) { // checked
1362            parent.checked = true;
1363            parent.indeterminate = false;
1364        } else if (childrenStates === 3) { // unchecked
1365            parent.checked = false;
1366            parent.indeterminate = false;
1367        } else {
1368            console.log("unknown children state", $parent, childrenStates);
1369        }
1370        $parent.trigger("change");
1371        parent.bsChangeUpdate = null;
1372    }
1373
1374    function updateChildren($children, checked) {
1375        /// <summary> Provede update stavu checkboxů směrem k potomkům. </summary>
1376        if (!$children || $children.length === 0) return;
1377        for (var i = 0; i < $children.length; i++) {
1378            var child = $children[i][0];
1379            child.bsChangeUpdate = "children";
1380            child.checked = checked;
1381            $(child).trigger("change");
1382            child.bsChangeUpdate = null;
1383        }
1384    }
1385
1386    function getChildrenStates($input) {
1387        /// <summary> Vrátí hodnotu, jakou by měl mít checkbox stav, podle nastavení potomků. </summary >
1388        /// <returns type="number"> 0 pokud checkbox žádné potomky nemá. </returns>
1389        /// <returns type="number"> 1 pokud checkbox má být indeterminate. </returns>
1390        /// <returns type="number"> 2 pokud checkbox má být checked. </returns>
1391        /// <returns type="number"> 3 pokud checkbox má být unchecked. </returns>
1392        var $children = $input.data("bs-check-children");
1393        if ($children.length === 0) return 0; // no children
1394        var anyChecked = false;
1395        var anyUnchecked = false;
1396        var anyIndeterminated = false;
1397        for (var i = 0; i < $children.length; i++) {
1398            var child = $children[i][0];
1399            if (child.indeterminate) anyIndeterminated = true;
1400            if (child.checked) anyChecked = true;
1401            else anyUnchecked = true;
1402        }
1403
1404        if (anyIndeterminated) return 1; // indeterminate
1405        if (anyChecked && anyUnchecked) return 1; // indeterminate
1406        if (anyChecked) return 2; // checked
1407        if (anyUnchecked) return 3; // unchecked
1408        return 0;
1409    }
1410}
1411;(function(a){a.widget("ui.dropdownchecklist",{version:function(){alert("DropDownCheckList v1.4")},_appendDropContainer:function(b){var d=a("<div/>");d.addClass("ui-dropdownchecklist ui-dropdownchecklist-dropcontainer-wrapper");d.addClass("ui-widget");d.attr("id",b.attr("id")+"-ddw");d.css({position:"absolute",left:"-33000px",top:"-33000px"});var c=a("<div/>");c.addClass("ui-dropdownchecklist-dropcontainer ui-widget-content");c.css("overflow-y","auto");d.append(c);d.insertAfter(b);d.isOpen=false;return d}
1411,_isDropDownKeyShortcut:function(c,b){return c.altKey&&(a.ui.keyCode.DOWN==b)},_isDropDownCloseKey:function(c,b){return(a.ui.keyCode.ESCAPE==b)||(a.ui.keyCode.ENTER==b)},_keyFocusChange:function(f,i,c){var g=a(":focusable");var d=g.index(f);if(d>=0){d+=i;if(c){var e=this.dropWrapper.find("input:not([disabled])");var b=g.index(e.get(0));var h=g.index(e.get(e.length-1));if(d<b){d=h}else{if(d>h){d=b}}}g.get(d).focus()}},_handleKeyboard:function(d){var b=this;var c=(d.keyCode||d.which);if(!b.dropWrapper.isOpen&&b._isDropDownKeyShortcut(d,c)){d.stopImmediatePropagation();b._toggleDropContainer(true)}else{if(b.dropWrapper.isOpen&&b._isDropDownCloseKey(d,c)){d.stopImmediatePropagation();b._toggleDropContainer(false);b.controlSelector.focus()}else{if(b.dropWrapper.isOpen&&(d.target.type=="checkbox")&&((c==a.ui.keyCode.DOWN)||(c==a.ui.keyCode.UP))){d.stopImmediatePropagation();b._keyFocusChange(d.target,(c==a.ui.keyCode.DOWN)?1:-1,true)}else{if(b.dropWrapper.isOpen&&(c==a.ui.keyCode.TAB)){}}}}},_handleFocus:function(f,d,b){var c=this;if(b&&!c.dropWrapper.isOpen){f.stopImmediatePropagation();if(d){c.controlSelector.addClass("ui-state-hover");if(a.ui.dropdownchecklist.gLastOpened!=null){a.ui.dropdownchecklist.gLastOpened._toggleDropContainer(false)}}else{c.controlSelector.removeClass("ui-state-hover")}}else{if(!b&&!d){if(f!=null){f.stopImmediatePropagation()}c.controlSelector.removeClass("ui-state-hover");c._toggleDropContainer(false)}}},_cancelBlur:function(c){var b=this;if(b.blurringItem!=null){clearTimeout(b.blurringItem);b.blurringItem=null}},_appendControl:function(){var j=this,c=this.sourceSelect,k=this.options;var b=a("<span/>");b.addClass("ui-dropdownchecklist ui-dropdownchecklist-selector-wrapper ui-widget");b.css({display:"inline-block",cursor:"default",overflow:"hidden"});var f=c.attr("id");if((f==null)||(f=="")){f="ddcl-"+a.ui.dropdownchecklist.gIDCounter++}else{f="ddcl-"+f}b.attr("id",f);var h=a("<span/>");h.addClass("ui-dropdownchecklist-selector ui-state-default");h.css({display:"inline-block",overflow:"hidden","white-space":"nowrap"});var d=c.attr("tabIndex");if(d==null){d=0}else{d=parseInt(d);if(d<0){d=0}}h.attr("tabIndex",d);h.keyup(function(l){j._handleKeyboard(l)});h.focus(function(l){j._handleFocus(l,true,true)});h.blur(function(l){j._handleFocus(l,false,true)});b.append(h);if(k.icon!=null){var i=(k.icon.placement==null)?"left":k.icon.placement;var g=a("<div/>");g.addClass("ui-icon");g.addClass((k.icon.toOpen!=null)?k.icon.toOpen:"ui-icon-triangle-1-e");g.css({"float":i});h.append(g)}var e=a("<span/>");e.addClass("ui-dropdownchecklist-text");e.css({display:"inline-block","white-space":"nowrap",overflow:"hidden"});h.append(e);b.hover(function(){if(!j.disabled){h.addClass("ui-state-hover")}},function(){if(!j.disabled){h.removeClass("ui-state-hover")}});b.click(function(l){if(!j.disabled){l.stopImmediatePropagation();j._toggleDropContainer(!j.dropWrapper.isOpen)}});b.insertAfter(c);a(window).resize(function(){if(!j.disabled&&j.dropWrapper.isOpen){j._toggleDropContainer(true)}});return b},_createDropItem:function(g,f,o,l,q,h,e,k){var m=this,c=this.options,d=this.sourceSelect,p=this.controlWrapper;var t=a("<div/>");t.addClass("ui-dropdownchecklist-item");t.css({"white-space":"nowrap"});var r=h?' checked="checked"':"";var j=e?' class="inactive"':' class="active"';var b=p.attr("id");var n=b+"-i"+g;var s;if(m.isMultiple){s=a('<input disabled type="checkbox" id="'+n+'"'+r+j+' tabindex="'+f+'" />')}else{s=a('<input disabled type="radio" id="'+n+'" name="'+b+'"'+r+j+' tabindex="'+f+'" />')}s=s.attr("index",g).val(o);t.append(s);var i=a("<label for="+n+"/>");i.addClass("ui-dropdownchecklist-text");if(q!=null){i.attr("style",q)}i.css({cursor:"default"});i.html(l);if(k){t.addClass("ui-dropdownchecklist-indent")}t.addClass("ui-state-default");if(e){t.addClass("ui-state-disabled")}i.click(function(u){u.stopImmediatePropagation()});t.append(i);t.hover(function(v){var u=a(this);if(!u.hasClass("ui-state-disabled")){u.addClass("ui-state-hover")}},function(v){var u=a(this);u.removeClass("ui-state-hover")});s.click(function(w){var v=a(this);w.stopImmediatePropagation();if(v.hasClass("active")){var x=m.options.onItemClick;
1411if(a.isFunction(x)){try{x.call(m,v,d.get(0))}catch(u){v.prop("checked",!v.prop("checked"));m._syncSelected(v);return}}m._syncSelected(v);m.sourceSelect.trigger("change","ddcl_internal");if(!m.isMultiple&&c.closeRadioOnClick){m._toggleDropContainer(false)}}});t.click(function(y){var x=a(this);y.stopImmediatePropagation();if(!x.hasClass("ui-state-disabled")){var v=x.find("input");var w=v.prop("checked");v.prop("checked",!w);var z=m.options.onItemClick;if(a.isFunction(z)){try{z.call(m,v,d.get(0))}catch(u){v.prop("checked",w);m._syncSelected(v);return}}m._syncSelected(v);m.sourceSelect.trigger("change","ddcl_internal");if(!w&&!m.isMultiple&&c.closeRadioOnClick){m._toggleDropContainer(false)}}else{x.focus();m._cancelBlur()}});t.focus(function(v){var u=a(this);v.stopImmediatePropagation()});t.keyup(function(u){m._handleKeyboard(u)});return t},_createGroupItem:function(f,d){var b=this;var e=a("<div />");e.addClass("ui-dropdownchecklist-group ui-widget-header");if(d){e.addClass("ui-state-disabled")}e.css({"white-space":"nowrap"});var c=a("<span/>");c.addClass("ui-dropdownchecklist-text");c.css({cursor:"default"});c.text(f);e.append(c);e.click(function(h){var g=a(this);h.stopImmediatePropagation();g.focus();b._cancelBlur()});e.focus(function(h){var g=a(this);h.stopImmediatePropagation()});return e},_createCloseItem:function(e){var b=this;var d=a("<div />");d.addClass("ui-state-default ui-dropdownchecklist-close ui-dropdownchecklist-item");d.css({"white-space":"nowrap","text-align":"right"});var c=a("<span/>");c.addClass("ui-dropdownchecklist-text");c.css({cursor:"default"});c.html(e);d.append(c);d.click(function(g){var f=a(this);g.stopImmediatePropagation();f.focus();b._toggleDropContainer(false)});d.hover(function(f){a(this).addClass("ui-state-hover")},function(f){a(this).removeClass("ui-state-hover")});d.focus(function(g){var f=a(this);g.stopImmediatePropagation()});return d},_appendItems:function(){var d=this,f=this.options,h=this.sourceSelect,g=this.dropWrapper;var b=g.find(".ui-dropdownchecklist-dropcontainer");h.children().each(function(j){var k=a(this);if(k.is("option")){d._appendOption(k,b,j,false,false)}else{if(k.is("optgroup")){var l=k.prop("disabled");var n=k.attr("label");if(n!=""){var m=d._createGroupItem(n,l);b.append(m)}d._appendOptions(k,b,j,true,l)}}});if(f.explicitClose!=null){var i=d._createCloseItem(f.explicitClose);b.append(i)}var c=b.outerWidth();var e=b.outerHeight();return{width:c,height:e}},_appendOptions:function(g,d,f,c,b){var e=this;g.children("option").each(function(h){var i=a(this);var j=(f+"."+h);e._appendOption(i,d,j,c,b)})},_appendOption:function(g,b,h,d,n){var m=this;var k=g.html();if((k!=null)&&(k!="")){var j=g.val();var i=g.attr("style");var f=g.prop("selected");var e=(n||g.prop("disabled"));var c=m.controlSelector.attr("tabindex");var l=m._createDropItem(h,c,j,k,i,f,e,d);b.append(l)}},_syncSelected:function(h){var i=this,l=this.options,b=this.sourceSelect,d=this.dropWrapper;var c=b.get(0).options;var g=d.find("input.active");if(l.firstItemChecksAll=="exclusive"){if((h==null)&&a(c[0]).prop("selected")){g.prop("checked",false);a(g[0]).prop("checked",true)}else{if((h!=null)&&(h.attr("index")==0)){var e=h.prop("checked");g.prop("checked",false);a(g[0]).prop("checked",e)}else{var f=true;var k=null;g.each(function(m){if(m>0){var n=a(this).prop("checked");if(!n){f=false}}else{k=a(this)}});if(k!=null){if(f){g.prop("checked",false)}k.prop("checked",f)}}}}else{if(l.firstItemChecksAll){if((h==null)&&a(c[0]).prop("selected")){g.prop("checked",true)}else{if((h!=null)&&(h.attr("index")==0)){g.prop("checked",h.prop("checked"))}else{var f=true;var k=null;g.each(function(m){if(m>0){var n=a(this).prop("checked");if(!n){f=false}}else{k=a(this)}});if(k!=null){k.prop("checked",f)}}}}}var j=0;g=d.find("input");g.each(function(n){var m=a(c[n+j]);var o=m.html();if((o==null)||(o=="")){j+=1;m=a(c[n+j])}m.prop("selected",a(this).prop("checked"))});i._updateControlText();if(h!=null){h.focus()}},_sourceSelectChangeHandler:function(c){var b=this,d=this.dropWrapper;d.find("input").val(b.sourceSelect.val());b._updateControlText()},_updateControlText:function(){var c=this,g=this.sourceSelect,d=this.options,f=this.controlWrapper;var h=g.find("option:first");var b=g.find("option");var i=c._formatText(b,d.firstItemChecksAll,h);var e=f.find(".ui-dropdownchecklist-text");e.html(i);e.attr("title",e.text())},_formatText:function(b,d,e){var f;if(a.isFunction(this.options.textFormatFunction)){try{f=this.options.textFormatFunction(b)}catch(c){alert("textFormatFunction failed: "+c)}}else{if(d&&(e!=null)&&e.prop("selected")){f=e.html()}else{f="";b.each(function(){if(a(this).prop("selected")){if(f!=""){f+=", "}var g=a(this).attr("style");var h=a("<span/>");h.html(a(this).html());if(g==null){f+=h.html()}else{h.attr("style",g);f+=a("<span/>").append(h).html()}}});if(f==""){f=(this.options.emptyText!=null)?this.options.emptyText:"&nbsp;"}}}return f},_toggleDropContainer:function(e){var c=this;var d=function(f){if((f!=null)&&f.dropWrapper.isOpen){f.dropWrapper.isOpen=false;a.ui.dropdownchecklist.gLastOpened=null;var h=f.options;f.dropWrapper.css({top:"-33000px",left:"-33000px"});var g=f.controlSelector;g.removeClass("ui-state-active");g.removeClass("ui-state-hover");var j=f.controlWrapper.find(".ui-icon");if(j.length>0){j.removeClass((h.icon.toClose!=null)?h.icon.toClose:"ui-icon-triangle-1-s");j.addClass((h.icon.toOpen!=null)?h.icon.toOpen:"ui-icon-triangle-1-e")}a(document).unbind("click",d);f.dropWrapper.find("input.active").prop("disabled",true);if(a.isFunction(h.onComplete)){try{h.onComplete.call(f,f.sourceSelect.get(0))}catch(i){alert("callback failed: "+i)}}}};var b=function(n){if(!n.dropWrapper.isOpen){n.dropWrapper.isOpen=true;a.ui.dropdownchecklist.gLastOpened=n;var g=n.options;if((g.positionHow==null)||(g.positionHow=="absolute")){n.dropWrapper.css({position:"absolute",top:n.controlWrapper.position().top+n.controlWrapper.outerHeight()+"px",left:n.controlWrapper.position().left+"px"})}else{if(g.positionHow=="relative"){n.dropWrapper.css({position:"relative",top:"0px",left:"0px"})}}var m=0;if(g.zIndex==null){var l=n.controlWrapper.parents().map(function(){var o=a(this).css("z-index");return isNaN(o)?0:o}).get();var i=Math.max.apply(Math,l);if(i>=0){m=i+1}}else{m=parseInt(g.zIndex)}if(m>0){n.dropWrapper.css({"z-index":m})}var j=n.controlSelector;j.addClass("ui-state-active");j.removeClass("ui-state-hover");var h=n.controlWrapper.find(".ui-icon");if(h.length>0){h.removeClass((g.icon.toOpen!=null)?g.icon.toOpen:"ui-icon-triangle-1-e");h.addClass((g.icon.toClose!=null)?g.icon.toClose:"ui-icon-triangle-1-s")}a(document).bind("click",function(o){d(n)});var f=n.dropWrapper.find("input.active");
1411f.prop("disabled",false);var k=f.get(0);if(k!=null){k.focus()}}};if(e){d(a.ui.dropdownchecklist.gLastOpened);b(c)}else{d(c)}},_setSize:function(b){var m=this.options,f=this.dropWrapper,l=this.controlWrapper;var k=b.width;if(m.width!=null){k=parseInt(m.width)}else{if(m.minWidth!=null){var c=parseInt(m.minWidth);if(k<c){k=c}}}var i=this.controlSelector;i.css({width:k+"px"});var g=i.find(".ui-dropdownchecklist-text");var d=i.find(".ui-icon");if(d!=null){k-=(d.outerWidth()+4);g.css({width:k+"px"})}k=l.outerWidth();var j=(m.maxDropHeight!=null)?parseInt(m.maxDropHeight):-1;var h=((j>0)&&(b.height>j))?j:b.height;var e=b.width<k?k:b.width;a(f).css({height:h+"px",width:e+"px"});f.find(".ui-dropdownchecklist-dropcontainer").css({height:h+"px"})},_init:function(){var c=this,d=this.options;if(a.ui.dropdownchecklist.gIDCounter==null){a.ui.dropdownchecklist.gIDCounter=1}c.blurringItem=null;var g=c.element;c.initialDisplay=g.css("display");g.css("display","none");c.initialMultiple=g.prop("multiple");c.isMultiple=c.initialMultiple;if(d.forceMultiple!=null){c.isMultiple=d.forceMultiple}g.prop("multiple",true);c.sourceSelect=g;var e=c._appendControl();c.controlWrapper=e;c.controlSelector=e.find(".ui-dropdownchecklist-selector");var f=c._appendDropContainer(e);c.dropWrapper=f;var b=c._appendItems();c._updateControlText(e,f,g);c._setSize(b);if(d.firstItemChecksAll){c._syncSelected(null)}if(d.bgiframe&&typeof c.dropWrapper.bgiframe=="function"){c.dropWrapper.bgiframe()}c.sourceSelect.change(function(i,h){if(h!="ddcl_internal"){c._sourceSelectChangeHandler(i)}})},_refreshOption:function(e,d,c){var b=e.parent();if(d){e.prop("disabled",true);e.removeClass("active");e.addClass("inactive");b.addClass("ui-state-disabled")}else{e.prop("disabled",false);e.removeClass("inactive");e.addClass("active");b.removeClass("ui-state-disabled")}e.prop("checked",c)},_refreshGroup:function(c,b){if(b){c.addClass("ui-state-disabled")}else{c.removeClass("ui-state-disabled")}},close:function(){this._toggleDropContainer(false)},refresh:function(){var b=this,e=this.sourceSelect,d=this.dropWrapper;var c=d.find("input");var g=d.find(".ui-dropdownchecklist-group");var h=0;var f=0;e.children().each(function(i){var j=a(this);var l=j.prop("disabled");if(j.is("option")){var k=j.prop("selected");var n=a(c[f]);b._refreshOption(n,l,k);f+=1}else{if(j.is("optgroup")){var o=j.attr("label");if(o!=""){var m=a(g[h]);b._refreshGroup(m,l);h+=1}j.children("option").each(function(){var p=a(this);var r=(l||p.prop("disabled"));var q=p.prop("selected");var s=a(c[f]);b._refreshOption(s,r,q);f+=1})}}});b._syncSelected(null)},enable:function(){this.controlSelector.removeClass("ui-state-disabled");this.disabled=false},disable:function(){this.controlSelector.addClass("ui-state-disabled");this.disabled=true},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments);this.sourceSelect.css("display",this.initialDisplay);this.sourceSelect.prop("multiple",this.initialMultiple);this.controlWrapper.unbind().remove();this.dropWrapper.remove()}});a.extend(a.ui.dropdownchecklist,{defaults:{width:null,maxDropHeight:null,firstItemChecksAll:false,closeRadioOnClick:false,minWidth:50,positionHow:"absolute",bgiframe:false,explicitClose:null}})})(jQuery);
1412;var ClientValidation=function(){function t(n,t){var i=n==null||n.length===0,r=t==null||t.length===0;return r?!0:i?!1:t.toLowerCase().indexOf(n.toLowerCase())>=0?!0:!1}function i(n,t){var i=n==null||n.length===0,r=t==null||t.length===0;return r?!1:i?!1:t.toLowerCase().indexOf(n.toLowerCase())>=0?!0:!1}function r(n,t){return n.filter(function(n){return t.indexOf(n)!==-1})}if(typeof n=="undefined")var n={debugWarn:function(){}};this.entries=[];this.currentBillingCountry="";this.currentDeliveryCountry="";this.currentFlags=[];this.setValidationEntries=function(n){this.entries=n.ValidationEntries;this.currentBillingCountry=n.CurrentBillingCountry;this.currentDeliveryCountry=n.CurrentDeliveryCountry;this.currentFlags=n.CurrentFlags;this.currentBillingCountry=this.currentBillingCountry?this.currentBillingCountry.toLowerCase():"";this.currentDeliveryCountry=this.currentDeliveryCountry?this.currentDeliveryCountry.toLowerCase():"";
1412this.billingCountryGroups=n.BillingCountryGroups;this.deliveryCountryGroups=n.DeliveryCountryGroups};this.active=function(){return this.entries.length>0};this.findValidationEntry=function(n){var u,r,f;for(u in this.entries)if((r=this.entries[u],t(this.currentBillingCountry,r.AllowedBillingCountries))&&!i(this.currentBillingCountry,r.DisabledBillingCountries)&&t(this.currentDeliveryCountry,r.AllowedDeliveryCountries)&&!i(this.currentDeliveryCountry,r.DisabledDeliveryCountries)&&(r.AllowedBillingCountryGroups===0||(this.billingCountryGroups&r.AllowedBillingCountryGroups)!=0)&&(r.DisabledBillingCountryGroups===0||(this.billingCountryGroups&r.DisabledBillingCountryGroups)==0)&&(r.AllowedDeliveryCountryGroups===0||(this.deliveryCountryGroups&r.AllowedDeliveryCountryGroups)!=0)&&(r.DisabledBillingCountryGroups===0||(this.deliveryCountryGroups&r.DisabledBillingCountryGroups)==0)&&(f=r.Selector,n.is(f)))return r;return null};this.isOptional=function(n){return!n.OptionalForFlags||n.OptionalForFlags.length===0?!1:this.currentFlags&&this.currentFlags.length>0&&r(this.currentFlags,n.OptionalForFlags).length>0?!0:n.OptionalForFlags.filter(function(n){return n==="*"}).length>0?!0:!1};this.matchesRule=function(n,t,i){if(t=this.transform(t,n.Transformations),n.Condition&&!this.regexTest(t,n.Condition,i))return!0;var r=this.regexTest(t,n.Expression,i);return n.Inverse&&(r=!r),r};this.getRawValue=function(n){return n.val()};this.transformValue=function(n,t){return t==="Trim"?n.trim():t==="RemoveSpaces"?n.replace(/\s/g,""):t==="RemoveAccent"?tools.removeAccent(n):n};this.transform=function(n,t){var i,r;if(t===undefined||t==null)return n;for(i in t)r=t[i],n=this.transformValue(n,r);return n};this.substituteValue=function(n,t){var r,i;return t.SubstitutionType==="Expression"?(r=new RegExp(t.Expression,"g"),n=n.replace(r,t.Replacement)):t.SubstitutionType==="LowerCase"?n=n.toLowerCase():t.SubstitutionType==="UpperCase"?n=n.toUpperCase():t.SubstitutionType==="RemoveAccent"?n=tools.removeAccent(n):t.SubstitutionType==="PhoneDigitSeparation"?(i=/^(\+1\d\d\d|\+2[1234569]\d|\+3[578]\d|\+4[2]\d|\+5[09]\d|\+6[789]\d|\+9[679]\d|\+\d\d)?\s*(\d\d\d)?\s*(\d\d\d)?\s*(.*)$/g,n=n.replace(/\s/g,""),n=n.replace(i,"$1 $2 $3 $4").trim(),n=n.replace(/\s{2,50}/g,"")):t.SubstitutionType==="ZipDigitSeparation"?(i=/^\s*(\d\d\d)(.*)/g,n=n.replace(/\s/g,""),n=n.replace(i,"$1 $2").trim()):t.SubstitutionType==="RemoveMoreSpaces"?n=n.replace(/\s{2,50}/g," "):t.SubstitutionType==="RemoveSpaces"&&(n=n.replace(/\s/g,"")),n};this.substitute=function(n,t){var u=$(n),i=this.findValidationEntry(u),r;if(i===undefined||i===null||!i.Substitutions)return t;for(r in i.Substitutions)t=this.substituteValue(t,i.Substitutions[r]);return t};this.addPlaceholder=function(n){var i=$(n),t=this.findValidationEntry(i);t!==undefined&&t!==null&&t.Placeholder&&n.attr("placeholder",t.Placeholder)};this.isAllowedValue=function(n,t){var r=$(n),i=this.findValidationEntry(r);return i===undefined||i===null?!0:i.DisallowedText&&this.regexTest(t,i.DisallowedText,i)?!1:i.AllowedText&&!this.regexTest(t,i.AllowedText,i)?!1:!0};this.regexTest=function(n,t,i){var r="g",u;return i.RegexIgnoreCase&&(r+="i"),i.RegexIgnoreAccent&&(n=tools.removeAccent(n)),u=new RegExp(t,r),u.test(n)};this.validateElement=function(t){var f=$(t),r=this.findValidationEntry(f),i={message:"",ok:!1,error:!1,warning:!1,found:!0},o,u;if(r===undefined||r===null)return n.debugWarn("Validation entry not found for "+$(t).attr("name")),i.ok=!1,i.error=!1,i.warning=!1,i.found=!1,i;var s=this.getRawValue(f),h=this.substitute(f,s),e=this.transform(h,r.Transformations);if(e===""&&this.isOptional(r))return i.ok=!1,i.error=!1,i.warning=!1,i;for(o in r.Rules)if(u=r.Rules[o],!this.matchesRule(u,e,r))return i.message=u.Message,u.Severity==="Error"?i.error=!0:u.Severity==="Warning"?i.warning=!0:i.error=!0,i;return i.ok=!0,i}},clientValidation=new ClientValidation
1413;function __bs_error_hint_show(scrollToHint) {
1414
1415    var debug = false;
1416
1417    function showHint(target, show, hideOthersIfCurrentValid) {
1418        ///<summary>zobrazíme chybu nebo varování, dle typu validační chyby, která je uložena v datech</summary>
1419
1420        var $target = $(target);
1421        // element již nepatří do DOMu, nebudeme hint zobrazovat
1422        if (!jQuery.contains(document.documentElement, $target.get(0))) return;
1423
1424        // najdeme element hintu
1425        var $hint = bindElement($target);
1426
1427        // zjistíme typ chyby
1428        var isError = hasError($target);
1429        var isWarning = !isError && hasWarning($target);
1430        var isOk = !isError && !isWarning && hasOk($target);
1431
1432        // aktualizujeme css
1433        $hint.removeClass("error");
1434        $hint.removeClass("warning");
1435        $hint.removeClass("ok");
1436        if (isError) $hint.addClass("error");
1437        else if (isWarning) $hint.addClass("warning");
1438        else if (isOk) $hint.addClass("ok");
1439
1440        if (debug) console.debug("Show " + $target.attr("name") + ", " + show + ", " + hideOthersIfCurrentValid);
1441
1442        // schová všechny ostatní hinty
1443        function hideOthers() {
1444            $(".bs-error-hint").each(function () {
1445                var $el = $(this);
1446                if ($el.get(0) === $hint.get(0)) return;
1447                $el.hide();
1448            });
1449        }
1450
1451        // pokud žádná chyba není nebo chceme hinty schovat, tak schováme hinty a skončíme
1452        if ((!isError && !isWarning) || !show) {
1453            if (hideOthersIfCurrentValid) hideOthers();
1454            $hint.fadeOut(100);
1455            return;
1456        }
1457
1458        // schováme všechny ostatní hinty
1459        hideOthers();
1460
1461        // zobrazíme hint
1462        $hint.fadeIn(300);
1463
1464        // při najetí myši na hint, hint schováme ať nepřekáží (může překrývat další pole)
1465        $hint.one('mousemove', function () {
1466            $(this).fadeOut(100);
1467        });
1468
1469        // a poštelujeme pozici (toto kdyžtak udělat nastavitelné pomocí nějakého atributu)
1470        var offset = $target.offset();
1471        offset.top += $target.outerHeight();
1472        $hint.offset(offset);
1473        $hint.css("max-width", $target.outerWidth());
1474
1475        // pokud hint překrývá input, který má právě focus, tak zobrazíme hint nad ním
1476        var $activeElement = $(document.activeElement);
1477        if ($activeElement.is("input,textarea") && isOverlapping($activeElement, $hint)) {
1478            if (debug) console.debug("overlaping");
1479            offset = $target.offset();
1480            offset.top -= $hint.outerHeight();
1481            $hint.offset(offset);
1482            $hint.addClass("above");
1483        } else {
1484            $hint.removeClass("above");
1485        }
1486    }
1487
1488    function isOverlapping(a, b) {
1489        ///<summary>Zjistí, zda se zadané elementy překrývají</summary>
1490        var $a = $(a);
1491        var $b = $(b);
1492        var al = $a.offset().left;
1493        var bl = $b.offset().left;
1494        var at = $a.offset().top;
1495        var bt = $b.offset().top;
1496        var ar = $a.width() + al;
1497        var br = $b.width() + bl;
1498        var ab = $a.height() + at;
1499        var bb = $b.height() + bt;
1500        if (ar < bl) return false; // a je vlevo, b vpravo
1501        if (br < al) return false; // b je vlevo, a vpravo
1502        if (ab < bt) return false; // a je nahoře, b dole
1503        if (bb < at) return false; // b je nahoře, a dole
1504        return true;
1505    }
1506
1507    function updateVisualState($target) {
1508        ///<summary>aktualizuje vizuální stav podle typu chyby</summary>
1509
1510        if (hasError($target)) {
1511            $target.addClass("error");
1512            $target.removeClass("warning");
1513            $target.removeClass("ok");
1514        } else if (hasWarning($target)) {
1515            $target.removeClass("error");
1516            $target.addClass("warning");
1517            $target.removeClass("ok");
1518        } else if (hasOk($target)) {
1519            $target.removeClass("error");
1520            $target.removeClass("warning");
1521            $target.addClass("ok");
1522        } else {
1523            $target.removeClass("error");
1524            $target.removeClass("warning");
1525            $target.removeClass("ok");
1526        }
1527    }
1528
1529    function validate(target) {
1530        ///<summary>provede validaci</summary>
1531
1532        var $target = $(target);
1533
1534        if (!clientValidation) {
1535            console.debugWarn("Client validation is not present.");
1536            return;
1537        }
1538        var result = clientValidation.validateElement($target);
1539        if (result === null || result === undefined) {
1540            console.debugWarn("Validation result is null.");
1541            return;
1542        }
1543
1544        // pokud nebylo nalezeno validační pravidlo, tak nebudeme nic dělat
1545        if (!result.found) return;
1546
1547        var isError = result.error;
1548        var isWarning = !isError && result.warning;
1549        var isOk = result.ok;
1550        var message = result.message;
1551
1552        validationMessage($target, message);
1553
1554        // pokud se jedná o chybu nebo o varování
1555        if (isError || isWarning) {
1556            $target.removeClass("ok");
1557            if (isWarning) {
1558                hasWarning($target, true);
1559            } else {
1560                hasError($target, true);
1561            }
1562        }
1563        // pokud je vše v pořádku
1564        else if (isOk) {
1565            hasOk($target, true);
1566        }
1567
1568        updateVisualState($target);
1569    }
1570
1571    function validationMessage(target, value) {
1572        ///<summary>zapíše / zjistí validační chybu</summary>
1573
1574        var $hint = bindElement(target);
1575        if (!$hint || $hint.length === 0) throw "Hint not found for " + target.outerHTML;
1576        if (value === undefined) return $(".message", $hint).text();
1577        else return $(".message", $hint).text(value);
1578    }
1579
1580    function hasErrorWarningOk(target) {
1581        ///<summary>zjistí zda má element chybu, varování nebo ok</summary>
1582
1583        return hasError(target) || hasWarning(target) || hasOk(target);
1584    }
1585
1586    function hasError(target, value) {
1587        ///<summary>zapíše / zjistí, zda má textbox chybu</summary>
1588
1589        var $hint = bindElement(target);
1590        if (!$hint || $hint.length === 0) throw "Hint not found for " + target[0].outerHTML;
1591        if (value === undefined) return $hint.attr("data-bs-error-type") === "error";
1592        if (value) return $hint.attr("data-bs-error-type", "error");
1593        else return $hint.attr("data-bs-error-type", "");
1594    }
1595
1596    function hasWarning(target, value) {
1597        ///<summary>zapíše / zjistí, zda má textbox varování</summary>
1598
1599        var $hint = bindElement(target);
1600        if (!$hint || $hint.length === 0) throw "Hint not found for " + target.outerHTML;
1601        if (value === undefined) return $hint.attr("data-bs-error-type") === "warning";
1602        if (value) return $hint.attr("data-bs-error-type", "warning");
1603        else return $hint.attr("data-bs-error-type", "");
1604    }
1605
1606    function hasOk(target, value) {
1607        ///<summary>zapíše / zjistí, zda má textbox stav OK</summary>
1608
1609        var $hint = bindElement(target);
1610        if (!$hint || $hint.length === 0) throw "Hint not found for " + target.outerHTML;
1611        if (value === undefined) return $hint.attr("data-bs-error-type") === "ok";
1612        if (value) return $hint.attr("data-bs-error-type", "ok");
1613        else return $hint.attr("data-bs-error-type", "");
1614    }
1615
1616    function bindElement(target, value) {
1617        ///<summary>zapíše / zjistí provázanost elementu a hintu</summary>
1618
1619        if (value === undefined) return target.data("bs-hint-bind");
1620        return target.data("bs-hint-bind", value);
1621    }
1622
1623    function focusPrevented(target, value) {
1624        ///<summary>zapíše / zjistí, zda byla zamezena ztráta focusu kvůli chybě</summary>
1625
1626        if (value === undefined) return target.data("focusPrevented");
1627        return target.data("focusPrevented", value);
1628    }
1629
1630    function modified(target, value) {
1631        ///<summary>zapíše / zjistí, zda byl textbox editován od poslední ztráty focusu</summary>
1632
1633        if (value === undefined) return target.data("modified");
1634        return target.data("modified", value);
1635    }
1636
1637    function isInput(target) {
1638        ///<summary>zjistí, zda se jedná o input</summary>
1639
1640        return target.prop("tagName").toLowerCase() === "input";
1641    }
1642
1643    function scrollToElement($target) {
1644        ///<summary>provede odskrol na zadaný element</summary>
1645
1646        var scrollTop = $target.offset().top;
1647        var screenBottom = $(window).scrollTop() + window.innerHeight;
1648        var screenTop = $(window).scrollTop();
1649
1650        // nebudeme scrolovat pokud jsou všechny chyby ve viditelné části obrazovky
1651        if (scrollTop >= screenTop && scrollTop <= screenBottom) return;
1652
1653        $("html, body").animate({ scrollTop: scrollTop });
1654    }
1655
1656    function clientValidationEnabled() {
1657        // pokud není inicializovaná klientská validace
1658        if (!clientValidation || !clientValidation.active()) return false;
1659        return true;
1660    }
1661
1662    function initValidationElements() {
1663        ///<summary>najde elementy k validaci a inicializuje je</summary>
1664        /**
1665získání focusu
1666  aktuální element zatím nebyl validovaný
1667 
1668  aktuální element má chybu nebo warning
1669
1670ztráta focusu
1671  zvalidovat a zobrazit hint
1672
1673najetí myší na element, který má chybu nebo warning
1674  zobrazit hint, všechny ostatní hinty skrýt
1675  
1676vyjetí myší z elementu, který nemá focus a který má chybu nebo warning
1677  skrýt hint
1678
1679při změně textu provedeme validaci (kvůli SmartForm)
1680         */
1681        var $els = $(".bs-error-hint-target");
1682
1683        // provedeme validaci u neprázdných polí a aktualizujeme styly
1684        $els.each(function () {
1685            var $el = $(this);
1686
1687            // nastavíme výchozí text do placeholderu
1688            var defaultValue = $el.attr("data-default");
1689            if (defaultValue) $el.attr("placeholder", defaultValue);
1690
1691            // přidáme placeholder
1692            if (clientValidation) {
1693                clientValidation.addPlaceholder($el);
1694            }
1695
1696            // provedem náhradu zadaného textu, PH: přidáno 9.7.2020 v rámci 38182
1697            if (clientValidation) {
1698                var value = $el.val();
1699                var newValue = clientValidation.substitute($el, value);
1700                if (newValue !== value) {
1701                    $el.val(newValue);
1702                }
1703            }
1704
1705            // provedeme validaci pokud je vyplněný nějaký text a není to výchozí text
1706            var value = $el.val();
1707            if (value != null && value.length > 0 && value != $el.attr("data-default")) {
1708                validateAsync($el);
1709            }
1710
1711            // aktualizujeme stav (zelená, oranžová, červená)
1712            updateVisualState($el);
1713        });
1714
1715        // získání focusu
1716        $els.focus(function () {
1717            var $el = $(this);
1718
1719            // nastavíme výchozí text z placeholderu
1720            var defaultValue = $el.attr("data-default");
1721            if ($el.val().length === 0 && defaultValue) $el.val(defaultValue);
1722
1723            // vyresetujeme příznak zamezení ztráty focusu
1724            focusPrevented($el, false);
1725
1726            // zobrazíme hint
1727            showHintAsync($el, true, false);
1728        });
1729
1730        // ztráta focusu
1731        $els.blur(function (e) {
1732            var $this = $(this);
1733
1734            // provedeme validaci
1735            validateAsync($this.get(0));
1736
1737            // a zobrazíme hint
1738            showHintAsync($this.get(0), true);
1739
1740            /* funkce se zamezením ztráty focusu nefunguje na FF a asi i jinde, takže nemá cenu dělat
1741
1742            // pokud není validní a ještě jsme nezabránili ztráty focusu a textbox byl změněn
1743            if ((hasError($this) || hasWarning($this)) && !focusPrevented($this) && modified($this)) {
1744                // tak vrátíme focus zpět
1745                $this.focus();
1746                focusPrevented($this, true);
1747
1748            } else {
1749                // a resetujeme příznak modifikováno
1750                modified($this, false);
1751            }
1752            */
1753
1754
1755        });
1756
1757        $els.mouseout(function () {
1758            ///<summary>po vyjetí myši hint schováme, ale jen pokud nemá focus</summary>
1759
1760            if ($(this).is(":focus")) return;
1761            if ($(this).prop("tagName").toLowerCase() !== "input") return;
1762            showHintAsync($(this), false);
1763        });
1764
1765        $els.mouseenter(function () {
1766            ///<summary>po najetí myši hint zobrazíme</summary>           
1767            showHintAsync($(this), true);
1768        });
1769
1770        $els.keypress(function (e) {
1771            ///<summary>při zmáčknutí klávesy povolíme zapsat jen povolené hodnoty</summary>
1772
1773            var $el = $(this);
1774
1775            // pokud není povolená klientská validace, tak zrušíme případnou validační chybu ze serveru
1776            if (!clientValidationEnabled()) {
1777                hasError($el, false);
1778                hasWarning($el, false);
1779                hasOk($el, false);
1780                updateVisualState($el);
1781                return;
1782            }
1783
1784            // vypočteme nový text
1785            var currentText = $el.val();
1786            var newChar = String.fromCharCode(e.which);
1787            var startPosition = $el.get(0).selectionStart;
1788            var endPosition = $el.get(0).selectionEnd;
1789            var newText = "";
1790
1791            // backspace
1792            if (e.key === "Backspace") {
1793                newText = currentText.substr(0, startPosition - 1) + currentText.substr(endPosition);
1794            } else if (e.which > 0) {
1795                newText = currentText.substr(0, startPosition) + newChar + currentText.substr(endPosition);
1796            } else {
1797                return;
1798            }
1799
1800            // pokud se nejedná o povolený znak, tak zamezíme zmáčknutí klávesy
1801            if (!clientValidation.isAllowedValue($(this), newText)) {
1802                // kopírování a vkládání nezakážeme
1803                if (e.key === "Backspace" || e.ctrlKey || e.metaKey) return;
1804                else e.preventDefault();
1805            }
1806        });
1807
1808        $els.keydown(function () {
1809            ///<summary>při stisku klávesy označíme textbox jako změněný</summary>
1810
1811            var target = $(this);
1812            modified(target, true);
1813        });
1814
1815        // při zmáčknutí klávesy
1816        $els.keyup(function () {
1817            var target = $(this);
1818
1819            // provedem náhradu zadaného textu
1820            var value = target.val();
1821            if (clientValidationEnabled()) {
1822                var newValue = clientValidation.substitute(target, value);
1823                if (newValue !== value) {
1824                    var position = target.get(0).selectionStart;
1825                    var positionIsOnEnd = position >= value.length;
1826                    target.val(newValue);
1827                    if (positionIsOnEnd) position = newValue.length;
1828                    target.get(0).selectionStart = position;
1829                    target.get(0).selectionEnd = position;
1830                }
1831            }
1832
1833            // provedeme validaci a případně zobrazíme hint    
1834            // to však provedeme pouze pokud je textbox ve stavu chyba, varování nebo OK
1835            if (!(hasOk(target) || hasError(target) || hasWarning(target))) return;
1836
1837            validateAsync(target);
1838            showHintAsync(target, true);
1839        });
1840
1841        $els.change(function () {
1842            var target = $(this);
1843            validateAsync(target);
1844            showHintAsync(target, true);
1845        });
1846
1847        $els.on("paste", function (e) {
1848            var clipboardData = e.originalEvent.clipboardData || window.clipboardData;
1849            var newText = clipboardData.getData("Text");
1850            if (!clientValidation.isAllowedValue($(this), newText)) {
1851                e.preventDefault();
1852                return;
1853            }
1854        });
1855    }
1856
1857    function attachHints() {
1858        ///<summary>
1859        /// najde existující hinty a přiřadí je k elementům
1860        /// vrátí pole hintů
1861        ///</summary>
1862
1863        var hints = new Array();
1864        $(".bs-error-hint").each(function () {
1865            var $hint = $(this);
1866
1867            // najdeme cílový prvek
1868            var targetSelector = $hint.attr("data-target");
1869            var $target = $(targetSelector);
1870            if ($target.length === 0) {
1871                console.warn("Target " + targetSelector + " not found.");
1872            }
1873
1874            var proxyId = $target.attr("data-proxy");
1875            if (proxyId) $target = $("#" + proxyId);
1876
1877            $target.addClass("bs-error-hint-target");
1878            //$target.attr("title", )
1879
1880            // provážeme elment s hintem
1881            bindElement($target, $hint);
1882            bindElement($hint, $target);
1883
1884            hints[hints.length] = $hint;
1885        });
1886        return hints;
1887    }
1888
1889    function showFirstHint(arrayOfHints) {
1890        ///<summary>zobrazí první nalezený hint a odskroluje na něj</summary>
1891
1892        for (var i in arrayOfHints) {
1893            var $hint = arrayOfHints[i];
1894            var $target = bindElement($hint);
1895            if (!hasError($target) && !hasWarning($target)) continue;
1896            showHintAsync($target, true);
1897            updateVisualState($target);
1898            if ($target.prop("tagName").toLowerCase() === "input") $target.focus();
1899            scrollToElement($target);
1900            break;
1901        }
1902    }
1903
1904    var messageQueueTimeout;
1905    var messageQueue = new Array();
1906    var messageQueueOrder = 0;
1907
1908    function addToMessageQueue(key, fx) {
1909        if (messageQueue) clearTimeout(messageQueueTimeout);
1910        messageQueue[key] = { fx: fx, order: messageQueueOrder++ };
1911        messageQueueTimeout = setTimeout(function () {
1912            var previousQueue = messageQueue;
1913            messageQueue = new Array();
1914            previousQueue.sort(function (a, b) { return a.order < b.order });
1915            if (debug) for (var j in previousQueue) console.debug((j));
1916            for (var i in previousQueue) {
1917                var entry = previousQueue[i];
1918                entry.fx();
1919            }
1920        }, 250);
1921    }
1922
1923    function validateAsync(target) {
1924        var el = $(target).get(0);
1925        var key = "validate_" + $(target).attr("name");
1926        addToMessageQueue(key, function () {
1927            validate(el);
1928        });
1929    }
1930
1931    function showHintAsync(target, show, hideOthersIfCurrentValid) {
1932        var el = $(target).get(0);
1933        var key = "showHint_" + $(target).attr("name");
1934        addToMessageQueue(key, function () {
1935            showHint(el, show, hideOthersIfCurrentValid);
1936        });
1937    }
1938
1939    function init() {
1940        ///<summary>provede inicializaci</summary>
1941        var arrayOfHints = attachHints();
1942        initValidationElements();
1943        if (scrollToHint) showFirstHint(arrayOfHints);
1944    }
1945
1946    init();
1947}
1948
1949function bs_error_hint_show(scrollToHint) {
1950    var scrollToHintOnce = scrollToHint;
1951
1952    mvcCore.addAjaxEnd(function () {
1953        __bs_error_hint_show(scrollToHintOnce);
1954        scrollToHintOnce = false; // odskrol provedeme pouze 1x, viz 24092
1955    });
1956
1957    $(function () {
1958        __bs_error_hint_show(scrollToHintOnce);
1959        scrollToHintOnce = false; // odskrol provedeme pouze 1x, viz 24092
1960    });
1961
1962    /* 21.11.2018 - PH, zakomentováno kvůli responsivu, protože decorators.js nechceme, ono celé mvcUi.addDecorationEnd by chtělo zrušit nebo udělat jinak
1963    mvcUi.addDecorationEnd(function () {
1964        __bs_error_hint_show(scrollToHintOnce);
1965        scrollToHintOnce = false; // odskrol provedeme pouze 1x, viz 24092
1966    }, "bs_error_hint_show");*/
1967}
1968;//skript pro komponentu ForumView
1969//TODO vymyslet nějak univerzálně, eg uiCore.Init('ForumView', 'el123');
1970function ForumViewInit(viewId){
1971    var $forum = $("#" + viewId);
1972    var $topicHeader = $(".topicHeader", $forum);
1973    var $buttonNewTopic = $(".button.newTopic", $forum);
1974    var $newTopicForm = $(".topicForm.newTopic", $forum);
1975    var $respondForm = $(".topicForm.respond", $forum);
1976    var $buttonNewResponse = $(".button.newResponse", $forum);
1977
1978    $topicHeader.click(function () {
1979        var $header = $(this);
1980        var $topic = $header.parents(".topic");
1981        var $topicItemList = $(".topicItemList", $topic);
1982        $topicItemList.slideToggle("slow", function () {
1983            if ($(this).is(":visible")) {
1984                $topic.removeClass("collapsed");
1985                $topic.addClass("expanded");
1986            }
1987            else {
1988                $topic.removeClass("expanded");
1989                $topic.addClass("collapsed");
1990            }
1991        });
1992    });
1993
1994    $buttonNewTopic.click(function () {
1995        $buttonNewTopic.hide();
1996        $newTopicForm.slideToggle("slow");
1997    });
1998
1999    $buttonNewResponse.click(function () {
2000        var $topicItem = $(this).parents(".topicItem");
2001        var $respondPlaceholder = $(".respondPlaceholder", $topicItem);
2002        $(".button.newResponse").show();
2003        $(this).hide();
2004        $respondForm.hide();
2005        $respondForm.detach();
2006        $respondForm.appendTo($respondPlaceholder);
2007        $respondForm.slideDown();        
2008        $("input.topicItemId").prop("value", $topicItem.attr("data-id"));        
2009    });
2010
2011};
2012
2013;//skript pro komponentu ForumView
2014//TODO vymyslet nějak univerzálně, eg uiCore.Init('ProductsView', 'el123');
2015function ProductsViewInit(viewId, options) {
2016    var view = mvcUi.getView(viewId);
2017    
2018    if (!options) {
2019        options = {
2020            renderedColumns: null,
2021            visibleColumns: null,
2022        };
2023    }
2024
2025    mvcUi.invokeAfterLoad(function() {        
2026        // nastavení výšky názvů u ProductView    
2027        // Není úplně jasné na které straně toto řešit, ProductsView ví počet sloupců, ProductView zase tag, který obsahuje název.
2028        // Vyřešeno tak, že ProductView označí název speciální třídou pvi-sameHeight a ProductsView bude hledá tuto třídu.
2029        mvcUi.sameHeight(viewId, {
2030            itemSelector: ".pvi-sameHeight",
2031            containerSelector: ".productHolder",
2032            columns: options.renderedColumns, // nás zajímají renderované sloupce ne viditelné
2033            onHeightSet: setSmartSeparatorHeight
2034        });
2035
2036        // nastavení výšky smart vertical separátorů dle aktuální výšky elementu productHolder        
2037        function setSmartSeparatorHeight() {
2038            view.$(".separator.vertical.smart").each(function () {
2039                var $separator = $(this);
2040                var $productHolder = $separator.prev(".productHolder");
2041                if ($productHolder.length > 0) {
2042                    $separator.height($productHolder.outerHeight(false));
2043                }
2044            });
2045        }        
2046    });
2047};
2048
2049;//skript pro komponentu LoginView,
2050//je nutné pro funkci "Zapamatovat heslo" u prohlížečů, detailní informace viz LognView.cs metoda DummyLoginForm
2051//TODO vymyslet nějak univerzálně, eg uiCore.Init('ForumView', 'el123');
2052function LoginViewInit(viewId, loginId, passwordId, submitId, actionData) {        
2053    var $view = $("#" + viewId);
2054    var $login = $("#" + loginId);
2055    var $password = $("#" + passwordId);
2056    var $button = $("#" + submitId);
2057    var $dummyForm = $("#bs-dummy-login-form");
2058    var $dummyLogin = $("#bs-dummy-login");
2059    var $dummyPassword = $("#bs-dummy-password");
2060    var existsDummyForm = $dummyForm.length > 0;
2061    if (existsDummyForm) {
2062        $login.val($dummyLogin.val());
2063        $password.val($dummyPassword.val());
2064    }
2065
2066    $button.click(function() {        
2067        mvcCore.invokeAction(actionData, null, viewId, function (result) {
2068            // uložíme si data pro případné volání LoginViewLogin();
2069            var data =  {
2070                view: $view,
2071                login: $login.val(),
2072                password: $password.val()
2073            };
2074            if (existsDummyForm) {
2075                data.dummy = {
2076                    form: $dummyForm,
2077                    login: $dummyLogin,
2078                    password: $dummyPassword
2079                }
2080            }
2081            window["BS_LAST_LOGIN_VIEW_DATA"] = data;
2082            if (result.success) {
2083                /* 113473 - přesunuto do veřejné funkce LoginViewLogin(), protože je potřeba ji volat i ze strany serveru v případě navázaných skriptů na ClientInterface
2084                if (existsDummyForm) {
2085                    $dummyLogin.val($login.val());
2086                    $dummyPassword.val($password.val());
2087                    var $watermark = $login.find("+ .watermark");
2088                    if ($watermark.length > 0) {
2089                        // 53383 - Ve Firefoxu dochází k načítání username z vodoznaku při pokusu o zapamatování přihlašovacích údajů
2090                        $watermark.val($login.val());
2091                    }
2092                    $dummyForm.submit(); // tím dojde k reloadu celé stránky
2093                    return true;
2094                } else {
2095                    if ($view.is("form")) $view.submit(); // 90590
2096                    location.reload(true);
2097                    return true;
2098                }*/
2099                
2100                LoginViewLogin();
2101                return true;
2102            }
2103            return false;
2104        });
2105    });
2106
2107    $password.keyup(function(e) {
2108        if (e.keyCode == 13) {
2109            $button.click();
2110            $password.blur(); // defocus pole password, 26930 - bsshop - přihlašování s chybným heslem,
2111        }
2112    });    
2113};
2114
2115function LoginViewLogin() {
2116    var data = window["BS_LAST_LOGIN_VIEW_DATA"];
2117    if (!data) return;
2118
2119    // vyvoláme poslední akce ještě před provedením redirectu
2120    mvcCore.sendActionsBeforeUnload();
2121    if (data.dummy) {
2122        var dummy = data.dummy;
2123        // provedeme přihlášení přes dummy formulář aby došlo k uložení přihlášení do prohlížeče
2124        dummy.login.val(data.login);
2125        dummy.password.val(data.password);
2126        dummy.form.submit(); // tím dojde k reloadu celé stránky
2127    } else {
2128        var $view = data.view;
2129        if ($view && $view.is("form")) $view.submit(); // 90590
2130        location.reload(true);
2131    }
2132}
2133;//skript pro komponentu ProductDetailImageView
2134//TODO vymyslet nějak univerzálně, eg uiCore.Init('ProductDetailImageView', 'el123');            
2135function ProductDetailImageViewInit(viewId, otherImageClickAction, otherImageEnterAction, otherImageLeaveAction) {
2136   
2137    var viewEl = document.getElementById(viewId);    
2138    if (viewEl == null) return;
2139    
2140    var $view = mvcUi.getView(viewId);
2141    var $mainImageContainer = $view.$(".mainImage");
2142    var $otherImages = $view.$(".otherImage");
2143    var $nextImage = $view.$(".nextMainImage");
2144    var $prevImage = $view.$(".previousMainImage");
2145    var otherImagesCount = $otherImages.length;
2146    var currentImageIndex = 0;
2147
2148    var ITEM_TYPE_VIDEO = "Video";
2149    var ITEM_TYPE_YOUTUBE = "Youtube";
2150    
2151    if ($mainImageContainer.length === 0) return;
2152    if (otherImagesCount < 2) {
2153        if ($nextImage.length > 0) {
2154            $nextImage.addClass("disabled");
2155        }
2156        if ($prevImage.length > 0) {
2157            $prevImage.addClass("disabled");
2158        }
2159    } else {
2160        $otherImages.each(function(i, el) {
2161            $(el).data("imageIndex", i);
2162        });
2163        $nextImage.click(function() {
2164            var targetIndex = (currentImageIndex + 1) % otherImagesCount;
2165            replaceMainImage($($otherImages[targetIndex]));
2166        });
2167        $prevImage.click(function() {
2168            var targetIndex = (currentImageIndex + otherImagesCount - 1) % otherImagesCount;
2169            replaceMainImage($($otherImages[targetIndex]));
2170        });
2171
2172        // jednoduchý l/p | p/l swipe při dotyku
2173        // todo: vertical pohyb, v případě potřeby upravit
2174        // todo: nastaveno napevno pro min pohyb 50px, v případě potřeby do proměnné
2175        var touchMoveStartX;
2176        var wasImageReplaced = false;
2177        var minimalMoveLength = 50;
2178        $mainImageContainer.touchstart(function (e) {
2179            var startX = e.originalEvent.touches[0].clientX;
2180            touchMoveStartX = startX;
2181            wasImageReplaced = false;
2182        });
2183        $mainImageContainer.on("touchmove", function (e) {
2184            var touchMoveCurrent = e.originalEvent.touches[0].clientX;
2185            if (Math.abs(touchMoveStartX - touchMoveCurrent) > minimalMoveLength && !wasImageReplaced) {
2186                // defaultně pohyb doprava
2187                var targetIndex = (currentImageIndex + 1) % otherImagesCount;
2188                if (touchMoveStartX - touchMoveCurrent < - minimalMoveLength) {
2189                    targetIndex = (currentImageIndex + otherImagesCount - 1) % otherImagesCount;
2190                }
2191                replaceMainImage($($otherImages[targetIndex]));
2192                wasImageReplaced = true;
2193            }
2194        });
2195
2196    }
2197    if (otherImagesCount === 0) return;
2198
2199    var originalMainImageUrl = $mainImageContainer.children("img.mainImg").attr("src");
2200    var originalMainImageHref = $mainImageContainer.attr("href");
2201
2202    var isFirstChange = true;
2203
2204    function doAction(action, $el) {
2205        if (action == 'replaceMainImage') replaceMainImage($el);
2206        if (action == 'restoreMainImage') restoreMainImage($el);
2207    };
2208    
2209    function replaceMainImage($otherImage) {
2210
2211        var mainUrl = $otherImage.attr("data-main-url");
2212        var alt = $otherImage.children("img, iframe, video").attr("alt");
2213        var title = $otherImage.children("img, iframe, video").attr("title");
2214        var dataType = $otherImage.children("img, iframe, video").attr("data-type");
2215
2216        let $img = $mainImageContainer.children("img.mainImg");
2217        let $iframe = $mainImageContainer.children("iframe.mainImg");
2218        let $video = $mainImageContainer.children("video.mainImg");
2219        const disableCssClass = 'disable';
2220
2221        if (dataType === ITEM_TYPE_YOUTUBE)
2222        {
2223            $iframe.removeClass(disableCssClass);
2224            $img.addClass(disableCssClass);
2225            $video.addClass(disableCssClass);
2226            $img.attr('src', null);
2227            $video.attr('src', null);
2228            $iframe.attr('src', mainUrl);
2229            $iframe.attr("data-type", dataType);
2230        }
2231        else if (dataType === ITEM_TYPE_VIDEO)
2232        {
2233            $img.attr('src', null);
2234            $img.addClass(disableCssClass);
2235            $iframe.attr('src', null);
2236            $iframe.addClass(disableCssClass);
2237            $video.removeClass(disableCssClass);
2238            $video.attr('src', mainUrl);
2239            $video.attr("data-type", dataType);
2240        }
2241        else
2242        {    
2243            $iframe.attr('src', null);
2244            $video.attr('src', null);
2245            $iframe.addClass(disableCssClass);
2246            $video.addClass(disableCssClass);
2247            $img.removeClass(disableCssClass);
2248            // uzamkneme velikost hlavního obrázku, jinak to bude nepříjemně poskakovat při různých velikostech obrázků
2249            if (isFirstChange && $mainImageContainer.height() > 300) { // 300 nemá smysl omezovat výšku pokud obrázek není rozumné velikosti - viz. chyba youtube - 102231
2250                isFirstChange = false;
2251                $img.css("max-width", $mainImageContainer.width());
2252                $img.css("max-height", $mainImageContainer.height());
2253                $mainImageContainer.height($mainImageContainer.height());
2254            }
2255            $img.attr("src", mainUrl);
2256            $img.attr("alt", alt);
2257            $img.attr("title", title);
2258            $img.attr("data-type", dataType);
2259        }
2260
2261        $mainImageContainer.attr("href", $otherImage.attr("href"));
2262        currentImageIndex = $otherImage.data("imageIndex");
2263    };
2264    
2265    function restoreMainImage($otherImage) {
2266        $mainImageContainer.children("img.mainImg").attr("src", originalMainImageUrl);
2267        $mainImageContainer.attr("href", originalMainImageHref);
2268    };
2269
2270    $otherImages.on('click', function () {
2271        doAction(otherImageClickAction, $(this));
2272    });
2273
2274    $otherImages.on('mouseenter', function() {
2275        doAction(otherImageEnterAction, $(this));               
2276    });
2277    
2278    $otherImages.on('mouseleave', function () {
2279        doAction(otherImageLeaveAction, $(this));        
2280    });
2281};
2282
2283;//Skript pro zobrazování galerie obrázků.
2284//Pro fungování galerie je nutné, aby stránka na které se bude galerie zobrazovat obsahovala následující náležitosti:
2285//1. elementu <a> musí obsahovat atribut data-lightbox="gallery"
2286//2. musí být na stránce načten skript GalleryLoaderView.js, který přidává na poslední kliknutý element atribut data-click=1
2287//3. Název produktu v titulku se bere z aktuálně vybraného obrázku z atributu "title"
2288//4. url adresa velkého obázku se bere z elementu <a data-lightbox="gallery"> z atributu href 
2289//5. url adresa malého obrázku se bere z elementu <img> z atributu src, který je uvnitř elementu <a data-lightbox="gallery">
2290function GalleryViewInit(viewId, options) {
2291
2292    if (!options) {
2293        options = {
2294            galleryMainItem: "galleryMainImage",
2295            galleryMainImg: "galleryMainImg",
2296            galleryButtonPrev: "galleryButtonPrev",
2297            galleryButtonNext: "galleryButtonNext",
2298            galleryButtonScrollBottom: "galleryButtonScrollBottom",
2299            galleryButtonScrollTop: "galleryButtonScrollTop",
2300            galleryButtonScrollLeft: "galleryButtonScrollLeft",
2301            galleryButtonScrollRight: "galleryButtonScrollRight",
2302            galleryPageNumbers: "galleryPageNumbers",
2303            galleryOtherImagesVertical: "galleryOtherImagesVertical",
2304            galleryOtherImagesHorizontal: "galleryOtherImagesHorizontal",
2305            galleryName: "galleryName",
2306            otherImagesColumnCount: 2
2307        };
2308    }
2309
2310    const ITEM_TYPE_VIDEO = "Video";
2311    const ITEM_TYPE_YOUTUBE = "Youtube";
2312    const ITEM_TYPE_IMAGE = "Image";
2313
2314    var viewEl = document.getElementById(viewId);
2315    if (viewEl == null) return;
2316    var $view = mvcUi.getView(viewId);
2317    var $galleryName = $view.$("." + options.galleryName);
2318    var $galleryMainImg = $view.$("." + options.galleryMainImg);
2319    var $galleryOtherImagesVertical = $view.$("." + options.galleryOtherImagesVertical);
2320    var $galleryOtherImagesHorizontal = $view.$("." + options.galleryOtherImagesHorizontal);
2321    var $galleryButtonPrev = $view.$("." + options.galleryButtonPrev);
2322    var $galleryButtonNext = $view.$("." + options.galleryButtonNext);
2323    var $galleryButtonScrollTop = $view.$("." + options.galleryButtonScrollTop);
2324    var $galleryButtonScrollBottom = $view.$("." + options.galleryButtonScrollBottom);
2325    var $galleryButtonScrollLeft = $view.$("." + options.galleryButtonScrollLeft);
2326    var $galleryButtonScrollRight = $view.$("." + options.galleryButtonScrollRight);
2327    var $galleryPageNumbers = $view.$("." + options.galleryPageNumbers);
2328    
2329    var items = [];
2330    var scrollTopId = 0;
2331    var galleryMainItemZoom = false;
2332    var currentItem;
2333
2334    $view.$(".galleryMainImgWrap").append("<div class='galleryLoading'></div>");
2335    $view.$(".galleryMainImgWrap").append("<div class='zoomContainerWrap'><div class='buttonZoom'></div><div class='zoomContainer'><img class='zoom'/></div></div>");
2336    
2337    var touchStart;
2338
2339    var $zoomContainer = $(".zoomContainer");
2340    var $zoomContainerWrap = $(".zoomContainerWrap");
2341    var $galleryMainItemWrap = $(".galleryMainImgWrap");
2342    //elementy ze kterých budeme brát url adresy obrázků
2343    //var $dataElements = $('a[data-lightbox=gallery]');
2344    var $dataElements = $('*[data-lightbox=gallery]');
2345
2346    var $galleryLoading = $(".GalleryView .galleryLoading");
2347
2348    var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
2349    var verticalThumbnails;
2350
2351    //Po klinutí na tlačítko zpět chceme pouze zavřít dialog. Jinak by jsme se dostali na výpis produktu. 
2352    $(async function ($) {
2353        if (window.history && window.history.pushState) {
2354            //window.history.pushState('', null, './#gallery');
2355            // 98077
2356            var url = new URL(window.location);
2357            url.hash = "gallery";
2358            window.history.pushState('', null, url);
2359            var isGalleryClosed = false;
2360            $(window).on('popstate', function () {
2361                if (isGalleryClosed) return;
2362                isGalleryClosed = true;
2363                $('.closeButton').click();
2364            });
2365            $('.closeButton').click(function () {
2366                if (isGalleryClosed) return;
2367                isGalleryClosed = true;
2368                window.history.back();
2369            });
2370        }
2371        await initGalleryAsync();
2372    });
2373
2374    function removeZoom() {
2375        $('.buttonZoom').css('visibility', 'hidden');
2376        $view.$('.zoom').css('display', 'none');
2377        $view.$('.zoomContainerWrap').css('pointer-events', 'none');
2378
2379        galleryMainItemZoom = false;
2380        $(".buttonZoom").removeClass("out");
2381    }
2382
2383    $view.$(".buttonZoom").click(function () {
2384        //        document.body.webkitRequestFullScreen();
2385        if (galleryMainItemZoom) {
2386            removeZoom();
2387            $('.buttonZoom').css('visibility', 'visible'); //oprava - 118992
2388
2389        } else {
2390            galleryMainItemZoom = true;
2391            $(".buttonZoom").addClass("out");
2392            $view.$('.zoomContainerWrap').css('pointer-events', 'all');
2393        }
2394
2395        $galleryMainImg.trigger("mouseenter");
2396    });
2397
2398    $zoomContainer.on({
2399        'touchstart': function (event) {
2400            touchStart = event;
2401        }
2402    });
2403
2404    $zoomContainer.on({
2405        'touchmove mousemove': function (event) {
2406            var isTouchDevice = 'ontouchstart' in document.documentElement;
2407            //  if (isTouchDevice && !event.touches) return;
2408            var sourceWidth = $view.$('.zoom').width();
2409            var sourceHeight = $view.$('.zoom').height();
2410            var xRatio = ($galleryMainImg.width() - sourceWidth) / $galleryMainImg.width();
2411            var yRatio = ($galleryMainImg.height() - sourceHeight) / $galleryMainImg.height();
2412
2413            if (!galleryMainItemZoom) return;
2414
2415            var left, top;
2416            if (isTouchDevice) {
2417                //var currentLeft = parseInt($view.$('.zoom').css('left'),10)/xRatio;
2418                //var currentTop = parseInt($view.$('.zoom').css('top'),10)/yRatio;
2419                //left = currentLeft + touchStart.targetTouches[0].pageX - event.touches[0].pageX;
2420                //top = currentTop + touchStart.targetTouches[0].pageY - event.touches[0].pageY;
2421                left = event.touches[0].pageX - $galleryMainImg.offset().left;
2422                top = event.touches[0].pageY - $galleryMainImg.offset().top;
2423            }
2424            else {
2425                left = event.pageX - $galleryMainImg.offset().left;
2426                top = event.pageY - $galleryMainImg.offset().top;
2427            }
2428
2429            top = Math.max(Math.min(top, sourceHeight), 0);
2430            left = Math.max(Math.min(left, sourceWidth), 0);
2431
2432            $view.$('.zoom').css('left', (left * xRatio) + 'px');
2433            $view.$('.zoom').css('top', (top * yRatio) + 'px');
2434            //  event.stopImmediatePropagation();
2435        }
2436    });
2437
2438    $view.$('.closeButton').click(() => $view.$('.galleryMainImage').empty()); // ukončení přehrávání videa
2439
2440    $galleryMainImg.mouseenter(function () {
2441
2442        if (!galleryMainItemZoom) return;
2443        $view.$('.zoom').css('display', 'block');
2444    });
2445
2446    $zoomContainer.mouseenter(function () {
2447
2448        if (!galleryMainItemZoom) return;
2449        $view.$('.zoom').css('display', 'block');
2450    });
2451
2452    //Událost po klinutí na předchozí obrázek. 
2453    //Nastavuje se zde proměnná mainImageIndex.
2454    $galleryButtonPrev.click(function () {
2455        galleryButtonPrevClick();
2456    });
2457
2458    function galleryButtonPrevClick() {
2459        console.log(currentItem.index);
2460        if (currentItem.index === 0) {
2461            currentItem = items[items.length - 1];
2462        } else {
2463            currentItem = items.find(f => f.index === currentItem.index - 1);
2464        }
2465        setMainImageUrl();
2466    }
2467
2468    //Událost po klinutí na další obrázek.
2469    //Nastavuje se zde proměnná mainImageIndex.
2470    $galleryButtonNext.click(function () {
2471        galleryButtonNextClick();
2472    });
2473
2474    function galleryButtonNextClick() {
2475        if (items.length === currentItem.index + 1) {
2476            currentItem = items[0];
2477        } else {
2478            currentItem = items.find(f => f.index === currentItem.index + 1)
2479        }
2480        setMainImageUrl();
2481    }
2482
2483    // změna obrázku na rolování kolečkem
2484    $(document).on('mousewheel DOMMouseScroll', function (e) {
2485        if (e.originalEvent.wheelDelta < 0 || e.originalEvent.detail > 0) {
2486            galleryButtonNextClick();
2487        } else {
2488            galleryButtonPrevClick();
2489        }
2490
2491        //prevent page fom scrolling only if lightbox is visible
2492        if (window.getComputedStyle(viewEl).getPropertyValue("display") == "fixed") {
2493            return false;
2494        }
2495
2496    });
2497
2498    $(document).keydown(function (event) {
2499        if (event.which == 32 || event.which == 39 || event.which == 40 || event.which == 34) { // 8 - spacebar , 39 - right arrow, 40 - down arrow, 34 - page down
2500            galleryButtonNextClick();
2501        }
2502        if (event.which == 37 || event.which == 38 || event.which == 33) { // 8 - backspace , 39 - left arrow, 38 - up arrow, 33 - page up
2503            galleryButtonPrevClick();
2504        }
2505        if (event.which == 27) { // 27 - escape
2506            $('.closeButton').click();
2507        }
2508    });
2509
2510    //Událost po klinutí na šipku dolů u ostatních obrázků.
2511    $galleryButtonScrollBottom.click(function () {
2512        galleryOtherImagesVerticalScrollBottom();
2513    });
2514
2515    //Událost po klinutí na šipku nahoru u ostatních obrázků.
2516    $galleryButtonScrollTop.click(function () {
2517        galleryOtherImagesVerticalScrollTop();
2518    });
2519
2520    //Událost po klinutí na levou šipku u ostatních obrázků.
2521    $galleryButtonScrollLeft.click(function () {
2522        galleryOtherImagesHorizontalScrollLeft();
2523    });
2524
2525    //Událost po klinutí na pravou šipku u ostatních obrázků.
2526    $galleryButtonScrollRight.click(function () {
2527        galleryOtherImagesHorizontalScrollRight();
2528    });
2529
2530    $(window).resize(function () {
2531        resizeWindow();
2532    });
2533
2534    // každých 100ms během resizování okna spustí vynucení překreslení obrázku
2535    if (isChrome) {
2536        var fixIt;
2537        window.onresize = function () {
2538            clearTimeout(fixIt);
2539            fixIt = setTimeout(function () {
2540                fixDeformedImage();
2541            }, 100);
2542        };
2543    }
2544
2545
2546    function resizeWindow() {
2547        var windowsHeight = $(window).height();
2548        var windowsWidth = $(window).width();
2549        var viewportRatio = windowsWidth / windowsHeight;
2550
2551        if (viewportRatio > 14 / 9) {
2552            $view.$().addClass("vertical");
2553            $view.$().removeClass("horizontal");
2554            verticalThumbnails = true;
2555        } else {
2556            $view.$().addClass("horizontal");
2557            $view.$().removeClass("vertical");
2558            verticalThumbnails = false;
2559        }
2560
2561        $view.$('.galleryOtherImagesVertical').height(windowsHeight * 0.8 - ($galleryButtonScrollBottom.height() + $galleryButtonScrollTop.height()) * 1.0);
2562        removeZoom();
2563        setZoomContainer();
2564        setButtonVisibility();
2565    }
2566
2567    function galleryOtherImagesHorizontalScrollLeft() {
2568        var minOffset = 100000; // Number.MAX_VALUE
2569        var $nextElement;
2570        var scrollLeft = $('.galleryOtherImagesHorizontalContainer').scrollLeft();
2571
2572        $('.galleryOtherImagesHorizontalContainer img').each(function () {
2573            var nextImagePositionHorizontal = $(this).position().left; // prvni hazi 0 , takze se nemus nic odecit a veme se prvni kladnej
2574            nextImagePositionHorizontal = Math.floor(nextImagePositionHorizontal); // byl problém s desetinnými čísly
2575            if (nextImagePositionHorizontal < 0 && minOffset > -nextImagePositionHorizontal) {
2576                minOffset = -nextImagePositionHorizontal;
2577                $nextElement = $(this);
2578            }
2579        });
2580
2581        if (minOffset) { //http://knowledge:81/knowledge/1449
2582            scrollHorizontalId = $nextElement.attr("data-id");
2583            scrollLeft -= minOffset;
2584            $('.galleryOtherImagesHorizontalContainer').animate({
2585                scrollLeft: scrollLeft
2586            }, 250, function () {
2587                setButtonVisibility();
2588            });
2589        }
2590    }
2591
2592    function galleryOtherImagesHorizontalScrollRight() {
2593        var minOffset = 100000;
2594        var $nextElement;
2595        var scrollLeft = $('.galleryOtherImagesHorizontalContainer').scrollLeft();
2596
2597        $('.galleryOtherImagesHorizontalContainer img').each(function () {
2598            var nextImagePositionHorizontal = $(this).position().left; // prvni hazi 0 , takze se nemus nic odecit a veme se prvni kladnej
2599            nextImagePositionHorizontal = Math.floor(nextImagePositionHorizontal); // byl problém s desetinnými čísly
2600            if (nextImagePositionHorizontal > 0 && minOffset > nextImagePositionHorizontal) {
2601                minOffset = nextImagePositionHorizontal;
2602                $nextElement = $(this);
2603            }
2604        });
2605
2606        if (minOffset) { //http://knowledge:81/knowledge/1449
2607            scrollHorizontalId = $nextElement.attr("data-id");
2608            scrollLeft += minOffset;
2609            $('.galleryOtherImagesHorizontalContainer').animate({
2610                scrollLeft: scrollLeft
2611            }, 250, function () {
2612                setButtonVisibility();
2613            });
2614        }
2615    }
2616
2617    //Zde posuneme element "galleryOtherImagesVerticalContainer" tak,
2618    //aby horní hrana nejbližšího dalšího horního obrázku lícovala se začátkem. 
2619    function galleryOtherImagesVerticalScrollTop() {
2620        var position = $('.galleryOtherImagesVerticalContainer').scrollTop();
2621        var minOffset = 100000;
2622        var $prevElement;
2623        //Projedeme všechny obrázky.
2624        //Ten který bude mít nejmenší "zápornou" vzdálenost od počátku, je náš obrázek na který se chceme posunout.
2625        $('.galleryOtherImagesVerticalContainer img').each(function () {
2626            var offset;
2627            var positionOtherImagesContainer = $('.galleryOtherImagesVerticalContainer').position().top;
2628            var nextImagePositionTop = $(this).position().top;
2629            offset = positionOtherImagesContainer - nextImagePositionTop;
2630            if (offset > 0 && minOffset > offset) {
2631                minOffset = offset;
2632                $prevElement = $(this);
2633            }
2634        });
2635        if (minOffset > 0 && typeof $prevElement != 'undefined') {
2636            scrollTopId = $prevElement.attr("data-id"); // zde si zapamatujeme obrázek na který jsme se posunuli
2637            position -= minOffset;
2638
2639            $('.galleryOtherImagesVerticalContainer').animate({
2640                scrollTop: position
2641            }, 250, function () {
2642                setButtonVisibility();
2643            });
2644        }
2645    }
2646    //Zde posuneme element "galleryOtherImagesVerticalContainer" vždy na následující obrázek směrem dolů. 
2647    function galleryOtherImagesVerticalScrollBottom() {
2648        var position = $('.galleryOtherImagesVerticalContainer')[0].scrollTop;
2649        var minOffset = 100000;
2650        var $nextElement;
2651        //Projedeme všechny obrázky.
2652        //Ten který bude mít nejmenší "kladnou" vzdálenost od aktuálního obrázku, je náš obrázek na který se chceme posunout.
2653        $('.galleryOtherImagesVerticalContainer img').each(function () {
2654            var imagePositionTop = $('[data-id=' + scrollTopId + ']').position().top;
2655            var nextImagePositionTop = $(this).position().top;
2656            var offset = nextImagePositionTop - imagePositionTop;
2657            if (offset > 0.9 && minOffset > offset) {
2658                minOffset = offset;
2659                $nextElement = $(this);
2660            }
2661        });
2662        if (minOffset > 0 && typeof $nextElement != 'undefined') {
2663            scrollTopId = $nextElement.attr("data-id");
2664            position += minOffset;
2665
2666            $('.galleryOtherImagesVerticalContainer').animate({
2667                scrollTop: position
2668            }, 250, function () {
2669                setButtonVisibility();
2670            });
2671        }
2672
2673    }
2674
2675    async function initGalleryAsync() {  
2676        //obrázek, na který jsme klikli - ten nastavíme jako aktuální(hlavní) obrázek
2677        const $currentElement = $("[data-click=1]");
2678        currentItem = convertToItem($currentElement, -1);
2679        let tempItems = new Map();  // nejdříve dáme do setu kůli duplicitám
2680        $dataElements.each(function (i, el) {
2681            const item = convertToItem($(el), -1); // -1 -> chceme stejný index všude (zatím), chceme odstranit dulicity
2682          //  tempItems.add(JSON.stringify(item));
2683            tempItems.set(removeUrlParameter(item.fullUrl, '_gl'), JSON.stringify(item));
2684        });
2685        items = Array.from([...tempItems.values()], i => JSON.parse(i));
2686        for(let i = 0; i < items.length; i++) {
2687            if (IsSameItem(items[i], currentItem)) {
2688                currentItem.index = i;
2689            }
2690            items[i].index = i; 
2691        }
2692        if (items.length === 0) return;
2693        if (items.length === 1) $view.$().addClass("singleImage");
2694        $galleryOtherImagesVertical.append("<div class='galleryOtherImagesVerticalContainer col" + options.otherImagesColumnCount + "'></div>");
2695        //vytvoříme sloupce dle parametru options.otherImagesColumnCount
2696        for (var j = 1; j < options.otherImagesColumnCount + 1; j++) {
2697            $('.galleryOtherImagesVerticalContainer').append("<div class='column' data-column='" + j + "'></div>");
2698        }
2699
2700        await preloadAsync(items, 0);
2701
2702        var currentTitle = currentItem.title;
2703        for (let item of items) {
2704            const htmlElement = convertItemToHtmlElement(item, true);
2705            const $columns = $('.galleryOtherImagesVerticalContainer .column');
2706            let $column;
2707            let minHeight = 100000;
2708            $columns.each(function (i, column) {
2709                let height = $(column).outerHeight(true);
2710                if (height < minHeight) {
2711                    $column = $(column);
2712                    minHeight = height;
2713                }
2714            });
2715            if (item.type === ITEM_TYPE_VIDEO || item.type === ITEM_TYPE_YOUTUBE) { 
2716                $column.append(`<div data-id="${item.index}" class="bs-item-wrap wrap-overlay">${htmlElement}</div>`);
2717            } else {
2718                $column.append(htmlElement);   
2719            }
2720            
2721        }
2722
2723        $galleryOtherImagesHorizontal.append("<div class='galleryOtherImagesHorizontalContainer'></div>");
2724        for (let item of items) {
2725            const htmlElement = convertItemToHtmlElement(item, true);
2726            if (item.type === ITEM_TYPE_VIDEO || item.type === ITEM_TYPE_YOUTUBE) { 
2727                $('.galleryOtherImagesHorizontalContainer').append(`<div data-id="${item.index}" class="bs-item-wrap wrap-overlay">${htmlElement}</div>`);
2728            } else {
2729                $('.galleryOtherImagesHorizontalContainer').append(htmlElement);   
2730            }
2731            
2732        }
2733
2734        setMainImageUrl();
2735        $galleryName.text(currentTitle);
2736        resizeWindow();
2737
2738        // pokud je jenom jeden obrázek, kliknutí na pozadí, zavře lightbox
2739        // umístil jsem to sem, protože se nejdříve musí přiřadit třída singleImage  
2740        $("#PDGallery.singleImage .header, #PDGallery.singleImage .content1").on('click', function (e) {
2741            if (e.target === this) {
2742                $('#PDGallery .closeButton').click();
2743                e.stopPropagation();
2744            }
2745        });
2746
2747        $("body")
2748            .on('touchstart', function (e) {
2749                xD = e.changedTouches[0].pageX;
2750            })
2751            .on('touchend', function (e) {
2752                xU = e.changedTouches[0].pageX;
2753                if (xD < (xU - 50)) {
2754                    $galleryButtonNext.click();
2755                }
2756                if (xD > (xU + 50)) {
2757                    $galleryButtonPrev.click();
2758                }
2759            })
2760            ;
2761
2762        //Událost po klinutí na jeden z náhledů obrázku.
2763        $("." + options.galleryOtherImagesVertical + " .bs-item-wrap").click(function () {
2764            const index = parseInt($(this).attr("data-id"))
2765            currentItem = items.find(item => item.index === index);
2766            setMainImageUrl();
2767        });
2768
2769        //Událost po klinutí na jeden z náhledů obrázku.
2770        $("." + options.galleryOtherImagesHorizontal + " .bs-item-wrap").click(function () {
2771            const index = parseInt($(this).attr("data-id"))
2772            currentItem = items.find(item => item.index === index);
2773            setMainImageUrl();
2774        });
2775        resizeWindow();
2776        
2777    }
2778
2779    function convertItemToHtmlElement(item, useSmallUrl) {
2780        let appendElement = "";
2781        let url = item.fullUrl;
2782        if (useSmallUrl){
2783             url = item.smallUrl;
2784        }
2785        
2786        if (item.type === ITEM_TYPE_IMAGE ) {
2787            appendElement = `<img class="bs-item-wrap" src="${url}" data-id="${item.index}">`;
2788        }
2789        if (item.type === ITEM_TYPE_VIDEO) {
2790            let autoplay = '';
2791            if (!useSmallUrl) {
2792                autoplay = "autoplay";
2793            }
2794            appendElement = `<video width="100%" ${autoplay} style="aspect-ratio:${item.videoWidth}/${item.videoHeight}" controls="" class="bs-item-wrap" data-id="${item.index}"><source src="${url}" type="video/mp4"></video>`;
2795        } 
2796        if (item.type === ITEM_TYPE_YOUTUBE) {
2797            let autoplay = '';
2798            if (!useSmallUrl) {
2799                if (url.includes("?")) {
2800                    autoplay = "&autoplay=1";
2801                } else {
2802                    autoplay = "?autoplay=1";
2803                }
2804            }
2805            appendElement = `<iframe width="100%" class="bs-item-wrap" src="${url}${autoplay}" title="${item.title}" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>`;
2806        } 
2807        return appendElement;
2808    }
2809
2810    function convertToItem($element, index) {
2811        let item = "";
2812        const $img = $element.find("img:not(.disable)").first();
2813        const $iframe = $element.find("iframe:not(.disable)").first();
2814        const $video = $element.find("video:not(.disable)").first();
2815        if ($img.length > 0 && $img[0].src)
2816        {
2817            const fullImageUrl = $element.attr("href");
2818            let smallImageUrl;
2819            const imageTitle = $img.attr("alt");
2820            if ($img[0].hasAttribute("data-src")) {
2821                smallImageUrl = $img.attr("data-src");
2822            } else {
2823                smallImageUrl = $img.attr("src");
2824            }
2825            smallImageUrl = smallImageUrl.replace(/(\r\n|\n|\r)/gm, "");
2826            item = { fullUrl: fullImageUrl, smallUrl: smallImageUrl, type: ITEM_TYPE_IMAGE, title: imageTitle, index: index };
2827        }
2828        else if ($video.length > 0 && $video[0].src)
2829        {
2830            const title = $element.attr("title");
2831            let fullImageUrl = $element.attr("href");
2832            item = { fullUrl: fullImageUrl, smallUrl: fullImageUrl, type: ITEM_TYPE_VIDEO, title: title, index: index };
2833        }
2834        else if ($iframe.length > 0 && $iframe[0].src)
2835        {
2836            const url = $element.attr("href");
2837            const regex = /img=([^&]+).*&youtube=1/;
2838            const match = regex.exec(url);
2839            const parsedValue = match[1];
2840            const fullImageUrl = atob(parsedValue);
2841            const title = $element.attr("title");
2842            item = { fullUrl: fullImageUrl, smallUrl: fullImageUrl, type: ITEM_TYPE_YOUTUBE, title: title, index: index };
2843        }
2844        
2845        return item;
2846    }
2847
2848    function IsSameItem(item1, item2) {
2849       // return JSON.stringify(item1) === JSON.stringify(item2);
2850        return removeUrlParameter(item1.fullUrl, '_gl') === removeUrlParameter(item2.fullUrl, '_gl');
2851    }
2852
2853    function removeUrlParameter(url, parameter) {
2854        if (url === undefined) {
2855            return ''; 
2856        }
2857        let [path, queryString = ''] = url.split('?');
2858        let params = new URLSearchParams(queryString);
2859        params.delete(parameter);
2860        return `${path}${params.toString() ? '?' + params.toString() : ''}`;
2861    }
2862
2863    function setMainImageUrl() {
2864        removeZoom();
2865        const mainImageUrl = currentItem.fullUrl;
2866        const tempCssClass = $galleryMainImg.attr('class');
2867        $galleryMainImg.replaceWith(convertItemToHtmlElement(currentItem, false));
2868        $galleryMainImg = $galleryMainItemWrap.children('.bs-item-wrap');
2869        $galleryMainImg.addClass(tempCssClass);
2870        $('.galleryOtherImagesVerticalContainer .bs-item-wrap').removeClass("active");
2871        $('.galleryOtherImagesVerticalContainer .bs-item-wrap[data-id=' + currentItem.index + ']').addClass("active");
2872        $('.galleryOtherImagesHorizontalContainer .bs-item-wrap').removeClass("active");
2873        $('.galleryOtherImagesHorizontalContainer .bs-item-wrap[data-id=' + currentItem.index + ']').addClass("active");
2874        const title = currentItem.title;
2875        if (currentItem.title) {
2876            $galleryName.text(currentItem.title);
2877            $galleryMainImg.attr("alt", title);
2878            $galleryMainImg.attr("title", title);
2879        } else {
2880            $galleryName.text("");
2881        }
2882
2883        var activePage = parseInt(currentItem.index) + 1;
2884        $galleryPageNumbers.text(activePage + " / " + items.length);
2885        
2886        if (currentItem.type === ITEM_TYPE_IMAGE) {
2887            $galleryLoading.addClass("visible");
2888            $('.zoom').attr("src", mainImageUrl); 
2889            $galleryMainImg.one('load', function () {
2890                loadingComplete();
2891            });
2892    
2893            if ($galleryMainImg.complete) { //řeší problém pokud to je v cache
2894                loadingComplete();
2895            }
2896        }
2897
2898        if (currentItem.type === ITEM_TYPE_VIDEO || currentItem.type === ITEM_TYPE_YOUTUBE) {
2899            $('.buttonZoom').css('visibility', 'hidden');
2900        }
2901        
2902        function loadingComplete() {
2903            $galleryLoading.removeClass("visible");
2904            resizeWindow();
2905            setZoomContainer();
2906        }
2907
2908        preloadImages(); 
2909       
2910    }
2911
2912    function setButtonVisibility() {
2913        if (verticalThumbnails) {
2914            setVerticalArrowsVisibility();
2915        } else {
2916            setHorizontalArrowsVisibility();
2917        }
2918        setZoomButtonVisibility();
2919    }
2920
2921    //Zde nastavujeme viditelnost horního a dolního tlačítka u náhledů,
2922    //pokud již nelze obrázky posunout, tlačítka nebudou viditelná. 
2923    function setVerticalArrowsVisibility() {
2924        const $lastItem = $('.galleryOtherImagesVerticalContainer .bs-item-wrap').last();
2925        if ($lastItem.length === 0) return;
2926        const lastItemHeight = $lastItem.height();
2927
2928
2929        if ($('.galleryOtherImagesVerticalContainer')[0].scrollTop > 10) { // limit od 10 pixelů má zabránit zobrazení šipky, která to po kliknutí posune o 1px
2930            $galleryButtonScrollTop.css("visibility", "visible");
2931        } else {
2932            $galleryButtonScrollTop.css("visibility", "hidden");
2933        }
2934
2935        if ($lastItem.offset().top + lastItemHeight + Math.max(1, lastItemHeight) <= $galleryButtonScrollBottom.offset().top + 10) { // +10 pixelů má zabránit zobrazení šipky, která to po kliknutí posune o 1px
2936            $galleryButtonScrollBottom.css("visibility", "hidden");
2937        } else {
2938            $galleryButtonScrollBottom.css("visibility", "visible");
2939        }
2940    }
2941
2942    //Zde nastavujeme viditelnost levého a pravého tlačítka u náhledů,
2943    //pokud již nelze obrázky posunout, tlačítka nebudou viditelná. 
2944    function setHorizontalArrowsVisibility() {
2945        const $lastItem = $('.galleryOtherImagesHorizontalContainer .bs-item-wrap').last();
2946        const lastItemWidth = $lastItem.width();
2947        if ($('.galleryOtherImagesHorizontalContainer').scrollLeft() > 5) { // limit od 5 pixelů má zabránit zobrazení šipky, která to po kliknutí posune o 1px
2948            $galleryButtonScrollLeft.css("visibility", "visible");
2949        } else {
2950            $galleryButtonScrollLeft.css("visibility", "hidden");
2951        }
2952
2953        if ($lastItem.offset().left + Math.max(1, lastItemWidth) <= $galleryButtonScrollRight.offset().left + 5) { // +5 pixelů má zabránit zobrazení šipky, která to po kliknutí posune o 1px
2954            $galleryButtonScrollRight.css("visibility", "hidden");
2955        } else {
2956            $galleryButtonScrollRight.css("visibility", "visible");
2957        }
2958    }
2959
2960    function setZoomButtonVisibility() {
2961
2962        var sourceWidth = $view.$('.zoom').width();
2963        var sourceHeight = $view.$('.zoom').height();
2964        if (sourceWidth === 0 || sourceHeight === 0 || currentItem.type === ITEM_TYPE_VIDEO || currentItem.type === ITEM_TYPE_YOUTUBE) {
2965            $('.buttonZoom').css('visibility', 'hidden');
2966            return;
2967        }
2968        var xRatio = ($galleryMainImg.width() - sourceWidth) / $galleryMainImg.width();
2969        var yRatio = ($galleryMainImg.height() - sourceHeight) / $galleryMainImg.height();
2970        var fixXRatio = Math.round(xRatio * 100000); // IE dává hrozně malá desetinná čísla 1.7438616071428571e-7
2971        var fixYRatio = Math.round(yRatio * 100000);
2972
2973        if (fixXRatio === 0 && fixYRatio === 0) {
2974            $('.buttonZoom').css('visibility', 'hidden');
2975        } else {
2976            $('.buttonZoom').css('visibility', 'visible');
2977        }
2978    }
2979
2980    function setZoomContainer() {
2981        var width = $galleryMainImg.width();
2982        var height = $galleryMainImg.height();
2983        $zoomContainerWrap.width(width);
2984        $zoomContainerWrap.height(height);
2985        var widthContainer = $galleryMainItemWrap.width();
2986        var heightContainer = $galleryMainItemWrap.height();
2987
2988        $zoomContainerWrap.css("left", (widthContainer - width) / 2);
2989        $zoomContainerWrap.css("top", (heightContainer - height) / 2);
2990    }
2991
2992    //donutí prohlížeč přerenderovat stránku a zobrazit obrázek se správným poměrem stran
2993    function fixDeformedImage() {
2994        var currentZindex = $galleryMainImg.css("flex-shrink");
2995        if (currentZindex == 0) {
2996            $galleryMainImg.css("flex-shrink", "1");
2997        }
2998        else {
2999            $galleryMainImg.css("flex-shrink", "0");
3000        }
3001        setZoomContainer();
3002    }
3003
3004    function preloadImages() {
3005        let urlImageBefore;
3006        if (currentItem.index === 0) {
3007            urlImageBefore = items[items.length - 1].fullUrl;
3008        } else {
3009            urlImageBefore = items.find(f => f.index === currentItem.index - 1).fullUrl;
3010        }
3011
3012        let imgBefore = new Image();
3013        imgBefore.src = urlImageBefore;
3014
3015        let urlImageAfter;
3016        if (items.length === currentItem.index + 1) {
3017            urlImageAfter = items[0].fullUrl;
3018        } else {
3019            urlImageAfter = items.find(f => f.index === currentItem.index + 1).fullUrl;
3020        }
3021
3022        let imgAfter = new Image();
3023        imgAfter.src = urlImageAfter;
3024    }
3025
3026    async function preloadAsync(items, index) {
3027        const promises = [];
3028
3029        for (let item of items) {
3030            if (item.type === ITEM_TYPE_IMAGE) {
3031                const promise = new Promise((resolve) => {
3032                    const img = new Image();
3033                    img.onload = function () {
3034                        resolve();
3035                    }
3036                    img.src = item.smallUrl;
3037                });
3038                promises.push(promise);
3039            }
3040            if (item.type === ITEM_TYPE_VIDEO) {
3041                const promise = new Promise((resolve) => {
3042                    const video = document.createElement("video");
3043                    video.src = item.smallUrl;
3044                    video.onloadedmetadata = function() {
3045                        item.videoHeight = video.videoHeight;
3046                        item.videoWidth = video.videoWidth;
3047                        resolve();
3048                    };
3049                });
3050                promises.push(promise);
3051            }
3052        }
3053
3054        for (let prom of promises) {
3055            await prom;
3056        }
3057    }
3058}
3059;//Skript je viditelný na všech stránkách.
3060//Má za úkol přidat všem elementům <a data-lightbox="gallery"> navázání události po kliknutí.
3061//Po klinutí na element(obrázek) se musí nastavit atribut data-click na 1, 
3062//ostatním elementům tento atribut nastavit na 0.
3063function GalleryLoaderViewInit(viewId, actionData) {
3064    var viewEl = document.getElementById(viewId);
3065    if (viewEl == null) return;
3066    
3067    var $view = mvcUi.getView(viewId);
3068    initializeGalleryEvents($view, actionData, viewId);
3069
3070    mvcCore.addAjaxEnd(function () {
3071        initializeGalleryEvents($view, actionData, viewId);
3072        /*console.log("GalleryLoaderView: AjaxEnd.");*/
3073    });
3074
3075    function initializeGalleryEvents($view, actionData, viewId) {
3076        var $images = $('*[data-lightbox=gallery]');
3077        $images.click(function (event) {
3078            event.stopImmediatePropagation(); //86024 funguje
3079            //if (event.target !== event.currentTarget) return false; funguje také
3080            $images.attr("data-click", "0");
3081            $(this).attr("data-click", "1");
3082            showGallery();
3083            return false;
3084        });
3085
3086        function showGallery() {
3087            mvcCore.invokeAction(actionData, $view.$(), viewId);  
3088          /*  console.log("GalleryLoaderView: ShowGallery."); */   
3089        };
3090    }
3091}
3092;//skript pro komponentu OrderActionPanelView
3093//TODO vymyslet nějak univerzálně, eg uiCore.Init('OrderActionPanelView', 'el123');            
3094function OrderActionPanelViewInit(viewId, targetSelector, anchorSlector) {
3095   
3096    var viewEl = document.getElementById(viewId);    
3097    if (viewEl == null) return;
3098    
3099    var view = mvcUi.getView(viewId);
3100    var clicksWithoutScroll = 0; // počet kliknutí, kdy nedošlo k žádnému scrolování dokumentu - určeno k ochraně proti chybě
3101        
3102    function getDimensions(anchor) {
3103        anchor = $(anchor);
3104        var d = {
3105            screenBottom: $(window).scrollTop() + $(window).innerHeight(),
3106            screenTop: $(window).scrollTop(),
3107            screenHeight: $(window).innerHeight()
3108        };
3109
3110        // pokud je ActionPanel vespod a překrývá spodek obrazovky, tak posuneme viditelný spodek obrazovky výš o výšku panelu
3111        if (view.$().offset().top < d.screenBottom && view.$().offset().left < anchor.offset().left + anchor.outerHeight() && view.$().hasClass("scroll")) {
3112            d.screenBottom = d.screenBottom - view.$().outerHeight(true);
3113            d.screenHeight = $(window).innerHeight() - view.$().outerHeight(true);
3114        }
3115
3116        d.anchorHeight = anchor.height();
3117        d.anchorTop = anchor.offset().top;				             // vrch kotvy
3118        d.anchorBottom = d.anchorTop + d.anchorHeight;        // spodek kotvy				
3119        d.anchorFitsOnScreen = d.screenHeight >= d.anchorHeight; // zda se celá kotva vejde na stránku                
3120
3121        // zda je kotva plně zobrazena na stránce:		
3122        if (d.anchorFitsOnScreen) {
3123            // vrch musí být vidět
3124            d.anchorIsOnScreen = d.anchorTop >= d.screenTop;
3125            // spodek musí být vidět
3126            d.anchorIsOnScreen &= d.anchorBottom <= d.screenBottom;
3127        } else {
3128            // musí být vidět tělo kotvy a nic jiného
3129            d.anchorIsOnScreen = d.anchorTop <= d.screenTop && d.anchorBottom >= d.screenBottom;
3130        }
3131
3132        // zda byla kotva viditelná, tj. nyní je již odskrolovaná nahoře		
3133        if (d.anchorFitsOnScreen) {
3134            d.anchorWasOnScreen = d.anchorTop < d.screenTop;
3135        } else {
3136            d.anchorWasOnScreen = d.anchorBottom < d.screenBottom;
3137        }
3138
3139        return d;
3140    }
3141
3142    function scroll() {
3143
3144        var anchors = $(anchorSlector).toArray();
3145        
3146        for (var i = 0; i < anchors.length; i++) {
3147
3148            var $anchor = $(anchors[i]);
3149
3150            var d = getDimensions($anchor);
3151
3152            // pokud je tato kotva viditelná nebo již byla zobrazena, tak nás nezajímá a jdeme na další
3153            if (d.anchorIsOnScreen || d.anchorWasOnScreen) continue;
3154
3155            // - zrušeno protože dole někdy bývá fixed element, který to pak překrývá
3156            // provedeme scroll na spodek kotvy
3157            var scrollTop = d.anchorTop + d.anchorHeight - d.screenHeight;
3158            // pokud se však kotva nevejde na stránku, tak odskrolujeme na vrch kotvy
3159            if (!d.anchorFitsOnScreen) scrollTop = d.anchorTop;
3160            
3161            scrollTop += 30; // přidáme pár pixelů jako rezervu, toto číslo by mělo reprezentovat rozdíl výšek plovocího panelu s/bez css třídy "scroll"
3162            
3163            $("html, body").animate({ scrollTop: scrollTop});
3164            break;
3165        }
3166    }
3167    
3168
3169    function adjustState() {
3170        var anchors = $(anchorSlector).toArray();
3171        if (anchors.length <= 0) {
3172            view.$().removeClass("scroll");
3173            return;
3174        }
3175
3176        // podle umístění poslední kotvy změníme třídu "scroll" na plovoucím panelu
3177        var lastAnchor = anchors[anchors.length - 1];
3178        var d = getDimensions(lastAnchor);
3179        if (d.anchorIsOnScreen || d.anchorWasOnScreen) {
3180            view.$().removeClass("scroll");
3181        } else {
3182             view.$().addClass("scroll");
3183        }
3184    }
3185
3186    $(targetSelector).click(function() {
3187        // ochrana proti chybě
3188        if (clicksWithoutScroll >= 1) {
3189            view.$().removeClass("scroll");
3190            return;
3191        }
3192        clicksWithoutScroll++;
3193        scroll();
3194    });
3195    $(document).scroll(function () {
3196        clicksWithoutScroll = 0;
3197        adjustState();
3198    });
3199
3200    // kvůli změnám výšky dokumentu, lepší by byla událost documentHeightChaged
3201    var height;
3202    setInterval(function () {
3203        if (height == $(document).height()) return;
3204        height = $(document).height();
3205        adjustState();
3206    }, 100);
3207};
3208
3209;//skript pro komponentu SliderView
3210//TODO vymyslet nějak univerzálně, eg uiCore.Init('AddToCartView', 'el123');
3211function AddToCartViewInit(viewId, buttonPlusId, buttonMinusId, quantityBoxId, minimalQuantity, maximalQuantity, increment, allowEmptyQuantity) {
3212
3213    var view = mvcUi.getView(viewId);
3214    var $buttonPlus = view.$("#" + buttonPlusId);
3215    var $buttonMinus = view.$("#" + buttonMinusId);
3216    var $quantityBox = view.$("#" + quantityBoxId);
3217    var $baseUnitQuantity = view.$(".baseUnitQuantity");
3218    var calcBaseUnitQty = $baseUnitQuantity.length > 0;
3219
3220    if ($buttonPlus.length === 0 || $buttonMinus.length === 0 || $quantityBox.length === 0) {
3221        console.error("AddToCartViewInit", viewId, buttonPlusId, buttonMinusId, quantityBoxId);
3222        return;
3223    }
3224
3225    function updateState() {
3226        var quantity = $quantityBox.val().replace(",", ".") * 1;
3227        if (allowEmptyQuantity) {
3228            if ($quantityBox.val() === "") $buttonMinus.addClass("disabled");
3229            else $buttonMinus.removeClass("disabled");
3230        } else {
3231            if (quantity <= minimalQuantity) $buttonMinus.addClass("disabled");
3232            else $buttonMinus.removeClass("disabled");
3233        }
3234        if (quantity >= maximalQuantity) $buttonPlus.addClass("disabled");
3235        else $buttonPlus.removeClass("disabled");
3236    }
3237
3238    $buttonPlus.click(function () {
3239        var quantity = $quantityBox.val().replace(",", ".") * 1;
3240        if (allowEmptyQuantity && $quantityBox.val() === "") {
3241            $quantityBox.val(minimalQuantity);
3242        } else {
3243            quantity = recalculateQuantity(quantity);
3244            var newQuantity = Math.round((quantity + increment) * 100000) / 100000;
3245            if (newQuantity <= maximalQuantity) quantity = newQuantity;
3246            if (quantity < minimalQuantity) quantity = minimalQuantity;
3247            quantity = Math.round(quantity * 100000) / 100000; // zaokrouhlení na 6 des míst (3*0,1 totiž nebylo 0,3 ale 0,30000000000054)
3248            $quantityBox.val(quantity);
3249        }
3250        // po změně hodnoty v inputu vyvolat událost "change"
3251        // použito u zákazníka JIMI pro aktualizaci ceny celkového množství varianty v detailu produktu
3252        // 18076, file://///data-server/BSSHOP/zakaznici/JIMI/design/05-detail-v1-full_hodnoceni3_varianty_vyber_B.png
3253        $quantityBox.trigger("change");
3254
3255        //přepočet na množství v základní jednotce
3256        if (calcBaseUnitQty) {
3257            changeBaseUnitQuantity(quantity);
3258        }
3259
3260        updateState();
3261    });
3262    
3263    $buttonMinus.click(function () {
3264        var quantity = $quantityBox.val().replace(",", ".") * 1;
3265        if (allowEmptyQuantity && (quantity == minimalQuantity || $buttonMinus.hasClass("disabled"))) {
3266            $quantityBox.val("");
3267        } else {
3268            quantity = recalculateQuantity(quantity);
3269            var newQuantity = Math.round((quantity - increment) * 100000) / 100000;
3270            if (newQuantity >= minimalQuantity) quantity = newQuantity;
3271            quantity = Math.round(quantity * 100000) / 100000; // zaokrouhlení na 6 des míst (3*0,1 totiž nebylo 0,3 ale 0,30000000000054)
3272            $quantityBox.val(quantity);
3273        }
3274        // po změně hodnoty v inputu vyvolat událost "change"
3275        // použito u zákazníka JIMI pro aktualizaci ceny celkového množství varianty v detailu produktu
3276        // 18076, file://///data-server/BSSHOP/zakaznici/JIMI/design/05-detail-v1-full_hodnoceni3_varianty_vyber_B.png        
3277        $quantityBox.trigger("change");
3278
3279        //přepočet na množství v základní jednotce
3280        if (calcBaseUnitQty) {
3281            changeBaseUnitQuantity(quantity);
3282        }
3283
3284        updateState();
3285    });
3286
3287    var originTbValue;
3288    $quantityBox.click(function () {
3289        originTbValue = $(this).val() * 1;
3290    });
3291
3292    // překliknutí mimo quantity -> normalizovat množství dle násobku
3293    $quantityBox.focusout(function () {
3294        if (!allowEmptyQuantity) {
3295            normalizeQuantity();
3296        }
3297    });
3298
3299    // stisk klávesy enter -> normalizovat množství dle násobku
3300    $quantityBox.keypress(function (event) {
3301        var keycode = (event.keyCode ? event.keyCode : event.which);
3302        if (keycode == '13') {
3303            $quantityBox.blur();
3304        }
3305    });
3306
3307    function changeBaseUnitQuantity(quantity) {
3308        //přepočet na množství v základní jednotce
3309        if (calcBaseUnitQty) {
3310            var baseQtyKoef = $baseUnitQuantity.data('koef') * 1;
3311            if (baseQtyKoef > 0) {
3312                var baseQty = baseQtyKoef * quantity;
3313                var decimalPlaces = (baseQtyKoef.toString().split('.')[1] || '').length;
3314                var roundedBaseQty = baseQty.toFixed(decimalPlaces);
3315                view.$(".baseUnitQuantity .value").text(roundedBaseQty);
3316            }
3317        }
3318    }
3319
3320    function recalculateQuantity(quantity) {
3321
3322        //var quantityModulo = quantity % increment; // 21 % 2.5 = 2
3323        // 0.1 + 0.2 != 0.3,  neumí pracovat s des. čísly, 116054
3324        //https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript
3325        //var quantityModulo = ((quantity*1000000) % (increment*1000000))/1000000; // 21 % 2.5 = 2  ; 118683 - pro 55.632 % 2.7816 to vracelo nesmysl.
3326
3327        //118683 - řešeno bez použití JS modulo a násobění milionem, protože to špatně počítalo kvůli plovoucí desetinné čárce.
3328
3329        var qtyWN = Math.round(quantity * 1000000);
3330        var incWH = Math.round(increment * 1000000);
3331        var div = qtyWN / incWH;
3332        var num = Math.floor(div);
3333        var quantityModulo = (qtyWN - (num * incWH))/1000000;
3334        if (quantityModulo > 0 && Math.abs(quantityModulo - increment) > 0.0001) {
3335            //quantity -= quantityModulo; // 21 - 1 = 20 úloha 54422 - úprava, aby hodnota byla násobkem inkrementu
3336            quantity = (quantity*1000000 - quantityModulo*1000000 + increment*1000000)/1000000; // 21 - 1 +2.5 = 22.5  úloha 54422 - úprava, aby hodnota byla násobkem inkrementu, úloha 113412 - aby byl použit vyšší násobek
3337        }
3338        
3339        return quantity;
3340    }
3341
3342    // 63174 - při ručním zadání do pole přepočítat na nejbližší násobek
3343    function normalizeQuantity() {
3344        var quantityValue = $quantityBox.val().replace(",", ".") * 1;
3345        // pokud se hodnota nezměnila, nedělat nic
3346        if (originTbValue == quantityValue) return;
3347        var quantity;
3348        if (quantityValue >= maximalQuantity) {
3349            quantity = recalculateQuantity(maximalQuantity);
3350        }
3351        else if (quantityValue <= minimalQuantity) {
3352            quantity = recalculateQuantity(minimalQuantity);
3353        } else {
3354            quantity = recalculateQuantity(quantityValue);
3355        }
3356        $quantityBox.val(quantity);
3357        $quantityBox.trigger("change");
3358        updateState();
3359    }
3360    
3361    updateState();
3362};
3363
3364;//skript pro komponentu AttributeFilterView
3365//TODO vymyslet nějak univerzálně, eg uiCore.Init('AttributeFilterView', 'el123');
3366function AttributeFilterViewInit(viewId) {
3367    var view = mvcUi.getView(viewId);
3368    
3369    view.openAttribute = function (attributeId) {
3370        ///<summary>viz 22371 - otevře záložku se zadaným atributem</summary>        
3371
3372        view.ensureVisible();
3373
3374        var tab = view.$(".attribute[data-attrid='" + attributeId + "']");
3375        tab.click();
3376    };    
3377}
3378;//skript pro komponentu UserPagePopupView
3379//TODO vymyslet nějak univerzálně, eg uiCore.Init('UserPagePopupView', 'el123');
3380function UserPagePopupViewInit(viewId, popupData) {
3381    if (!localStorage) return;
3382
3383    for (var i in popupData) {
3384        var data = popupData[i];
3385
3386        // pokud už jsme popup jednou zobrazili, tak v localStorage bude displayKey
3387        var key = "UserPagePopupView_" + data.id;
3388        var key2 = "UserPagePopupView_shown_" + data.id;
3389        if (localStorage.getItem(key) === data.displayKey && parseInt(localStorage.getItem(key2)) + data.resetInterval > Date.now()) continue;
3390
3391        // zobrazíme popup po zadaném intervalu tak, že odešleme AJAX request na server
3392        setTimeout(function() {
3393            mvcCore.invokeAction(data.actionData, $(viewId).get(0), viewId, function() {
3394                
3395                // po vyrenderování popupu po určitém zpoždění zapíšeme do localStorage, že už byl popup zobrazen
3396                setTimeout(function() {
3397                    localStorage.setItem(key, data.displayKey);
3398                    localStorage.setItem(key2, Date.now());
3399                },2000);
3400                return false;
3401            });
3402        }, data.delay);
3403
3404        // zobrazíme vždy jen jeden popup
3405        break;
3406    }
3407};
3408
3409;(function(){function n(n,t){function s(){var n=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(t=="x"?i:i&3|8).toString(16)})}var e=document.cookie,o=new RegExp(n.replace(".","\\.")+"=([^;]+)"),u=o.exec(e),r,f,i;(u==null||u.length<2||u[1]==="")&&(r=new Date,r.setFullYear(r.getFullYear()+2),f=n+"="+s()+";expires="+r.toUTCString()+"; path=/",t&&(i=document.location.hostname,i=i.match(/^.+\..+\..+/)?i.replace(/^[^\.]+/,""):"."+i,f+="; domain="+i),document.cookie=f)}n(".BSCTOK2",!1)})()
3410;var console,MvcCore,mvcCore;console||(console={});console.warn||(console.warn=function(){});console.debug||(console.debug=function(){});console.error||(console.error=function(){});console.info||(console.info=function(){});console.log||(console.log=function(){});console.time||(console.time=function(){});console.timeEnd||(console.timeEnd=function(){});console.debugWarn=function(n){mvcCore&&mvcCore.isDebug()&&console.warn(n)};MvcCore=function(){function st(){ht()||(ct(),window.onpopstate=function(n){window.history.pushState&&n.state&&n.state!=i&&(i=n.state,document.location=n.state)},$.event.special.destroyed={remove:function(n){n.handler&&n.handler()}},$(document).ready(function(){document.write=function(){console.warn("document.write není možné použít po načtení DOM.")}}),$.event.special.onviewport={setup:function(){var n=this,t=new IntersectionObserver(function(t){t.forEach(function(t){t.isIntersecting&&t.intersectionRatio!==0&&$(n).trigger("onviewport")})});t.observe(n)}})}function ht(){return location.hash.indexOf("#~")==0?(document.location=location.hash.replace("#~",""),!0):!1}function ct(){i=location.href;
3410window.history.pushState&&window.history.replaceState(i,null,null)}function rt(){if(l)for(let n of l)try{n()}catch(t){}}function ut(n,t){if(n=at(n),n||(n=i),t){nt=!0;var r=c;if(r&&(r.ctrlKey||r.metaKey)){if(r.BSSHOP_INTERFACE_NOT_PREVENTED)return;window.open(n,"_blank")}else rt(),window.location=n;return}lt(n)&&(window.history.pushState?window.history.pushState(n,document.title,n):location.hash="~"+n,i=n)}function lt(n){return n?w(i)!==w(n)?!0:!1:!1}function w(n){return n?n.replace("https:","").replace("http:",""):n}function at(n){if(!n)return n;var t=n.indexOf("://")>0;return t?(n=w(n),location.protocol+n):n}function vt(n,t){for(var i in o)o[i](n,t)}function ft(n,t){for(var i in s)s[i](n,t)}function yt(n){var t="AJAX error: "+n+" "+n.status+" "+n.statusText;console.error(t);t+="<br /><br />"+n.responseText;r&&$("body").html(t)}function v(n){var t,i;for(console.error("Exception: "+n.message),n.inner&&console.error(" inner: "+n.inner.message),n.stack&&console.error(" stack: "+n.stack),t="<div style='background:red'><b>SCRIPT error:<\/b>",t+="<br /><br />"+n.message,i=n.inner;i;)t+="<br /><br />INNER: "+i.message,i=i.inner;t+="<\/div>";r&&$("body").prepend(t);throw n;}function pt(n,t){function i(r){var f,u,e,o;if(r>=n.length){t();return}f=n[r];tt++;u="__bschainScript"+tt;e="window['"+u+"'] = function(proceed){ "+f+" }";eval(e);o=window[u];o(function(){i(r+1)})}if(!n||n.length===0){t();return}i(0)}function wt(n){for(var u in n){var i=n[u],f=i.HasScriptTags,t=i.Script,r=i.Execution,e=i.OwnerElementId;f?$("body").append(t):r==0?et(t):r==1?bt(t):r==2?dt(t):r==3?kt(e,t):et(t)}}function bt(n){$(window).on("load",function(){eval(n)})}function kt(n,t){$("#"+n).on("load",function(){eval(t)})}function dt(n){$(function(){eval(n)})}function et(n){try{eval(n)}catch(t){throw{message:"Error executing script: "+n,inner:t};}}function gt(n){n&&n.length>0&&(document.title=n)}function ni(n,t){var u=document.head,r="bs-style_"+n,f=!/\{.*\w+.*\}/.test(t),i=document.getElementById(r);f||i||(i=document.createElement("style"),i.id=r,i.type="text/css",i.innerHTML=t,u.appendChild(i))}function ti(n){var t,i;for(t in n)i=n[t],ii(i)}function ii(n){var i,o;try{var u=n.Selector,s=n.RenderMode===1,f=n.RenderMode===2,r=n.Id,e=n.AfterUpdate,t;if(u)t=$(u);else if(r)t=$("#"+r);else throw new Error("Unable to setHtmlItem, selector neither id was specified");if(t&&t.length>0){if(i=ot(n),f)ri(t[0],i);else if(s)t.append(i);else{let n="";const r=t.find(":focus");if(r.length>0){let i="",u=r[0];while(u!=null){const f=u.parentElement,r=Array.prototype.indexOf.call(f.children,u);if(r<0)break;if(i=i?":nth-child("+(r+1)+") > "+i:":nth-child("+(r+1)+")",u=f,u==t[0]){n="> "+i;break}}}if(t.html(i),n){const r=t.find(n),i=r[0];if(i)if(i.tagName=="SELECT"){const n=n=>{n.preventDefault(),n.stopImmediatePropagation()},t=["mousedown","touchstart","pointerdown","click"],r=()=>t.forEach(t=>i.removeEventListener(t,n,{capture:!0}));t.forEach(t=>i.addEventListener(t,n,{capture:!0}));requestAnimationFrame(()=>{i.addEventListener("focus",()=>setTimeout(r,0),{once:!0}),i.focus({preventScroll:!0})})}else i.focus({preventScroll:!0})}}f||ui(t,n)}else o=fi(n),$("body").append(o),t=$("#"+r);e&&e(t)}catch(h){throw{message:"Error setHtmlItem, Id='"+n.Id+"', RenderMode='"+n.RenderMode+"'",inner:h};}}function ri(n,t){var o=document.createElement("bs-temp"),u,f,r,s,e,i;for(o.innerHTML=t,u=n.querySelectorAll("bs-lazy-render"),f={},i=0;i<u.length;i++)r=u[i],s=r.getAttribute("data-lazy-id"),f[s]=r;for(e=o.querySelectorAll("bs-lazy-render"),i=0;i<e.length;i++){var h=e[i],c=h.getAttribute("data-lazy-id"),r=f[c];r&&(r.outerHTML=h.innerHTML)}}function ui(n,t){var i,r;for(i in t.Attributes)r=t.Attributes[i],n.attr(i,r)}function fi(n){var t="<"+n.Tag+" id='"+n.Id+"'",i,r;for(i in n.Attributes)r=n.Attributes[i],t+=" "+i+'="'+r+'"';return t+=">",t+=ot(n),t+("<\/"+n.Tag+">")}function ot(n){return n.Html}function ei(n){var t,i;for(t in n)i=n[t],oi(i)}function oi(t){var f=t.OwnerViewId,c=t.ControllerName,o=t.MethodSignature,p=t.SecurityHash,l=t.Selectors,u=t.EventName,e=t.EventFilter,a=t.ValueFilter,w=t.Once,b=t.Arguments,v=t.BeforeScript,y=t.AfterScript,k=u,s,h,i;if(u=="checked"&&(u="change"),s=f?$("#"+f):$("body"),s.length<=0){h="View '"+f+"' not found while attaching action descriptors.";console.error(h,t);throw new Error(h);}i=n.selectElements(l,s);i.length<=0&&console.error("No element found for selector: '"+vi(l)+"', ownerViewId='"+f+"', eventName='"+u+"', methodSignature='"+o+"', controllerName='"+c+"'");r&&i.attr("data-action-on-"+u,o);i.data("bs-binded",u);i.on("destroyed",function(){$(this).off(u)});
3410if(u==="__immediateChange"&&i.is("input:text")){i.data("__immediateChange_value",i.val());i.on("keyup",function(){var t=i.data("__immediateChange_value"),n=i.val();t!==n&&(i.data("__immediateChange_value",n),i.change())});u="change"}if(u==="click")i.on("keyup",function(n){n.which===13&&$(this).click()});i.on(u,function(t){var s,h,r,l,d;if(w){if(i.data("__once_"+u))return!0;i.data("__once_"+u,!0)}return u==="keyup"&&e&&t.which!=e?!0:u==="keypress"&&e&&t.which!=e?!0:k==="checked"&&!$(this).prop("checked")?!0:v&&(s=eval("(function(){"+v+"})()"),s===!0)?!0:(h={Action:o,Controller:c,Args:b,SecurityHash:p},r=$(this),a&&(l=r.val(),!l.match(a)))?!0:(setTimeout(function(){n.invokeAction(h,r,f,function(){if(y)return eval("(function(){"+y+"})()"),!1})},1),d=$(this).attr("href"),d?!1:!0)})}function si(n){var t,i;u=ci(u,n);for(t in n)i=n[t],hi(i)}function hi(t){var i=t.OwnerViewId,r=u[i];if(!r){r=[];u[i]=r;$("#"+i).on("destroyed",function(){u[i]=null})}r[r.length]={propertyMapping:t,originalValues:n.getValues(t.Arguments,i)}}function ci(n,t){var r=[],i,u,f;for(u in t)f=t[u],i=f.OwnerViewId,i in n&&(n[i]=null);for(i in n)n[i]!=null&&(r[i]=n[i]);return r}function li(){var i=[],r,f,o;for(r in u){f=u[r];for(o in f){var e=f[o],t=e.propertyMapping,s=e.originalValues,h=e.isModel,c=n.getValues(t.Arguments,r);i[i.length]={dataName:t.DataName,dataType:t.DataType,methodSignature:t.MethodSignature,securityHash:t.SecurityHash,values:c,originalValues:s,isModel:h}}}return i}function ai(){$(document).ajaxSend(function(){b++;y("Sending ajax request")});$(document).ajaxSuccess(function(){y("Ajax success")});$(document).ajaxError(function(){y("Ajax error")})}function y(t){var u=$("#debugPanel"),r,i;u&&(r=$("#debugPanelSummary"),i="<b>Location: <\/b>"+location.pathname+location.search,i+="<br/><b>AJAX calls: <\/b>"+b,r.html(i),n.log(t))}function vi(n){var r="",u,t,i;for(u in n)t=n[u],i=t.Value,t.Kind==undefined&&(t.Kind=0),t.Kind==0?i="#"+i:t.Kind==1&&(i="."+i),r+=" "+i;return r}function yi(){var n={},t;$("[id]").each(function(){n[this.id]||(n[this.id]=0);n[this.id]++});for(t in n)n[t]>1&&console.warn("Multiple IDs found #"+n[t])}var n=this,i,u=[],b=0,k=0,r=!1,d,f,g,t,e=[],o=[],s=[],h=0,nt=!1,tt=0,c,it,p=!1,l,a;st();l=[];this.enqueueBeforeRedirect=function(n){l.push(n)};a=[];this.enqueueAction=function(t){a.push(t);
3411//! další akci zpracujeme až bude dokončen aktuální ajax, viz 33768 - zde je podrobnější vysvětlení včetně diagramu
3412h===0&&p&&n.dequeueAction()};this.dequeueAction=function(){if(a.length!==0){var t=a.shift();n.doInvokeActionThroughHandler(t)}};this.invokeAction=function(n,t,i,r,u,f){var e={actionData:n,contextElement:t,ownerViewId:i,succesFunc:r,completeFunc:f,originalEvent:u};
3413//! akce dáme do fronty a spouštíme jednu po druhé, viz 33768 - zde je podrobnější vysvětlení včetně diagramu
3414this.enqueueAction(e)};this.doInvokeActionThroughHandler=function(t){function i(r){if(r>=e.length)n.doInvokeAction(t);else{var u=e[r],f={contextElement:t.contextElement,actionName:t.actionData.Action};u(function(){i(r+1)},f)}}i(0)};this.doInvokeAction=function(u){var o,b,nt,tt,y,ot,lt,at;try{var e=u.actionData,p=u.contextElement,s=u.ownerViewId,st=u.succesFunc,ht=u.completeFunc;c=u.originalEvent;var l=e.Action,w=e.Controller,pt=e.SecurityHash,rt=e.Args;if(l||(l=e.action),w||(w=e.controller),rt||(rt=e.args),!l)throw new Error("No action specified.");if(r&&console.debug("Action: "+l+", Controller: "+w+", OwnerViewId: "+s),o=$("#"+s),o.length===0&&s){console.warn('Error invoking action "'+l+'", owner view "'+s+'" was not found.');n.dequeueAction();return}b=o.data("name");b||(b=s);var wt=o.attr("class"),a=n.getValues(rt,s,p),bt=li(),ct={ownerViewName:b,ownerViewClassName:wt,controller:w,action:l,propertyValues:bt,args:a,modelState:d,blazorSessionId:g,blazorData:t,securityHash:f,securityHash2:pt,migratedViews:it},ut,et;if(a.length>0&&a.containsFile){if(window.FormData==undefined){alert("Browser doesn't support AJAX file upload.");return}if(btoa==undefined){alert("Browser doesn't support base64 conversion.");return}nt=new window.FormData;for(tt in a)(y=a[tt],tt!="containsFile")&&y.Value!=null&&y.Value.isFile&&(ot="file"+tt,nt.append(ot,y.Value.file),y.Value="bs-file-in-argument:"+ot);lt=JSON.stringify({data:ct});at=btoa(unescape(encodeURIComponent(lt)));nt.append("bs-json-in-form",at);ut=nt;et=!1}else ut=JSON.stringify({data:ct}),et="application/json; charset=UTF-8";h++;vt(o,p);$.ajax({url:i,type:"POST",contentType:et,processData:!1,data:ut,success:function(t){try{var i=!1;st&&(i=st(t));i||n.attachData(t);ht&&ht()}catch(r){v(r)}},error:function(n,t,i){ft(o,p);yt(n,t,i)}
3414,complete:function(){if(h===0)throw new Error("gAjaxInProgress is zero");h--;ft(o,p);c=null;n.dequeueAction();k++}})}catch(kt){v(kt)}};this.addBeforeAjaxBegin=function(n,t){(t||(t=e.length),t in e)||(e[t]=n)};this.addAjaxBegin=function(n,t){(t||(t=o.length),t in o)||(o[t]=n)};this.addAjaxEnd=function(n,t){(t||(t=s.length),t in s)||(s[t]=n)};this.isRedirecting=function(){return nt};this.attachData=function(i){var u;try{if(!i)return;var o=i.Url,s=i.Title,h=i.Redirect,e=i.StyleSheets,c=i.Html,l=i.ClientScripts,a=i.ChainScripts,y=i.ActionDescriptors,w=i.PropertyMappings;d=i.ModelState;f=i.SecurityHash;g=i.BlazorSessionId;t=i.BlazorData;f||(console.log("gsh <-- ",f),console.trace());for(u in e)ni(u,e[u]);ti(c);ei(y);si(w);wt(l);r&&yi();pt(a,function(){try{gt(s);ut(o,h)}catch(n){v(n)}});p||(p=!0,n.dequeueAction())}catch(b){v(b)}};this.getViewJqueryElement=function(n){var t=$("#"+n);if(t.length==0)throw new Error("View '"+n+"' not found");if(t.length>1)throw new Error("More than one view '"+n+"' has been found");return t};this.isAttached=function(n,t){var i=$(n).data("bs-binded");return t?i===t:i!=undefined};this.getValues=function(t,i,r){var v=$("#"+i),u=[],h,f,o,c;for(h in t){var s=t[h],l=s.ConstantValue,a=s.JavascriptExpression,y=s.Single,p=s.UseContext,e=s.AttributeName;if(l!=null)u[u.length]={Value:l};else if(a!=null)f=eval(a),e=="__file"&&(f={isFile:!0,file:f},u.containsFile=!0),u[u.length]={Value:f};else{if(o=n.selectElements(s.Selectors,v,r,p),!o)throw new Error("No element found for argument "+h+", ownerViewId: "+i+", args: "+JSON.stringify(t));if(y){if(o.length>1)throw new Error("Single value requested but more elements found for args: "+JSON.stringify(t));e=="__innerText"?f=o.text():e=="__value"?f=o.val():e=="__checked"?f=o.is(":checked"):e=="__file"?(c=o.get(0).files,f=c.length>0?{isFile:!0,file:c[0]}:null,u.containsFile=!0):f=o.attr(e);u[u.length]={Value:f}}else data=[],o.each(function(){var n;n=e=="__innerText"?$(this).text():e=="__value"?$(this).val():$(this).attr(e);data[data.length]=n}),u[u.length]={Values:data}}}return u};this.selectElementsEx=function(n,t,i){var r,u,s,h;t&&(t=$(t));i&&(i=$(i));var c=n[0]==="1",f="",e=0,o=[];for(r=2;r<n.length;r++)u=n[r],s=n[r-1],u==="|"?(h=o.length===0&&e===0&&f===$(t).attr("id"),h||o.push({Value:f,Kind:e}),f=""):s==="|"&&u.match(/\d/g)?e=parseInt(u):f+=u;return this.selectElements(o,t,i,c)};this.selectElements=function(n,t,i,r){var f,e,u;if(r&&n.length==0)return i;for(t&&(t=$(t)),i&&(i=$(i)),f=r?$(i):$(t),e=0;e<n.length;e++){if(u=n[e],u.Kind==undefined&&(u.Kind=0),u.Kind==0)f=$("#"+u.Value,f);else if(u.Kind==1)f=$("."+u.Value,f);else if(u.Kind==2)f=$(u.Value,f);else if(u.Kind==3)f=$(u.Value,f);else if(u.Kind==4)f=f.parent(u.Value);else if(u.Kind==5)f=f.parents(u.Value).first();else throw new Error("SelectorKind "+u.Kind+" is not supported");if(f==null){console.warn("no element found for selector "+u);break}}return f};this.setMigratedViews=function(n){it=n};this.log=function(n){if(n){var t=$("#debugPanelLog"),i="<b>"+(new Date).toLocaleTimeString()+":<\/b> "+n+"<br/>";t.append(i);t.scrollTop(1e4)}};this.logToServer=function(n,t){if(t||(t=function(){}),!n){t();return}$.ajax({url:"/Services/LogToServer.ashx",type:"POST",contentType:"text/plain",processData:!1,data:n,complete:function(){t()}})};this.debug=function(){r||(r=!0,console.info("debug mode on"),ai(),y())};this.isDebug=function(){return r};this.getTotalCompletedAjaxCalls=function(){return k};this.getSecurityHash=function(){return f};this.setLocation=function(n,t){t&&(c=t);ut(n,!0)};this.sendActionsBeforeUnload=function(){rt()};this.setBlazorData=function(n,i){t||(t={});t[n]=i};this.getBlazorData=function(n){return t?n in t?t[n]:null:null};this.addAjaxEndForBlazor=function(n,i){this.addAjaxEnd(()=>n.invokeMethodAsync(i,t))};this.invokeActionFromBlazor=function(n,i,r){return new Promise(u=>{this.invokeAction(n,i,r,null,null,()=>u(t))})}};mvcCore=new MvcCore
3415;/* 
3416  Klientské javascriptové rozhraní pro interakci s třetími stranami.
3417  Umožňuje předávat informace o zobrazených produktech, kliknutí na produkt, přechod do detailu, apod.
3418  Toto rozhranní využívá například Goolge Enhancec Ecommerce, viz EnhancedEcommerce.js
3419  viz 19760
3420 */
3421
3422var BsshopInterface = function () {
3423    // Hledaný řetězec
3424    var searchHandlers = new Array();
3425    this.notifySearch = function (searchString, proceed) {
3426        invokeThroughHandler(searchHandlers, 0, searchString, proceed);
3427    };
3428
3429    this.addSearchHandler = function (handler) {
3430        searchHandlers[searchHandlers.length] = handler;
3431    };
3432
3433    // Přidání produktu do sledování hlídacím psem
3434    var addToWatchListHandlers = new Array();
3435    this.notifyAddToWatchList = function (productData, proceed) {
3436        invokeThroughHandler(addToWatchListHandlers, 0, productData, proceed);
3437    };
3438
3439    this.addToWatchListHandler = function (handler) {
3440        addToWatchListHandlers[addToWatchListHandlers.length] = handler;
3441    };
3442
3443    // Přidání produktu do oblíbených
3444    var addToFavoriteHandlers = new Array();
3445    this.notifyAddToFavorite = function (productData, proceed) {
3446        invokeThroughHandler(addToFavoriteHandlers, 0, productData, proceed);
3447    };
3448
3449    this.addToFavoriteHandler = function (handler) {
3450        addToFavoriteHandlers[addToFavoriteHandlers.length] = handler;
3451    };
3452
3453    // Dokončení registrace
3454    var registrationCompletedHandlers = new Array();
3455    this.notifyRegistrationCompleted = function (proceed) {
3456        invokeThroughHandler(registrationCompletedHandlers, 0, proceed);
3457    };
3458
3459    this.addRegistrationCompletedHandler = function (handler) {
3460        registrationCompletedHandlers[registrationCompletedHandlers.length] = handler;
3461    };
3462
3463    // Kliknutí na odkaz mířící na detail produktu
3464    var gotoProductDetailHandlers = new Array();
3465    this.notifyGotoProductDetail = function (productData, proceed) {
3466        invokeThroughHandler(gotoProductDetailHandlers, 0, productData, proceed);
3467    };
3468
3469    this.addGotoProductDetailHandler = function (handler) {
3470        gotoProductDetailHandlers[gotoProductDetailHandlers.length] = handler;
3471    };
3472
3473    // Vstup do košíku
3474    var gotoBasketHandlers = new Array();
3475    this.notifyGotoBasket = function (basketData, proceed) {
3476        invokeThroughHandler(gotoBasketHandlers, 0, basketData, proceed);
3477    };
3478
3479    this.addGotoBasketHandler = function (handler) {
3480        gotoBasketHandlers[gotoBasketHandlers.length] = handler;
3481    };
3482
3483    // Přidání produktu do košíku
3484    var addToCartHandlers = new Array();
3485    this.notifyAddToCart = function (productData, proceed) {
3486        invokeThroughHandler(addToCartHandlers, 0, productData, proceed);
3487    };
3488
3489    this.addAddToCartHandler = function (handler) {
3490        addToCartHandlers[addToCartHandlers.length] = handler;
3491    };
3492
3493    // Odebrání produktu z košíku
3494    var removeFromCartHandlers = new Array();
3495    this.notifyRemoveFromCart = function (productData, proceed) {
3496        invokeThroughHandler(removeFromCartHandlers, 0, productData, proceed);
3497    };
3498
3499    this.addRemoveFromCartHandler = function (handler) {
3500        removeFromCartHandlers[removeFromCartHandlers.length] = handler;
3501    };
3502
3503    // Zobrazení určitého kroku v košíku
3504    var orderCurrentStepHandlers = new Array();
3505    this.notifyOrderCurrentStep = function (basketData, proceed) {
3506        invokeThroughHandler(orderCurrentStepHandlers, 0, basketData, proceed);
3507    };
3508
3509    this.addOrderCurrentStepHandler = function (handler) {
3510        orderCurrentStepHandlers[orderCurrentStepHandlers.length] = handler;
3511    };
3512
3513    // Přechod na další krok v košíku
3514    var orderNextStepHandlers = new Array();
3515    this.notifyOrderNextStep = function (basketData, proceed) {
3516        invokeThroughHandler(orderNextStepHandlers, 0, basketData, proceed);
3517    };
3518
3519    this.addOrderNextStepHandler = function (handler) {
3520        orderNextStepHandlers[orderNextStepHandlers.length] = handler;
3521    };
3522
3523    // Zvolena doprava a platba
3524    var deliveryPaymentHandlers = new Array();
3525    this.notifyDeliveryPayment = function (basketData, proceed) {
3526        invokeThroughHandler(deliveryPaymentHandlers, 0, basketData, proceed);
3527    };
3528
3529    this.addDeliveryPaymentHandler = function (handler) {
3530        deliveryPaymentHandlers[deliveryPaymentHandlers.length] = handler;
3531    };
3532
3533    // Dokončení objednávky. Spouští se při zobrazení konverzní děkovací stránky
3534    var orderCompletedHandlers = new Array();
3535    this.notifyOrderCompleted = function (orderData, proceed) {
3536        invokeThroughHandler(orderCompletedHandlers, 0, orderData, proceed);
3537    };
3538
3539    this.addOrderCompletedHandler = function (handler) {
3540        orderCompletedHandlers[orderCompletedHandlers.length] = handler;
3541    };
3542
3543    // Vytvoření objednávky. Spouští se při kliknutí na tlačítko "Odeslat objednávku"
3544    var orderCreatedHandlers = new Array();
3545    this.notifyOrderCreated = function (orderData, proceed) {
3546        invokeThroughHandler(orderCreatedHandlers, 0, orderData, proceed);
3547    };
3548
3549    this.addOrderCreatedHandler = function (handler) {
3550        orderCreatedHandlers[orderCreatedHandlers.length] = handler;
3551    }
3552
3553    // Vstup na stránku detailu produktu
3554    var productDetailHandlers = new Array();
3555    this.notifyProductDetail = function (productData, proceed) {
3556        invokeThroughHandler(productDetailHandlers, 0, productData, proceed);
3557    };
3558
3559    this.addProductDetailHandler = function (handler) {
3560        productDetailHandlers[productDetailHandlers.length] = handler;
3561    };
3562
3563    // Zobrazení kategorie či výsledku vyhledávání
3564    var productListHandlers = new Array();
3565    this.notifyProductList = function (productData, proceed) {
3566        invokeThroughHandler(productListHandlers, 0, productData, proceed);
3567    };
3568
3569    this.addProductListHandler = function (handler) {
3570        productListHandlers[productListHandlers.length] = handler;
3571    };
3572
3573    // Odeslání formuláře dotaz k produktu
3574    var questionSentHandlers = new Array();
3575    this.notifyQuestionSent = function (productData, proceed) {
3576        invokeThroughHandler(questionSentHandlers, 0, productData, proceed);
3577    };
3578
3579    this.addQuestionSentHandler = function (handler) {
3580        questionSentHandlers[questionSentHandlers.length] = handler;
3581    };
3582
3583    // Vybrána varianta produktu
3584    var variantSelectedHandlers = new Array();
3585    this.notifyVariantSelected = function (productData, proceed) {
3586        invokeThroughHandler(variantSelectedHandlers, 0, productData, proceed);
3587    };
3588
3589    this.addVariantSelectedHandler = function (handler) {
3590        variantSelectedHandlers[variantSelectedHandlers.length] = handler;
3591    };
3592
3593    // Přidán dotaz na kategorii (fórum)
3594    var categoryTopicAddedHandlers = new Array();
3595    this.categoryTopicAdded = function (categoryData, proceed) {
3596        invokeThroughHandler(categoryTopicAddedHandlers, 0, categoryData, proceed);
3597    }
3598
3599    this.addCategoryTopicAddedHandler = function (handler) {
3600        categoryTopicAddedHandlers[categoryTopicAddedHandlers.length] = handler;
3601    };
3602
3603    // Přidána odpověď k dotazu na kategorii (fórum)
3604    var categoryTopicRespondedHandlers = new Array();
3605    this.categoryTopicResponded = function (categoryData, proceed) {
3606        invokeThroughHandler(categoryTopicRespondedHandlers, 0, categoryData, proceed);
3607    }
3608
3609    this.addCategoryTopicRespondedHandler = function (handler) {
3610        categoryTopicRespondedHandlers[categoryTopicRespondedHandlers.length] = handler;
3611    };
3612
3613    // Produkt doporučen
3614    var productRecommendedHandlers = new Array();
3615    this.productRecommended = function (productData, proceed) {
3616        invokeThroughHandler(productRecommendedHandlers, 0, productData, proceed);
3617    }
3618
3619    this.addProductRecommendedHandler = function (handler) {
3620        productRecommendedHandlers[productRecommendedHandlers.length] = handler;
3621    };
3622
3623    // Produkt přidán do porovnání
3624    var productAddedToCompareHandlers = new Array();
3625    this.productAddedToCompare = function (productData, proceed) {
3626        invokeThroughHandler(productAddedToCompareHandlers, 0, productData, proceed);
3627    }
3628
3629    this.addProductAddedToCompareHandler = function (handler) {
3630        productAddedToCompareHandlers[productAddedToCompareHandlers.length] = handler;
3631    };
3632
3633    // Přidán dotaz na produkt (fórum)
3634    var productTopicAddedHandlers = new Array();
3635    this.productTopicAdded = function (productData, proceed) {
3636        invokeThroughHandler(productTopicAddedHandlers, 0, productData, proceed);
3637    }
3638
3639    this.addProductTopicAddedHandler = function (handler) {
3640        productTopicAddedHandlers[productTopicAddedHandlers.length] = handler;
3641    };
3642
3643    // Přidána odpověď k dotazu na produkt (fórum)
3644    var productTopicRespondAddedHandlers = new Array();
3645    this.productTopicRespondAdded = function (productData, proceed) {
3646        invokeThroughHandler(productTopicRespondAddedHandlers, 0, productData, proceed);
3647    }
3648
3649    this.addProductTopicRespondAddedHandler = function (handler) {
3650        productTopicRespondAddedHandlers[productTopicRespondAddedHandlers.length] = handler;
3651    };
3652
3653    // Změna měny
3654    var currencyChangedHandlers = new Array();
3655    this.currencyChanged = function (currencyData, proceed) {
3656        invokeThroughHandler(currencyChangedHandlers, 0, currencyData, proceed);
3657    }
3658
3659    this.addCurrencyChangedHandler = function (handler) {
3660        currencyChangedHandlers[currencyChangedHandlers.length] = handler;
3661    };
3662
3663    // Změna mutace
3664    var languageChangedHandlers = new Array();
3665    this.languageChanged = function (languageData, proceed) {
3666        invokeThroughHandler(languageChangedHandlers, 0, languageData, proceed);
3667    }
3668
3669    this.addLanguageChangedHandler = function (handler) {
3670        languageChangedHandlers[languageChangedHandlers.length] = handler;
3671    };
3672
3673    function invokeThroughHandler(handlers, index, data, proceedRaw) {
3674        // ujistíme se, že bude funkce proceedRaw volaná právě jednou
3675        var proceeded = false;
3676        var proceed = proceedRaw
3677            ? (...args) => {
3678                if (proceeded) return;
3679                proceeded = true;
3680                proceedRaw(...args);
3681            }
3682            : null;
3683
3684        if (index < handlers.length) {
3685            const handler = handlers[index];
3686            try {
3687                handler(function () {
3688                    invokeThroughHandler(handlers, index + 1, data, proceed);
3689                },
3690                    data);
3691            } catch (ex) {
3692                console.error("Exception: " + ex.message);
3693                // v případě chyby budeme pokračovat dalším handlerem, abychom nezastavili řetěz
3694                invokeThroughHandler(handlers, index + 1, data, proceed);
3695            }
3696        } else {
3697            // zavoláme poslední článek řetězu (většinou callback z mvcCore.attachData)
3698            if (proceed) proceed();
3699        }
3700    }
3701
3702    this.hookStaticLinks = function () {
3703        function hookLinks() {
3704            for (let el of document.querySelectorAll("a")) {
3705                if (el["BSSHOP_INTERFACE_HOOK_LINK"]) continue;
3706                el["BSSHOP_INTERFACE_HOOK_LINK"] = true;
3707                $(el).on("click.bsClientInteraction",
3708                    function (e) {
3709                        //console.log("hook init", e);
3710                        if (e.originalEvent && e.originalEvent.isLoopback) return true;
3711                        if (e.originalEvent != undefined && e.originalEvent.button !== 0) return true; //108813, v Chromu se tato metoda nezavolá, pokud se button nerovná 0. V Safari se zavolá. Tímto jsme sjednotili chování Chromu a Safari.
3712
3713                        const el = this;
3714                        const $el = $(el);
3715                        const href = $el.attr("href");
3716                        const target = $el.attr("target");
3717                        const tag = el.getAttribute("data-ci-tag");
3718                        if (!href || href.length === 0) return true;
3719                        if (target && target === "_blank") return true;//85705 - nefungovalo otevření do nového okna
3720
3721                        if (mvcCore.isAttached(el, "click")) return true;
3722                        console.log("Client interface link clicked");
3723
3724                        const defaultData = window["BSSHOP_INTERFACE_LINK_CLICKED"]; // výchozí action data, generuje se na serveru
3725                        const data = JSON.parse(JSON.stringify(defaultData)); // pro jistotu si vytvoříme kopii
3726                        data.Args = [{ ConstantValue: href }, { ConstantValue: tag || "" }];
3727
3728                        var prevented = true;
3729                        // 147019 - pokud je volání z JS pomocí .click(), pak originalEvent neexistuje a způsobovalo to spousty chyb v konzoli
3730                        var event = e.originalEvent || e;
3731
3732                        // 109524 - otevře odkaz v nové záložce, není potřeba potlačit událost, protože na stávající stránce zůstáváme
3733                        if (event.ctrlKey) {
3734                            prevented = false;
3735                        }
3736
3737                        // 109524 - stáhne odkaz jako soubor, není potřeba potlačit událost, protože na stávající stránce zůstáváme
3738                        if (event.altKey) {
3739                            prevented = false;
3740                        }
3741
3742                        // 109524 - otevře odkaz v novém okně, není potřeba potlačit událost, protože na stávající stránce zůstáváme
3743                        if (event.shiftKey) {
3744                            prevented = false;
3745                        }
3746
3747                        // 123352 - otevře odkaz v novém okně (na MACu), není potřeba potlačit událost, protože na stávající stránce zůstáváme
3748                        if (event.metaKey) {
3749                            prevented = false;
3750                        }
3751
3752                        mvcCore.invokeAction(data,
3753                            this,
3754                            null,
3755                            function (result) {
3756                                if (!result && prevented) {
3757                                    // window.location = href; 30578
3758
3759                                    /* 31448 - ani jedno z níže uvedených nefunguje
3760                                    $el.trigger('click');
3761                                    $el.click();
3762                                    */
3763
3764                                    // 31448
3765                                    const evt = document.createEvent("MouseEvents");
3766                                    evt.initMouseEvent("click",
3767                                        true,
3768                                        true,
3769                                        window,
3770                                        1,
3771                                        0,
3772                                        0,
3773                                        0,
3774                                        0,
3775                                        event.ctrlKey,
3776                                        event.altKey,
3777                                        event.shiftKey,
3778                                        event.metaKey,
3779                                        event.button,
3780                                        null);
3781                                    evt.isLoopback = true;
3782
3783                                    e.currentTarget.dispatchEvent(evt);
3784                                }
3785                                return false;
3786                            },
3787                            event);
3788
3789                        if (!prevented) {
3790                            event["BSSHOP_INTERFACE_NOT_PREVENTED"] = true;
3791                            return true;
3792                        }
3793
3794                        e.preventDefault();
3795                        return false;
3796                    });
3797            }
3798        }
3799
3800        mvcCore.addAjaxEnd(function () {
3801            hookLinks();
3802        });
3803
3804        $(function () {
3805            hookLinks();
3806        });
3807    };
3808};
3809
3810var bsshopInterface = new BsshopInterface();
3811bsshopInterface.hookStaticLinks();
3812console.debug("BsshopInterface initialized");
3813;var BsDataLayer = function () {
3814    this.init = function () {
3815        window.bsshopInterface.addAddToCartHandler(this.onAddToCart);
3816        window.bsshopInterface.addGotoBasketHandler(this.onGoToBasket);
3817        window.bsshopInterface.addSearchHandler(this.onSearch);
3818        window.bsshopInterface.addRegistrationCompletedHandler(this.onCompleteRegistration);
3819        window.bsshopInterface.addToWatchListHandler(this.onAddToWishList); // dříve addToWatch a addToFavorite byl jeden event - pro zpětnou kompatibilitu mají společný handler
3820        window.bsshopInterface.addToFavoriteHandler(this.onAddToWishList); // dříve addToWatch a addToFavorite byl jeden event - pro zpětnou kompatibilitu mají společný handler
3821        window.bsshopInterface.addQuestionSentHandler(this.onQuestionSent); // dříve addQuestionSentHandler, addProductTopicAddedHandler a addProductTopicRespondAddedHandler byl jeden event - pro zpětnou kompatibilitu mají společný handler
3822        window.bsshopInterface.addProductTopicAddedHandler(this.onQuestionSent); // dříve addQuestionSentHandler, addProductTopicAddedHandler a addProductTopicRespondAddedHandler byl jeden event - pro zpětnou kompatibilitu mají společný handler
3823        window.bsshopInterface.addProductTopicRespondAddedHandler(this.onQuestionSent); // dříve addQuestionSentHandler, addProductTopicAddedHandler a addProductTopicRespondAddedHandler byl jeden event - pro zpětnou kompatibilitu mají společný handler
3824        window.bsshopInterface.addRemoveFromCartHandler(this.onRemoveFromCart);
3825        window.bsshopInterface.addProductListHandler(this.onProductsList);
3826        console.debug("BsDataLayer initialized");
3827    };
3828
3829
3830    // AddToCart
3831    this.onAddToCart = function (nextHandler, productData) {
3832        addProductData({
3833            'event': "AddToCart",
3834            'addToCart_quantity': productData.AddedQuantity,
3835            'addToCart_currency': productData.CurrencyCode,
3836            'addToCart_value': productData.TotalAddedPriceWithoutVat,
3837            'addToCart_value_vat': productData.TotalAddedPriceVat,
3838            'addToCart_productUrl': productData.ProductUrl,
3839            'addToCart_imageUrl': productData.ImageUrl,
3840            'addToCart_category': productData.Category
3841        }, "addToCart", productData);
3842
3843        nextHandler();
3844    };
3845
3846    // InitiateCheckout - příchod do košíku
3847    this.onGoToBasket = function (nextHandler) {
3848        addData({ 'event': "CustomizeProduct" });
3849        nextHandler();
3850    };
3851
3852    // Search - stránka hledání
3853    this.onSearch = function (nextHandler, searchData) {
3854        if (searchData.SearchString !== "") {
3855            addData({
3856                'event': "Search",
3857                'search_string': searchData.SearchString
3858            });
3859        }
3860        nextHandler();
3861    };
3862
3863    // CompleteRegistration - návštěvník dokončí registraci
3864    this.onCompleteRegistration = function (nextHandler, data) {
3865        addData({ 'event': "CompleteRegistration" });
3866        nextHandler();
3867    };
3868
3869    // AddToWishlist && WatchDog - návštěvník přidá produkt do seznamu příní
3870    this.onAddToWishList = function (nextHandler, productData) {
3871        addProductData({
3872            'event': "AddToWishList",
3873            'addToWish_value': productData.PriceWithoutVat,
3874            'addToWish_value_vat': productData.PriceVat
3875        }, "addToWish", productData);
3876        nextHandler();
3877    };
3878
3879    // Výpis kategorie, 74377
3880    this.onProductsList = function (nextHandler, productsData) {
3881        addData({
3882            'event': "OnProductsList",
3883            'onProducsList_category_id': productsData.Id,
3884            'onProducsList_category_name': productsData.CategoryName
3885        });
3886        nextHandler();
3887    };
3888
3889
3890    // Contact - návštěvník odešle dotaz k produktu, nebo odešle jiný dotazník
3891    this.onQuestionSent = function (nextHandler, productData) {
3892        addData({ 'event': "Contact" });
3893        nextHandler();
3894    };
3895
3896
3897    this.onRemoveFromCart = function (nextHandler, productData) {
3898        addProductData({
3899            'event': "RemoveFromCart",
3900            'removeFromCart_quantity': -productData.AddedQuantity,
3901            'removeFromCart_currency': productData.CurrencyCode,
3902            'removeFromCart_value': -productData.TotalAddedPriceVat,
3903            'removeFromCart_productUrl': productData.ProductUrl,
3904            'removeFromCart_imageUrl': productData.ImageUrl,
3905            'removeFromCart_category': productData.Category
3906        },
3907            "removeFromCart",
3908            productData);
3909        nextHandler();
3910    };
3911
3912    function debug(message, obj) {
3913        if (!mvcCore.isDebug()) return;
3914        if (obj) message += ", " + JSON.stringify(obj);
3915        console.debug("BsDataLayer: " + message);
3916    }
3917
3918    function addProductData(data, productDataPrefix, productData) {
3919        data[productDataPrefix + "_product_id"] = productData.Id;
3920        data[productDataPrefix + "_product_name"] = productData.Name;
3921        data[productDataPrefix + "_product_code"] = productData.Code;
3922        data[productDataPrefix + "_product_brand"] = productData.Maker;
3923        addData(data);
3924    }
3925
3926    function addData(data) {
3927        window.dataLayer.push(data);
3928    }
3929};
3930
3931var bsDataLayer = new BsDataLayer();
3932$(function () {
3933    bsDataLayer.init();
3934});
3935
3936;(function(){var t=!1,n;try{n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("bs-test-supportsPassive",null,n);window.removeEventListener("bs-test-supportsPassive",null,n)}catch(i){}$.fn.extend({hide_bs:function(){return this.each(function(){$(this).addClass("bs-display-none")})},show_bs:function(){return this.each(function(){$(this).removeClass("bs-display-none")})},touchstart:function(n){return this.on("touchstart",n)},touchmove:function(n){return this.on("touchmove",n)},touchend:function(n){return this.on("touchend",n)},touchcancel:function(n){return this.on("touchcancel",n)},touchstartpassive:function(n){return t?this.each(function(t,i){var r={passive:!0};i.addEventListener("touchstart",n,r);$(i).on("remove",function(){i.removeEventListener("touchstart",n,r)})}):this.touchstart(n)}})})();"IntersectionObserver"in window||(window.IntersectionObserver=function(n){this.observe=function(t){n([{target:t,isIntersecting:!0}])};this.disconnect=function(){n([{isIntersecting:!1}])}});var MvcUi=function(){function u(){var n=location.hash,t,i;n&&n.indexOf("#inv:")===0&&(t=n.substring(5),i=atob(t),$(document).ready(function(){eval(i)}))}var n=this;this.currencyCode="czk";this.mobile=!1;this.documentIsLoaded=!1;$(window).on("load",function(){n.documentIsLoaded=!0;u()});var i=[],r=[],t=[];this.getView=function(n){var i=$("#"+n),t=i.data("_MvcViewInstance");return t||(t=new MvcView(n),i.data("_MvcViewInstance",t)),t};
3936this.registerPriceFormatter=function(n,t){n||(n="default");i[n]=new MvcPriceFormatter(t)};this.getPriceFormatter=function(n){var u=r[n],t;return u||(u="default"),t=i[u],t||(t=i["default"]),t};this.IsIE8=function(){return document.all&&document.querySelector&&!document.addEventListener};this.setCurrencyCode=function(n){this.currencyCode=n};this.getCurrencyName=function(n,t){return n||(n=this.currencyCode),t.currencyCodes[n.toLowerCase()]||this.currencyCode};this.mapPriceFormatter=function(n,t){r[n]=t};this.setMobile=function(n){this.mobile=n};this.isMobile=function(){return this.mobile};this.findFocusableElements=function(n){return $(n).find("[tabindex], a[href], input, textarea, select").filter(':visible:not([tabindex="-1"])')};this.dynamicPopup=function(t,i){function c(e){function c(){o.hide(i.closeupSpeed);e.removeClass("bs-popup-open");u.$().removeClass("bs-popup-open");e.data("openedByEnter")&&(e.focus(),e.data("openedByEnter",!1));a.hide()}function w(){function r(){var n=s.left+o.outerWidth()-b-$(document).scrollLeft(),t,r;n>0&&(s.left-=n);n=s.top+o.outerHeight()-k-$(document).scrollTop();n>0&&(s.top-=n);n=$(document).scrollTop()-s.top;n>0&&(s.top+=n);t=o.outerHeight(!0)-o.outerHeight(!1);r=o.outerWidth(!0)-o.outerWidth(!1);s.top+=t;s.left+=r;o.offset(s);i.expandDirection==="fromright"&&(o.css("right","calc(100% - "+o.css("left")+" - "+o.outerWidth()+"px)"),o.css("left","auto"))}var h,t;o.css("z-index",n.getMaxZ()+1);o.addClass("bs-tab-boundary");i.horizontalAlignment==="right"&&(s.left-=o.outerWidth(!1));r();o.show(i.popupSpeed,null,r);o.offset(s);i.expandDirection==="fromright"&&o.css("left","auto");e.addClass("bs-popup-open");u.$().addClass("bs-popup-open");a.css("z-index",0);o.after(a);e.data("openedByEnter")&&n.findFocusableElements(o).first().focus();o.off("keydown.popup");o.on("keydown.popup",function(n){n.key==="Escape"&&(c(),n.preventDefault(),n.stopPropagation())});if(h=u.$(),i.triggerMode==="click"){t=function(n){var i=$(n.target),r=h.has(i).length>0,u=o.has(i).length>0||i.is(o);r||u||($(document).off("mousedown",t),c())};$(document).on("mousedown",t)}else{o.mouseleave(function(){f(e,function(){e.data("hover")||c()},i.closeupDelay)});e.mouseleave(function(){f(e,function(){o.data("hover")||c()},i.closeupDelay)});e.on("destroyed",function(){c()})}}var o=e.data("popupEl"),l=i.pivotSelector?$(i.pivotSelector):e,s=l.offset(),y=l.height(),p=l.width();i.position==="bottomleft"?s.top+=y:i.position==="topright"?s.left+=p:i.position==="bottomright"&&(s.top+=y,s.left+=p);var b=$(window).width(),k=$(window).height(),a=$("<div class='bs-popup-overlay'><\/div>");if(h=c,o){o.is(":visible")&&r=="mousedown"?c():w(o);return}mvcCore.invokeAction(v,e,t,function(n){var i=n.Html,u;return i.length===0?(console.warn("No result from controller for dynamicPopup, view="+t),!1):(u=i[0],u.AfterUpdate=function(n){o=$(n);o.addClass("popup");e.data("popupEl",o);o.hover(function(){$(this).data("hover",!0)},function(){$(this).data("hover",!1)});w(o);r!=="mouseenter"||e.data("openedByEnter")||f(e,function(){e.data("hover")||c()},200)},!1)})}function f(n,t,i){var r=n[0];clearTimeout(r[s]);r[s]=setTimeout(t,i)}var l,s;i||(i={triggerMode:"hover",position:"bottomleft",targetSelector:null,actionData:null,pivotSelector:null,popupDelay:400,popupSpeed:200,closeupDelay:400,closeupSpeed:200,horizontalAlignment:"left",expandDirection:"fromleft"});var a=i.targetSelector,v=i.actionData,r="mouseenter";i.triggerMode=="click"&&(r="click");var u=mvcUi.getView(t),e=u.$(a),o="bs-dynamicPopup-counter";window[o]=window[o]||0;l=window[o]++;s="bs-dynamicPopup-actionTimeout"+l;let h=null;e.hover(function(){$(this).data("hover",!0)},function(){$(this).data("hover",!1)});e.on(r,function(){var n=$(this);r==="mouseenter"?f(n,function(){n.data("hover")&&c(n)},i.popupDelay):c(n)});e.keydown(function(n){if(n.key==="Enter"){const t=$(this),i=t.data("openedByEnter");i&&h!=null?h():(t.data("openedByEnter",!0),c(t));n.preventDefault();n.stopPropagation()}})};this.dialog=function(t,i){function s(n,t){var i=$(n),u=o||r;u.append(i);t&&i.click(function(){t()})}function a(n){return n?function(){mvcCore.invokeAction(n)}:u}function v(){var i=$(window).width(),u=$(window).height(),f=r.outerWidth(),e=r.outerHeight(),o=(i-f)/2,t=(u-e)/2;n.mobile&&(t+=$(document).scrollTop());r.css("top",t+"px");r.css("left",o+"px")}function p(){var f,s,o;if($("html,body").css("overflow-y","hidden"),f=n.getMaxZ()+1,n.mobile?r.css("position","absolute"):r.css("position","fixed"),r.css("z-index",f+1),y(!1),r.show(),r.data("previousFocusedElement",$(document.activeElement)),n.findFocusableElements(r).first().focus(),v(),n.invokeAfterImagesLoaded(r,v),s="<div class='bs-dialog-overlay' data-for-id='"+t+"' style='position:fixed; top:0; left:0; width:100%; height:100%;'><\/div>",e=$(s),o=f,o>=f+1&&o--,e.css("z-index",o),r.before(e),r.is(":visible")||u(),i.closeOnOffClick&&e.click(function(){u()}),i.closeAfterMouseLeave&&r.mouseleave(function(){u()}),i.closeOnEsc||i.showCloseButton)$(document).on("keydown",function(n){n.key==="Escape"&&u()})}function u(){y(!0);r.fadeOut(500,function(){r.data("dialog")&&r.show()});e.hide();$("html,body").css("overflow-y","visible");var n=r.data("previousFocusedElement");n&&n.focus();f.$().data("dialog",!1);r.hide()}function y(n){var t=$("#heurekaTableft").parent(),r,i;t.length&&(r=t.attr("id"),r.search("hw")===0&&(n?t.css("display","block"):t.css("display","none")));
3936i=$(".shoproku-sticky-widget");t.length&&(n?i.css("display","block"):i.css("display","none"))}var f,r,e,h,c,l,o;i||(i={closeButtonSelector:null,dialogType:"information",showCloseButton:!0,showIcon:!0,showDelay:0,selector:null,closeAfterMouseLeave:!1,closeOnOffClick:!1,closeDialog:!1,closeAfter:0,closeOnEsc:!1,yesButtonText:null,noButtonText:null,yesActionData:null,noActionData:null});f=this.getView(t);r=f.$(i.selector);r.length===0&&i.selector&&i.selector[0]==="#"&&(r=$(i.selector));h=f.$().parent().get(0).tagName;h.toLowerCase()!="body"&&(r.before("<bs-empty><\/bs-empty>"),$("body").append(r));c=f.$().data("dialog");l=!c&&!i.closeDialog;i.closeDialog||f.$().data("dialog",!0);r.addClass("bs-dialog");r.addClass("bs-tab-boundary");r.addClass(i.dialogType);i.showIcon&&r.addClass("hasIcon");i.showCloseButton&&r.addClass("hasClose");i.showCloseButton&&s("<a class='bs-close' tabindex='0' role='button'><\/a>",u);o=null;(i.yesButtonText||i.noButtonText)&&(o=$("<div class='buttons'><\/div>"));i.noButtonText&&s("<a class='bs-no-button button'>"+i.noButtonText+"<\/a>",a(i.noActionData));i.yesButtonText&&s("<a class='bs-yes-button button'>"+i.yesButtonText+"<\/a>",a(i.yesActionData));o&&r.append(o);l?setTimeout(p,i.showDelay):e=$("div.bs-dialog-overlay");i.closeButtonSelector&&$(i.closeButtonSelector).click(function(){u()});i.closeDialog&&u();i.closeAfter&&setTimeout(function(){u()},i.closeAfter)};this.dynamicData=function(n,t,i){mvcCore.invokeAction(t,n,n,function(n){return i(n),!0})};this.dynamicAutoComplete=function(t,i){function e(r,u){var h;if(!f&&(h=r.val(),u==!0||!(h.length<i.prefixLength))){var c=i.pivotSelector&&$(i.pivotSelector).length>0?$(i.pivotSelector):r,s=c.offset(),l=c.outerHeight(),a=r.outerWidth();s.top+=l;f=!0;o=h;mvcCore.invokeAction(i.actionData,i.targetSelector,t,function(t){var u=t.Html,h;return u.length==0?(console.error("DynamicAutoComplete: no html found in AJAX result."),!1):(h=u[0],h.AfterUpdate=function(t){function b(n){setTimeout(()=>{u.hide()},n);removeEventListener("click",k);c[y]=!1;var t=h[l];t&&t.disconnect();h[l]=null}function k(n){var t=$(n.target);t.closest(u).length||b(i.closeupDelay)}var l="dynamicAutoCompleteResizeObserver",y="dynamicAutoCompleteOnDocumentClick",u=$(t),h=r[0],c,p,w,v;h.popupEl=u;c=u[0];u.css("z-index",n.getMaxZ()+1);u.addClass("bs-tab-boundary");c.style.setProperty("--search-input-width",a+"px");u.show();c.style.setProperty("--search-offset-pivot-target",s.left-u[0].offsetLeft+"px");p=u.outerHeight(!0)-u.outerHeight(!1);w=u.outerWidth(!0)-u.outerWidth(!1);s.top+=p;s.left+=w;u.offset(s);f=!1;o!=r.val()&&e(r);u.keydown(function(n){n.key==="Escape"&&(u.hide(),r.focus())});c[y]||(addEventListener("click",k),c[y]=!0);!h[l]&&h.parentElement&&(v=new ResizeObserver(()=>{h.isConnected||(b(0),v.disconnect(),h[l]=null)}),v.observe(h),h[l]=v)},!1)})}}i||(i={targetSelector:null,actionData:null,prefixLength:3,popupDelay:250,closeupDelay:500,openOnFocus:!1,pivotSelector:null});var u=mvcUi.getView(t),o="",f=!1,r;i.openOnFocus&&u.$(i.targetSelector).focus(function(){var n=$(this);r=setTimeout(function(){e(n,!0)},i.popupDelay)});u.$(i.targetSelector).keyup(function(){var n=$(this),t=n.val(),u;if(t&&(u=n.get(0).oldValue,u!=t)){if(n.get(0).oldValue=t,t.length<i.prefixLength){n.get(0).popupEl&&n.get(0).popupEl.hide();return}r&&clearTimeout(r);r=setTimeout(function(){e(n)},i.popupDelay)}});u.$(i.targetSelector).keydown(function(t){var r=$(this);let i=r.get(0).popupEl;i&&i.is(":visible")&&(t.key==="Tab"?(n.findFocusableElements(i).first().focus(),t.preventDefault(),t.stopPropagation()):t.key==="Escape"&&i.hide())})};this.collapsible=function(n,t){function e(n){u.hide();f.show();n===!0?r.show():r.slideDown();f.one("click",o);i.setValue("expanded",!0)}function o(n){f.hide();u.show();n===!0?r.hide():r.slideUp();u.one("click",e);i.setValue("expanded",!1)}var i=mvcUi.getView(n),s;t||(t={collapsedHeaderSelector:null,expandedHeaderSelector:null,contentSelector:null,defaultExpanded:!1});var u=i.$(t.collapsedHeaderSelector),f=i.$(t.expandedHeaderSelector),r=i.$(t.contentSelector);this.setEnsureVisibleFunction(r,function(){e(!0)});s=i.getValue("expanded",t.defaultExpanded);s?e(!0):o(!0)};this.expandableContainer=function(n,t){function c(){if(t.collapsedHeight)return t.collapsedHeight;var n=0;return t.itemSelector&&y.each(function(i){i==t.collapsedVisibleItems-1&&(n=$(this).offset().top-r.offset().top+$(this).outerHeight())}),n}function s(n){n?(i.addClass("expanded"),i.removeClass("collapsed")):(i.addClass("collapsed"),i.removeClass("expanded"),i.removeClass("processing"));u.setValue(l,n)}function h(n){e.hide();o.show();n===!0?(s(!0),i.show()):i.animate({height:r.outerHeight()},{complete:function(){s(!0)}});o.one("click",v)}function v(n){i.addClass("processing");o.hide();e.show();n===!0?(i.height(c()),s(!1)):i.animate({height:c()},{complete:function(){s(!1)}});e.one("click",h)}var u=mvcUi.getView(n),i,l,f,a;t||(t={collapsedHeight:100,collapsedVisibleItems:3,buttonExpandSelector:null,buttonCollapseSelector:null,contentSelector:null,itemSelector:null,rememberExpansion:!0,rememberExpansionKey:null,defaultExpanded:!1});var r=u.$(t.contentSelector),e=u.$(t.buttonExpandSelector),o=u.$(t.buttonCollapseSelector),y=u.$(t.itemSelector);if(y.length<=t.collapsedVisibleItems){e.hide();o.hide();return}if(r&&r.length>0&&$(r).outerHeight()<c()){e.hide();o.hide();return}r.wrap("<div class='bs-expandableContainer' style='position:relative; overflow:hidden;'><\/div>");r.before("<div class='bs-expandableContainerDecorator'><\/div>");i=r.parent(".bs-expandableContainer");i[0].BS_EXPAND_CONTAINER=function(){h(!0)};l=(t.rememberExpansionKey||"")+"expanded";f=t.defaultExpanded;window.location.hash&&(f=i.find(window.location.hash).length>0);!f&&t.rememberExpansion&&(a=u.getValue(l),a!=null&&(f=a));f?h(!0):v(!0);this.invokeAfterLoad(function(){f?h(!0):v(!0)})};this.cssExpandableContainer=function(n,t){function nt(){return i.offsetHeight}function tt(n,t){w(ut,n,"px");w(ft,t,"px")}function w(n,t,r){i.style.setProperty("--"+n,t+r)}function r(n,t,i,r){n.classList.add(r?t:i);n.classList.remove(r?i:t)}function it(n){t.rememberExpansion&&e.setValue(y,n);a=n}function c(n,t){r(i,k,d,!0);n&&(t||rt(),r(o,u,f,!1),r(s,u,f,!0),it(!0))}function v(n,t){r(i,k,d,!1);n&&(t||rt(),r(o,u,f,!0),r(s,u,f,!1),it(!1))}function rt(){l=!0;i.classList.add(g);setTimeout(et,t.duration*1e3)}function et(){l=!1;i.classList.remove(g)}function ot(){if(!l&&!a){var n=b(!1);tt(n.collapsedPx,n.expandedPx);c(!0)}}function st(){if(!l&&a){var n=b(!0);tt(n.expandedPx,n.collapsedPx);v(!0)}}function b(n){var i=nt(),t;return n?v(!1):c(!1),t=nt(),n?c(!1):v(!1),{collapsedPx:n?t:i,expandedPx:n?i:t}}var e=mvcUi.getView(n),o,s,y,h,p;t||(t={containerSelector:null,expandSelector:null,collapseSelector:null,duration:1,rememberExpansion:!0,rememberExpansionKey:null,defaultExpanded:!1});var k="expanded",d="collapsed",g="animate",u="show",f="hide",ut="bs-animation-height-from",ft="bs-animation-height-to",l,a,i=e.$(t.containerSelector)[0];i.BS_EXPAND_CONTAINER=function(){a||c(!0,!0)};o=e.$(t.expandSelector)[0];s=e.$(t.collapseSelector)[0];w("bs-animation-duration",t.duration,"s");o.addEventListener("click",ot);
3936s.addEventListener("click",st);y=(t.rememberExpansionKey||"")+"expanded";h=t.defaultExpanded;window.location.hash?h=i.querySelectorAll(window.location.hash).length>0:t.rememberExpansion&&(h=e.getValue(y,t.defaultExpanded));h?c(!0,!0):v(!0,!0);p=b(h);p.expandedPx<=p.collapsedPx&&(r(o,u,f,!1),r(s,u,f,!1),i.classList.add("notExpandable"))};this.openTab=function(n){for(var t=$(n),r,u,i;;){if(t.length===0)return null;if(r=t.data("isBsTabHeader"),r)return t.click(),t;if(u=t.data("isBsTabPage"),u)return i=t.data("bsTabsHeaderElement"),$(i).click(),$(i);if(t=t.parent(),typeof t.prop("tagName")!="undefined"&&t.prop("tagName").toLowerCase()==="body")return null}};this.tabs=function(n,t){function e(n,e){var o,c,s,h;return(f.removeClass("nothingSelected"),o=i.filter("[data-pageid="+n+"]"),o.length==0)?!1:t.allowFullCollapse&&(c=o.hasClass("selected"),c)?t.disableFullCollapseOnClass&&f.hasClass(t.disableFullCollapseOnClass)?!0:(i.removeClass("selected"),r.hide(),u.setValue("pageid",-1),f.addClass("nothingSelected"),!0):(i.removeClass("selected"),o.addClass("selected"),r.removeClass("selected"),s=r.filter("[data-pageid="+n+"]"),s.addClass("selected"),h=r,e?(h.hide(),s.show()):h.fadeOut(0,function(){s.fadeIn(0)}),t.storeActivePage&&u.setValue("pageid",n),!0)}var u=mvcUi.getView(n),f=u.$(),i,r;t||(t={headerSelector:"",pageSelector:"",allowFullCollapse:!1,defaultCollapsed:!1,disableFullCollapseOnClass:null,storeActivePage:!0});i=u.$(t.headerSelector);i.each(function(n){$(this).attr("data-pageid",n);$(this).data("isBsTabHeader",!0)});r=u.$(t.pageSelector);r.each(function(n){$(this).attr("data-pageid",n);$(this).data("isBsTabPage",!0);$(this).data("bsTabsHeaderElement",i[n])});i.click(function(){var n=$(this),t=n.attr("data-pageid");e(t)});this.invokeAfterLoad(function(){var n=t.storeActivePage?u.getValue("pageid"):-1;n>=0?e(n,!0)||$(i[0]).click():t.defaultCollapsed?(f.addClass("nothingSelected"),r.hide()):$(i[0]).click()})};this.multiTabs=function(n,t){function a(n){return n!==""}function y(){return!!t.allowMultiSelectedTabsClass}function d(){return y()?k.hasClass(t.allowMultiSelectedTabsClass):!1}function g(n){var t=i.getValue(e);(t||(t=":"),t.indexOf(":"+n+":")>-1)||(t+=n+":",i.setValue(e,t))}function nt(n){var t=i.getValue(e);t||(t=":");t=t.replace(":"+n+":",":");i.setValue(e,t)}function p(){var n=i.getValue(e),t;return n||(n=":"),t=n.match(/\d+/g),t||[]}function w(n,t){var r=t.split(",").filter(a),i,u;if(r.length==0)return!1;for(i=0;i<r.length;i++)if(u=r[i],!n.classList.contains(u))return!1;return!0}function v(n,t){var i=t.split(" ").filter(a);i.forEach(function(t){n.length!==undefined?n.forEach(function(n){n.classList.add(t)}):n.classList.add(t)})}function c(n,t){var i=t.split(" ").filter(a);i.forEach(function(t){n.length!==undefined?n.forEach(function(n){n.classList.remove(t)}):n.classList.remove(t)})}function b(n,l){var tt,b,k;if(!(n<0)&&!(n>=r.length)&&!(n>=s.length)){var a=r[n],y=s[n],it=l==null?d():l==!0;if(it)tt=r.filter("."+f),tt.filter(a).length>0?(nt(n),b=p(),b.length===0&&w(a,f)?c([a,y],f):(c([a,y],u+" "+f),k=b[b.length-1],v([r[k],s[k]],u),i.setValue(h,k))):(g(n),c(o,u),v([a,y],u+" "+f),i.setValue(h,n));else{if(w(a,u)){t.tabIsCollapsible&&(c(o,u+" "+f),i.setValue(h,""),i.setValue(e,""));return}c(o,u+" "+f);v([a,y],u+" "+f);i.setValue(h,n);i.setValue(e,":"+n+":")}}}var u="selected",f="multiSelected",h="pageid",e="pageids",l="data-pageid",i=mvcUi.getView(n),k=i.$(),o,r,s;t||(t={headerSelector:"",pageSelector:"",allowMultiSelectedTabsClass:null,autoselectFirstTab:!0,tabIsCollapsible:!1,defaultMultiSelectedTabs:[]});o=[];r=i.$(t.headerSelector);r.each(function(n){$(this).attr(l,n);$(this).data("isBsTabHeader",!0);o.push(r[n])});s=i.$(t.pageSelector);s.each(function(n){$(this).attr(l,n);$(this).data("isBsTabPage",!0);$(this).data("bsTabsHeaderElement",r[n]);o.push(s[n])});r.click(function(){var n=$(this),t=n.attr(l);b(t)});this.invokeAfterLoad(function(){function e(){return u&&n?t.defaultMultiSelectedTabs:t.autoselectFirstTab&&!n?[0]:t.autoselectFirstTab&&n?[0,0]:[]}function o(){var t=n?p():[r];return t.length===0&&(t=[r,r]),t}var n=y(),u=t.defaultMultiSelectedTabs&&t.defaultMultiSelectedTabs.length>0,r=i.getValue(h),f=r==null?e():o();f.forEach(function(t){b(t,n)})})};this.rangeSlider=function(n,t){function v(){var n=parseFloat(o.val().replace(/\s/g,"")),t=parseFloat(s.val().replace(/\s/g,""));y(n,t)}function y(n,t){n>=f-i&&(n=t-i);t<=u+i&&(t=n+i);o.attr("data-value",n);s.attr("data-value",t)}function p(n,t){var i=c?n+c:r.formatPrice(n),u=c?t+c:r.formatPrice(t);o.val(i);s.val(u);w.text(i);b.text(u)}var r=mvcUi.getView(n);
3936t==null&&(t={targetSelector:null,updateButtonSelector:null,fromPriceSelector:null,toPriceSelector:null,fromPriceLabelSelector:null,toPriceLabelSelector:null,minValue:0,maxValue:100,step:null,roundToStep:!0,unit:null});var e=r.$(t.targetSelector),o=r.$(t.fromPriceSelector),s=r.$(t.toPriceSelector),w=r.$(t.fromPriceLabelSelector),b=r.$(t.toPriceLabelSelector),h=t.maxValue-t.minValue,i=t.step,c=t.unit;i||(i=1,h>100&&(i=1),h>1e3&&(i=10),h>1e4&&(i=100),h>1e5&&(i=1e3));var u=t.minValue,f=t.maxValue,l=parseFloat(o.attr("data-value").replace(/\s/g,"")),a=parseFloat(s.attr("data-value").replace(/\s/g,""));t.roundToStep&&(u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i,l<u+i&&(l=u),a>f-i&&(a=f),p(l,a));e.slider({range:!0,min:u,max:f,values:[l,a],step:i,slide:function(n,t){var i=t.values[0],r=t.values[1];y(i,r);p(i,r)},stop:function(){r.$(t.updateButtonSelector).click()}});o.change(function(){v()});s.change(function(){v()});r.$().on("change",function(){r.$(t.updateButtonSelector).click()});e.find(".ui-slider-handle:first").addClass("left");e.find(".ui-slider-handle:last").addClass("right");e.prepend("<div class='left stop' style='position:absolute; left:0;'><\/div>");e.append("<div class='right stop' style='position:absolute; left:100%;'><\/div>")};this.registerPriceFormatter(function(t,i){return i||(i=n.currencyCode),t.toFixed(2)+" "+i});this.dropDownCheckList=function(n,t,i,r,u,f){function c(){e&&(i&&mvcCore.invokeAction(i,t,n),e=!1)}function l(){e=!0;r&&mvcCore.invokeAction(r,t,n)}var o=mvcUi.getView(n),s=o.$(t),h={onClosed:c,onChanged:l,emptyText:u,allText:f},e;s.bsDropdown(h);e=!1};this.scrollContainer=function(n,t){t||(t={containerSelector:null,itemSelector:null,previousSelector:null,nextSelector:null,vertical:!1,increment:1,rotate:!0});var i=mvcUi.getView(n),r=i.$(t.containerSelector),u=i.$(t.previousSelector),f=i.$(t.nextSelector),e=i.$(t.itemSelector),o={containerEl:r,itemEls:e,previousEl:u,nextEl:f,vertical:t.vertical,increment:t.increment,rotate:t.rotate,speedup:t.speedup,nativeScroll:t.nativeScroll,autoScrollInterval:t.autoScrollInterval};this.createScrollContainer(o)};this.createScrollContainer=function(n){function kt(){return y()+e(v)+o(v)}function gt(n){return ni(n).index}function ni(n){for(var u,f=e(i[n]),t=n+1;t<r;t++)if(u=i[t],f!=e(u))return{el:u,index:t,steps:t-n};return{el:null,index:r-1,steps:-1}}function ci(n){return ti(n).index}function li(n){return ti(n).el}function ti(n){for(var r,u=e(i[n]),t=n-1;t>=0;t--)if(r=i[t],u!=e(r))return{el:r,index:t,steps:n-t};return{el:null,index:0,steps:-1}}function vt(){if(!n.nativeScroll&&!at&&u){var t=f.css("display");t&&t.indexOf("flex")!==-1||f.css("display","flex");at=!0}}function g(){if(f.css("--bs-scroll-container-size",p()),u){if(c&&h){if(!tt()&&!nt()){c.addClass("disabled");h.addClass("disabled");return}c.removeClass("disabled");h.removeClass("disabled")}else c&&c.removeClass("disabled"),h&&h.removeClass("disabled");return}c&&(tt()?c.removeClass("disabled"):c.addClass("disabled"));h&&(nt()?h.removeClass("disabled"):h.addClass("disabled"))}function ii(t){var s,e,o,h,f;if(!n.nativeScroll&&u&&t!=0){if(vt(),ht+=t,s=[],t>0)for(e=r-t,f=0;f<r;f++)o=f<e?f+t:f-e,s[o]=i[f],i[f].css("order",(o+1)*10);else for(e=-t,h=r-e,f=0;f<r;f++)o=f<e?f+h:f+t,s[o]=i[f],i[f].css("order",(o+1)*10);i=s;v=i[r-1];st=i[0]}}function nt(){var u,f,s,h;return n.nativeScroll?Math.round(kt()-p()-y())>0:!l&&Math.floor(t)>=r-1?!1:(u=Math.floor(e(v))+Math.floor(o(v)),f=p(),!l&&(s=i[Math.floor(t)],h=Math.floor(e(s)),h+f>=u))?!1:u<=f?!1:!0}function tt(){return n.nativeScroll?Math.round(y())>0:y()<=0?!1:!l&&Math.ceil(t)<=0?!1:!0}function it(){var r,f,e,s,i;if(n.nativeScroll){r=y()-p();yt(r,!0);return}if(l!=!0&&(vt(),u||tt())){if(u&&!tt()&&n.increment==1&&(f=o(v),ft(f,!0)),t=Math.ceil(t),n.increment>1){if(t-=n.increment,t<0)if(u){for(e=t,s=n.increment,n.increment=1,t=0,i=0;i<Math.abs(e);i++)it();n.increment=s}else t=0}else t=ci(t);rt()}}function ut(){var f,e,s,h,i;if(n.nativeScroll){f=y()+p();yt(f,!0);return}if(l!=!0&&(vt(),u||nt())){if(u&&!nt()&&n.increment==1&&(e=o(st),ft(-e,!0)),t=Math.floor(t),n.increment>1){if(t+=n.increment,t>=r)if(u){for(s=t,h=n.increment,n.increment=1,t=0,i=0;i<Math.abs(s);i++)it();n.increment=h}else t=r-1}else t=gt(t);rt()}}function ai(t){if(!n.nativeScroll&&!(t<0)&&!(t>=r)){var i=ui(t);ri(i)}}function vi(t){if(!n.nativeScroll&&!(t<0)&&!(t>=r)){var u=ui(t),f=i[u],s=Math.floor(e(f)),h=s+Math.floor(o(f));(s<0||h>p())&&ri(u)}}function ri(i){var s,h;if(!n.nativeScroll&&t!=i)if(u){var f=t-i,e=f>0?f-r:r+f,o=Math.abs(f)<Math.abs(e)?f:e;if(Math.abs(f)==Math.abs(e)&&(o=f>e?e:f),o>0)for(s=0;s<o;s++)it();else for(h=0;h<-o;h++)ut()}else{t=i;rt();return}}function rt(){if(!n.nativeScroll){t=Math.floor(t);var r=e(i[t])+y();yt(r);dt()}}function yt(n,t){t&&(n=yi(n));f.css("--bs-scroll-offset",n);f.animate(ct(n),{queue:!1,complete:g,duration:500})}function yi(n){for(var r=0,t=0,f=y(),u=0;u<i.length;u++){if(t=e(i[u])+f,t>n)break;r=t}return n-r>t-n?t:r}function ui(n){var t=(n+ht)%r;return t<0?t+r:t}function pi(){if(!k){for(var n=0;n<r;n++)i[n].css("pointer-events","none");k=!0}}function wi(){if(k){for(var n=0;n<r;n++)i[n].css("pointer-events","auto");k=!1}}function bi(n){var i=n.targetTouches,t;if(i.length>0)for(t=0;t<i.length;t++){var r=i[t],u=r.identifier,f=r.clientX,e=r.clientY;fi(u,f,e)}}function ki(n){var t=n.clientX,i=n.clientY;fi("mouse",t,i)}function fi(t,i,r){if(a[t]==undefined){s.length==0&&(ot=y(),a.length=0,pt=Date.now(),wt=setTimeout(hi,1e3/n.fps),c&&c.addClass("disabled"),h&&h.addClass("disabled"));var f={id:t,nowX:i,nowY:r,startX:i,startY:r},u=s.length;a[t]=u;a.length=a.length+1;s[u]=f;l=!0}}function ei(){l==!0&&si("mouse")}function oi(n){var i,t;if(l==!0)for(i=n.changedTouches,t=0;t<i.length;t++)si(i[t].identifier)}function si(n){var r=a[n],t,i;if(r!=undefined&&(t=s[r],t!=undefined&&(t.id=null,t.nowX=0,t.nowY=0,t.startX=0,t.startY=0),delete a[n],a.length=a.length-1,a.length==0)){for(di(),i=0;i<s.length;i++)delete s[i];s=[]}}function di(){var u,f,s,h;if(l==!0){for(l=!1,wi(),u=0;u<r;u++)if(f=e(i[u]),f>0){s=li(u);s!=null?(h=o(s),t=u-f/h):t=u;n.alignToItem&&(t=Math.round(t),rt());break}g();clearTimeout(wt)}}function gi(n){var u,t,i,f,r;if(l==!0)for(u=n.targetTouches,t=0;t<u.length;t++)i=u[t],f=a[i.identifier],f!=undefined&&(r=s[f],r!=undefined&&(r.nowX=i.clientX,r.nowY=i.clientY,b=!0))}
3936function nr(n){if(l==!0){var i=a.mouse,t=s[i];t!=undefined&&(t.nowX=n.clientX,t.nowY=n.clientY,b=!0)}}function hi(){if(l==!0)try{b==!0&&tr()}finally{wt=setTimeout(hi,1e3/n.fps)}}function tr(){for(var h,c,f,e,r,t=0,i=0;i<s.length;i++)s[i].id!=null&&(t=lt(s[i]));if(t!=0){if(h=Date.now()-pt>150||Math.abs(t)>10,!h)return;if(pi(),c=ot-t*n.speedup,d(c),u){if(f=nt(),e=tt(),!f&&!e)return;f?e||(r=o(st),ft(r)):(r=o(v),ft(-r))}}b=!1}function ft(i,r){for(var u,f,o=y()+i,e=0;e<s.length;e++)u=s[e],u.startX=u.startX+i/n.speedup,u.startY=u.startY+i/n.speedup;f=gt(0);i<0?(ii(-f),r&&(t-=f)):(ii(f),r&&(t+=f));d(o)}var u,w,l,a,s,b,k,ot,i,r,dt,at,pt,wt;if(!n||!n.containerEl||!n.itemEls||(!n.increment||n.increment==0)&&!n.nativeScroll)return null;n.speedup==undefined&&(n.speedup=1.8);u=n.rotate==undefined?!0:n.rotate;n.fps==undefined&&(n.fps=60);n.alignToItem==undefined&&(n.alignToItem=!0);var f=n.containerEl,et=n.itemEls,h=n.nextEl,c=n.previousEl,bt=n.vertical;if(n.responsive==undefined&&(n.responsive=!1),w=(n.speedup<0||n.speedup>0)&&n.fps>0,n.nativeScroll==undefined&&(n.nativeScroll=!1),n.nativeScroll&&(w=!1,u=!1),l=!1,w&&(a={},s=[],b=!1,k=!1,ot=0),i=[],et.each(function(){var t=$(this),e,r;i[i.length]=t;u&&(n.responsive||t.css("flex-shrink","0"),t.css("order",i.length*10),e=$(".separator",f),r=1,e.each(function(){var i=$(this);i.css("order",r*10+5);i.css("pointer-events","none");i.css("flex-shrink","0");n.responsive||t.css("flex-shrink","0");r++}));w&&(t.css("-webkit-touch-callout","none"),t.css("-webkit-user-select","none"),t.css("-khtml-user-select","none"),t.css("-moz-user-select","none"),t.css("-ms-user-select","none"),t.css("user-select","none"))}),r=i.length,r<=0)return null;var t=0,st=i[0],v=i[r-1],ht=0,e,o,y,p,ct,lt,d;if(bt?(e=function(n){return n.position().top},o=function(n){return n.outerHeight()},y=function(){return f.scrollTop()},p=function(){return f.height()},kt=function(){return e(v)+o(v)},ct=function(n){return{scrollTop:n}},lt=function(n){return n.nowY-n.startY},d=function(n){f.scrollTop(n)}):(e=function(n){return n.position().left},o=function(n){return n.outerWidth()},y=function(){return f.scrollLeft()},p=function(){return f.outerWidth()},ct=function(n){return{scrollLeft:n}},lt=function(n){return n.nowX-n.startX},d=function(n){f.scrollLeft(n)}),dt=n.changeHandler?function(){var i=(t-ht)%r;i=i<0?i+r:i;n.changeHandler(i)}:function(){return},n.nativeScroll)f.on("scroll",function(){g()});return at=!u||n.responsive,pt=0,c&&c.click(it),h&&h.click(ut),n.autoScrollInterval!==null&&n.autoScrollInterval>0&&setInterval(ut,n.autoScrollInterval),mvcUi.invokeAfterLoad(function(){var s,l,a,y,t;if(d(0),g(),w)if(s=e(v)+o(v),s<p())c&&c.addClass("disabled"),h&&h.addClass("disabled");else{l=$(document);et.on("dragstart",function(n){n.preventDefault()});et.on("dropend",function(n){n.preventDefault()});f.mousedown(ki);f.touchstartpassive(bi);l.mousemove(nr);l.touchmove(gi);l.mouseup(ei);l.mouseleave(ei);l.touchend(oi);l.touchcancel(oi)}if(u){for(s=e(v)+o(v),a=0,t=0;t<r;t++)a+=o(i[t]);for(s=s>a?s:a,y=0,t=0;t<r;t++)o(i[t])>y&&(y=o(i[t]));Math.round(s)-Math.round(y)<p()&&(u=!1,g())}u&&(n.responsive||(f.css("flex-wrap","nowrap"),bt?f.css("flex-direction","column"):f.css("flex-direction","row")));$(window).resize(rt)}),{moveNext:ut,movePrevious:it,moveTo:ai,moveToVisible:vi}};this.scroll=function(t,i){function r(){var f=$(i.anchorSelector),e=n.openTab(f),t=f.offset(),r,u,o;(e!=null&&(r=e.offset(),r.top<t.top&&(t=r)),u=t.top-$(window).scrollTop(),u>=0&&!i.scrollDown)||u<=0&&!i.scrollUp||(o=!i.targetSelector,o?$("html, body").scrollTop(t.top):$("html, body").animate({scrollTop:t.top}))}i||(i={targetSelector:null,anchorSelector:null,scrollUp:!0,scrollDown:!0});var u=this.getView(t);i.targetSelector?u.$(i.targetSelector).click(r):$(window).ready(r)};this.scrollToElement=function(n){function t(){var t=$(n),i=t.offset();$("html, body").scrollTop(i.top)}$(window).ready(t)};this.reloadButton=function(n,t,i,r){var u=this.getView(n),f=u.$(t);f.click(function(){mvcCore.invokeAction(r,t,n);setTimeout(function(){location.reload(!0)},i)})};this.confirmButton=function(n,t,i,r){var u=this.getView(n),f=u.$(t);f.click(function(){confirm(i)&&mvcCore.invokeAction(r,t,n)})};this.promptButton=function(n,t,i,r,u){var e=this.getView(n),f=e.$(t);f.click(function(){var e=prompt(i,r);
3936e!=null&&(f.attr("data-value",e),mvcCore.invokeAction(u,t,n))})};this.toggleButton=function(n,t,i,r,u){function h(){f.is(":visible")?(e.removeClass("collapsed"),e.addClass("expanded")):(e.removeClass("expanded"),e.addClass("collapsed"))}var o=this.getView(n),e=o.$(t),f=$(i),s;e.click(function(){f.toggle();h();o.setValue("expanded",f.is(":visible"))});r!=null&&(s=u?o.getValue("expanded",r):!1,s&&!f.is(":visible")?f.show():!s&&f.is(":visible")&&f.hide());h()};this.invokeAfterImagesLoaded=function(n,t,i){var o=$(n),r=$("img",o);r.length==0&&t();var u=50,f=0,e=!1,s=setInterval(function(){if(f++,!e&&f*u>i){e=!0;t();return}var n=0;r.each(function(){this.complete&&n++;n==r.length&&(clearInterval(s),t())})},u)};this.sameHeight=function(n,t){function u(){function e(){var o,h,u,c;n.length>10&&i.hide();for(o in n){var s=n[o],t=0,e=null;for(h in s)f[t]!=r[t]&&(u=s[h],c=u.height(),c!=r[t]&&(u.css("height",r[t]+"px"),e?e.add(u):e=u)),t++}n.length>10&&i.show()}var u=0,r=[],f=[],n=[];i.each(function(){var s=t.columns&&u%t.columns==0,i,o;s&&(e(),u=0,n=[],r=[],f=[]);i=$(this);n[u]=[];o=t.itemSelector!=t.containerSelector?$(t.itemSelector,i):i;o.each(function(){var t=n[u].length,e=$(this),i=e.outerHeight(!1);(r[t]==null||r[t]<i)&&(r[t]=i);(f[t]==null||f[t]>i)&&(f[t]=i);n[u][t]=e});u++});e();t.onHeightSet&&t.onHeightSet()}var r=mvcUi.getView(n),i;(t||(t={itemSelector:null,containerSelector:null,columns:null,onHeightSet:null}),t.itemSelector)&&t.columns!=1&&(t.containerSelector||(t.containerSelector=t.itemSelector),i=r.$(t.containerSelector),this.invokeAfterImagesLoaded(t.itemSelector,u,3e3))};this.getMaxZ=function(n){var t=0;return n&&(t=n),$("div, ul, dc-con").each(function(){var i,n;$(this).attr("id")!="DebugPanels"&&this.checkVisibility()&&$(this).is(":visible")&&(i=$(this).css("z-index"),i)&&((n=parseInt(i,10),n<0||n>=2147483647)||n>t&&(t=n))}),t};this.dynamicPosition=function(t,i){function f(){var e=$(window).scrollTop()+window.innerHeight,o=u.offset().top+s>e,t,f;o?r.hasClass("offScreen")||(t=r.innerWidth(),f=r.css("width"),r.css("z-index",n.getMaxZ()+1),r.addClass("offScreen"),i.preserveWidth&&(r.data("originalWidth",f),r.innerWidth(t))):(r.removeClass("offScreen"),i.preserveWidth&&r.css("width",r.data("originalWidth")))}i||(i={targetSelector:null,clickSelector:null,preserveWidth:!1});var e=this.getView(t),r=e.$(i.targetSelector),o=t+"_dynamicPositionDummy",u=$("<div id="+o+"><\/div>"),s=r.outerHeight(!0);e.$().before(u);f(u.offset().top);$(window).scroll(function(){f()});$(window).resize(function(){f()});i.clickSelector&&e.$(i.clickSelector).click(function(){$("html, body").animate({scrollTop:u.offset().top});f(u.offset().top)})};this.hideElement=function(n,t){var i=$(n),r=$(t);i.click(function(){r.hide()})};this.showElement=function(n,t){var i=$(n),r=$(t);i.click(function(){r.show()})};this.invokeAfterLoad=function(n,t){if(this.documentIsLoaded)n();else $(window).on("load",n);t&&mvcCore.addAjaxEnd(n)};this.smartHover=function(n,t){function i(n){var r=$(n),i=r.find(t.elementSelector);t.closeDelay==0&&i.hide();i.data("isClosing",!1);setTimeout(function(){i.data("isClosing")||(i.fadeIn(t.openDuration,function(){i.data("isClosing")&&i.hide()}),i.addClass("open"))},t.openDelay)}function r(n){var r=$(n),i=r.find(t.elementSelector);i.data("isClosing",!0);setTimeout(function(){i.data("isClosing")&&(i.fadeOut(t.closeDuration),i.removeClass("open"))},t.closeDelay)}if(t||(t={targetSelector:null,elementSelector:null,openDelay:250,closeDelay:0,openDuration:250,closeDuration:125}),!jQuery().menuAim){console.error("Nepodařilo se aktivovat smartHover, protože potřebná závislost menuAim není v jquery zaregistrována. Zkontrolujte, zda se načítá skript jquery.menu-aim.js");$("#"+n).removeClass("SmartHover");return}$("#"+n).menuAim({activate:i,deactivate:r,rowSelector:t.targetSelector,submenuDirection:"below",exitMenu:function(){return!0}})};this.notifyDecorated=function(){for(var n in t)t[n]()};this.addDecorationEnd=function(n,i){i||(i=t.length);t[i]=n};this.toggleClass=function(n,t){function s(n,f){var e=mvcCore.selectElementsEx(t.targetSelector,i.$(),f),o;return u?r.is(":checked")?e.addClass(t.cssClass):e.removeClass(t.cssClass):e.toggleClass(t.cssClass),t.persist&&i.setValue("toggleClass_"+t.cssClass,e.hasClass(t.cssClass)),t.resetSelector&&(o=mvcCore.selectElementsEx(t.resetSelector,i.$(),f).not(e),o.removeClass(t.cssClass)),t.stopPropagation?(n.preventDefault(),n.stopPropagation(),!1):void 0}var e,u,f,h;t||(t={targetSelector:null,sourceSelector:null,resetSelector:null,stopPropagation:!1,cssClass:"",persist:!1,defaultToggled:!1});var i=this.getView(n),r=i.$(t.sourceSelector),o="{"+t.targetSelector+":"+t.cssClass+"}";if(r=r.filter(function(){var n=this;return n[o]?!1:(n[o]=!0,!0)}),r.length!==0){e="click";u=r.attr("type")=="checkbox";u&&(e="change");r.on(e,function(n){s(n,this)});f=mvcCore.selectElementsEx(t.targetSelector,i.$(),this);t.persist&&(h=i.getValue("toggleClass_"+t.cssClass),h?f.addClass(t.cssClass):f.removeClass(t.cssClass));t.defaultToggled&&i.getValue("toggleClass_"+t.cssClass,null)===null&&f.addClass(t.cssClass);u&&s()}};this.lazyImageLoad=function(n){function r(n){n.nodeName==="VIDEO"?f(n):n.nodeName==="IMG"&&u(n)}function u(n){var i=n.getAttribute("data-src"),t;i&&(n.src&&n.src===i||n["bs-lazy-image-loader"]||(t=new Image,t.src=n.getAttribute("data-src"),t.onload=function(){n.src=t.src;n["bs-lazy-image-loader"]=null},n["bs-lazy-image-loader"]=t))}function f(n){var r=n.getAttribute("data-src"),i,t;r&&(i=n.getAttribute("data-type"),i)&&(n["bs-lazy-video-loaded"]||(t=document.createElement("source"),t.setAttribute("src",r),t.setAttribute("type",i),n.appendChild(t),n["bs-lazy-video-loaded"]=!0))}function i(){var u,i,f;
3936for(t=new IntersectionObserver(function(n){n.forEach(function(n){n.isIntersecting&&n.intersectionRatio!==0&&(r(n.target),t.unobserve&&t.unobserve(n.target))})},{threshold:[0,.001]}),u=document.querySelectorAll(n.imageSelector),i=0;i<u.length;i++)f=u[i],t.observe(f)}n||(n={imageSelector:null});var t;mvcCore.addAjaxEnd(function(){t.disconnect();i()},"lazyImageLoad");i()};this.copyToClipboard=function(n){function u(t,i,r){var e=document.body.getBoundingClientRect(),f=r.getBoundingClientRect(),o=f.left-e.left+f.width/2,s=f.bottom-e.top,u=document.createElement("div");u.style.cssText="position: absolute; left: "+o+"px; top: "+s+"px; animation: delayedDecay "+n.timeout+"s; transform: translate(-50%, 0);";u.setAttribute("class","bs-tooltipPopup "+t);u.innerHTML="<span>"+i+"<\/span>";document.body.appendChild(u);setTimeout(function(){document.body.removeChild(u)},1e3*n.timeout)}var i,r,t,f;for(n||(n={targetSelector:null}),i=document.querySelectorAll(n.targetSelector),r=/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!window.MSStream,t=0;t<i.length;t++)f=i[t],f.addEventListener("click",function(t){var f=t.currentTarget,i,e,o,s;try{if(e=f.getAttribute("data-clipboard"),!e)return;if(i=document.createElement("input"),i.style.cssText="position: fixed; right: 100vw; bottom: 100vh;",i.value=e,i.readOnly=!0,document.body.appendChild(i),r?(o=document.createRange(),s=window.getSelection(),o.selectNodeContents(i),s.removeAllRanges(),s.addRange(o),i.setSelectionRange(0,999999)):i.select(),!document.execCommand("copy"))throw new Error;u("success",n.tooltip,f)}catch(h){console.error("copyToClipboard",h);u("error",n.errorTooltip,f)}finally{if(i)try{document.body.removeChild(i)}catch(h){}}})};this.setEnsureVisibleFunction=function(n,t){var i=$(n);i.each(function(){var n=$(this).get(0);n.ensureVisible=function(){t(n)}})};this.placeholderSuggestions=function(n){function f(){if(o(u)){var r=i[t.suggestionIndex];t.append?(++t.showLength,u.setAttribute("placeholder",r.slice(0,t.showLength))):(--t.showLength,u.setAttribute("placeholder",r.slice(0,t.showLength)));t.showLength>=r.length&&t.append?(t.showLength=r.length,t.append=!1,setTimeout(f,n.suggestionDuration)):t.showLength<=0?(t.showLength=0,t.suggestionIndex=(t.suggestionIndex+1)%t.suggestions.length,t.append=!0,setTimeout(f,n.emptyDelay)):setTimeout(f,t.append?n.appendDelay:n.removeDelay)}}function s(n){var t=document.querySelectorAll(n),i,r,u;if(!t||t.length===0)return null;for(i=[],r=0;r<t.length;r++)u=t[r],e(u,i);return i.length===0?null:i}function e(n,t){var i,r,u;if(n.nodeName==="#text"){if(i=n.data.trim(),!i)return;t.push(i);return}r=n.childNodes;for(let n=0;n<r.length;n++)u=r[n],e(u,t)}function o(n){var t=n.parentNode;return t==null?!1:t===document?!0:o(t)}var r,u,i,t;(n||(n={inputSelector:null,suggestionsSelector:null,suggestions:null,suggestionDuration:2e3,appendDelay:200,removeDelay:50,emptyDelay:500}),r=document.querySelectorAll(n.inputSelector),r&&r.length!==0)&&(u=r[0],i=n.suggestions,i&&i.length!==0||(i=s(n.suggestionsSelector)),i&&i.length!==0)&&(t={suggestions:i,suggestionIndex:0,showLength:0,append:!0},f())};this.dateTimePicker=function(n,t){function k(){var n,r,f;if(i={currentMonth:o.getMonth(),currentYear:o.getFullYear(),minDate:t.minDate&&v(new Date(t.minDate)),maxDate:t.maxDate&&v(new Date(t.maxDate)),prevButton:e(t.previousButtonSelector),nextButton:e(t.nextButtonSelector),monthLabel:e(t.monthLabelSelector),yearLabel:e(t.yearLabelSelector),daysContainer:e(t.daysContainerSelector),selectedDate:u.value,availableDaysOfWeek:t.availableDaysOfWeek},l(i,t.language)||l(i,navigator&&navigator.language)||(i.locale=undefined),t.invalidDates)for(i.invalidDates=[],n=0;n<t.invalidDates.length;n++)r=new Date(t.invalidDates[n]),f=h(r),i.invalidDates.push(f);return i.prevButton?i.nextButton?i.monthLabel?i.yearLabel?i.daysContainer?!0:!1:!1:!1:!1:!1}function l(n,t){if(!t)return!1;try{return(new Date).toLocaleDateString(t),n.locale=t,!0}catch(i){return!1}}function d(){for(var e,s,o,u=[],t=r(2020,1,1),n=0;n<=7;n++)e=a(t,!0),e.classList.add("header"),s=f(t),u[s]=e,t=y(t);for(o=document.createElement("div"),n=0;n<u.length;n++)o.appendChild(u[n]);i.daysHeader=o.innerHTML}function s(){i.firstDayOfMonth=r(i.currentYear,i.currentMonth,1);i.currentMonth=i.firstDayOfMonth.getMonth();i.currentYear=i.firstDayOfMonth.getFullYear();i.selectedDate=u.value;it();rt();ut()}function a(n,t){var r=document.createElement(t?"span":"a"),u;return r.classList.add("day"),u=f(n),r.classList.add("dow"+u),r.innerHTML=t?n.toLocaleDateString(i.locale,{weekday:"short"}):n.getDate(),r}function h(n){var t=n.getFullYear(),i=n.getMonth()+1,r=n.getDate(),u=("0"+i).slice(-2),f=("0"+r).slice(-2);return t+"-"+u+"-"+f}
3936function r(n,t,i){return new Date(Date.UTC(n,t,i))}function v(n){var t=n.getFullYear(),i=n.getMonth(),u=n.getDate();return r(t,i,u)}function f(n){var t=n.getDay();return(t+6)%7}function g(n,t){var r=n.getDay();return i.availableDaysOfWeek[r]?i.minDate&&n<i.minDate?!1:i.maxDate&&n>i.maxDate?!1:i.invalidDates&&i.invalidDates.indexOf(t)>=0?!1:!0:!1}function y(n){var t=n.getFullYear(),i=n.getMonth(),u=n.getDate();return r(t,i,u+1)}function e(n){var t=document.querySelectorAll(n);return!t||t.length===0?null:t[0]}function nt(){p()&&(i.currentMonth-=1,s())}function tt(){w()&&(i.currentMonth+=1,s())}function p(){if(i.minDate){var n=r(i.currentYear,i.currentMonth,0);if(n<i.minDate)return!1}return!0}function w(){if(i.maxDate){var n=r(i.currentYear,i.currentMonth+1,1);if(n>i.maxDate)return!1}return!0}function it(){i.monthLabel.innerHTML=i.firstDayOfMonth.toLocaleDateString(i.locale,{month:"long"});i.yearLabel.innerHTML=i.firstDayOfMonth.toLocaleDateString(i.locale,{year:"numeric"})}function rt(){var o=i.firstDayOfMonth,l=r(i.currentYear,i.currentMonth+1,0),s=l,v,p,c,u,e,n;for(t.showOffMonthDays&&(v=f(o),o=r(i.currentYear,i.currentMonth,1-v),p=6-f(s),s=r(i.currentYear,i.currentMonth+1,p)),i.daysContainer.innerHTML=i.daysHeader,c=1,u=o;u<=s;)e=h(u),n=a(u),n.classList.add("wim"+c),n.setAttribute("data-date",e),n["bs-date"]=e,u<i.firstDayOfMonth?n.classList.add("prevMonth"):u>l?n.classList.add("nextMonth"):n.classList.add("currentMonth"),e===b&&n.classList.add("today"),e===i.selectedDate&&n.classList.add("selected"),g(u,e)||n.classList.add("invalid"),i.daysContainer.appendChild(n),u=y(u),f(u)===0&&c++}function ut(){p()?i.prevButton.classList.remove("disabled"):i.prevButton.classList.add("disabled");w()?i.nextButton.classList.remove("disabled"):i.nextButton.classList.add("disabled")}function ft(i){i&&i["bs-date"]&&(u.value=i["bs-date"],s(),et(),t.showInDialog&&mvcUi.dialog(n,{closeDialog:!0}))}function et(){if("createEvent"in document){var n=document.createEvent("HTMLEvents");n.initEvent("change",!1,!0);u.dispatchEvent(n)}else u.fireEvent("onchange")}var u,i;if(t||(t={inputId:null,previousButtonSelector:null,nextButtonSelector:null,monthLabelSelector:null,yearLabelSelector:null,daysContainerSelector:null,showOffMonthDays:!0,availableDaysOfWeek:[!1,!0,!0,!0,!0,!0,!1],invalidDates:[],minDate:null,maxDate:null,showInDialog:!1,language:null}),u=document.getElementById(t.inputId),u){var c=new Date,b=h(c),o=new Date(Date.parse(u.value));(isNaN(o)&&(o=c),k())&&(t.showInDialog&&this.dialog(n,{dialogType:"information",showCloseButton:!0,closeOnOffClick:!0}),d(),s(),i.daysContainer.addEventListener("click",function(n){ft(n.target)}),i.prevButton.addEventListener("click",function(){nt()}),i.nextButton.addEventListener("click",function(){tt()}))}};this.dateTimePickerPopup=function(n){if(n||(n={inputId:null,targetSelector:null,actionData:null}),n.inputId&&n.actionData){var i=document.getElementById(n.inputId),t=document.querySelectorAll(n.targetSelector),r=t.length>0?t[0]:i,u=JSON.parse(n.actionData);r.addEventListener("click",function(){mvcCore.invokeAction(u)})}};this.highlightItems=function(n){function s(n){for(var r,i=document.querySelectorAll("["+o+"='"+n+"']"),t=0;t<i.length;t++)r=i[t],h(r)}function h(t){t.classList.add(u);var i=t[f];i&&clearTimeout(i);i=setTimeout(function(){t.classList.remove(u)},n.delay);t[f]=i}var t,e;n||(n={items:[],effectName:null,delay:1e3});var r=n.items,i=n.effectName,u="bs-highlight-"+i,f="bs-highlight-timeout-"+i,o="data-bs-highlight-"+i;for(t=0;t<r.length;t++)e=r[t],s(e)};this.lazyRender=function(n,t){function s(){f()&&mvcCore.invokeAction(t);h()}function f(){return!i["bs-lazy-loaded"]}function h(){i["bs-lazy-render-observer"]&&(i["bs-lazy-render-observer"].disconnect(),i["bs-lazy-render-observer"]=null);i["bs-lazy-loaded"]=!0}function c(n){var t,i;if(f())for(t=0;t<n.length;t++)if(i=n[t],i.isIntersecting&&i.intersectionRatio!==0){s();break}}var i=document.getElementById(n),e=new IntersectionObserver(c,{threshold:[0,.001]}),u,r,o;for(i["bs-lazy-render-observer"]=e,u=i.querySelectorAll("bs-lazy-render"),r=0;r<u.length;r++)o=u[r],e.observe(o)};this.countdown=function(n,t){function b(){var n={};return n.entries={},n.counter=0,n.interval=setInterval(function(){k(n)},145),window["bs-countdown-watcher"]=n,n}function k(n){for(var i,r=Date.now(),t=0;t<n.counter;t++)i=n.entries[t],c(n,i,r)}
3936function d(n,t,i,r){var u={el:t,index:n.counter++,start:r,end:i};return n.entries[u.index]=u,u}function g(n,t){for(var i,u=t.index,r=u+1;r<n.counter;r++)i=n.entries[r],i.index--,n.entries[i.index]=i;n.entries[n.counter-1]=null;n.counter--;n.counter===0&&(clearInterval(n.interval),window["bs-countdown-watcher"]=null)}function c(n,t,i){var h=t.el,c=t.end,a=t.start,o=c-i,e,r,v,u;if(o<0){h.classList.add("expired");g(n,t);return}if(e=Math.floor(o/1e3),t.remainingSeconds!==e){r=h.style;a&&(v=c-a,u=1-o/v,u>1&&(u=1),u<0&&(u=0),r.setProperty("--progress",u),r.setProperty("--progress-percent",u*100+"%"));var y=Math.floor(e/60),s=Math.floor(y/60),p=Math.floor(s/24);r.setProperty("--seconds",f(e,60));r.setProperty("--minutes",f(y,60));r.setProperty("--hours",f(s,24));r.setProperty("--total-hours",l(s));r.setProperty("--total-days",l(p));t.remainingSeconds=e}}function f(n,t){return t&&(n%=t),"'"+("00"+n).slice(-2)+"'"}function l(n,t){return t&&(n%=t),"'"+n+"'"}function a(n){return n-n%1e3}function r(n,t){for(var n,r=n.querySelectorAll(t),i=0;i<r.length;i++)n=r[i],n.innerHTML=""}var v=document.getElementById(n),i=v.querySelector(t.target),e=t.serverNow,y=t.end,o=t.start,s=Date.now(),p=a(y-e+s),w=o?a(o-e+s):null,u=window["bs-countdown-watcher"],h;u||(u=b());h=d(u,i,p,w);i.classList.add("bs-countdown");r(i,".seconds");r(i,".minutes");r(i,".hours");r(i,".total-hours");r(i,".total-days");c(u,h,Date.now())};this.createDynamicFixPanel=function(n){function ot(){return wt?!1:!0}function f(n,t){u||n.push(t)}function e(n,t){for(var r,i=0;i<n.length;i++)if(r=n[i],r)try{r.apply(null,t)}catch(u){console.error(u)}}function ii(n){if(!ot()){var t=n[0];t.time!==pt&&(t.intersectionRatio!==0&&t.isIntersecting||w())}}function ri(n){if(!ot()){var t=n[0];(t.intersectionRatio>0||t.isIntersecting)&&(b(),pt=t.time)}}function w(){u||(t.classList.add(v),a=!0,st(),e(d))}function b(){u||(t.classList.remove(v),a=!1,st(),e(nt))}function ui(n){n.classList.add(v);e(g,[n])}function fi(n){n.classList.remove(v);e(tt,[n])}function st(){for(var t,r=i.querySelectorAll("."+kt),n=0;n<r.length;n++)t=r[n],a?ui(t):fi(t);e(it)}function ht(){h&&(h.disconnect(),h=null);c&&(c.disconnect(),c=null)}function k(){if(!u&&!et){var n={rootMargin:"0px 0px 0px 0px",threshold:[0]},t={rootMargin:"0px 0px 0px 0px",threshold:[1]};ht();try{if(et=!0,e(rt),a?(r=i.offsetHeight,b(),o=i.offsetHeight,w()):(o=i.offsetHeight,w(),r=i.offsetHeight,b()),ot())return;n.rootMargin="-"+r+"px 0px 0px 0px";t.rootMargin=o-r+1+"px 0px 0px 0px";h=new IntersectionObserver(function(n){ii(n)},n);h.observe(y);c=new IntersectionObserver(function(n){ri(n)},t);c.observe(p)}finally{try{e(ut)}finally{et=!1}}ei()}}function ei(){t.style.setProperty(dt,r);t.style.setProperty(gt,r+"px");t.style.setProperty(ni,o);t.style.setProperty(ti,o+"px")}function oi(){var n=new CustomEvent(yt);setTimeout(function(){document.dispatchEvent(n)},1)}function si(){function n(){window.dynamicContainer.addAfterResized(ct)}typeof dynamicContainer=="undefined"?document.addEventListener("dynamicContainerInitialized",n,!1):n();l=new MutationObserver(function(){st()});l.observe(t,{subtree:!0,childList:!0})}function hi(n){u||(wt=!n,n?ht():setTimeout(function(){k()},1))}function ci(){u||(u=!0,d.length=0,g.length=0,nt.length=0,tt.length=0,it.length=0,rt.length=0,ut.length=0,ht(),l&&(l.disconnect(),l=null),window.dynamicContainer.removeAfterResize(ct))}var s,ct,bt;if(!n)return null;var d=[],g=[],nt=[],tt=[],it=[],rt=[],ut=[],ft=n.masterSelector||"body",lt=n.containerSelector,at=n.pivotFixSelector,vt=n.pivotUnfixSelector,v=n.class,kt=n.awareClass||"canbe_"+n.class,dt="--bs-fix-height-"+n.class,gt="--bs-fix-height-"+n.class+"-px",ni="--bs-unfix-height-"+n.class,ti="--bs-unfix-height-"+n.class+"-px",yt=n.eventName||"DynamicFix_"+n.class+"_Initialized",r=0,o=0,pt=0,h,c,l,a=!1,wt=!0,et=!1,u=!1,t=document.querySelector(ft);if(!t)throw Error("Master '"+ft+"' nebyl nalezen");var i=t.querySelector(lt),y=t.querySelector(at),p=t.querySelector(vt);if(!i||!y||!p){s="Některé prvky nebyli v '"+ft+"' nalezeny (";i||(s+="panel '"+lt+"', ");y||(s+="pivot pro zafixování '"+at+"', ");p||(s+="pivot pro odfixování '"+vt+"', ");s+=")";throw Error(s);}return ct=function(){k()},bt={registerFix:function(n){f(d,n)},registerFixAwareEl:function(n){f(g,n)},registerUnfix:function(n){f(nt,n)}
3936,registerUnfixAwareEl:function(n){f(tt,n)},registerUpdate:function(n){f(it,n)},registerEnterCheck:function(n){f(rt,n)},registerExitCheck:function(n){f(ut,n)},isFixed:function(){return a},checkHeights:function(){k()},fixedHeight:function(){return r},unfixedHeight:function(){return o},getMaster:function(){return t},getContainer:function(){return i},getFixPivot:function(){return y},getUnfixPivot:function(){return p},getEventName:function(){return yt},setFixed:function(n){n?w():b()},disableDynamicFix:function(n){hi(n)},dispose:function(){ci()}},k(),si(),oi(),bt};this.resizeObserver=function(n,t){const i="BS RESIZE-OBSERVER";if(typeof ResizeObserver!="undefined"&&t){const u=document.getElementById(n);if(u){const f=u.querySelectorAll(t.target);let r=null;if(t.collector){if(f.length>1)throw Error(`Byl specifikovaný selektor '${t.collector}' pro kolektor, ale cílových prvků '${t.target}' bylo nalezeno více, takový scénář není podporovaný.`);if(r=document.querySelector(t.collector),!r)throw Error(`Byl specifikovaný selektor '${t.collector}' pro kolektor, ale takový nebyl na stránce nalezen.`);}const e=n=>{for(let t of n)if(t.borderBoxSize){const n=t.borderBoxSize[0];if(n){const r=t.target[i];if(r)for(let t of r){const i=t.prefix?`--bs-el-${t.prefix}`:"--bs-el",r=t.collector;r.style.setProperty(`${i}-width`,`${n.inlineSize}px`);r.style.setProperty(`${i}-height`,`${n.blockSize}px`)}}}},o=()=>(window[i]||(window[i]=new ResizeObserver(e)),window[i]);for(let n of f){const u=n[i]?n[i]:n[i]=[];r||(r=n);u.push({collector:r,prefix:t.prefix});u.length===1&&o().observe(n,{box:"border-box"})}}}};this.watchDom=function(n,t,i,r){function o(n){const i=e(),t=[];for(let n=0;n<i.length;n++)t.push({action:i[n],entries:[]});for(let i of n)f(i.removedNodes,t,!1),f(i.addedNodes,t,!0);for(let n of t)try{for(let t of n.entries){if(t.isAdded&&n.action.onAdd)n.action.onAdd(t.target);if(!t.isAdded&&n.action.onRemove)n.action.onRemove(t.target)}}catch(i){console.error("chyba při zpracovávání MvcUi.watchDom.onDomChange",n.entries,i)}}function f(n,t,i){if(n)for(let r=0;r<n.length;r++){const u=n[r];if(f(u.childNodes,t,i),u.nodeType===u.ELEMENT_NODE)for(let n of t)try{if(n.action.predicate(u)){let t=!1;for(let r=0;r<n.entries.length;r++){const f=n.entries[r];if(f.target===u){i&&!f.isAdded&&n.entries.splice(r,1);t=!0;break}}t||n.entries.push({target:u,isAdded:i})}}catch(r){console.error("chyba při zpracovávání MvcUi.watchDom.onDomChange.parseNodeList",u,r)}}}function e(){return s(),window[u].actions}function s(){if(!window[u]){const n=new MutationObserver(o);window[u]={observer:n,actions:[]};n.observe(document.body,{childList:!0,subtree:!0})}}const u="BS MUTATION-OBSERVER";if(!n)throw Error("predicate je povinný parametr");if(!t&&!i)throw Error("alespoň jeden z parametrů 'onAdd' nebo 'onRemove' musí být nastaven");if(e().push({predicate:n,onAdd:t,onRemove:i}),r&&t){const i=document.querySelectorAll("*");for(let r of i)n(r)&&t(r)}}},MvcView=function(n){var i=mvcCore.getViewJqueryElement(n),t=i.data("name");t||(t=n);this.$=function(t){return t=="#"+n?i:t?$(t,i):i};this.getName=function(){return t};this.__hasUrlPathDurability=function(){return!this.__hasDomainDurability()&&!this.__hasCategoryDurability()};this.__hasDomainDurability=function(){return this.$().hasClass("bsddr2")};this.__hasCategoryDurability=function(){return this.$().hasClass("bsddr3")};this.getValue=function(n,t){var i=this.__getDataValidityKey();return this.__getPageValue(n,t,i)};this.setValue=function(n,t){var i=this.__getDataValidityKey();this.__setPageValue(n,t,i)};this.__getPageValue=function(n,i,r){var f,u;return r!=null&&(f=localStorage.getItem(t+"_"+n+"_validity"),f!==r)?i:(u=localStorage.getItem(t+"_"+n),!u)?i:JSON.parse(u)};this.__setPageValue=function(n,i,r){localStorage.setItem(t+"_"+n,JSON.stringify(i));r!=null&&localStorage.setItem(t+"_"+n+"_validity",r)};this.__getDataValidityKey=function(){var n=null;return this.__hasCategoryDurability()?n="cat_"+$("body").attr("data-cat-id"):this.__hasUrlPathDurability()&&(n=location.pathname.replace(/\/$/,"")),n};this.formatPrice=function(n,i){var r=mvcUi.getPriceFormatter(t);return r.formatPrice(n,i)};this.ensureVisible=function(){for(var n=i.parent(),t;n.length>0;)t=n.get(0),t.ensureVisible&&t.ensureVisible(),n=n.parent()}},MvcPriceFormatter=function(n){this.round=function(n){return this.roundToDecimals(n,this.getDecimals(n))};this.roundToDecimals=function(n,t){return+(Math.round(n+"e+"+t)+"e-"+t)}
3936;this.formatPrice=function(t,i){var u=this.round(t),r=this.getDecimals(t);return u.toLocaleString(document.documentElement.lang,{minimumFractionDigits:r,maximumFractionDigits:r})+" "+mvcUi.getCurrencyName(i,n)};this.getDecimals=function(t){var i=mvcUi.currencyCode,u=n.treshold3,r;return(n.treshold3ByCurrency&&n.treshold3ByCurrency[i]&&(u=n.treshold3ByCurrency[i]),r=n.treshold2,n.treshold2ByCurrency&&n.treshold2ByCurrency[i]&&(r=n.treshold2ByCurrency[i]),t>u)?n.decimals3:t>r?n.decimals2:n.decimals}},mvcUi=new MvcUi;setTimeout(function(){if(typeof mvcUiLoadedListeners!="undefined")for(var n in mvcUiLoadedListeners)mvcUiLoadedListeners.hasOwnProperty(n)&&mvcUiLoadedListeners[n]();mvcUi.fullyLoaded=!0},1);$(function(){if(!($("#loadingPanel").length<=0)&&!($("#miniLoading").length<=0)){var n=!1,t=null,i=null;mvcCore.addAjaxBegin(function(r,u){var f,e;n=!0;u&&(f=$("#miniLoading").attr("data-timeout"),f||(f=100),t&&clearTimeout(t),t=setTimeout(function(){var t,i;n&&(t=$(u),t.addClass("bs-ajax-progress"),t.is(":visible")&&(i=$("#miniLoading"),i.show(),i.offset(t.offset()),i.width(t.outerWidth()),i.height(t.outerHeight()),i.css("z-index",parseInt(t.css("z-index"))+1)))},f));e=$("#loadingPanel").attr("data-timeout");e||(e=2e3);i&&clearTimeout(i);i=setTimeout(function(){if(n){var t=$("#loadingPanel");t.css("z-index",mvcUi.getMaxZ()+1);t.show()}},e)});mvcCore.addAjaxEnd(function(t,i){n=!1;var r=1;mvcCore.isRedirecting()&&(r=3e3);setTimeout(function(){$("#loadingPanel").hide();$("#miniLoading").hide()},r);i&&$(i).removeClass("bs-ajax-progress")});window.addEventListener("keydown",function(n){function r(n){const i=$(n),t=i[0].getBoundingClientRect(),r={x:t.left+t.width/2,y:t.top+t.height/2};return{rect:t,center:r,element:i}}function i(n,i){if(n.ctrlKey&&!t.is("html, body")){const s=mvcUi.findFocusableElements(document);let u=s.map((n,t)=>r(t)).get();const f=r(t[0]);console.log(i,n,f,u);let e=null;if(i==="down"?e=n=>n.center.y>f.rect.bottom:i==="up"?e=n=>n.center.y<f.rect.top:i==="left"?e=n=>n.center.x<f.rect.left:i==="right"&&(e=n=>n.center.x>f.rect.right),u=u.filter(e),u.length!==0){const h=2,o=i==="down"||i==="up";for(u.forEach(n=>{const t=n.center.x-f.center.x,i=n.center.y-f.center.y,r=o?i:t,u=o?t:i;n.distance=Math.sqrt(Math.pow(r,2)+Math.pow(u*h,2))});u.length>0;){let t=0,i=u[0].distance;for(let n=1;n<u.length;n++)u[n].distance<i&&(i=u[n].distance,t=n);const r=u[t];if(r.element.focus(),r.element.is(":focus")){n.preventDefault();n.stopPropagation();break}u.splice(t,1)}}}}const t=$(n.target);if(n.key==="Tab"){const e=n.shiftKey,u=t.closest(".bs-tab-boundary"),o=u.length>0?u:$(document),r=mvcUi.findFocusableElements(o);let i=r.index(t),f=0;while(i!==-1&&r.length){if(i=e?i-1:i+1,f++,f>r.length)return;i>=r.length&&(i=0);i<0&&(i=r.length-1);let t=r.eq(i);if(console.log("tab",n.target,t),t.focus(),t.is(":focus")){n.preventDefault();n.stopPropagation();break}}}else n.key==="Enter"?t.is("[role=button],[role=tab]")&&t.click():n.key==="ArrowDown"?i(n,"down"):n.key==="ArrowUp"?i(n,"up"):n.key==="ArrowLeft"?i(n,"left"):n.key==="ArrowRight"&&i(n,"right")})}})
3937;/*
3938https://github.com/kamens/jQuery-menu-aim
3939*/
3940(function($) {
3941
3942    $.fn.menuAim = function(opts) {
3943        // Initialize menu-aim for all elements in jQuery collection
3944        this.each(function() {
3945            init.call(this, opts);
3946        });
3947
3948        return this;
3949    };
3950
3951    function init(opts) {
3952        var $menu = $(this),
3953            activeRow = null,
3954            mouseLocs = [],
3955            lastDelayLoc = null,
3956            timeoutId = null,
3957            options = $.extend({
3958                rowSelector: "> li",
3959                submenuSelector: "*",
3960                submenuDirection: "right",
3961                tolerance: 75,  // bigger = more forgivey when entering submenu
3962                enter: $.noop,
3963                exit: $.noop,
3964                activate: $.noop,
3965                deactivate: $.noop,
3966                exitMenu: $.noop
3967            }, opts);
3968
3969        var MOUSE_LOCS_TRACKED = 3,  // number of past mouse locations to track
3970            DELAY = 300;  // ms delay when user appears to be entering submenu
3971
3972        /**
3973         * Keep track of the last few locations of the mouse.
3974         */
3975        var mousemoveDocument = function(e) {
3976                mouseLocs.push({x: e.pageX, y: e.pageY});
3977
3978                if (mouseLocs.length > MOUSE_LOCS_TRACKED) {
3979                    mouseLocs.shift();
3980                }
3981            };
3982
3983        /**
3984         * Cancel possible row activations when leaving the menu entirely
3985         */
3986        var mouseleaveMenu = function() {
3987                if (timeoutId) {
3988                    clearTimeout(timeoutId);
3989                }
3990
3991                // If exitMenu is supplied and returns true, deactivate the
3992                // currently active row on menu exit.
3993                if (options.exitMenu(this)) {
3994                    if (activeRow) {
3995                        options.deactivate(activeRow);
3996                    }
3997
3998                    activeRow = null;
3999                }
4000            };
4001
4002        /**
4003         * Trigger a possible row activation whenever entering a new row.
4004         */
4005        var mouseenterRow = function() {
4006                if (timeoutId) {
4007                    // Cancel any previous activation delays
4008                    clearTimeout(timeoutId);
4009                }
4010
4011                options.enter(this);
4012                possiblyActivate(this);
4013            },
4014            mouseleaveRow = function() {
4015                options.exit(this);
4016            };
4017
4018        /*
4019         * Immediately activate a row if the user clicks on it.
4020         */
4021        var clickRow = function() {
4022                activate(this);
4023            };
4024
4025        /**
4026         * Activate a menu row.
4027         */
4028        var activate = function(row) {
4029                if (row == activeRow) {
4030                    return;
4031                }
4032
4033                if (activeRow) {
4034                    options.deactivate(activeRow);
4035                }
4036
4037                options.activate(row);
4038                activeRow = row;
4039            };
4040
4041
4042        var possiblyActivate = function(row) {
4043                var delay = activationDelay();
4044
4045                if (delay) {
4046                    timeoutId = setTimeout(function() {
4047                        possiblyActivate(row);
4048                    }, delay);
4049                } else {
4050                    activate(row);
4051                }
4052            };
4053
4054
4055        var activationDelay = function() {
4056                if (!activeRow || !$(activeRow).is(options.submenuSelector)) {
4057
4058                    return 0;
4059                }
4060
4061                var offset = $menu.offset(),
4062                    upperLeft = {
4063                        x: offset.left,
4064                        y: offset.top - options.tolerance
4065                    },
4066                    upperRight = {
4067                        x: offset.left + $menu.outerWidth(),
4068                        y: upperLeft.y
4069                    },
4070                    lowerLeft = {
4071                        x: offset.left,
4072                        y: offset.top + $menu.outerHeight() + options.tolerance
4073                    },
4074                    lowerRight = {
4075                        x: offset.left + $menu.outerWidth(),
4076                        y: lowerLeft.y
4077                    },
4078                    loc = mouseLocs[mouseLocs.length - 1],
4079                    prevLoc = mouseLocs[0];
4080
4081                if (!loc) {
4082                    return 0;
4083                }
4084
4085                if (!prevLoc) {
4086                    prevLoc = loc;
4087                }
4088
4089                if (prevLoc.x < offset.left || prevLoc.x > lowerRight.x ||
4090                    prevLoc.y < offset.top || prevLoc.y > lowerRight.y) {
4091
4092                    return 0;
4093                }
4094
4095                if (lastDelayLoc &&
4096                        loc.x == lastDelayLoc.x && loc.y == lastDelayLoc.y) {
4097
4098                    return 0;
4099                }
4100
4101
4102                function slope(a, b) {
4103                    return (b.y - a.y) / (b.x - a.x);
4104                };
4105
4106                var decreasingCorner = upperRight,
4107                    increasingCorner = lowerRight;
4108
4109                if (options.submenuDirection == "left") {
4110                    decreasingCorner = lowerLeft;
4111                    increasingCorner = upperLeft;
4112                } else if (options.submenuDirection == "below") {
4113                    decreasingCorner = lowerRight;
4114                    increasingCorner = lowerLeft;
4115                } else if (options.submenuDirection == "above") {
4116                    decreasingCorner = upperLeft;
4117                    increasingCorner = upperRight;
4118                }
4119
4120                var decreasingSlope = slope(loc, decreasingCorner),
4121                    increasingSlope = slope(loc, increasingCorner),
4122                    prevDecreasingSlope = slope(prevLoc, decreasingCorner),
4123                    prevIncreasingSlope = slope(prevLoc, increasingCorner);
4124
4125                if (decreasingSlope < prevDecreasingSlope &&
4126                        increasingSlope > prevIncreasingSlope) {
4127
4128                    lastDelayLoc = loc;
4129                    return DELAY;
4130                }
4131
4132                lastDelayLoc = null;
4133                return 0;
4134            };
4135
4136        /**
4137         * Hook up initial menu events
4138         */
4139        $menu
4140            .mouseleave(mouseleaveMenu)
4141            .find(options.rowSelector)
4142                .mouseenter(mouseenterRow)
4143                .mouseleave(mouseleaveRow)
4144                .click(clickRow);
4145
4146        $(document).mousemove(mousemoveDocument);
4147
4148    };
4149})(jQuery);
4150
4151
4152;
4153// skript pro komponentu SliderView
4154// jedná se o responzivní variantu skriptu
4155//TODO vymyslet nějak univerzálně, eg uiCore.Init('SliderViewRwd', 'el123');
4156function SliderViewRwdInit(viewId, interval, logTouchEventPositions = false) {
4157
4158    // pokud nebude view vyrenderováno, tak dojde k chybě
4159    // stává se to např. pokud produkt má vlastní obsah ve kterém je slider, ale produkt renderuje pouze textový obsah
4160    // při zavolání ProductGetContent.Destription dojde k interpretaci html a registraci tohoto skriptu, ale html se na klienta nedostane
4161    var viewEl = document.getElementById(viewId);
4162    if (viewEl === null) return;
4163
4164    var $slider = $(viewEl);
4165
4166    var slides = [];
4167    var currentSlideIndex = 0;
4168    var timeout;
4169    var $slides = $slider.find("> .slides > .slide");
4170    if ($slides.length === 0) return;
4171    var $previews = $slider.find("> .slidesPreview > .preview");
4172    var $buttonNext = $slider.find(".button.next");
4173    var $buttonPrev = $slider.find(".button.prev");
4174    var $pagination = $slider.find(".pagination > span");
4175    var isVisible = true; // 61099 - zda je slider vidět
4176    var singleSlide = $slides.length === 1; // 61099 - je jednom jeden slide
4177    var outOfAnimationTimeout;
4178
4179    $slides.each(function () { initSlide(this); });
4180
4181    if ($slides.length === 1) {
4182        // Pokud máme jenom jeden slide, pak skryjeme tlačítka na přesun mezi slidy.
4183        $buttonNext.css("display", "none");
4184        $buttonPrev.css("display", "none");
4185    }
4186    $previews.click(previewClicked);
4187    $pagination.click(pageClicked);
4188
4189    $buttonNext.click(moveNext);
4190    $buttonPrev.click(movePrev);
4191
4192    initIntersectionObserver();
4193
4194    var xDown = null;
4195    var yDown = null;
4196    var windowScrollY = null;
4197
4198    function initIntersectionObserver() {
4199        if (!("IntersectionObserver" in window)) return;
4200
4201        // 61099 - pokud není slider vidět, tak nebudeme posouvat slidery, v případě lazy loadingu obrázků to totiž může odskakovat se stránkou
4202        var intersectionObserver = new IntersectionObserver(function (entries) {
4203            for (var i = 0; i < entries.length; i++) {
4204                var entry = entries[i];
4205                if (entry.isIntersecting) {
4206                    isVisible = true;
4207                    scheduleNextSlide();
4208                } else {
4209                    stopScheduleNextSlide();
4210                    isVisible = false;
4211                }
4212            }
4213        }, {
4214            rootMargin: "0px 0px 0px 0px",
4215            threshold: [0]
4216        });
4217        intersectionObserver.observe($slider[0]);
4218    }
4219
4220    function initSlide(slide) {
4221        var $slide = $(slide);
4222        slides.push($slide);
4223        try {
4224            // vezmeme img element uvnitř slidu (.slide > a > img), pokud takový img element neexistuje, nejedná se o obrázkový slider a nebudeme tedy čekat na načtení obrázku
4225            var a = slide.children[0];
4226            if (a == undefined || a.tagName !== "A") {
4227                markSlideAsLoaded(slide);
4228                return;
4229            }
4230            var img = a.children[0];
4231            if (img == undefined || img.tagName !== "IMG") {
4232                markSlideAsLoaded(slide);
4233                return;
4234            }
4235            if (img.naturalWidth > 1 || img.naturalHeight > 1) {
4236                // obrázek už je zřejmě stažený
4237                markSlideAsLoaded(slide);
4238                return;
4239            }
4240            // a nastavíme událost, která je zavolána až po úspěšném stažení obrázku
4241            img.addEventListener("load",
4242                function () {
4243                    try {
4244                        // pokud došlo k nahrání placeholder obrázku, budeme událost ignorovat
4245                        if (this.naturalWidth <= 1 && this.naturalHeight <= 1) return;
4246                    } catch (ex) {
4247                    };
4248                    // nastavíme CSS třídu, která značí, že obrázek tohoto slidu byl stažen
4249                    markSlideAsLoaded(slide);
4250                    //if (!slide.classList.contains("loaded")) slide.className += " loaded"; // IE neumí classList.add(), proto je potřeba použít className += " css"
4251                });
4252
4253        } catch (ex) {
4254            // pokud došlo k nějaké výjimce, raději označíme slide jako stažený
4255            markSlideAsLoaded(slide);
4256        }
4257    }
4258
4259    // swipe na mobilech, jen takto události fungují spolehlivě
4260    $slides.on('touchstart', handleTouchStart);
4261    $slides.on('touchmove', handleTouchMove);
4262
4263    function handleTouchStart(evt) {
4264        xDown = evt.touches[0].clientX;
4265        yDown = evt.touches[0].clientY;
4266        windowScrollY = window.scrollY;
4267        if (logTouchEventPositions) {
4268            console.log('start - windowScrollY: ' + windowScrollY + ', x: ' + xDown + ', y: ' + yDown);
4269        }
4270    };
4271
4272    function handleTouchMove(evt) {
4273        if (!xDown || !yDown) {
4274            return;
4275        }
4276        evt.preventDefault();
4277        evt.stopPropagation();
4278        var xUp = evt.touches[0].clientX;
4279        var yUp = evt.touches[0].clientY;
4280
4281        var xDiff = xDown - xUp;
4282        var yDiff = yDown - yUp;
4283
4284        var minimalTouchedMove = 5;
4285        if (logTouchEventPositions) {
4286            console.log('move - windowScrollY: ' + window.scrollY + ', x: ' + xDiff + ', y: ' + yDiff);
4287        }
4288        if (Math.abs(xDiff) > Math.abs(yDiff)) {
4289            if (xDiff > minimalTouchedMove) { // minimální pohyb myší pro posun slidu
4290                /* left swipe */
4291                moveNext();
4292            } else if (xDiff < (minimalTouchedMove * -1)) {
4293                /* right swipe */
4294                movePrev();
4295            }
4296
4297            /* reset values */
4298            xDown = null;
4299            yDown = null;
4300        }
4301        else {
4302            // vertical swipe v browseru (stává se, že slider je přes celý screen a na mobilu se nelze přes slider posunout)
4303            var resultPos = yDown - yUp; //  + 
4304            if (windowScrollY > 0) {
4305                resultPos = (windowScrollY + yDown) - yUp;
4306            }
4307            window.scrollTo(0, resultPos);
4308        }
4309    }
4310
4311    function markSlideAsLoaded(slide) {
4312        try {
4313            if (!slide.classList.contains("loaded")) slide.className += " loaded"; // IE neumí classList.add(), proto je potřeba použít className += " css"
4314        } catch (ex) {
4315            //console.log(ex);
4316        }
4317    }
4318
4319    function nextIndex(index) {
4320        var newIndex = (index + 1) % slides.length;
4321        return newIndex;
4322    }
4323
4324    function prevIndex(index) {
4325        var newIndex = (index - 1 + slides.length) % slides.length;
4326        return newIndex;
4327    }
4328
4329    function moveNext() {
4330        var slideIndex = nextIndex(currentSlideIndex);
4331        moveTo(slideIndex);
4332    }
4333
4334    function movePrev() {
4335        var slideIndex = prevIndex(currentSlideIndex);
4336        moveTo(slideIndex, true);
4337    }
4338
4339    function preloadSlide(slideIndex) {
4340        if (singleSlide) return; // 61099 - pokud je jenom jeden slide, pak není potřeba preloadovat
4341        var slide = slides[slideIndex];
4342        slide.find("picture").children().removeAttr("loading");
4343        if (slide.hasClass("loaded")) return;
4344        slide.addClass("preload");
4345    }
4346
4347    function moveTo(slideIndex, reverse, disableAnimation) {
4348        clearTimeout(outOfAnimationTimeout);
4349        $slides.removeClass("next");
4350        $slides.removeClass("previous");
4351        $slides.removeClass("active");
4352        $slides.removeClass("reverse");
4353        $slides.removeClass("preload");
4354        
4355        if (!disableAnimation) {
4356            slides[currentSlideIndex].addClass("previous");
4357            slides[slideIndex].addClass("next");
4358            if (reverse) {
4359                slides[currentSlideIndex].addClass("reverse");
4360                slides[slideIndex].addClass("reverse");
4361            }
4362
4363            // 112813 - po uplynutí animace odebereme CSS třídy, aby při úpravě HTML nedocházelo opětovně ke spuštění animace
4364            try {
4365                var slide = slides[currentSlideIndex][0];
4366                var animationStyleDuration = getComputedStyle(slide)["animation-duration"];
4367                var match = animationStyleDuration.match(/(?<NUM>\d+)\s*(?<UNIT>s|ms)/);
4368                var duration = Number.parseInt(match.groups["NUM"]);
4369                if (match.groups["UNIT"] === "s") duration *= 1000;
4370                outOfAnimationTimeout = setTimeout(() => {
4371                    $slides.removeClass("next");
4372                    $slides.removeClass("previous");
4373                    $slides.removeClass("reverse");
4374                }, duration);
4375            } catch(ex) {
4376                console.log(ex);
4377            }
4378        }
4379
4380        // 61099 - s předstihem stáhneme i následující slide, jinak totiž na Safari se slide nezobrazí během animace
4381        if (reverse) {
4382            preloadSlide(prevIndex(slideIndex));
4383        } else {
4384            preloadSlide(nextIndex(slideIndex));
4385        }
4386
4387        slides[slideIndex].addClass("active");
4388
4389        currentSlideIndex = slideIndex;
4390
4391        $previews.removeClass("active");
4392        var $preview = $($previews.get(slideIndex));
4393        $preview.addClass("active");
4394
4395        $pagination.removeClass("active");
4396        var $page = $($pagination.get(slideIndex));
4397        $page.addClass("active");
4398
4399        scheduleNextSlide();
4400    }
4401
4402    function previewClicked() {
4403        var $preview = $(this);
4404        var slideIndex = $preview.index();
4405        moveTo(slideIndex);
4406        return false;
4407    }
4408
4409    function pageClicked() {
4410        var $page = $(this);
4411        var slideIndex = $page.index();
4412        moveTo(slideIndex);
4413        return false;
4414    }
4415
4416    function scheduleNextSlide() {
4417        if (timeout) clearTimeout(timeout);
4418        if (!isVisible) return;
4419        if (singleSlide) return; // 61099 - nemá smysl spouštět animaci pokud je jenom jeden slide
4420        timeout = setTimeout(moveNext, interval);
4421    }
4422
4423    function stopScheduleNextSlide() {
4424        if (timeout) clearTimeout(timeout);
4425    }
4426
4427    moveTo(0, false, true);
4428};
4429;
4430// skript pro komponentu ProductComparisonView
4431//TODO vymyslet nějak univerzálně, eg uiCore.Init('ProductComparisonView', 'el123');
4432function ProductComparisonRwdViewInit(viewId, fixedHeader, tableSelector, headerSelector, itemSelector, previousSelector, nextSelector, scrollButtonsSelector) {
4433    var view = mvcUi.getView(viewId);
4434    // všechny selectory musí být nastavené
4435    if (!tableSelector || !headerSelector || !itemSelector || !previousSelector || !nextSelector || !scrollButtonsSelector) return;
4436    var $table = view.$(tableSelector);
4437    if ($table.length === 0) return;
4438    var $prevButton = view.$(previousSelector);
4439    if ($prevButton.length === 0) return;
4440    var $nextButton = view.$(nextSelector);
4441    if ($nextButton.length === 0) return;
4442    var $scrollButtonsSelector = view.$(scrollButtonsSelector);
4443    if ($scrollButtonsSelector.length === 0) return;
4444
4445    var children = $table.children();
4446    var headerSize, productEls;
4447    init();
4448    if (productEls.length === 0) return;
4449
4450    // navázání událostí
4451    $(window).on("resize", init);
4452    $(window).on("scroll", function () { hiddenScrollButtons(); });
4453    $table.on("scroll", function () { refreshButtonState(); });
4454    $nextButton.on("click", function () { moveNext(); });
4455    $prevButton.on("click", function () { movePrevious(); });
4456
4457    function hiddenScrollButtons() {
4458        var tableBottomPos = $table.offset().top + $table.height();
4459        var buttonsPosTop = $scrollButtonsSelector.offset().top;
4460        if (tableBottomPos < buttonsPosTop) {
4461            $scrollButtonsSelector.addClass('hidden');
4462        } else {
4463            $scrollButtonsSelector.removeClass('hidden');
4464        }
4465    }
4466
4467    function init() {
4468        productEls = [];
4469        var firstHeader = true;
4470        for (var i = 0; i < children.length; i++) {
4471            var $child = $(children[i]);
4472            if ($child.is(headerSelector)) {
4473                if (firstHeader) {
4474                    headerSize = $child.outerWidth();
4475                    if (fixedHeader) $prevButton.css("left", headerSize);
4476                    firstHeader = false;
4477                } else {
4478                    return;
4479                }
4480            }
4481            else if ($child.is(itemSelector)) {
4482                productEls.push($child);
4483            }
4484        }
4485        if (productEls.length > 0) refreshButtonState();
4486    }
4487
4488    function fullTableWidth() {
4489        var lastEl = productEls[productEls.length - 1];
4490        return lastEl.position().left + lastEl.outerWidth();
4491    }
4492
4493    function moveNext() {
4494        if ($nextButton.hasClass("disabled")) return;
4495        var scrollLeft = 0;//$table.scrollLeft();
4496        // posuneme scroll o šířku headeru, používáme-li zafixovaný header
4497        scrollLeft += fixedHeader ? headerSize : 0;
4498        for (var i = 0; i < productEls.length; i++) {
4499            var product = productEls[i];
4500            // vzdálenost levé strany vůči scrollLeft
4501            var productLeft = product.position().left;
4502            if (scrollLeft <= productLeft) {
4503                // vzdálenost pravéhé strany vůči scrollLeft
4504                var productRight = productLeft + product.outerWidth();
4505                $table.scrollLeft($table.scrollLeft() + productRight - (fixedHeader ? headerSize : 0));
4506                return;
4507            }
4508        }
4509    }
4510
4511    function movePrevious() {
4512        if ($prevButton.hasClass("disabled")) return;
4513        var scrollLeft = 0;//$table.scrollLeft();
4514        // posuneme scroll o šířku headeru, používáme-li zafixovaný header
4515        scrollLeft += fixedHeader ? headerSize : 0;
4516        for (var i = 0; i < productEls.length; i++) {
4517            var product = productEls[i];
4518            if (scrollLeft < product.position().left + 1) { // + 1 je zde kuli borderu
4519                product = productEls[i - 1];
4520                // vzdálenost levé strany vůči scrollLeft
4521                var productLeft = product.position().left;
4522                $table.scrollLeft($table.scrollLeft() + productLeft - (fixedHeader ? headerSize : 0));
4523                return;
4524            }
4525        }
4526
4527    }
4528
4529    function refreshButtonState() {
4530        // tlačítko předchozí
4531        if (productEls.length > 1 && $table.scrollLeft() > 0) {
4532            $prevButton.removeClass("disabled");
4533        } else {
4534            $prevButton.addClass("disabled");
4535        }
4536
4537        // tlačítko další
4538        if ($table.outerWidth() < fullTableWidth()) {
4539            $nextButton.removeClass("disabled");
4540        } else {
4541            $nextButton.addClass("disabled");
4542        }
4543    }
4544}
4545;var MsGridAutoPrefixer = undefined;
4546    $(function () {
4547    // test zda se jedná o Internet Explorer
4548    var isIe = window.MSStyleCSSProperties;
4549        if (!isIe) return;
4550
4551    (function() {
4552        var gridEntries = [];
4553        var rulesToAdd = {};
4554        var bsRuleIdCounter = 0;
4555        var $msStyleSheet;
4556        var initialized = false;
4557
4558        // stylesheet pro dynamicky vytvářená pravidla, která nevznikla modifikací těch starých
4559        $(function () {
4560            initialized = true;
4561            $msStyleSheet = $("<style id=\"ms-grid-styles\"></style>");
4562            $msStyleSheet.appendTo($("html"));
4563            
4564            loadStyleSheets();
4565
4566            // aktualizace při změně v DOMu
4567            $("html").bind("DOMNodeInserted", function (event) {
4568                // pokud dojde k přidání nových styleSheetů je potřeba je zpracovat
4569                if (event.target.nodeName === "STYLE" || event.target.nodeName === "LINK") {
4570                    setTimeout(function() { loadStyleSheets(); }, 10);
4571                }
4572                MsGridAutoPrefixer.scheduleUpdate();
4573            });
4574            $("html").bind("DOMNodeRemoved", function () {
4575                MsGridAutoPrefixer.scheduleUpdate();
4576            });
4577        });
4578
4579        /*
4580         * Veřejné metody
4581         */
4582
4583        this.loadStyleSheets = function () {
4584            /// <summary>
4585            /// Zpracuje nezpracované stylesheety a vytvoří pravidla pro implementaci gridu v IE 11.
4586            /// Zpracovává pouze stylesheety a nikoliv inlinovaný styly.
4587            /// </summary>
4588            if (!initialized) return;
4589            var styleSheetCount = 0;
4590            var ruleCount = 0;
4591            
4592            console.time("loadStyleSheets");
4593            var styleSheets = document.styleSheets;
4594            for (var i = 0; i < styleSheets.length; i++) {
4595                var styleSheet = styleSheets[i];
4596                if (styleSheet.bsRuleId) continue;
4597
4598                styleSheetCount++;
4599                styleSheet.bsRuleId = bsRuleIdCounter++; // vlastní identifikátor pro stylesheet, který označuje, že daný stylesheet již byl zpracován
4600                var rules = styleSheet.rules;
4601                for (var j = 0; j < rules.length; j++) {
4602                    var rule = rules[j];
4603                    processRule(rule);
4604                    ruleCount++;
4605                }
4606            }
4607
4608            saveRules();
4609            scheduleUpdate();
4610            console.timeEnd("loadStyleSheets");
4611            console.info("loadStyleSheets - styleSheets: " + styleSheetCount + ", rules: " + ruleCount);
4612        }
4613
4614        var isUpdating = false;
4615        this.updateGrids = function () {
4616            /// <summary>
4617            /// Projede všechny HTML prvky, které mají nastaveno display: -ms-[inline-]grid a provede transformaci aplikovaných css pravidel,
4618            /// aby co nejlépe vyhovovali IE 11 implementaci gridu a chovalo se to co nejpodobněji gridu ostatních prohlížečů.
4619            /// </summary>
4620
4621            if (!initialized) return;
4622            if (isUpdating) return;
4623            isUpdating = true;
4624            console.time("updateGrid");
4625
4626            // odebereme staré gridy (mohlo dojít ke změně)
4627            var $oldGrids = $(".bs-isMsGrid");
4628            $oldGrids.each(function (_, el) {
4629                var $oldGrid = $(el);
4630                $oldGrid.removeClass("bs-isMsGrid");
4631
4632                // odstraníme přiřazenou css třídu pro automatické pozicování prvků v gridu, protože mohlo dojít ke změně pravidel aplikovaných na daný prvek
4633                var oldClass = $oldGrid.data("bs-msGridClass");
4634                if (oldClass) $oldGrid.removeClass(oldClass);
4635                $oldGrid.data("bs-msGridClass", false);
4636            });
4637
4638            for (var i = 0; i < gridEntries.length; i++) {
4639                var gridEntry = gridEntries[i];
4640                var $grids = $(gridEntry.selector);
4641                $grids.each(function (_, el) {
4642                    processGridElement($(el), gridEntry);
4643                });
4644            }
4645
4646            saveRules();
4647            isUpdating = false;
4648            console.timeEnd("updateGrid");
4649        }
4650
4651        var updateTimeout = 0;
4652        this.scheduleUpdate = function () {
4653            /// <summary>
4654            /// Zařadí update k zpracování až po 10 ms, aby neprobíhalo více updatů zbytečně hned po sobě.
4655            /// </summary>
4656
4657            if (updateTimeout) return;
4658
4659            updateTimeout = setTimeout(function () {
4660                updateGrids();
4661                updateTimeout = 0;
4662            }, 10);
4663        }
4664
4665        /*
4666         * Interní metody
4667         */
4668
4669        function ensureHasGridTemplateRule(cols, rows) {
4670            /// <summary>
4671            /// Zajistí, že existuje pravidlo pro dynamicky vytvořenou třídu pro daný automaticky pozicovaný grid-template
4672            /// a vrátí název této třídy.
4673            /// </summary>
4674            
4675            var className = "bs-msGridC" + cols + "R" + rows;
4676            if (!$msStyleSheet.data(className)) {
4677                $msStyleSheet.data(className, true);
4678                var content = "";
4679                // minmax(min-content, 1fr) se chová podobně jako auto u modernějších prohlížečů
4680                content += cols === 1 ? "-ms-grid-columns: 1fr;" : "-ms-grid-columns: (minmax(min-content, 1fr))[" + cols + "];";
4681                // explicitní nastavování výšky u řádků již většinou není potřeba naopak, může dojít k nepříjemnému roztažení řádků v případě, že grid je vyšší než jeho obsah
4682                content += rows === 1 ? "-ms-grid-rows: 1fr;" : /*"(minmax(min-content, 1fr))[" + maxRows + "]"*/""; 
4683
4684                $msStyleSheet[0].sheet.insertRule("." + className + " {" + content + "}", 0);
4685            }
4686            return className;
4687        }
4688
4689        function ensureHasGridRule(gridEntry, position) {
4690            /// <summary>
4691            /// Zajistí, že existují dynamicky vytvářená pravidla pro automaticky pozicovaného potomka na dané pozici.
4692            /// </summary>
4693
4694            var media = gridEntry.parent.media;
4695            if (media) {
4696                var mediaText = media.mediaText;
4697                // pravidlo není aplikováno pro daný breakpoint
4698                if (!window.matchMedia(mediaText).matches) return;
4699            }
4700            if (gridEntry.childCreated[position]) return; // pravidlo již bylo vytvořeno
4701
4702            gridEntry.createRulesForPosition(position);
4703            gridEntry.childCreated[position] = true;
4704        }
4705
4706        function processRule(rule) {
4707
4708            // pravidlo již bylo zpracováno
4709            if (rule.bsRuleId !== undefined) return;
4710            // nastavíme vlastní identifikátor pravidla, který označuje, že pravidlo již bylo zpracováno
4711            rule.bsRuleId = bsRuleIdCounter++; 
4712            if (!rule || !rule.cssText) return;
4713
4714            var parent = rule.parentRule || rule.parentStyleSheet;
4715            var bContent = rule.cssText.indexOf("{");
4716            var eContent = rule.cssText.indexOf("}");
4717            var content = rule.cssText.substring(bContent + 1, eContent);
4718            var gridEntry = null;
4719            var style = rule.style;
4720            var definedColumns = style.msGridColumns;
4721            var definedRows = style.msGridRows;
4722            var autoFlow = content.match(/grid-auto-flow\s*:\s*(row|column)/);
4723            var gridPositionFunc;
4724
4725            if (style.display.indexOf("-ms-grid") >= 0) {
4726                gridEntry = {
4727                    isGrid: true
4728                };
4729            }
4730
4731            if (gridEntry && gridEntry.isGrid && (!definedRows || !definedColumns)) {
4732                // defaulně jsou prvky pozicovány v jednom řádku
4733                gridPositionFunc = function (position) {
4734                    var column = parseInt(position) + 1;
4735                    appendRule(rule.selectorText + " > *:nth-child(" + (position + 1) + ")", "-ms-grid-column: " + column, parent);
4736                };
4737                
4738                gridEntry.createRulesForPosition = gridPositionFunc;
4739
4740            }
4741
4742            // jsou definovány pouze sloupce
4743            if (definedColumns && !definedRows) {
4744                var gridTemplate = style.msGridColumns;
4745                var columnsCount = gridTemplate
4746                    .replace(/\(.*?\)/g, "") // odebereme volání funkcí (minmax), protože může obsahovat bílé znaky
4747                    .split(/\s+/) // rozdělit podle mezer
4748                    .length; // TODO neřeší repeat() -- možná řešit na straně StyleSheetsPrepoprocessoru
4749                gridPositionFunc = function (position) {
4750                    var reminder = (position) % columnsCount;
4751                    var row = ((position - reminder) / columnsCount) + 1;
4752                    var column = (reminder) + 1;
4753                    appendRule(rule.selectorText + " > *:nth-child(" + (position + 1) + ")", "-ms-grid-row: " + row, parent);
4754                    appendRule(rule.selectorText + " > *:nth-child(" + (position + 1) + ")", "-ms-grid-column: " + column, parent);
4755                };
4756                if (!gridEntry) gridEntry = {};
4757
4758                gridEntry.createRulesForPosition = gridPositionFunc;
4759            }
4760
4761            // jsou definovány pouze řádky
4762            if (definedRows && !definedColumns) { // mixovaný template rows a columns s použitím auto placement nepodporujeme
4763                var gridTemplate = style.msGridRows;
4764                var columnsCount = gridTemplate.split(/\s+/).length; // TODO neřeší repeat() -- možná řešit na straně StyleSheetsPrepoprocessoru
4765                gridPositionFunc = function (position) {
4766                    var reminder = (position) % columnsCount;
4767                    var row = (reminder) + 1;
4768                    var column = ((position - reminder) / columnsCount) + 1;
4769                    appendRule(rule.selectorText + " > *:nth-child(" + (position + 1) + ")", "-ms-grid-row: " + row, parent);
4770                    appendRule(rule.selectorText + " > *:nth-child(" + (position + 1) + ")", "-ms-grid-column: " + column, parent);
4771                };
4772                if (!gridEntry) gridEntry = {};
4773
4774                gridEntry.createRulesForPosition = gridPositionFunc;
4775            }
4776            
4777            if (!definedColumns && !definedRows && autoFlow) {
4778                // pokud je nastaveno na "column", pak nemusíme nic dělat, protože to je výchozí stav, pracovat tak má smysl pouze s "row"
4779                if (autoFlow[1] === "row") {
4780                    if (!gridEntry) gridEntry = {
4781                    };
4782                    gridPositionFunc = function (position) {
4783                        var row = parseInt(position) + 1;
4784                        appendRule(rule.selectorText + " > *:nth-child(" + (position + 1) + ")", "-ms-grid-row: " + row, parent);
4785                    };
4786                    gridEntry.createRulesForPosition = gridPositionFunc;
4787                }
4788            }
4789
4790            var justify;
4791            if ((justify = content.match(/justify-(items|self)\s*:\s*([^;
4791]+)/))) {
4792                var place = justify[1];
4793                var value = justify[2];
4794                // pokud již byla hodnota definována, budeme ji ignorovat
4795                var isSelf = place === "self";
4796                var addRule = !(isSelf && style.msGridColumnAlign !== value);
4797                if (value.indexOf("flex-") === 0) value = value.substr(5);
4798
4799                if (addRule) {
4800                    var selector = rule.selectorText + (isSelf ? "" : " > * ");
4801                    appendRule(selector, "-ms-grid-column-align: " + value, parent);
4802                }
4803            }
4804
4805            var align;
4806            if ((align = content.match(/align-(items|self)\s*:\s*([^;]+)/))) {
4807                var place = align[1];
4808                var value = align[2];
4809                // pokud již byla hodnota definována, budeme ji ignorovat
4810                var isSelf = place === "self";
4811                var addRule = !(isSelf && style.msGridRowAlign !== value);
4812
4813                if (value.indexOf("flex-") === 0) value = value.substr(5);
4814                if (addRule) {
4815                    var selector = rule.selectorText + (place === "items" ? " > * " : "");
4816                    appendRule(selector, "-ms-grid-row-align: " + value, parent);
4817                }
4818            }
4819
4820            if (gridEntry) {
4821                gridEntry.parent = parent;
4822                gridEntry.selector = rule.selectorText;
4823                gridEntry.childCreated = [];
4824                gridEntries.push(gridEntry);
4825            }
4826        }
4827
4828        function appendRule(selector, rule, parent) {
4829            /// <summary>
4830            /// Uloží nové pravidlo do pomocné struktury, ze které se pak budou vytvářet samotná pravidla.
4831            /// TODO: pamatovat si dvojice vlastnost: hodnota a případně jenom přepisovat hodnoty
4832            /// </summary>
4833
4834            // přidáme k pravidlu vlastní identifikátor pravidla (označující, že toto pravidlo bylo již pracováno)
4835            if (parent.bsRuleId === undefined) parent.bsRuleId = bsRuleIdCounter++;
4836            var p = rulesToAdd[parent.bsRuleId];
4837            if (!p) {
4838                p = {};
4839                // uložíme si odkaz na rodiče (media query nebo samotný stylesheet)
4840                p["{parent}"] = parent;
4841                rulesToAdd[parent.bsRuleId] = p;
4842            }
4843            var s = p[selector];
4844            if (!s) {
4845                s = [];
4846                p[selector] = s;
4847            }
4848            s.push(rule);
4849        }
4850
4851        function saveRules() {
4852            /// <summary>
4853            /// Vytvoří nová pravidla uložené v pomocné struktuře a přidá je do stylesheetů
4854            /// </summary>
4855            
4856            if (rulesToAdd.length === 0) return;
4857            console.time("saveRules");
4858            for (var parentProperty in rulesToAdd) {
4859                if (!rulesToAdd.hasOwnProperty(parentProperty)) continue;
4860                var parentEntry = rulesToAdd[parentProperty];
4861                var parent = parentEntry["{parent}"];
4862                var saveIndex = parent.bsSaveIndex | 0;
4863
4864                for (var selector in parentEntry) {
4865                    if (!parentEntry.hasOwnProperty(selector)) continue;
4866                    if (selector === "{parent}") continue;
4867                    var rules = parentEntry[selector];
4868                    while (true) {
4869                        try {
4870                            parent.insertRule(selector + "{" + rules.join(";") + "}", saveIndex);
4871                            break;
4872                        } catch (e) {
4873                            if (e.name === "SyntaxError") {
4874                                console.error("new rule save failed for wrong syntax", "selector: " + selector, "rules: " + rules.join(";"));
4875                                break;
4876                            }
4877                            console.info("save index increased for ", parent);
4878                            saveIndex++;
4879                            if(saveIndex <= parent.cssRules.length) continue;
4880                            console.error("new rule save failed for " + selector);
4881                            break;
4882                        }
4883                    }
4884                    parent.bsSaveIndex = saveIndex;
4885                }
4886            }
4887            console.timeEnd("saveRules");
4888            rulesToAdd = {};
4889        }
4890
4891        function processGridElement($grid, gridEntry) {
4892            if (gridEntry.isGrid && $grid.css("display").indexOf("-ms-grid") >= 0) {
4893                $grid.addClass("bs-isMsGrid");
4894            }
4895            // TODO zkusit nasetit přes třídu, align-content/justify-content přes 1fr na první a poseldní sloupec a align-self/justify-self
4896            // Pokus o přiblížení se k chování podobnému jako u moderních prohlížečů, kde se auto roztahuje přes celý prostor kontejneru, 
4897            // ale u IE má maximální velikost danou max-content a více ani ťuk.
4898            var $children = $grid.children();
4899            var childrenCount = $children.length;
4900            var childPositionSet = [];
4901            var styles = $grid[0].currentStyle;
4902            if (styles.msGridColumns === "none") {
4903                var maxCols = 1;
4904                var maxRows = 1;
4905                // najdeme si jaké buňky jsou zaplněny, tím, že projedeme všechny potomky a podíváme se na jejich aktuální styly
4906                for (var j = 0; j < childrenCount; j++) {
4907                    var child = $children[j];
4908                    var childStyle = child.currentStyle;
4909                    // 1 je výchozí hodnota u msGrid pozičních vlastností
4910                    childPositionSet.push(childStyle.msGridColumn !== "1" && childStyle.msGridColumnSpan !== "1" && childStyle.msGridRow !== "1" && childStyle.msGridRowSpan !== "1");
4911                    // pokud potomek vidět není, pak ho budeme ignorovat
4912                    if (childStyle.display.indexOf("none") >= 0) continue;
4913                    // začátek + span - 1 (protože indexujeme od 0)
4914                    var colEnd = parseInt(childStyle.msGridColumn) + parseInt(childStyle.msGridColumnSpan) - 1;
4915                    var rowEnd = parseInt(childStyle.msGridRow) + parseInt(childStyle.msGridRowSpan) - 1;
4916                    maxCols = colEnd > maxCols ? colEnd : maxCols;
4917                    maxRows = rowEnd > maxRows ? rowEnd : maxRows;
4918                }
4919
4920                // prvku nastavíme třídu podle toho, jakou grid template pro něj požadujeme
4921                var newClass = ensureHasGridTemplateRule(maxCols, maxRows);
4922                $grid.addClass(newClass);
4923                $grid.data("bs-msGridClass", newClass);
4924            }
4925
4926            if (gridEntry.createRulesForPosition) {
4927                for (var i = 0; i < childrenCount; i++) {
4928                    // přeskočit vytváření pravidel pro potomky, které již pozici nastavenou mají
4929                    if(childPositionSet[i]) continue;
4930                    ensureHasGridRule(gridEntry, i);
4931                }
4932            }
4933        }
4934
4935        // navázání událostí na změnu breakpointu
4936        function attachToDynamicContainer() {
4937            dynamicContainer.addAfterResized(updateGrids);
4938        }
4939        if (typeof dynamicContainer === 'undefined') document.addEventListener('dynamicContainerInitialized', attachToDynamicContainer, false);
4940        else attachToDynamicContainer();
4941
4942        MsGridAutoPrefixer = this;
4943    })();
4944});
4945;/*
4946 *  Skript, který zajištuje funkčnost zafixování hlavičky.
4947 *  Jelikož při zafixování hlavičky se musí měnit styl/funkčnost i různých popupů, není tento skript zrovna triviální.
4948 *  V budocna je možné, že se tohoto skriptu zbavíme a uděláme to jinak.
4949 *  Nápady na vylepšení:
4950 *    1a. Místo "isFixedHeaderAware" použí "canbe_headerFixed", reps. obecně "canbe_{className}", pokud by se tedy na předkovi (hlavičce) nastavila třída "className",
4951 *        tak u všech potomcích, které mají třídu "canbe_{className}" by se nastavila i třída "className".
4952 *        HOTOVO
4953 *
4954 *    1b. NEBO, v potomcích tuto třídu vůbec nenastavovat, a v designeru umožnit vytvořit variantu "~headerFixed", ta ~ by znamenala,
4955 *        že stačí aby libovolný předek měl třídu "headerFixed" a použila by se daná varianta
4956 *        designer by pak vytvořil css pravidlo: ".headerFixed .dc1 { ... }" místo ".dc1.headerFixed { ... }"
4957 *        HOTOVO
4958 *
4959 *    2. U kategorií je problém s pozicováním a odkskrolem, protože při zafixování dostane hlavička position:fixed, není pak možné odskrolovat,
4960 *       proto se zde nastavuje výška kategorií (skrollbar je uvnitř kategorií).
4961 *       Mohli bychom vytvořit core-ui.setPosition(...), která by pomocí mutation observeru při změně css třídy, napozicovala element na pozici nějakého pivotu a zároveň
4962 *       by dopočetla výšku tak, aby spodek nepřesahoval obrazovku. Zároveň by v tomto skriptu mohli být další podmínky, které by určovali zda se má pozicování aplikovat nebo ne (něco ve smylsu is(:hover) nebo is(.fixed)).
4963 *
4964 *
4965 *
4966 * !!! POKUD BY TENTO SKRIPT NEVYHOVOAL U NĚJKÝCH KUSTOMIZOVANÝCH DESIGŮ, TAK NEKOPÍROVAT ALE PROBRAT S PH A OK !!!
4967 *
4968 */
4969
4970var FixedHeaderHandler = undefined;
4971function 
4972    RwdFixedHeader(disableHeaderFix, disableDynamicHide, options) {
4973    // dynamicky zafixujeme hlavičku
4974    var dynamicFixHandle;
4975    try {
4976        dynamicFixHandle = window.mvcUi.createDynamicFixPanel(options);
4977    } catch (ex) {
4978        console.error(ex);
4979        return;
4980    }
4981    if (!dynamicFixHandle) return;
4982    var disposed = false; // zda je skript uvolněn (například kvůli přerenderování klíčových prvků)
4983
4984    var context = {
4985        timeouts: {},
4986        elements: [],
4987        eventListeners: [],
4988        intersectionObservers: [],
4989        resizeObservers: []
4990    };
4991
4992    /** nastavení spouštění timeoutů, pokud má dojít k uvolnění, pak se ukončí i všechny timeouty a další již nepůjdou spustit */
4993    var timeoutCounter = 0;
4994    function safeSetTimeout(func, timeoutMiliseconds) {
4995        if (disposed) return;
4996        var id = timeoutCounter++;
4997        context.timeouts[id] = setTimeout(function () {
4998            delete context.timeouts[id];
4999            func();
5000        }, timeoutMiliseconds);
5001    };
5002
5003    /** vytváření HTML prvků, držíme si seznam vytvořených HTML prvků pro případné uvolnění */
5004    function safeCreateElement(tag) {
5005        var element = document.createElement(tag);
5006        context.elements.push(element);
5007        return element;
5008    }
5009
5010    /** registrace obsluhy událostí, držíme si seznam navázaných událostí pro případné uvolnění */
5011    function safeAddEventListener(target, event, callback, options) {
5012        context.eventListeners.push({ target: target, event: event, callback: callback, options: options });
5013        target.addEventListener(event, callback, options);
5014    }
5015
5016    /** centrální vytáření IntersectionObserverů */
5017    function createIntersectionObserver(callback, options) {
5018        var observer = new IntersectionObserver(function () {
5019            // při každé změně pro jistotu se dotážeme zda má ještě smysl aby byl skript aktivní
5020            if (checkAlive()) callback.apply(null, arguments);
5021        }, options);
5022        context.intersectionObservers.push(observer);
5023        return observer;
5024    }
5025
5026    /** centrální vytáření ResizeObserverů */
5027    function createResizeObserver(callback) {
5028        var observer = new ResizeObserver(function () {
5029            // při každé změně pro jistotu se dotážeme zda má ještě smysl aby byl skript aktivní
5030            if (checkAlive()) callback.apply(null, arguments);
5031        });
5032        context.resizeObservers.push(observer);
5033        return observer;
5034    }
5035
5036    /** Otestuje, zda má ještě být skript živý a nebo má dojít k jeho ukončení a uvolnění prostředků.
5037     * @returns Vrátí TRUE, pokud jsou všechny důležité HTML prvky stále součástí DOMu
5038     */
5039    function checkAlive() {
5040        var alive = isAlive(dynamicFixHandle.getContainer()) && isAlive(dynamicFixHandle.getMaster());
5041        if (!alive) dispose();
5042        return alive;
5043
5044        function isAlive(el) {
5045            return document.contains(el);
5046        }
5047    }
5048
5049    var masterSelector = options.masterSelector;
5050    var hideSelector = masterSelector + " > .wrap > *:not(.dcHeader)";
5051
5052    // vytvoříme si style element, ve kterém budeme uchovávat styly pro správné pozicování popupů (aby nezasahovali do zafixované hlavičky a aby při fixaci nepřečnívali stránku)
5053    var popupStyle = safeCreateElement("style");
5054    document.head.appendChild(popupStyle);
5055    var popupStylesheet = popupStyle.sheet;
5056    var viewportUnitsStyle = safeCreateElement("style");
5057    document.head.appendChild(viewportUnitsStyle);
5058    var viewportStylesheet = viewportUnitsStyle.sheet;
5059
5060    var maxContentWidth; // maximální šířka obsahu stránky, nastavitelná pomocí --max-content-width
5061    var headerTopOffset = 0; // odsazení hlavičky od začtku stránky
5062    var checkingStyle; // dočasný styl použitý při výpočtu výšky hlavičky
5063    var forceAllwaysFixed = options.allwaysFixed || false; // zda má být hlavička pořád v zafixovaném stavu
5064    var allwaysFixed = forceAllwaysFixed; // vynutíme hlavičku pořád zafixovanou (pro případ, kdy je hlavička v zafixovaném stavu stejná, či vyšší než nezafixovaná)
5065    var disableFixed = false; // zda má být hlavička nezafixovaná
5066    var enableDynamicHide = !disableDynamicHide;
5067    var isMacOrIOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform); // zda se jedná o Apple zařízení
5068    var isMsEdge = !!window.MSStream; // zda se jedná o prohlížeč MS Edge - 51177 + 54259
5069    var isHiddenOnScroll = false; // zda je skrytá hlavička kvůli odscrollování - 114925
5070    var isScriptScrolling = false; // zda se provádí scrollování přes skript, v takovém případě nechceme měnit viditelnost hlavičky - 114925 
5071    var isScriptScrollingTimeout; // handler pro timeout pro ukončení scrollování přes skript - 114925
5072    var anyCheck = false; // zda byl nějaký test na velikost vůbec proveden
5073
5074    /** Ukončí skript a uvolní prostředky. */
5075    function dispose() {
5076        if (disposed) return;
5077        disposed = true;
5078
5079        // odebereme přidané HTML prvky
5080        for (var el of context.elements) {
5081            if (el && el.parentElement) {
5082                el.parentElement.removeChild(el);
5083            }
5084        }
5085        context.elements.length = 0;
5086
5087        // ukončíme timeouty
5088        for (var id in context.timeouts) {
5089            if (!context.timeouts.hasOwnProperty(id)) continue;
5090            clearTimeout(context.timeouts[id]);
5091            delete context.timeouts[id];
5092        }
5093
5094        // odregistrujeme událost
5095        for (var e of context.eventListeners) {
5096            e.target.removeEventListener(e.event, e.callback, e.options);
5097        }
5098        context.eventListeners.length = 0;
5099
5100        // ukončíme sledování IntersectionObserverů
5101        for (var observer of context.intersectionObservers) {
5102            observer.disconnect();
5103        }
5104        context.intersectionObservers.length = 0;
5105
5106        // ukončíme sledování ResizeObserverů
5107        for (var observer of context.resizeObservers) {
5108            observer.disconnect();
5109        }
5110        context.resizeObservers.length = 0;
5111
5112        // uvolníme dynamické fixování
5113        dynamicFixHandle.dispose();
5114        dynamicFixHandle = null;
5115    }
5116
5117    // zakázat zafixování hlavičky v prohlížeči MS Edge (s jádrem EdgeHTML) - 51177 + 54259
5118    if (isMsEdge) {
5119        disableFixedHeader();
5120    }
5121
5122    /** Zda je momentálně hlavička zafixovaná (může být i během výpočtu). */
5123    function isFixed() {
5124        return dynamicFixHandle.isFixed();
5125    }
5126
5127    /** Výška zafixované hlavičky. */
5128    function fixedHeight() {
5129        return dynamicFixHandle.fixedHeight();
5130    }
5131
5132    /** Výška statické/nezafixoované hlavičky. */
5133    function unfixedHeight() {
5134        // pokud je zafixovaná hlavička větší jak statická, pak necháme zafixovanou hlavičku stále a statickou hlavičku budeme považovat za stejně velkou jako zafixovanou (kvůli dalším výpočtům)
5135        var unfixed = dynamicFixHandle.unfixedHeight();
5136        var fixed = dynamicFixHandle.fixedHeight();
5137        return unfixed < fixed ? fixed : unfixed;
5138    }
5139
5140    /** Vrátí element hlavičky. */
5141    function headerEl() {
5142        return dynamicFixHandle.getContainer();
5143    }
5144
5145    /** Vrátí element master. */
5146    function masterEl() {
5147        return dynamicFixHandle.getMaster();
5148    }
5149
5150    /** 62917
5151     *  Apple kvůli optimalizacím někdy nepřepočítává layout, i když došlo ke změně.
5152     *  Na krátko přidáme styl, který všechno skryje a pak ho zase odebereme. Tím donutíme přepočítání layoutu celé stránky.
5153     *  U ostatních prohlížečů stačí si šáhnout na vlastnost z offsetHeight (například height). */
5154    function forceReflow() {
5155        if (isMacOrIOs) {
5156            var tempStyle = safeCreateElement("style");
5157            var masterHeight = getComputedStyle(masterEl()).height;
5158            tempStyle.innerHTML = masterSelector + " { height: " + masterHeight + " !important; }"; // je potřeba nastavit původní výšku Masteru, jinak by docházelo k odskrolování nahoru při přepočítávání
5159            tempStyle.innerHTML += masterSelector + " > *{display:none;}"; // je nutné pro vynucení reflow nastavit display none
5160
5161            document.body.appendChild(tempStyle);
5162            // šáhneme si na výšku stránky, abychom donutili k přepočítání layoutu, hodnotu uložíme do neexistující vlastnosti dočasného elementu <style>
5163            tempStyle.discard = document.body.offsetHeight;
5164            document.body.removeChild(tempStyle);
5165        }
5166    }
5167
5168    /** Aktualizuje odsazení hlavičky od horního kraje stránky v nezafixovaném stavu.
5169     *  Je nutné volat pouze v nezafixovaném stavu!
5170     */
5171    function updateHeaderTopOffset() {
5172        var windowOffset = headerEl().getBoundingClientRect().top; // odsazení hlavičky vůči viewportu
5173        var widowScroll = document.defaultView.pageYOffset; // odskrolování viewportu vůči stránce
5174        headerTopOffset = windowOffset + widowScroll;
5175    }
5176
5177    /* Naplánuje přepočet CSS proměnných, včetně --vh a --vw.
5178     * Pokud je již přepočet naplánován, odpočet bude pouze restartován.
5179     **/
5180    var updateViewportUnitsTimeout;
5181    var viewTestEl;
5182
5183    /** 100604
5184     *  Proměnná pro uložení původu aktualizaci. Možné stavy jsou:
5185     *  isFixed: aktualizace vznikla zafixováním/odfixováním hlavičky
5186     *  isSize: aktualizace vznikla změnou velikosti hlavičky
5187     *  TODO zjišťování správné příčiny záleží na správném načasování, kvůli několika asynchronním operacím (agregující callbacky prohlížeče) nelze vyřešit jinak aniž by docházelo k rušivému přerenderování stránky.
5188     */
5189    var changeState = {};
5190    clearState();
5191
5192    /** Vymaže stav aktualizací.
5193     */
5194    function clearState() {
5195        changeState = {
5196            isFixed: false,
5197            isSize: false
5198        };
5199    }
5200
5201    /** Zda se jedná o čistý stav. Žádné aktualizace nejsou naplánovány.
5202     */
5203    function isClearState() {
5204        if (changeState.isFixed) return false;
5205        if (changeState.isSize) return false;
5206        return true;
5207    }
5208
5209    function scheduleUpdateViewportUnits(updateFast) {
5210        if (updateViewportUnitsTimeout) clearTimeout(updateViewportUnitsTimeout);
5211
5212        // timeout po kterém dojde k přepočítání jednotek, výpočet je drahý a tak omezujeme četnost jejich výpočtu (nižší = větší respozivita za cenu vyššího CPU zatížení)
5213        var timeoutMs = updateFast
5214            // jednotky se pokusíme přepočítat co nejdříve, ale až po provedení aktuálního skriptu
5215            ? 1
5216            // jednotky přepočítáme až 100ms po poslední žádosti, hodnotu lze změnit
5217            : 100;
5218
5219        updateViewportUnitsTimeout = safeSetTimeout(function () { updateViewportUnits(); }, timeoutMs);
5220    }
5221
5222    /* prohlížeče u mobilu jinak interpretují viewport jednotky v případě, že je/není vidět navigační panel
5223       https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
5224    */
5225    function updateViewportUnits() {
5226        if (!viewTestEl) startResizeObserver();
5227
5228        // velikost viewportu si vyčteme z viewport prvku
5229        var viewportWidth = viewTestEl.clientWidth;
5230        var viewportHeight = viewTestEl.clientHeight;
5231
5232        // nové jednotky velikosti viewportu, klasické vw a vh totiž na mobilech nepočítaj s vysunutou hlavičkou prohlížeče
5233        var vw = viewportWidth * 0.01;
5234        var vh = viewportHeight * 0.01;
5235
5236        if (viewportStylesheet.cssRules.length > 0) {
5237            // odebereme staré pravidlo ze stylsheetu
5238            viewportStylesheet.deleteRule(0);
5239        }
5240
5241        // nastavíme novou hodnotu pro odsazení obsahu stránky od okraje viewportu, tuto hodnotu si nacachujeme, protože by měla být konstantní pro všechny breakpointy a její získávání výrazně zpomaluje prohlížeč
5242        if (!maxContentWidth) {
5243            maxContentWidth = getComputedStyle(document.documentElement).getPropertyValue("--max-content-width");
5244            if (!maxContentWidth) maxContentWidth = "1280px";
5245            maxContentWidth = parseInt(maxContentWidth);
5246        }
5247        var outerWidth = (viewportWidth - maxContentWidth) / 2;
5248        if (outerWidth < 0) outerWidth = 0;
5249
5250        // pokud se změnil rozměr hlavičky necháme si ji znovu přepočítat přepočítat
5251        if (changeState.isSize || !anyCheck) {
5252            dynamicFixHandle.checkHeights();
5253        }
5254        var headerHeight = isFixed() ? fixedHeight() : unfixedHeight();
5255
5256        // nastavíme nové hodnoty pro CSS proměnné (!important je kvůli proměnným v variables.css, které můžou mít specifičtější prioritu)
5257        var rule = "* {";
5258        rule += " --vh: " + vh + "px !important;";
5259        rule += " --vw: " + vw + "px !important;";
5260        rule += " --outer-width: " + outerWidth + "px !important;";
5261        rule += " --bs-header-height: " + headerHeight + "px !important;";
5262        rule += " --bs-max-popup-height: " + (viewportHeight - headerHeight) + "px !important;";
5263        rule += "}";
5264        viewportStylesheet.insertRule(rule, 0);
5265
5266        // pokud se jednalo o změnu velikosti, vymažeme stav rovnou..
5267        if (changeState.isSize) clearState();
5268        // ..jinak vymažeme stav později, protože se ještě může zavolat callback reagující na změnu velikosti hlavičky a ten nechceme vykonat
5269        else safeSetTimeout(function () { clearState(); }, 1);
5270    }
5271
5272    /** Vytvoříme viewport prvek, který bude mít fixní pozici vždy přes celý viewport.
5273     *  Fixní pozice totiž počítá i se scrollbary a zasunutou hlavičkou na mobilu.
5274     * **/
5275    function startResizeObserver() {
5276        viewTestEl = safeCreateElement("view-test");
5277        viewTestEl.setAttribute("style", "display: block; top: 0; left: 0; bottom: 0; right: 0; position: fixed; pointer-events: none");
5278        document.body.appendChild(viewTestEl);
5279        
5280        /** Pokud existuje ResizeObserver necháme hlídat velikost našeho viewport prvku. De facto se tak jedná o spolehlivější variantu události resize. */
5281        if (typeof (ResizeObserver) !== "undefined") {
5282            var currentWidth = -1;
5283
5284            var viewTestResizeObserver = createResizeObserver(function (entries) {
5285                // 119401 - budeme sledovat jenom šířku, na Safari se resize volá velmi často kvůli změnám výšky v desetinách pixelu, ale stejně má smysl sledovat jenom šířku
5286                var newWidth = Math.round(entries[0].contentRect.width);
5287                if (currentWidth === newWidth) return;
5288                currentWidth = newWidth;
5289
5290                scheduleUpdateViewportUnits(false);
5291                // 100604 - pokud neprobíhá žádná aktualizace, označíme si stav jako změnu veliksoti
5292                if (isClearState()) changeState.isSize = true;
5293            });
5294
5295            // viewport
5296            viewTestResizeObserver.observe(viewTestEl);
5297
5298            // hlavička
5299            viewTestResizeObserver.observe(headerEl());
5300        } else {
5301            // jinak použít listener na událost resize
5302            safeAddEventListener(window, "resize", function () {
5303                scheduleUpdateViewportUnits();
5304                // 100604 - pokud neprobíhá žádná aktualizace, označíme si stav jako změnu veliksoti
5305                if (isClearState()) changeState.isSize = true;
5306            });
5307        }
5308    }
5309
5310    /* Funkce volaná při začátku měření výšky hlavičky.
5311     * Pro rychlejší měření tato funkce přidá stylesheet s vygenerovaným pravidlem, které skryje všechny ostatní prvky.
5312     * Je nutné po této funkci zavolat i exitChecking(), která naopak odebere stylesheet a opětovně zobrazí všechny ostatní prvky.
5313     * **/
5314    dynamicFixHandle.registerEnterCheck(function () {
5315        var masterHeight = getComputedStyle(masterEl()).height;
5316        checkingStyle = safeCreateElement("style");
5317        document.head.appendChild(checkingStyle);
5318        var styleSheet = checkingStyle.sheet;
5319        styleSheet.insertRule(hideSelector + " { display: none !important; }", 0);
5320        styleSheet.insertRule(masterSelector + " { height: " + masterHeight + " !important; }",
5321            1); // je potřeba nastavit původní výšku Masteru, jinak by docházelo k odskrolování nahoru při přepočítávání
5322    });
5323
5324    /* Funkce volaná na konci měření výšky hlavičky.
5325     * Odebere z DOMu stylesheet, který skrýval některé prvky, které byli skryty pro rychlejší výpočet.
5326     * **/
5327    dynamicFixHandle.registerExitCheck(function () {
5328        if (!checkingStyle) return;
5329        anyCheck = true;
5330
5331        // 104728 - necháme hlavičku zafixovanou pořád bez možnosti odfixování
5332        if (forceAllwaysFixed) {
5333            if (!isFixed()) {
5334                dynamicFixHandle.setFixed(true);
5335                dynamicFixHandle.disableDynamicFix(true);
5336            }
5337        } else {
5338            var wasAllwaysFixed = allwaysFixed;
5339            allwaysFixed = false;
5340            if (headerTopOffset === 0 && !disableFixed) {
5341                // pokud je výška zafixované hlavičky stejná jako nezafixované, pak necháme hlavičku zafixovanou pořád, jinak bude docházek k nepříjemným odskokům při přepínání fixace
5342                if (fixedHeight() === unfixedHeight()) {
5343                    if (!isFixed()) {
5344                        dynamicFixHandle.setFixed(true);
5345                    }
5346
5347                    // zakážeme odfixování hlavičky
5348                    dynamicFixHandle.disableDynamicFix(true);
5349                    allwaysFixed = true;
5350                }
5351            }
5352
5353            // pokud byla hlavička dříve permanentně zafixovaná a nyní není, pak povolíme dynamické fixování
5354            if (wasAllwaysFixed && !allwaysFixed) {
5355                dynamicFixHandle.disableDynamicFix(false);
5356            }
5357        }
5358
5359        // odebereme dočasné CSS styly urychlující výpočet velikosti hlavičky
5360        checkingStyle.parentElement.removeChild(checkingStyle);
5361        checkingStyle = null;
5362        getComputedStyle(document.body);
5363    });
5364
5365    /** Zaregistrujeme callback pro aktualizaci zafixování hlavičky */
5366    dynamicFixHandle.registerUpdate(function () {
5367        // 100604 - pokud neprobíhá žádná aktualizace, označíme si stav jako změnu fixace
5368        if (isClearState()) changeState.isFixed = true;
5369
5370        // 104728 - necháme hlavičku zafixovanou pořád bez možnosti odfixování
5371        if (forceAllwaysFixed) {
5372            if (!isFixed()) {
5373                dynamicFixHandle.setFixed(true);
5374                dynamicFixHandle.disableDynamicFix(true);
5375            }
5376        }
5377
5378        if (isFixed()) {
5379            // napsat CSS pravidla a nastavovat přes vlastnosti, nebude potřeba vytvářet a udržovat stylesheety
5380            dynamicFixHandle.getFixPivot().style.height = unfixedHeight() + "px";
5381
5382            if (popupStylesheet.cssRules.length > 0) {
5383                // odebereme staré pravidla ze stylsheetu
5384                popupStylesheet.deleteRule(1);
5385                popupStylesheet.deleteRule(0);
5386            }
5387
5388            // TODO řešit přes CSS proměnné z createDynamicFixPanel
5389            // styly upravující pozici popupů, aby nezasahovali do zafixované hlavičky a upravující jejich maximlní výšku, aby nepřečnívala mimo stránku
5390            popupStylesheet.insertRule(".fixedHeaderAwarePopup { position: fixed !important; top: " + fixedHeight() + "px !important; max-height: calc(var(--vh, 1vh) * 100 - " + fixedHeight() + "px) !important}", 0);
5391            popupStylesheet.insertRule(".fixedHeaderOverlay { position: fixed !important; height: " + fixedHeight() + "px !important; top: 0 !important;}", 1);
5392        } else {
5393            dynamicFixHandle.getFixPivot().style.height = 0;
5394
5395            if (popupStylesheet.cssRules.length > 0) {
5396                // odebereme stará pravidla ze stylsheetu
5397                popupStylesheet.deleteRule(1);
5398                popupStylesheet.deleteRule(0);
5399            }
5400
5401            // TODO řešit přes CSS proměnné z createDynamicFixPanel
5402            // styly upravující pozici popupů, aby nezasahovali do zafixované hlavičky a upravující jejich maximální výšku, aby nepřečnívala mimo stránku
5403            var headerHeightWithOffset = unfixedHeight() + headerTopOffset || 0;
5404            var popupStyle = "top: " + headerHeightWithOffset + "px !important;";
5405            popupStylesheet.insertRule(".fixedHeaderAwarePopup {" + popupStyle + "}", 0);
5406            popupStylesheet.insertRule(".fixedHeaderOverlay { height: " + unfixedHeight() + "px !important; top: " + headerTopOffset + "px !important;}", 1);
5407        }
5408
5409        forceReflow(); // vynutíme přepočítání aby se projevili změny - 62917
5410        scheduleUpdateViewportUnits(true);
5411    });
5412
5413    /** Při vypočítávání výšky odfixované hlavičky si uložíme odsazení hlavičky od horního okraje stránky. */
5414    dynamicFixHandle.registerUnfix(function () {
5415        if (checkingStyle) {
5416            updateHeaderTopOffset();
5417        }
5418    });
5419
5420    /** Upraví funkce související se scrollováním na kotvy tak, aby počítali s offsetem kvůli zafixované hlavičce. */
5421    function updateAnchorOffsets() {
5422        // změna fungování jQuery scrollTop a animate funkcí aby počítali se zafixovanou hlavičkou
5423        var oldScrollTop = $.fn.scrollTop; // půovodní jQuery funkce scrollTop
5424        $.fn.scrollTop = function () {
5425            if (disposed) return oldScrollTop.apply(this, arguments);
5426
5427            if (this.is("html,body") && arguments[0]) {
5428                arguments[0] = arguments[0] - getFixedHeaderHeightForScroll();
5429                isScriptScrollingStart(2000); // TODO zkusíme 2 sekundy
5430            }
5431            return oldScrollTop.apply(this, arguments);
5432        }
5433        var oldAnimate = $.fn.animate;
5434
5435        $.fn.animate = function () {
5436            if (disposed) return oldAnimate.apply(this, arguments);
5437
5438            if (this.is("html,body") && arguments[0]) {
5439                var options = arguments[0];
5440                var isScrolling = false;
5441                var duration = 400;
5442                for (var option in options) {
5443                    if (!options.hasOwnProperty(option))
5444                        continue;
5445                    if (option === "scrollTop") {
5446                        options[option] = options[option] - getFixedHeaderHeightForScroll();
5447                        isScrolling = true;
5448                    }
5449                    if (option === "deration") {
5450                        duration = options[option];
5451                    }
5452                }
5453
5454                if (isScrolling) {
5455                    isScriptScrollingStart(duration);
5456                }
5457            }
5458            return oldAnimate.apply(this, arguments);
5459        }
5460
5461        // nastavíme všem odkazům na kotvy scroll počítající s výškou fixní hlavičky
5462        var els = document.querySelectorAll("a[href*=\\#]:not([href=\\#])");
5463        for (var i = 0; i < els.length; i++) {
5464            var el = els[i];
5465            safeAddEventListener(el, "click",
5466                function (e) {
5467                    if (location.pathname.replace(/^\//, "") === this.pathname.replace(/^\//, "") &&
5468                        location.hostname === this.hostname) {
5469                        scrollToAnchor(this.hash);
5470                        window.location.hash = this.hash;
5471                        e.preventDefault();
5472                    }
5473                });
5474        }
5475
5476        // pokud máme odskrolovat na kotvu, provedeme odskrolování na kotvu se započítáním výšky hlavičky
5477        if (window.location.hash) {
5478            safeSetTimeout(function() {
5479                scrollToAnchor(window.location.hash);
5480            }, 1);
5481        }
5482
5483        // při překliku na kotvu provést odskrolování se započítáním výšky hlavičky
5484        safeAddEventListener(window, "hashchange",
5485            function () {
5486                scrollToAnchor(window.location.hash);
5487            });
5488
5489        function isScriptScrollingStart(timeout) {
5490            isScriptScrolling = true;
5491
5492            clearTimeout(isScriptScrollingTimeout);
5493            isScriptScrollingTimeout = setTimeout(function() { isScriptScrolling = false }, timeout);
5494        }
5495    }
5496
5497    // TODO hodilo by se reagovat na zafixované popupy užv momentu kdy vzniknou, to ale jednoduše nelze (bylo by potřeb sledovat všechny editace elementů na přidání třídy fixedHeaderAwarePopup)
5498    /** Nastaví hlídání popupů, pokud některý provede událost scroll (je scrollovatelný) zakáže scrollování na stránce a povolí jej až po uzavření popupu. */
5499    function fixScrollInPopup() {
5500        // funkčnost ResizeObserveru potřebujeme, kvůli možnému odfixování
5501        if (typeof (ResizeObserver) === "undefined") return;
5502
5503        var popupScrollPropertyName = "BS_RWD_FIXED_POPUP";
5504        var activePopups = 0;
5505
5506        // nastavíme obstarávání všech scroll událostí
5507        safeAddEventListener(window, "scroll",
5508            function (ev) {
5509                if (!isFixed()) return;
5510                checkScrollPopup(ev.target);
5511            },
5512            { capture: true, passive: true });
5513
5514        function isScrollPopup(el) {
5515            // pokud nemá nastavenou třídu, nejedná se o popup
5516            if (!el.classList.contains("fixedHeaderAwarePopup")) return false;
5517
5518            // pokud element má scrollovatelnou část větší jak zabíranou výšku, jedná se o popup se scrollem
5519            if (el.scrollHeight > el.clientHeight) return true;
5520            return false;
5521        }
5522
5523        function checkScrollPopup(el) {
5524            // nejedná se o HTML prvek
5525            if (!el || !el.classList) return;
5526
5527            // prvek již je zpracován tímto scriptem
5528            if (el[popupScrollPropertyName]) return;
5529
5530            // test zda se jedná o 
5531            if (!isScrollPopup(el)) return;
5532
5533            // zaregistrujeme popup se scrollem a zakážeme scrollování na stránce
5534            disablePageScroll(el);
5535        }
5536
5537        function disablePageScroll(popup) {
5538            if (activePopups === 0) {
5539                // pokud se jedná o první popup, nastavíme třídu na <html>
5540                document.body.parentElement.classList.add("hasScrollPopup");
5541            }
5542            activePopups++;
5543
5544            // vytvoíme resize observer, který bude hlídat popup zda je stále se scrollem, po zavření by měl povolit scrollování na stránce
5545            var resizeObserver = createResizeObserver(function (entries) {
5546                // načteme si všechny prvky z položek (mělo by se vždycky jednat právě o jeden prvek)
5547                var els = [];
5548                for (var i = 0; i < entries.length; i++) {
5549                    var el = entries[i].target;
5550                    if (!el || els.indexOf(el) >= 0) continue;
5551                    els.push(el);
5552                }
5553
5554                for (var i = 0; i < els.length; i++) {
5555                    var el = els[i];
5556
5557                    // pokud se již nejedná o popup se scrollem, pak opětovně povolíme scrollování na stránce
5558                    if (!isScrollPopup(el)) {
5559                        enablePageScroll(el);
5560                    }
5561                }
5562            });
5563
5564            // uložíme si resize observer k prvku a spustíme hlídání
5565            popup[popupScrollPropertyName] = resizeObserver;
5566            resizeObserver.observe(popup);
5567        }
5568
5569        function enablePageScroll(el) {
5570            if (!el[popupScrollPropertyName]) return;
5571
5572            activePopups--;
5573            if (activePopups === 0) {
5574                // pokud se jedná o poslední popup, odebereme třídu na <html>
5575                document.body.parentElement.classList.remove("hasScrollPopup");
5576            }
5577
5578            // ukončíme sledování a odebereme resize observer z prvku
5579            el[popupScrollPropertyName].disconnect();
5580            el[popupScrollPropertyName] = null;
5581        }
5582    }
5583    
5584    /** Pokusí se najít prvek kotvy. Pokud je umístěn ve sbalitelném kontejneru, pak jej rozbalí.
5585     *  Vrátí prvek kotvy.
5586     * @param {any} hash #IdElementu
5587     */
5588    function ensureVisibleAnchor(hash) {
5589        if (!hash) return;
5590
5591        var hashEl = document.querySelector(hash);
5592        var el = hashEl;
5593        while (el != null) {
5594            var expandAction = el['BS_EXPAND_CONTAINER'];
5595            if (expandAction) expandAction();
5596
5597            el = el.parentElement;
5598        }
5599
5600        return hashEl;
5601    }
5602
5603    /** Pokusí se provést odscroll na daný prvek s případným offsetem kvůli zafixované hlavičce.
5604     * @param {any} hash #IdElementu
5605     */
5606    function scrollToAnchor(hash) {
5607        var hashEl = ensureVisibleAnchor(hash);
5608        if (!hashEl) return;
5609
5610        var $target = $(hashEl);
5611        // provést odskok pouze v případě, že je prvek viditelný
5612        if ($target.is(":visible")) {
5613            // upravený jQuery scrollTop již počítá s fixní hlavičkou
5614            $("html,body").scrollTop($target.offset().top);
5615        }
5616
5617        // pokud prohlížeč podporuje scrollRestoration, nastavíme jej na manual, abychom zamezili tomu aby nám prohlížeč odscrolloval někam jinam
5618        if (window.history.scrollRestoration === "auto") {
5619            window.history.scrollRestoration = "manual";
5620        }
5621    }
5622
5623    /** Vrátí offset, který se má použít pro odscrollování kvůli zafixované hlavičce. */
5624    function getFixedHeaderHeightForScroll() {
5625        if (disableFixed) return 0;
5626
5627        // pokud je hlavička sice zafixovatelné, ale momentálně skrytá, pak nebudeme provádět offset
5628        if (isHiddenOnScroll) return 0;
5629
5630        // odsazení pár pixelů od zafixované hlavičky, například v případě odskrolování pomocí kotvy #{ElementId}
5631        return fixedHeight() + 5;
5632    }
5633
5634    /** Zakáže fixaci hlavičky, pokud je momentálně zafixovaná, pak ji odfixuje. */
5635    function disableFixedHeader() {
5636        if (isFixed()) {
5637            dynamicFixHandle.setFixed(false);
5638        }
5639        dynamicFixHandle.disableDynamicFix(true);
5640        disableFixed = true;
5641    }
5642
5643    /** Nastaví funkci pro skrývání zafixované hlavičky při scrollování.
5644     *  Tato funkce obsahuje veškerou funkcionalitu.
5645     */
5646    function initializeFixedHeaderHideOnScroll() {
5647        var hideAllowed;
5648        var isHeaderFocused = false;
5649        var scrollTop;
5650        var headerHideOffset;
5651        var hidden = false;
5652        var lastHeaderClickEvent;
5653        var showPivot;
5654        var hidePivot;
5655        var showPivotVisible;
5656        var hidePivotVisible;
5657        var isInitialized = false;
5658
5659        /** Zda je povoleno skrytí hlavičky při scrollování. */
5660        function isEnabled(options) {
5661            if (!options) options = { ignoreHeaderFocus: false };
5662            // automatické skrývání je zakázáno z programových důvodů (například hlavička není zafixovaná)
5663            if (!hideAllowed) return false;
5664
5665            // pokud bylo poslední kliknutí v hlavičce, pak zakážeme její skrytí, očekáváme totiž interakci s hlavičkou (třeba kliknutí na hamburgerové menu)
5666            if (isHeaderFocused && !options.ignoreHeaderFocus) return false;
5667
5668            // stránka ještě není zcela inicializovaná (například při odkazu s kotvou nechceme aby se hlavička automaticky skryla při automatickém odscrollu) a 
5668nebo skript skončil s chybou
5669            if (!isInitialized) return false;
5670
5671            // pokud se provádí scrollování vyvolané skriptem, pak nebudeme měnit skrytí hlavičky - 114925 (122568 - přidán parametr pro ignorování)
5672            if (isScriptScrolling && !options.ignoreScriptScrolling) return false;
5673            return true;
5674        }
5675
5676        /** Nastaví třídy pro animace a skrytí na hlavičce.
5677         * @param {any} showClass Zda má být nastavena třída pro zobrazení hlavičky (pokud je FALSE, třída bude odebrána)
5678         * @param {any} hideClass Zda má být nastavena třída pro skrytí hlavičky (pokud je FALSE, třída bude odebrána)
5679         */
5680        function toggleClass(showClass, hideClass) {
5681            var classList = dynamicFixHandle.getContainer().classList;
5682            if (showClass) classList.add("showHeaderOnScroll");
5683            else classList.remove("showHeaderOnScroll");
5684            if (hideClass) classList.add("hideHeaderOnScroll");
5685            else classList.remove("hideHeaderOnScroll");
5686        }
5687
5688        /** Aktualizace stavu při změně fixování hlavičky. */
5689        function updateScrollOnFix() {
5690            if (!dynamicFixHandle.isFixed()) {
5691                // pokud má být hlavička v nezafixovaném stavu, ale my ji skryli, tak ji zase zobrazíme
5692                if (hidden) {
5693                    show();
5694                }
5695
5696                // pokud jsme v odfixvaném stavu, odebereme třídy a umožníme tím utnout veškeré animace
5697                toggleClass(false, false);
5698            }
5699
5700            // skrytí povolíme pouze pokud je hlavička v zafixovaném stavu
5701            hideAllowed = dynamicFixHandle.isFixed() && !isHeaderFocused;
5702            updateState();
5703        }
5704
5705        /** Aktualizace stavu při scrollování. */
5706        function updateStateOnScroll() {
5707            // pokud je zakázáno skrývání, nic nedělat
5708            if (!hideAllowed) return;
5709
5710            // pokud nedošlo k žádnému posunu (napříkad při scrollování doprava-doleva), nic nedělat
5711            if (window.scrollY === scrollTop) return;
5712
5713            // scrollování je směrem dolů
5714            var scrollDown = window.scrollY >= scrollTop;
5715
5716            // scrollování je směrem nahoru
5717            var scrollUp = window.scrollY <= scrollTop;
5718
5719            // pokud bylo scrollování směrem dolů a hlavičku už jsme skryli, aktualizujeme stav, abychom posunuli threshold na její opětovné odkrytí
5720            if (hidden && scrollDown) updateState();
5721
5722            // naopak pokud bylo scrollování směrem nahoru a hlavička je odkrytá, tak aktualizujeme stav, abychom posunuli threshold na její skrytí
5723            if (!hidden && scrollUp) updateState();
5724
5725            // pokud sledovaný pivot pro skrytí není vidět a zároveň je povoleno skrytí hlavičky, provedeme aktualizaci stavu, pivot pro skrytí by měl být totiž vidět vždy, zřejmě došlo k prudkému odskrolu směrem nahoru
5726            if (hidePivotVisible === false && hideAllowed) updateState();
5727        }
5728
5729        /** Aktualizuje stav. */
5730        function updateState() {
5731            // uložíme si aktuální pozici prohlížeče
5732            scrollTop = window.scrollY;
5733            // offset pro zobrazení/skrytí hlavičky (použijeme aktuální výšku zafixované hlavičky)
5734            headerHideOffset = dynamicFixHandle.fixedHeight() * 1;
5735
5736            // nastavíme CSS vlastnosti, dle kterých se pozicují pivoti
5737            document.body.style.setProperty("--bs-hide-header-top", scrollTop + "px");
5738            document.body.style.setProperty("--bs-hide-header-offset", headerHideOffset + "px");
5739        }
5740
5741        /** Skryje hlavičku. */
5742        function hide() {
5743            if (!isEnabled()) return;
5744
5745            isHiddenOnScroll = true;
5746            hidden = true;
5747            toggleClass(false, true);
5748            updateState();
5749        }
5750
5751        /** Opětovně zobrazí hlavičku. */
5752        function show() {
5753            // i pokud bylo naposledy kliknuto na hlavičce povolíme zobrazení hlavičky
5754            // 122568 - i pokud se jedná o scrollování přes skript, v takovém případě chceme, aby se hlavička zobrazila, protože se může jednat o scroll na začátek stránky, problém z 114925 se nepodařilo 
5754nasimulovat, takže snad dobrý
5755            if (!isEnabled({ ignoreHeaderFocus: true, ignoreScriptScrolling: true })) return;
5756
5757            isHiddenOnScroll = false;
5758            hidden = false;
5759            toggleClass(true, false);
5760            updateState();
5761        }
5762
5763        /** Nastaví viditelnost hlavičky.
5764         * @param {any} isShow Zda se má hlavička zobrazit, jinak se skryje.
5765         */
5766        function setVisibility(isShow) {
5767            if (!hideAllowed) return;
5768            if (isShow) {
5769                // pokud je požadavek na zobrazení hlavičky, ale aktuální pozice pivotu pro zobrazení nad horní hranou viewportu (není vidět) nebudeme dělat nic, jedná se zřejmě o starý požadavek, který neodpovídá realitě
5770                if (window.scrollY > showPivot.offsetTop) return;
5771                show();
5772            } else {
5773                // pokud je požadavek na skrytí hlavičky, ale aktuální pozice pivotu pro skrytí je pod horní hranou viewportu nebudeme nic dělat, jedná se zřejmě o starý požadavek, který neodpovídá realitě
5774                if (window.scrollY < hidePivot.offsetTop) return;
5775                hide();
5776            }
5777        }
5778
5779        /** Projede události pro skrytí hlavičky z IntersectionObserveru. */
5780        function hideOnScroll(entries) {
5781            var entry = entries[0];
5782            if (entry.intersectionRatio === 0 || !entry.isIntersecting) {
5783                setVisibility(false);
5784                hidePivotVisible = false;
5785            } else {
5786                hidePivotVisible = true;
5787            }
5788        }
5789
5790        /** Projede události pro zobrazení hlavičky z IntersectionObserveru. */
5791        function showOnScroll(entries) {
5792            var entry = entries[0];
5793            if (entry.intersectionRatio > 0 || entry.isIntersecting) {
5794                setVisibility(true);
5795                showPivotVisible = true;
5796            } else {
5797                showPivotVisible = false;
5798            }
5799        }
5800
5801        /** Handler pro události kliknutí kdekoliv na stránce. */
5802        function offHeaderClick(event) {
5803            // kliknutí na hlavičku musíme zaznamenávat i když hlavička není zafixovaná, jinak by po zafixování došlo automaticky ke skrytí hlavičky
5804            //if (!hideAllowed) return;
5805
5806            // pokud se jedná o událost kliknutí, kterou již zpracoval handler pro hlavičku, pak budeme ignorovat
5807            if (lastHeaderClickEvent === event) return;
5808
5809            // pokud není focus na hlavičce, pak nebudeme dělat nic 
5810            if (!isHeaderFocused) return;
5811
5812            // v opačném případě opět povolíme skrytí hlavičky a opětovně přepočítáme thresholdy
5813            isHeaderFocused = false;
5814            updateState();
5815            lastHeaderClickEvent = null;
5816        }
5817
5818        /** Handler pro události kliknutí v hlavičce. */
5819        function onHeaderClick(event) {
5820            // kliknutí na hlavičku musíme zaznamenávat i když hlavička není zafixovaná, jinak by po zafixování došlo automaticky ke skrytí hlavičky
5821            //if (!hideAllowed) return;
5822
5823            // po kliknutí v hlavičce zakážeme její skrytí v případě scrollování, předpokládáme, že zákazník chce s hlavičkou nějakým způsobem interagovat (například rozbalil menu)
5824            isHeaderFocused = true;
5825
5826            // a uložíme si referenci na událost kvůli globálnímu handleru
5827            lastHeaderClickEvent = event;
5828        }
5829
5830        /** Nastaví veškerá potřebná naslouchání na události. */
5831        function setEventListeners() {
5832            // pokud došlo k zafixování nebo odfixování hlavičky, aktualizujeme hodnoty
5833            dynamicFixHandle.registerFix(function () { updateScrollOnFix(); });
5834            dynamicFixHandle.registerUnfix(function () { updateScrollOnFix(); });
5835
5836            // pasivní naslouchání na scroll událost ()
5837            safeAddEventListener(window, "scroll", function () { updateStateOnScroll(); }, { passive: true });
5838
5839            // událost kliknutí kdekoliv na stránce
5840            safeAddEventListener(document.body, "click", function (e) { offHeaderClick(e); });
5841
5842            // událost kliknutí v hlavičce
5843            safeAddEventListener(dynamicFixHandle.getContainer(), "click", function (e) { onHeaderClick(e); });
5844        }
5845
5846        /** Vytvoří pivoty, které následně použijeme pro sledování prahu, kdy chceme hlavičku zobrazit nebo naopak skrýt. */
5847        function initPivots() {
5848            // pivot, který pokud se dostane z viewportu (předpokládá se při směru dolů), tak dojde ke skrytí hlavičky
5849            hidePivot = safeCreateElement("bs-hide-header-pivot");
5850            hidePivot.setAttribute("style", "display: block; top: calc(max(var(--bs-hide-header-top) + var(--bs-hide-header-offset), 0px)); left: 0; right: 0; height: 1px; position: absolute; pointer-events: none; opacity: 0;");
5851            document.body.appendChild(hidePivot);
5852            var hideObserver = createIntersectionObserver(function (e) { hideOnScroll(e); }, { rootMargin: "0px 0px 0px 0px", threshold: [0, 1] });
5853            hideObserver.observe(hidePivot);
5854
5855            // pivot, který pokud se dostane do viewportu (předpokládá se směr nahoru), tak dojde k opětovnému zobrazení hlavičky
5856            showPivot = safeCreateElement("bs-hide-header-pivot");
5857            showPivot.setAttribute("style", "display: block; top: calc(max(var(--bs-hide-header-top) - var(--bs-hide-header-offset), 0px)); left: 0; right: 0; height: 1px; position: absolute; pointer-events: none; opacity: 0;");
5858            document.body.appendChild(showPivot);
5859            var showObserver = createIntersectionObserver(function (e) { showOnScroll(e); }, { rootMargin: "0px 0px 0px 0px", threshold: [0, 1] });
5860            showObserver.observe(showPivot);
5861        }
5862
5863        initPivots();
5864        setEventListeners();
5865        updateScrollOnFix();
5866
5867        // nastavíme třídu, že je možné hlavičku skrýt při scrollu
5868        dynamicFixHandle.getContainer().classList.add("canHideHeaderOnScroll");
5869        masterEl().style.setProperty("--bs-show-hide-header-animation-multiplier", "0"); // po dobu inicializace stránky vypneme animace
5870
5871        // první 2 sekundy zakážeme skrytí
5872        safeSetTimeout(function() {
5873             isInitialized = true;
5874             masterEl().style.removeProperty("--bs-show-hide-header-animation-multiplier"); // opětovně povolíme animace
5875        }, 2000);
5876    }
5877
5878    // spustíme sledování změn velikosti viewportu
5879    startResizeObserver();
5880
5881    // upravíme kotvy, aby uměli pracovat se zafixovanou hlavičkou
5882    updateAnchorOffsets();
5883
5884    // zakážeme scrollování stránky v případě, že je aktivní fixní popup se scrollem
5885    fixScrollInPopup();
5886
5887    // pokud je povoleno fixování hlavičky a její dynamické skrývání při scrollování, pak spustíme inicializaci skriptu (až po vykonání aktuální funkce ale)
5888    if (!disableHeaderFix && enableDynamicHide) {
5889        safeSetTimeout(function () { initializeFixedHeaderHideOnScroll(); }, 1);
5890    }
5891
5892    // zakážeme jakékoliv fixování hlavičky
5893    if (disableHeaderFix) {
5894        disableFixedHeader();
5895    }
5896
5897    // handler pro dynamické ovládání hlavičky
5898    FixedHeaderHandler = {
5899        disableFixedHeader: function () { disableFixedHeader(); }
5900    }
5901}
5902;// RwdPlaceholderManager.ts - skript pro podporu migrace view v responsivním frameworku.
5903/** Zavolá funkci po události DOMContentLoaded, která se zavolá po načtení a zpracování HTML. Pokud již je HTML zpracováno, pak je zavolána funkce okamžitě.
5904 *  Událost DOMContentLoaded nečeká na načtení všech obrázků/skriptů/stylů.
5905 */
5906function onHtmlLoaded(func) {
5907    if (document.readyState === "loading") {
5908        document.addEventListener("DOMContentLoaded", function () { func(); });
5909    }
5910    else {
5911        func();
5912    }
5913}
5914var NodeMap = /** @class */ (function () {
5915    function NodeMap() {
5916        this._nodes = new Array();
5917        this._values = new Array();
5918    }
5919    NodeMap.prototype.add = function (node, value) {
5920        this._nodes.push(node);
5921        this._values.push(value);
5922    };
5923    NodeMap.prototype.get = function (node) {
5924        var index = this._nodes.indexOf(node);
5925        return this._values[index];
5926    };
5927    NodeMap.prototype.addOrUpdate = function (node, value) {
5928        var index = this._nodes.indexOf(node);
5929        if (index >= 0) {
5930            this._values[index] = value;
5931        }
5932        else
5933            this.add(node, value);
5934    };
5935    NodeMap.prototype.contains = function (node) {
5936        return this._nodes.indexOf(node) >= 0;
5937    };
5938    Object.defineProperty(NodeMap.prototype, "values", {
5939        get: function () {
5940            return this._values;
5941        },
5942        enumerable: false,
5943        configurable: true
5944    });
5945    return NodeMap;
5946}());
5947var BsPlaceholderEntry = /** @class */ (function () {
5948    function BsPlaceholderEntry(view) {
5949        this.placeholders = {};
5950        this.view = view;
5951        this.id = view.id;
5952        this.tokens = [];
5953    }
5954    BsPlaceholderEntry.prototype.addPlaceholder = function (token, placeholder) {
5955        this.placeholders[token] = placeholder;
5956        if (this.tokens.indexOf(token) < 0) {
5957            this.tokens.push(token);
5958        }
5959    };
5960    BsPlaceholderEntry.prototype.removePlaceholder = function (token) {
5961        delete this.placeholders[token];
5962        this.tokens.splice(this.tokens.indexOf(token), 1);
5963    };
5964    BsPlaceholderEntry.prototype.getPlaceholder = function (token) {
5965        var placeholder = this.placeholders[token];
5966        if (placeholder) {
5967            if (document.contains(placeholder)) {
5968                return placeholder;
5969            }
5970            else {
5971                // pokud byl placeholder odebrán z DOMu, odebereme ho také
5972                this.removePlaceholder(token);
5973            }
5974        }
5975        return this.view;
5976    };
5977    return BsPlaceholderEntry;
5978}());
5979var BsPlaceholderManager = /** @class */ (function () {
5980    function BsPlaceholderManager() {
5981        // ReSharper disable once InconsistentNaming - konstanta
5982        this.PLACEHOLDER_TAG = "DC-PLACEHOLDER";
5983        // TODO reagovat na změny v DOM: +- placeholdery, +- view s nastaveným data-place-view
5984        this.init();
5985    }
5986    BsPlaceholderManager.prototype.init = function () {
5987        this.reload();
5988    };
5989    BsPlaceholderManager.prototype.reload = function () {
5990        this.views = {};
5991        this.aciveViews = {};
5992        this.viewIds = [];
5993        this.update();
5994        // Nastavíme zmigrovaná view
5995        for (var _i = 0, _a = this.viewIds; _i < _a.length; _i++) {
5996            var id = _a[_i];
5997            var view = this.views[id].view;
5998            var token = view.getAttribute("data-token");
5999            if (token) {
6000                this.setViewToken(id, token);
6001            }
6002        }
6003    };
6004    BsPlaceholderManager.prototype.update = function (added, removed) {
6005        var _this = this;
6006        if (added && removed) {
6007            if (removed.length > 0 && !this.checkAlive()) {
6008                this.reload();
6009                return;
6010            }
6011            var addedPlaceholders = added.filter(function (e) { return e.tagName === _this.PLACEHOLDER_TAG; });
6012            this.updatePlaceholders(addedPlaceholders);
6013        }
6014        else {
6015            var placeholders = document.getElementsByTagName(this.PLACEHOLDER_TAG);
6016            this.updatePlaceholders(placeholders);
6017        }
6018    };
6019    BsPlaceholderManager.prototype.updatePlaceholders = function (added) {
6020        for (var i = 0; i < added.length; i++) {
6021            var placeholder = added[i];
6022            var viewId = placeholder.getAttribute("data-place-view");
6023            var view = document.getElementById(viewId);
6024            if (!view) {
6025                console.warn("P\u0159eskakuji p\u0159id\u00E1v\u00E1n\u00ED placeholderu. View s id '" + viewId + "' nenalezeno.", placeholder);
6026                continue;
6027            }
6028            var token = placeholder.getAttribute("data-place-token");
6029            if (!token) {
6030                console.warn("P\u0159eskakuji p\u0159id\u00E1v\u00E1n\u00ED placeholderu. Placeholder nem\u00E1 nastaven token.", placeholder);
6031                continue;
6032            }
6033            var viewEntry = this.getOrCreateView(view.id, view);
6034            viewEntry.addPlaceholder(token, placeholder);
6035        }
6036    };
6037    BsPlaceholderManager.prototype.checkAlive = function () {
6038        for (var _i = 0, _a = this.viewIds; _i < _a.length; _i++) {
6039            var id = _a[_i];
6040            var entry = this.views[id];
6041            var view = entry.view;
6042            if (!document.contains(view))
6043                return false;
6044            for (var _b = 0, _c = entry.tokens; _b < _c.length; _b++) {
6045                var token = _c[_b];
6046                var placehodler = entry.getPlaceholder(token);
6047                if (!document.contains(placehodler))
6048                    return false;
6049            }
6050        }
6051        return true;
6052    };
6053    BsPlaceholderManager.prototype.getOrCreateView = function (id, view) {
6054        if (this.views[id])
6055            return this.views[id];
6056        var viewEntry = new BsPlaceholderEntry(view);
6057        this.views[id] = viewEntry;
6058        this.viewIds.push(id);
6059        return viewEntry;
6060    };
6061    BsPlaceholderManager.prototype.tryGetView = function (id) {
6062        var placeholders = document.querySelectorAll(this.PLACEHOLDER_TAG + "[data-place-view='" + id + "']");
6063        if (placeholders && placeholders.length) {
6064            this.updatePlaceholders(placeholders);
6065            var view = this.views[id];
6066            return view;
6067        }
6068        return null;
6069    };
6070    BsPlaceholderManager.prototype.getView = function (id) {
6071        var view = this.views[id];
6072        if (!view) {
6073            view = this.tryGetView(id);
6074        }
6075        return view;
6076    };
6077    BsPlaceholderManager.prototype.setViewToken = function (id, token) {
6078        var mvcCore = window.mvcCore;
6079        if (!mvcCore)
6080            return;
6081        if (!token) {
6082            if (this.aciveViews[id]) {
6083                delete this.aciveViews[id];
6084                mvcCore.setMigratedViews(this.aciveViews);
6085            }
6086        }
6087        else {
6088            this.aciveViews[id] = token;
6089            mvcCore.setMigratedViews(this.aciveViews);
6090        }
6091    };
6092    return BsPlaceholderManager;
6093}());
6094// TODO tuto třídu by pak šlo obecně použít i pro jiný JavaScript, který potřebuje sledovat změny u vybraných prvků kdekoliv na stránce specifikovaných konkrétním atributem/třídou (například RwdFixedHeader)
6095var BsDomMutationEntry = /** @class */ (function () {
6096    function BsDomMutationEntry(target, added) {
6097        this.target = target;
6098        this.added = added;
6099    }
6100    Object.defineProperty(BsDomMutationEntry.prototype, "isAdded", {
6101        get: function () { return this.added; },
6102        enumerable: false,
6103        configurable: true
6104    });
6105    Object.defineProperty(BsDomMutationEntry.prototype, "isRemoved", {
6106        get: function () { return !this.added; },
6107        enumerable: false,
6108        configurable: true
6109    });
6110    BsDomMutationEntry.parseRecords = function (records, added, removed, attributes) {
6111        var entries = new Array();
6112        for (var _i = 0, records_1 = records; _i < records_1.length; _i++) {
6113            var record = records_1[_i];
6114            // nejprve projedeme odebrané prvky, je totiž možné, že došlo pouze k přesunu v takovém případě bude v obou seznamech
6115            this.parseNodeList(record.removedNodes, entries, attributes, false);
6116            // poté zpracujeme všechny přidané prvky
6117            this.parseNodeList(record.addedNodes, entries, attributes, true);
6118        }
6119        for (var _a = 0, entries_1 = entries; _a < entries_1.length; _a++) {
6120            var entry = entries_1[_a];
6121            if (entry.isAdded)
6122                added.push(entry.target);
6123            if (entry.isRemoved)
6124                removed.push(entry.target);
6125        }
6126    };
6127    BsDomMutationEntry.parseNodeList = function (nodeList, array, attributes, add) {
6128        for (var i = 0; i < nodeList.length; i++) {
6129            var node = nodeList[i];
6130            // pokud chceme sledovat změny musíme projet celý DOM strom, nelze totiž nastavit v javascriptu hlídání jednotlivých prvků
6131            this.parseNodeList(node.childNodes, array, attributes, add);
6132            var el = node;
6133            if (node.nodeType === node.ELEMENT_NODE) {
6134                var match = false;
6135                // otestujeme zda odpovídá alespoň jednomu z povinných atributů
6136                for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) {
6137                    var attribute = attributes_1[_i];
6138                    if (el.getAttribute(attribute)) {
6139                        match = true;
6140                        break;
6141                    }
6142                }
6143                if (!match)
6144                    continue;
6145                var found = false;
6146                for (var j = 0; j < array.length; j++) {
6147                    var entry = array[j];
6148                    if (entry.target === node) {
6149                        // pokud byl prvek předtím odebrán a nyní přidán, chápeme to jako přesun, záznam tedy odebereme
6150                        if (add && entry.isRemoved)
6151                            array.splice(j, 1);
6152                        found = true;
6153                        break;
6154                    }
6155                }
6156                if (!found) {
6157                    array.push(new BsDomMutationEntry(el, add));
6158                }
6159            }
6160        }
6161    };
6162    return BsDomMutationEntry;
6163}());
6164var BsAttributeMutationEntry = /** @class */ (function () {
6165    function BsAttributeMutationEntry(target, oldValue, newValue, attribute) {
6166        this.target = target;
6167        this.oldValue = oldValue;
6168        this.newValue = newValue;
6169        this.attribute = attribute;
6170    }
6171    /** Zpracuje záznamy z MutationObserver pro daný atribut. K záznamům přidá starou hodnotu a novou hodnotu.
6172     */
6173    BsAttributeMutationEntry.parseRecords = function (records, attribute) {
6174        var result = new Array();
6175        var lastEntries = new NodeMap();
6176        for (var _i = 0, records_2 = records; _i < records_2.length; _i++) {
6177            var record = records_2[_i];
6178            // zpracujeme pouze záznamy týkající se našeho atributu
6179            if (record.attributeName !== attribute)
6180                continue;
6181            var target = record.target;
6182            if (lastEntries.contains(target)) {
6183                lastEntries.get(target).newValue = record.oldValue;
6184            }
6185            var entry = new BsAttributeMutationEntry(target, record.oldValue, null, attribute);
6186            result.push(entry);
6187            lastEntries.addOrUpdate(target, entry);
6188        }
6189        for (var _a = 0, _b = lastEntries.values; _a < _b.length; _a++) {
6190            var entry = _b[_a];
6191            var newValue = entry.target.getAttribute(attribute);
6192            entry.newValue = newValue;
6193        }
6194        return result;
6195    };
6196    return BsAttributeMutationEntry;
6197}());
6198(function () {
6199    // test zda se jedná o IE - u IE se nepoužívají změny breakpointů, není tak potřeba tento skript spouštět
6200    var isIe = window.MSStyleCSSProperties;
6201    if (isIe) {
6202        onHtmlLoaded(function () {
6203            removeToBeMigratedStyleTag();
6204        });
6205        return;
6206    }
6207    var placeholderManager = new BsPlaceholderManager();
6208    function placeChange(mutations, _) {
6209        /* Nejdříve je potřeba předzpracovat všechny přišlé Mutations, může se totiž stát, že je třída nastavena a hned zase odnastavena, dojde tak k selhání u první příchozí
6210         * mutation entry, která má zaznamenánu pouze původní hodnotu, ale nová hodnota je již ztracena, protože došlo k jejímu p
6210řenastavení v následující mutation entry.
6211         * Poté lze zpracovávat události jednu po druhé.
6212         */
6213        try {
6214            var entries = BsAttributeMutationEntry.parseRecords(mutations, "data-place");
6215            for (var i = 0; i < entries.length; i++) {
6216                var entry = entries[i];
6217                var view = placeholderManager.getView(entry.target.id);
6218                if (!view) {
6219                    // na stránce není žádný placeholder pro toto view nebo toto view nebylo nalezeno
6220                    console.warn(entry, "nebyl nalezen žádný placeholder nebo view.");
6221                    continue;
6222                }
6223                if (entry.newValue === entry.oldValue) {
6224                    console.warn(view, entry, "nová hodnota se rovná staré hodnotě, to by se asi nemělo stávat.");
6225                    continue;
6226                }
6227                swapElements(view.view, view.getPlaceholder(entry.oldValue));
6228                swapElements(view.view, view.getPlaceholder(entry.newValue));
6229                setPlaceClass(view, entry.newValue);
6230                placeholderManager.setViewToken(view.id, entry.newValue);
6231            }
6232        }
6233        finally {
6234            removeToBeMigratedStyleTag();
6235        }
6236    }
6237    function swapElements(source, target) {
6238        if (source === target)
6239            return;
6240        var sourceParent = source.parentNode;
6241        var targetParent = target.parentNode;
6242        var sourceNextSibling = source.nextSibling;
6243        var targetNextSibling = target.nextSibling;
6244        if (sourceNextSibling) {
6245            sourceParent.insertBefore(target, sourceNextSibling);
6246        }
6247        else {
6248            sourceParent.appendChild(target);
6249        }
6250        if (targetNextSibling) {
6251            targetParent.insertBefore(source, targetNextSibling);
6252        }
6253        else {
6254            targetParent.appendChild(source);
6255        }
6256    }
6257    function setPlaceClass(viewEntry, newValue) {
6258        var view = viewEntry.view;
6259        view.classList.remove("bsPlaceMigrated");
6260        if (viewEntry.getPlaceholder(newValue) !== view) {
6261            view.classList.add("bsPlaceMigrated");
6262        }
6263    }
6264    function removeToBeMigratedStyleTag() {
6265        /* Odebere styl skrývající prvky, které jsou určeny k přesunu. */
6266        var styleTag = document.getElementById("bs_toBeMigrated_style");
6267        if (styleTag && styleTag.parentNode) {
6268            styleTag.parentNode.removeChild(styleTag);
6269        }
6270    }
6271    onHtmlLoaded(function () {
6272        placeholderManager.update();
6273        var placeObserver = new MutationObserver(placeChange);
6274        var body = document.body;
6275        var config = { attributes: true, subtree: true, attributeFilter: ["data-place"], attributeOldValue: true };
6276        placeObserver.observe(body, config);
6277        /* OK: Pro hlídání změn v DOMu => odebrní a nebo přidávní placeholderů - řešení je velice komplikované a ideálně by bylo nejlepší se mu úplně vyhnout, ale může nastat
6278           hlavně v případě, že AJAXem aktualizujeme celé view ve kterém je placeholder a nebo migrující view po přesunu. Pokud došlo k přesunu view, pak mohlo dojít ke dvojímu
6279           vyrenderování stejného view a nebo stejného placeholderu a úplné ztrátě View.
6280           Řešení je takové, že řekneme serveru jaká view byla přesunuta a ten pak vyrenderuje místo view dané placeholder a samotné View může aktualizovat samostatně.
6281           PlaceholderManager si pak jenom aktualizuje odkazy na HTML prvky.*/
6282        function domChange(mutations) {
6283            var added = new Array();
6284            var removed = new Array();
6285            BsDomMutationEntry.parseRecords(mutations, added, removed, ["data-place", "data-place-token"]);
6286            if (added.length > 0 || removed.length > 0) {
6287                placeholderManager.update(added, removed);
6288            }
6289        }
6290        var domChangeObserver = new MutationObserver(domChange);
6291        domChangeObserver.observe(body, { childList: true, subtree: true });
vendor: 4,303 bytes, lines 6292-6295
6292    });
6293})();
6294
6295;!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){t.ui=t.ui||{};t.ui.version="1.12.1";var e,s=0,i=Array.prototype.slice;t.cleanData=(e=t.cleanData,function(s){var i,o,n;for(n=0;null!=(o=s[n]);n++)try{(i=t._data(o,"events"))&&i.remove&&t(o).triggerHandler("remove")}catch(t){}e(s)}),t.widget=function(e,s,i){var o,n,r,a={},l=e.split(".")[0],h=l+"-"+(e=e.split(".")[1]);return i||(i=s,s=t.Widget),t.isArray(i)&&(i=t.extend.apply(null,[{}].concat(i))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},o=t[l][e],n=t[l][e]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},t.extend(n,o,{version:i.version,_proto:t.extend({},i),_childConstructors:[]}),(r=new s).options=t.widget.extend({},r.options),t.each(i,function(e,i){t.isFunction(i)?a[e]=function(){function t(){return s.prototype[e].apply(this,arguments)}function o(t){return s.prototype[e].apply(this,t)}return function(){var e,s=this._super,n=this._superApply;return this._super=t,this._superApply=o,e=i.apply(this,arguments),this._super=s,this._superApply=n,e}}():a[e]=i}),n.prototype=t.widget.extend(r,{widgetEventPrefix:o&&r.widgetEventPrefix||e},a,{constructor:n,namespace:l,widgetName:e,widgetFullName:h}),o?(t.each(o._childConstructors,function(e,s){var i=s.prototype;t.widget(i.namespace+"."+i.widgetName,n,s._proto)}),delete o._childConstructors):s._childConstructors.push(n),t.widget.bridge(e,n),n},t.widget.extend=function(e){for(var s,o,n=i.call(arguments,1),r=0,a=n.length;r<a;r++)for(s in n[r])o=n[r][s],n[r].hasOwnProperty(s)&&void 0!==o&&(t.isPlainObject(o)?e[s]=t.isPlainObject(e[s])?t.widget.extend({},e[s],o):t.widget.extend({},o):e[s]=o);return e},t.widget.bridge=function(e,s){var o=s.prototype.widgetFullName||e;t.fn[e]=function(n){var r="string"==typeof n,a=i.call(arguments,1),l=this;return r?this.length||"instance"!==n?this.each(function(){var s,i=t.data(this,o);return"instance"===n?(l=i,!1):i?t.isFunction(i[n])&&"_"!==n.charAt(0)?(s=i[n].apply(i,a))!==i&&void 0!==s?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):void 0:t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+n+"'")}):l=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,o);e?(e.option(n||{}),e._init&&e._init()):t.data(this,o,new s(n,this))})),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,s){e._removeClass(s,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,s){var i,o,n,r=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(r={},i=e.split("."),e=i.shift(),i.length){for(o=r[e]=t.widget.extend({},this.options[e]),n=0;n<i.length-1;n++)o[i[n]]=o[i[n]]||{},o=o[i[n]];if(e=i.pop(),1===arguments.length)return void 0===o[e]?null:o[e];o[e]=s}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];r[e]=s}return this._setOptions(r),this},_setOptions:function(t){var e;
vendor: 14,087 bytes, line 6295
6295for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var s,i,o;for(s in e)o=this.classesElementLookup[s],e[s]!==this.options.classes[s]&&o&&o.length&&(i=t(o.get()),this._removeClass(o,s),i.addClass(this._classes({element:i,keys:s,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(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(e){var s=[],i=this;function o(o,n){var r,a;for(a=0;a<o.length;a++)r=i.classesElementLookup[o[a]]||t(),r=e.add?t(t.unique(r.get().concat(e.element.get()))):t(r.not(e.element).get()),i.classesElementLookup[o[a]]=r,s.push(o[a]),n&&e.classes[o[a]]&&s.push(e.classes[o[a]])}return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&o(e.keys.match(/\S+/g)||[],!0),e.extra&&o(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var s=this;t.each(s.classesElementLookup,function(i,o){-1!==t.inArray(e.target,o)&&(s.classesElementLookup[i]=t(o.not(e.target).get()))})},_removeClass:function(t,e,s){return this._toggleClass(t,e,s,!1)},_addClass:function(t,e,s){return this._toggleClass(t,e,s,!0)},_toggleClass:function(t,e,s,i){i="boolean"==typeof i?i:s;var o="string"==typeof t||null===t,n={extra:o?e:s,keys:o?t:e,element:o?this.element:t,add:i};return n.element.toggleClass(this._classes(n),i),this},_on:function(e,s,i){var o,n=this;"boolean"!=typeof e&&(i=s,s=e,e=!1),i?(s=o=t(s),this.bindings=this.bindings.add(s)):(i=s,s=this.element,o=this.widget()),t.each(i,function(i,r){function a(){if(e||!0!==n.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof r?n[r]:r).apply(n,arguments)}"string"!=typeof r&&(a.guid=r.guid=r.guid||a.guid||t.guid++);var l=i.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+n.eventNamespace,p=l[2];p?o.on(h,p,a):s.on(h,a)})},_off:function(e,s){s=(s||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(s).off(s),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){var s=this;return setTimeout(function(){return("string"==typeof t?s[t]:t).apply(s,arguments)},e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,s,i){var o,n,r=this.options[e];if(i=i||{},(s=t.Event(s)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),s.target=this.element[0],n=s.originalEvent)for(o in n)o in s||(s[o]=n[o]);return this.element.trigger(s,i),!(t.isFunction(r)&&!1===r.apply(this.element[0],[s].concat(i))||s.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,s){t.Widget.prototype["_"+e]=function(i,o,n){var r;"string"==typeof o&&(o={effect:o});var a=o?!0===o||"number"==typeof o?s:o.effect||s:e;"number"==typeof(o=o||{})&&(o={duration:o}),r=!t.isEmptyObject(o),o.complete=n,o.delay&&i.delay(o.delay),r&&t.effects&&t.effects.effect[a]?i[e](o):a!==e&&i[a]?i[a](o.duration,o.easing,n):i.queue(function(s){t(this)[e](),n&&n.call(i[0]),s()})}});t.widget,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(s){return!!t.data(s,e)}}):function(e,s,i){return!!t.data(e,i[3])}}),t.fn.scrollParent=function(e){var s=this.css("position"),i="absolute"===s,o=e?/(auto|scroll|hidden)/:/(auto|scroll)/,n=this.parents().filter(function(){var e=t(this);return(!i||"static"!==e.css("position"))&&o.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==s&&n.length?n:t(this[0].ownerDocument||document)},t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var o=!1;t(document).on("mouseup",function(){o=!1});t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(s){if(!0===t.data(s.target,e.widgetName+".preventClickEvent"))return t.removeData(s.target,e.widgetName+".preventClickEvent"),s.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(e){if(!o){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var s=this,i=1===e.which,n=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(i&&!n&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),o=!0,!0))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,o=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,s,i){var o,n=t.ui[e].prototype;for(o in i)n.plugins[o]=n.plugins[o]||[],n.plugins[o].push([s,i[o]])},call:function(t,e,s,i){var o,n=t.plugins[e];if(n&&(i||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<n.length;o++)t.options[n[o][0]]&&n[o][1].apply(t.element,s)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(s){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")};t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",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(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(e){var s=this.options;return!(this.helper||s.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===s.iframeFix?"iframe":s.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var s=t.ui.safeActiveElement(this.document[0]);t(e.target).closest(s).length||t.ui.safeBlur(s)},_mouseStart:function(e){var s=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.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=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){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:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,s){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!s){var i=this._uiHash();if(!1===this._trigger("drag",e,i))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=i.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var s=this,i=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(i=t.ui.ddmanager.drop(this,e)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==s._trigger("stop",e)&&s._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.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(e){var s=this.options,i=t.isFunction(s.helper),o=i?t(s.helper.apply(this.element[0],[e])):"clone"===s.helper?this.element.clone().removeAttr("id"):this.element;return o.parents("body").length||o.appendTo("parent"===s.appendTo?this.element[0].parentNode:s.appendTo),i&&o[0]===this.element[0]&&this._setPositionRelative(),o[0]===this.element[0]||/(fixed|absolute)/.test(o.css("position"))||o.css("position","absolute"),o},_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(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in 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(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),s=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==s&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRo
vendor: 4,335 bytes, line 6295
6295otNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?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 e,s,i,o=this.options,n=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),(i=(s=t(o.containment))[0])&&(e=/(scroll|auto)/.test(s.css("overflow")),this.containment=[(parseInt(s.css("borderLeftWidth"),10)||0)+(parseInt(s.css("paddingLeft"),10)||0),(parseInt(s.css("borderTopWidth"),10)||0)+(parseInt(s.css("paddingTop"),10)||0),(e?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(s.css("borderRightWidth"),10)||0)-(parseInt(s.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(s.css("borderBottomWidth"),10)||0)-(parseInt(s.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=s)):this.containment=o.containment:this.containment=[0,0,t(n).width()-this.helperProportions.width-this.margins.left,(t(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e||(e=this.position);var s="absolute"===t?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.offset.scroll.top:i?0:this.offset.scroll.top)*s,left:e.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.offset.scroll.left:i?0:this.offset.scroll.left)*s}},_generatePosition:function(t,e){var s,i,o,n,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return a&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(i=this.relativeContainer.offset(),s=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):s=this.containment,t.pageX-this.offset.click.left<s[0]&&(l=s[0]+this.offset.click.left),t.pageY-this.offset.click.top<s[1]&&(h=s[1]+this.offset.click.top),t.pageX-this.offset.click.left>s[2]&&(l=s[2]+this.offset.click.left),t.pageY-this.offset.click.top>s[3]&&(h=s[3]+this.offset.click.top)),r.grid&&(o=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,h=s?o-this.offset.click.top>=s[1]||o-this.offset.click.top>s[3]?o:o-this.offset.click.top>=s[1]?o-r.grid[1]:o+r.grid[1]:o,n=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,l=s?n-this.offset.click.left>=s[0]||n-this.offset.click.left>s[2]?n:n-this.offset.click.left>=s[0]?n-r.grid[0]:n+r.grid[0]:n),"y"===r.axis&&(l=this.originalPageX),"x"===r.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:a?0:this.offset.scroll.top),left
vendor: 4,505 bytes, line 6295
6295:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:a?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(e,s,i){return i=i||this._uiHash(),t.ui.plugin.call(this,e,[s,i,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,s,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,s,i){var o=t.extend({},s,{item:i.element});i.sortables=[],t(i.options.connectToSortable).each(function(){var s=t(this).sortable("instance");s&&!s.options.disabled&&(i.sortables.push(s),s.refreshPositions(),s._trigger("activate",e,o))})},stop:function(e,s,i){var o=t.extend({},s,{item:i.element});i.cancelHelperRemoval=!1,t.each(i.sortables,function(){this.isOver?(this.isOver=0,i.cancelHelperRemoval=!0,this.cancelHelperRemoval=!1,this._storedCSS={position:this.placeholder.css("position"),top:this.placeholder.css("top"),left:this.placeholder.css("left")},this._mouseStop(e),this.options.helper=this.options._helper):(this.cancelHelperRemoval=!0,this._trigger("deactivate",e,o))})},drag:function(e,s,i){t.each(i.sortables,function(){var o=!1,n=this;n.positionAbs=i.positionAbs,n.helperProportions=i.helperProportions,n.offset.click=i.offset.click,n._intersectsWith(n.containerCache)&&(o=!0,t.each(i.sortables,function(){return this.positionAbs=i.positionAbs,this.helperProportions=i.helperProportions,this.offset.click=i.offset.click,this!==n&&this._intersectsWith(this.containerCache)&&t.contains(n.element[0],this.element[0])&&(o=!1),o})),o?(n.isOver||(n.isOver=1,i._parent=s.helper.parent(),n.currentItem=s.helper.appendTo(n.element).data("ui-sortable-item",!0),n.options._helper=n.options.helper,n.options.helper=function(){return s.helper[0]},e.target=n.currentItem[0],n._mouseCapture(e,!0),n._mouseStart(e,!0,!0),n.offset.click.top=i.offset.click.top,n.offset.click.left=i.offset.click.left,n.offset.parent.left-=i.offset.parent.left-n.offset.parent.left,n.offset.parent.top-=i.offset.parent.top-n.offset.parent.top,i._trigger("toSortable",e),i.dropped=n.element,t.each(i.sortables,function(){this.refreshPositions()}),i.currentItem=i.element,n.fromOutside=i),n.currentItem&&(n._mouseDrag(e),s.position=n.position)):n.isOver&&(n.isOver=0,n.cancelHelperRemoval=!0,n.options._revert=n.options.revert,n.options.revert=!1,n._trigger("out",e,n._uiHash(n)),n._mouseStop(e,!0),n.options.revert=n.options._revert,n.options.helper=n.options._helper,n.placeholder&&n.placeholder.remove(),s.helper.appendTo(i._parent),i._refreshOffsets(e),s.position=i._generatePosition(e,!0),i._trigger("fromSortable",e),i.dropped=!1,t.each(i.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,s,i){var o=t("body"),n=i.options;o.css("cursor")&&(n._cursor=o.css("cursor")),o.css("cursor",n.cursor)},stop:function(e,s,i){var o=i.options;o._cursor&&t("body").css("cursor",o._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,s,i){var o=t(s.helper),n=i.options;o.css("opacity")&&(n._opacity=o.css("opacity")),o.css("opacity",n.opacity)},stop:function(e,s,i){var o=i.options;o._opacity&&t(s.helper).css("opacity",o._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,s){s.scrollParentNotHidden||(s.scrollParentNotHidden=s.helper.scrollParent(!1)),s.scrollParentNotHidden[0]!==s.document[0]&&"HTML"!==s.scrollParentNotHidden[0].tagName&&(s.overflowOffset=s.scrollParentNotHidden.offset())},drag:function(e,s,i){var o=i.options,n=!1,r=i.scrollParentNotHidden[0],a=i.document[0];r!==a&&"HTML"!==r.tagName?(o.axis&&"x"===o.axis||(i.overflowOffset.top+r.offsetHeight-e.pageY<o.scrollSensitivity?r.scrollTop=n=r.scrollTop+o.scrollSpeed:e.pageY-i.overflowOffset.top<o.scrollSensitivity&&(r.scrollTop=n=r.scrollTop-o.scrollSpeed)),o.axis&&"y"===o.axis||(i.overflowOffset.left+r.offsetWidth-e.pageX<o.scrollSensitivity?r.scrollLeft=n=r.scrollLeft+o.scrollSpeed:e.pageX-i.overflowOffset.left<o.scrollSensitivity&&(r.scrollLeft=n=r.scrollLeft-o.scrollSpeed))):(o.axis&&"x"===o.axis||(e.pageY-t
vendor: 9,002 bytes, line 6295
6295(a).scrollTop()<o.scrollSensitivity?n=t(a).scrollTop(t(a).scrollTop()-o.scrollSpeed):t(window).height()-(e.pageY-t(a).scrollTop())<o.scrollSensitivity&&(n=t(a).scrollTop(t(a).scrollTop()+o.scrollSpeed))),o.axis&&"y"===o.axis||(e.pageX-t(a).scrollLeft()<o.scrollSensitivity?n=t(a).scrollLeft(t(a).scrollLeft()-o.scrollSpeed):t(window).width()-(e.pageX-t(a).scrollLeft())<o.scrollSensitivity&&(n=t(a).scrollLeft(t(a).scrollLeft()+o.scrollSpeed)))),!1!==n&&t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,s,i){var o=i.options;i.snapElements=[],t(o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var e=t(this),s=e.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:s.top,left:s.left})})},drag:function(e,s,i){var o,n,r,a,l,h,p,c,u,f,d=i.options,g=d.snapTolerance,m=s.offset.left,v=m+i.helperProportions.width,_=s.offset.top,b=_+i.helperProportions.height;for(u=i.snapElements.length-1;u>=0;u--)h=(l=i.snapElements[u].left-i.margins.left)+i.snapElements[u].width,c=(p=i.snapElements[u].top-i.margins.top)+i.snapElements[u].height,v<l-g||m>h+g||b<p-g||_>c+g||!t.contains(i.snapElements[u].item.ownerDocument,i.snapElements[u].item)?(i.snapElements[u].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[u].item})),i.snapElements[u].snapping=!1):("inner"!==d.snapMode&&(o=Math.abs(p-b)<=g,n=Math.abs(c-_)<=g,r=Math.abs(l-v)<=g,a=Math.abs(h-m)<=g,o&&(s.position.top=i._convertPositionTo("relative",{top:p-i.helperProportions.height,left:0}).top),n&&(s.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),r&&(s.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left),a&&(s.position.left=i._convertPositionTo("relative",{top:0,left:h}).left)),f=o||n||r||a,"outer"!==d.snapMode&&(o=Math.abs(p-_)<=g,n=Math.abs(c-b)<=g,r=Math.abs(l-m)<=g,a=Math.abs(h-v)<=g,o&&(s.position.top=i._convertPositionTo("relative",{top:p,left:0}).top),n&&(s.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),r&&(s.position.left=i._convertPositionTo("relative",{top:0,left:l}).left),a&&(s.position.left=i._convertPositionTo("relative",{top:0,left:h-i.helperProportions.width}).left)),!i.snapElements[u].snapping&&(o||n||r||a||f)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,e,t.extend(i._uiHash(),{snapItem:i.snapElements[u].item})),i.snapElements[u].snapping=o||n||r||a||f)}}),t.ui.plugin.add("draggable","stack",{start:function(e,s,i){var o,n=i.options,r=t.makeArray(t(n.stack)).sort(function(e,s){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(s).css("zIndex"),10)||0)});r.length&&(o=parseInt(t(r[0]).css("zIndex"),10)||0,t(r).each(function(e){t(this).css("zIndex",o+e)}),this.css("zIndex",o+r.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,s,i){var o=t(s.helper),n=i.options;o.css("zIndex")&&(n._zIndex=o.css("zIndex")),o.css("zIndex",n.zIndex)},stop:function(e,s,i){var o=i.options;o._zIndex&&t(s.helper).css("zIndex",o._zIndex)}});t.ui.draggable;t.widget("ui.droppable",{version:"1.12.1",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,s=this.options,i=s.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(i)?i:function(t){return t.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(s.scope),s.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,s){if("accept"===e)this.accept=t.isFunction(s)?s:function(t){return t.is(s)};else if("scope"===e){var i=t.ui.ddmanager.droppables[this.options.scope];this._splice(i),this._addToManager(s)}this._super(e,s)},_activate:function(e){var s=t.ui.ddmanager.current;this._addActiveClass(),s&&this._trigger("activate",e,this.ui(s))},_deactivate:function(e){var s=t.ui.ddmanager.current;this._removeActiveClass(),s&&this._trigger("deactivate",e,this.ui(s))},_over:function(e){var s=t.ui.ddmanager.current;s&&(s.currentItem||s.element)[0]!==this.element[0]&&this.accept.call(this.element[0],s.currentItem||s.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(s)))},_out:function(e){var s=t.ui.ddmanager.current;s&&(s.currentItem||s.element)[0]!==this.element[0]&&this.accept.call(this.element[0],s.currentItem||s.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(s)))},_drop:function(e,s){var i=s||t.ui.ddmanager.current,o=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var s=t(this).droppable("instance");if(s.options.greedy&&!s.options.disabled&&s.options.scope===i.options.scope&&s.accept.call(s.element[0],i.currentItem||i.element)&&n(i,t.extend(s,{offset:s.element.offset()}),s.options.tolerance,e))return o=!0,!1}),!o&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.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")}});var n=t.ui.intersect=function(){function t(t,e,s){return t>=e&&t<e+s}return function(e,s,i,o){if(!s.offset)return!1;var n=(e.positionAbs||e.position.absolute).left+e.margins.left,r=(e.positionAbs||e.position.absolute).top+e.margins.top,a=n+e.helperProportions.width,l=r+e.helperProportions.height,h=s.offset.left,p=s.offset.top,c=h+s.proportions().width,u=p+s.proportions().height;switch(i){case"fit":return h<=n&&a<=c&&p<=r&&l<=u;case"intersect":return h<n+e.helperProportions.width/2&&a-e.helperProportions.width/2<c&&p<r+e.helperProportions.height/2&&l-e.helperProportions.height/2<u;case"pointer":return t(o.pageY,p,s.proportions().height)&&t(o.pageX,h,s.proportions().width);case"touch":return(r>=p&&r<=u||l>=p&&l<=u||r<p&&l>u)&&(n>=h&&n<=c||a>=h&&a<=c||n<h&&a>c);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,s){var i,o,n=t.ui.ddmanager.droppables[e.options.scope]||[],r=s?s.type:null,a=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||e&&!n[i].accept.call(n[i].element[0],e.currentItem||e.element))){for(o=0;o<a.length;o++)if(a[o]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===r&&n[i]._activate.call(n[i],s),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(e,s){var i=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&n(e,this,this.options.tolerance,s)&&(i=this._drop.call(this,s)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,s)))}),i},dragStart:function(e,s){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,s)})},drag:function(e,s){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,s),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var i,o,r,a=n(e,this,this.options.tolerance,s),l=!a&&this.isover?"isout":a&&!this.isover?"isover":null;l&&(this.options.greedy&&(o=this.options.scope,(r=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===o})).length&&((i=t(r[0]).droppable("instance")).greedyChild="isover"===l)),i&&"isover"===l&&(i.isover=!1,i.isout=!0,i._out.call(i,s)),this[l]=!0,this["isout"===l?"isover":"isout"]=!1,this["isover"===l?"_over":"_out"].call(this,s),i&&"isout"===l&&(i.isout=!1,i.isover=!0,i._over.call(i,s)))}})},dragStop:function(e,s){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,s)}},!1!==t.uiBackCompat&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1}
6295,_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)}});t.ui.droppable});
6296;//script pro OfferDetailView a OfferDetailItemsView
6297
6298function OfferDetailInit(viewId) {
6299    var viewEl = document.getElementById(viewId);
6300    if (viewEl == null) return;
6301    var view = mvcUi.getView(viewId);
6302
6303    checkActionButtonsFixedPosition();
6304
6305    $(document).scroll(function () {
6306        checkActionButtonsFixedPosition();
6307
6308    });
6309
6310    function checkActionButtonsFixedPosition() {
6311        var bottomPosition = view.$('.dcOfferButtons').position().top + view.$('.dcOfferButtons').outerHeight();
6312        var wHeight = $(window).height();
6313        var scrollTop = $(window).scrollTop();
6314        var windowBottomPosition = wHeight + scrollTop;
6315        var offset = Math.abs(bottomPosition - windowBottomPosition);
6316        if (offset < 60) {
6317            view.$('.dcOfferButtons').addClass('fixed');
6318        } else {
6319            view.$('.dcOfferButtons').removeClass('fixed');
6320        }
6321    }
6322
6323}
6324
6325function SetSelectedItemIdsJson(viewId, buttonId) {
6326    var viewEl = document.getElementById(viewId);
6327    if (viewEl == null) return false;
6328
6329    var view = mvcUi.getView(viewId);
6330
6331    var items = new Array();
6332
6333    view.$('.cbSelector').each(function () {
6334
6335        if ($(this).prop("checked")) {
6336            var itemId = $(this).attr("data-id");
6337            items.push(itemId);
6338        }
6339    });
6340    if (items.length > 0) {
6341        var data = JSON.stringify(items);
6342        view.$("#" + buttonId).attr("data-json", data);
6343
6344        return true;
6345    }
6346    return false;
6347}
6348
6349function PromptEmail(viewId, buttonId, message) {
6350    var viewEl = document.getElementById(viewId);
6351    if (viewEl == null) return false;
6352
6353    var view = mvcUi.getView(viewId);
6354
6355    var value = prompt(message, "");
6356
6357    if (value !== "") {
6358        view.$("#" + buttonId).attr("data-value", value);
6359
6360        return true;
6361    }
6362    return false;
6363}
6364
6365
6366function OfferDetailItemsInit(viewId, dropActionData) {
6367
6368    var viewEl = document.getElementById(viewId);
6369    if (viewEl == null) return;
6370
6371    var view = mvcUi.getView(viewId);
6372
6373    view.$(".table > .item").draggable({
6374        revert: false,
6375        helper: "clone",
6376        appendTo: "body",
6377        handle: ".sortHandle",
6378        zindex: 100,
6379        distance: 1,
6380        refreshPositions: false,
6381        cursorAt: { left: 0, top: -15 },
6382        start: function (e, ui) {
6383            $(this).addClass('dragging');
6384            $(ui.helper).addClass("ui-draggable-helper");
6385        },
6386        stop: function () {
6387            $(this).removeClass('dragging');
6388        }
6389
6390    });
6391
6392    view.$(".table > .item").droppable({
6393        greedy: true,
6394        tolerance: "pointer",
6395        over: function () {
6396            $(this).addClass('over');
6397        },
6398        out: function () {
6399            $(this).removeClass('over');
6400        },
6401        drop: function (event, ui) {
6402            //console.log(dropActionData);
6403            mvcCore.invokeAction(dropActionData, null, viewId);
6404            $(this).removeClass('over');
6405        }
6406    });
6407
6408
6409    view.$('.moveToSectionWrapper .sections .btn').click(function () {
6410        var section = $(this).data('section');
6411        if (section === "") return;
6412
6413        $('html, body').animate({
6414            scrollTop: view.$('.titleItem input.name[value="' + section + '"]').offset().top - 110
6415        }, 1000);
6416    });
6417
6418
6419
6420    view.$('.selectAllCheckbox').on('change',
6421        function () {
6422            var checked = $('.selectAllCheckbox').is(':checked');
6423
6424            $('input.cbSelector').prop("checked", checked);
6425        });
6426
6427    view.$('.cbSelector.categoryItem').on('change',
6428        function () {
6429            var checked = $(this).is(':checked');
6430            var catId = $(this).attr('data-catid');
6431
6432            $('input.cbSelector[data-catid=' + catId + ']').prop("checked", checked);
6433        });
6434
6435    $(document).scroll(function () {
6436        view.$('.header').css('top', getMainMenuHeight() + 'px');
6437    });
6438    /* scrolování při drag&drop mimo viewport */
6439    var clicked = false, clickY;
6440    $(document).on({
6441        'mousemove': function (e) {
6442            clicked && updateScrollPos(e);
6443        },
6444        'mousedown': function (e) {
6445            if ($(e.target).hasClass('ui-draggable-handle')) {
6446                clicked = true;
6447                clickY = e.clientY;
6448                //console.log(clickY);
6449            }
6450        },
6451        'mouseup': function () {
6452            clicked = false;
6453           // $('html').css('cursor', 'auto');
6454        }
6455    });
6456
6457    var updateScrollPos = function (e) {
6458        var viewportHeight = $(window).height();
6459        /*
6460        console.log(viewportHeight);
6461        console.log(e.clientY);
6462        console.log(e.pageY);
6463        */
6464
6465        if (clickY < e.clientY) {//pohyb dolů
6466
6467            if (viewportHeight - e.clientY < 200 && viewportHeight - e.clientY > 50) {
6468               // $('html').css('cursor', 'row-resize');
6469                $(window).scrollTop($(window).scrollTop() + 1);
6470            }
6471        } else {//pohyb nahoru
6472            if (e.clientY < 200 && e.clientY > 50) {
6473                //$('html').css('cursor', 'row-resize');
6474                $(window).scrollTop($(window).scrollTop() - 1);
6475            }
6476        }
6477    }
6478    /* KONEC scrolování při drag&drop mimo viewport */
6479
6480
6481    function getMainMenuHeight() {
6482        return $('.dcHeader').height();
6483    }
6484}
6485;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.