PageSourceSearch

https://auraf.ru/bitrix/cache/js/s1/aura-flowers-new/template_b871…b65a259d188b6c110c12_v1.js?1790853550707389

js auraf.ru collected 2026-10-07 16:59:43 UTC 707,389 bytes, 12,116 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:73:"/bitrix/templates/aura-flowers-new/js/jquery-1.9.0.min.js?171562863493068";s:6:"source";s:57:"/bitrix/templates/aura-flowers-new/js/jquery-1.9.0.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
vendor: 93,068 bytes, lines 3-6
3/*! jQuery v1.9.0 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */(function(e,t){"use strict";function n(e){var t=e.length,n=st.type(e);return st.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}function r(e){var t=Tt[e]={};return st.each(e.match(lt)||[],function(e,n){t[n]=!0}),t}function i(e,n,r,i){if(st.acceptData(e)){var o,a,s=st.expando,u="string"==typeof n,l=e.nodeType,c=l?st.cache:e,f=l?e[s]:e[s]&&s;if(f&&c[f]&&(i||c[f].data)||!u||r!==t)return f||(l?e[s]=f=K.pop()||st.guid++:f=s),c[f]||(c[f]={},l||(c[f].toJSON=st.noop)),("object"==typeof n||"function"==typeof n)&&(i?c[f]=st.extend(c[f],n):c[f].data=st.extend(c[f].data,n)),o=c[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[st.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[st.camelCase(n)])):a=o,a}}function o(e,t,n){if(st.acceptData(e)){var r,i,o,a=e.nodeType,u=a?st.cache:e,l=a?e[st.expando]:st.expando;if(u[l]){if(t&&(r=n?u[l]:u[l].data)){st.isArray(t)?t=t.concat(st.map(t,st.camelCase)):t in r?t=[t]:(t=st.camelCase(t),t=t in r?[t]:t.split(" "));for(i=0,o=t.length;o>i;i++)delete r[t[i]];if(!(n?s:st.isEmptyObject)(r))return}(n||(delete u[l].data,s(u[l])))&&(a?st.cleanData([e],!0):st.support.deleteExpando||u!=u.window?delete u[l]:u[l]=null)}}}function a(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(Nt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:wt.test(r)?st.parseJSON(r):r}catch(o){}st.data(e,n,r)}else r=t}return r}function s(e){var t;for(t in e)if(("data"!==t||!st.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(){return!0}function l(){return!1}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function f(e,t,n){if(t=t||0,st.isFunction(t))return st.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return st.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=st.grep(e,function(e){return 1===e.nodeType});if(Wt.test(t))return st.filter(t,r,!n);t=st.filter(t,r)}return st.grep(e,function(e){return st.inArray(e,t)>=0===n})}function p(e){var t=zt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function d(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function h(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function g(e){var t=nn.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function m(e,t){for(var n,r=0;null!=(n=e[r]);r++)st._data(n,"globalEval",!t||st._data(t[r],"globalEval"))}function y(e,t){if(1===t.nodeType&&st.hasData(e)){var n,r,i,o=st._data(e),a=st._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)st.event.add(t,n,s[n][r])}a.data&&(a.data=st.extend({},a.data))}}function v(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!st.support.noCloneEvent&&t[st.expando]){r=st._data(t);for(i in r.events)st.removeEvent(t,i,r.handle);t.removeAttribute(st.expando)}"script"===n&&t.text!==e.text?(h(t).text=e.text,g(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),st.support.html5Clone&&e.innerHTML&&!st.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Zt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function b(e,n){var r,i,o=0,a=e.getElementsByTagName!==t?e.getElementsByTagName(n||"*"):e.querySelectorAll!==t?e.querySelectorAll(n||"*"):t;if(!a)for(a=[],r=e.childNodes||e;null!=(i=r[o]);o++)!n||st.nodeName(i,n)?a.push(i):st.merge(a,b(i,n));return n===t||n&&st.nodeName(e,n)?st.merge([e],a):a}function x(e){Zt.test(e.type)&&(e.defaultChecked=e.checked)}function T(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Nn.length;i--;)if(t=Nn[i]+n,t in e)return t;return r}function w(e,t){return e=t||e,"none"===st.css(e,"display")||!st.contains(e.ownerDocument,e)}function N(e,t){for(var n,r=[],i=0,o=e.length;o>i;i++)n=e[i],n.style&&(r[i]=st._data(n,"olddisplay"),t?(r[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&w(n)&&(r[i]=st._data(n,"olddisplay",S(n.nodeName)))):r[i]||w(n)||st._data(n,"olddisplay",st.css(n,"display")));for(i=0;o>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[i]||"":"none"));return e}function C(e,t,n){var r=mn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function k(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=st.css(e,n+wn[o],!0,i)),r?("content"===n&&(a-=st.css(e,"padding"+wn[o],!0,i)),"margin"!==n&&(a-=st.css(e,"border"+wn[o]+"Width",!0,i))):(a+=st.css(e,"padding"+wn[o],!0,i),"padding"!==n&&(a+=st.css(e,"border"+wn[o]+"Width",!0,i)));return a}function E(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ln(e),a=st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=un(e,t,o),(0>i||null==i)&&(i=e.style[t]),yn.test(i))return i;r=a&&(st.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+k(e,t,n||(a?"border":"content"),r,o)+"px"}function S(e){var t=V,n=bn[e];return n||(n=A(e,t),"none"!==n&&n||(cn=(cn||st("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(cn[0].contentWindow||cn[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=A(e,t),cn.detach()),bn[e]=n),n}function A(e,t){var n=st(t.createElement(e)).appendTo(t.body),r=st.css(n[0],"display");return n.remove(),r}function j(e,t,n,r){var i;if(st.isArray(t))st.each(t,function(t,i){n||kn.test(e)?r(e,i):j(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==st.type(t))r(e,t);else for(i in t)j(e+"["+i+"]",t[i],n,r)}function D(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(lt)||[];if(st.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function L(e,n,r,i){function o(u){var l;return a[u]=!0,st.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||s||a[c]?s?!(l=c):t:(n.dataTypes.unshift(c),o(c),!1)}),l}var a={},s=e===$n;return o(n.dataTypes[0])||!a["*"]&&o("*")}function H(e,n){var r,i,o=st.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);return i&&st.extend(!0,e,i),e}function M(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(o in c)o in r&&(n[c[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function q(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=u[++s];)if("*"!==i){if("*"!==l&&l!==i){if(n=a[l+" "+i]||a["* "+i],!n)for(r in a)if(o=r.split(" "),o[1]===i&&(n=a[l+" "+o[0]]||a["* "+o[0]])){n===!0?n=a[r]:a[r]!==!0&&(i=o[0],u.splice(s--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(c){return{state:"parsererror",error:n?c:"No conversion from "+l+" to "+i}}}l=i}return{state:"success",data:t}}function _(){try{return new e.XMLHttpRequest}catch(t){}}function F(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function O(){return setTimeout(function(){Qn=t}),Qn=st.now()}function B(e,t){st.each(t,function(t,n){for(var r=(rr[t]||[]).concat(rr["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function P(e,t,n){var r,i,o=0,a=nr.length,s=st.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=Qn||O(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:st.extend({},t),opts:st.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Qn||O(),duration:n.duration,tweens:[],createTween:function(t,n){var r=st.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(R(c,l.opts.specialEasing);a>o;o++)if(r=nr[o].call(l,e,c,l.opts))return r;return B(l,c),st.isFunction(l.opts.start)&&l.opts.start.call(e,l),st.fx.timer(st.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function R(e,t){var n,r,i,o,a;for(n in e)if(r=st.camelCase(n),i=t[r],o=e[n],st.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=st.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function W(e,t,n){var r,i,o,a,s,u,l,c,f,p=this,d=e.style,h={},g=[],m=e.nodeType&&w(e);n.queue||(c=st._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,st.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===st.css(e,"display")&&"none"===st.css(e,"float")&&(st.support.inlineBlockNeedsLayout&&"inline"!==S(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",st.support.shrinkWrapBlocks||p.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Zn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=st._data(e,"fxshow")||st._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?st(e).show():p.done(function(){st(e).hide()}),p.done(function(){var t;st._removeData(e,"fxshow");for(t in h)st.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=p.createTween(i,m?s[i]:0),h[i]=s[i]||st.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=wn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function z(e){return st.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var X,U,V=e.document,Y=e.location,J=e.jQuery,G=e.$,Q={},K=[],Z="1.9.0",et=K.concat,tt=K.push,nt=K.slice,rt=K.indexOf,it=Q.toString,ot=Q.hasOwnProperty,at=Z.trim,st=function(e,t){return new st.fn.init(e,t,X)},ut=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,lt=/\S+/g,ct=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,pt=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,dt=/^[\],:{}\s]*$/,ht=/(?:^|:|,)(?:\s*\[)+/g,gt=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,mt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,yt=/^-ms-/,vt=/-([\da-z])/gi,bt=function(e,t){return t.toUpperCase()},xt=function(){V.addEventListener?(V.removeEventListener("DOMContentLoaded",xt,!1),st.ready()):"complete"===V.readyState&&(V.detachEvent("onreadystatechange",xt),st.ready())};st.fn=st.prototype={jquery:Z,constructor:st,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:ft.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof st?n[0]:n,st.merge(this,st.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:V,!0)),pt.test(i[1])&&st.isPlainObject(n))for(i in n)st.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=V.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=V,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):st.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),st.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return nt.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=st.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return st.each(this,e,t)},ready:function(e){return st.ready.promise().done(e),this},slice:function(){return this.pushStack(nt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(st.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:tt,sort:[].sort,splice:[].splice},st.fn.init.prototype=st.fn,st.extend=st.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||st.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(e=arguments[u]))for(n in e)r=s[n],i=e[n],s!==i&&(c&&i&&(st.isPlainObject(i)||(o=st.isArray(i)))?(o?(o=!1,a=r&&st.isArray(r)?r:[]):a=r&&st.isPlainObject(r)?r:{},s[n]=st.extend(c,a,i)):i!==t&&(s[n]=i));return s},st.extend({noConflict:function(t){return e.$===st&&(e.$=G),t&&e.jQuery===st&&(e.jQuery=J),st},isReady:!1,readyWait:1,holdReady:function(e){e?st.readyWait++:st.ready(!0)},ready:function(e){if(e===!0?!--st.readyWait:!st.isReady){if(!V.body)return setTimeout(st.ready);st.isReady=!0,e!==!0&&--st.readyWait>0||(U.resolveWith(V,[st]),st.fn.trigger&&st(V).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===st.type(e)},isArray:Array.isArray||function(e){return"array"===st.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Q[it.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==st.type(e)||e.nodeType||st.isWindow(e))return!1;try{if(e.constructor&&!ot.call(e,"constructor")&&!ot.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||ot.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||V;var r=pt.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=st.buildFragment([e],t,i),i&&st(i).remove(),st.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=st.trim(n),n&&dt.test(n.replace(gt,"@").replace(mt,"]").replace(ht,"")))?Function("return "+n)():(st.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||st.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&st.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(yt,"ms-").replace(vt,bt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,r){var i,o=0,a=e.length,s=n(e);if(r){if(s)for(;a>o&&(i=t.apply(e[o],r),i!==!1);o++);else for(o in e)if(i=t.apply(e[o],r),i===!1)break}else if(s)for(;a>o&&(i=t.call(e[o],o,e[o]),i!==!1);o++);else for(o in e)if(i=t.call(e[o],o,e[o]),i===!1)break;return e},trim:at&&!at.call("\ufeff\u00a0")?function(e){return null==e?"":at.call(e)}:function(e){return null==e?"":(e+"").replace(ct,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(n(Object(e))?st.merge(r,"string"==typeof e?[e]:e):tt.call(r,e)),r},inArray:function(e,t,n){var r;if(t){if(rt)return rt.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,r){var i,o=0,a=e.length,s=n(e),u=[];if(s)for(;a>o;o++)i=t(e[o],o,r),null!=i&&(u[u.length]=i);else for(o in e)i=t(e[o],o,r),null!=i&&(u[u.length]=i);return et.apply([],u)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),st.isFunction(e)?(i=nt.call(arguments,2),o=function(){return e.apply(n||this,i.concat(nt.call(arguments)))},o.guid=e.guid=e.guid||st.guid++,o):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===st.type(r)){o=!0;for(u in r)st.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,st.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(st(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),st.ready.promise=function(t){if(!U)if(U=st.Deferred(),"complete"===V.readyState)setTimeout(st.ready);else if(V.addEventListener)V.addEventListener("DOMContentLoaded",xt,!1),e.addEventListener("load",st.ready,!1);else{V.attachEvent("onreadystatechange",xt),e.attachEvent("onload",st.ready);var n=!1;try{n=null==e.frameElement&&V.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!st.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}st.ready()}}()}return U.promise(t)},st.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){Q["[object "+t+"]"]=t.toLowerCase()}),X=st(V);var Tt={};st.Callbacks=function(e){e="string"==typeof e?Tt[e]||r(e):st.extend({},e);var n,i,o,a,s,u,l=[],c=!e.once&&[],f=function(t){for(n=e.memory&&t,i=!0,u=a||0,a=0,s=l.length,o=!0;l&&s>u;u++)if(l[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}o=!1,l&&(c?c.length&&f(c.shift()):n?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function r(t){st.each(t,function(t,n){var i=st.type(n);"function"===i?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==i&&r(n)})})(arguments),o?s=l.length:n&&(a=t,f(n))}return this},remove:function(){return l&&st.each(arguments,function(e,t){for(var n;(n=st.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,u>=n&&u--)}),this},has:function(e){return st.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=c=n=t,this},disabled:function(){return!l},lock:function(){return c=t,n||p.disable(),this},locked:function(){return!c},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!c||(o?c.push(t):f(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},st.extend({Deferred:function(e){var t=[["resolve","done",st.Callbacks("once memory"),"resolved"],["reject","fail",st.Callbacks("once memory"),"rejected"],["notify","progress",st.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return st.Deferred(function(n){st.each(t,function(t,o){var a=o[0],s=st.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&st.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?st.extend(e,r):r}},i={};return r.pipe=r.then,st.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=nt.call(arguments),a=o.length,s=1!==a||e&&st.isFunction(e.promise)?a:0,u=1===s?e:st.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?nt.call(arguments):i,r===t?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&st.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(u.reject).progress(l(i,n,t)):--s;return s||u.resolveWith(r,o),u.promise()}}),st.support=function(){var n,r,i,o,a,s,u,l,c,f,p=V.createElement("div");if(p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=p.getElementsByTagName("*"),i=p.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=V.createElement("select"),a=o.appendChild(V.createElement("option")),s=p.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:!!s.value,optSelected:a.selected,enctype:!!V.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==V.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===V.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete p.test}catch(d){n.deleteExpando=!1}s=V.createElement("input"),s.setAttribute("value",""),n.input=""===s.getAttribute("value"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","t"),s.setAttribute("name","t"),u=V.createDocumentFragment(),u.appendChild(s),n.appendChecked=s.checked,n.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",function(){n.noCloneEvent=!1}),p.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})p.setAttribute(l="on"+f,"t"),n[f+"Bubbles"]=l in e||p.attributes[l].expando===!1;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",n.clearCloneStyle="content-box"===p.style.backgroundClip,st(function(){var r,i,o,a="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",s=V.getElementsByTagName("body")[0];s&&(r=V.createElement("div"),r.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",s.appendChild(r).appendChild(p),p.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=p.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",c=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=c&&0===o[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===p.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==s.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(p,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(p,null)||{width:"4px"}).width,i=p.appendChild(V.createElement("div")),i.style.cssText=p.style.cssText=a,i.style.marginRight=i.style.width="0",p.style.width="1px",n.reliableMarginRight=!parseFloat((e.getComputedStyle(i,null)||{}).marginRight)),p.style.zoom!==t&&(p.innerHTML="",p.style.cssText=a+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="<div></div>",p.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==p.offsetWidth,s.style.zoom=1),s.removeChild(r),r=p=o=i=null)}),r=o=u=a=i=s=null,n}();var wt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,Nt=/([A-Z])/g;st.extend({cache:{},expando:"jQuery"+(Z+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?st.cache[e[st.expando]]:e[st.expando],!!e&&!s(e)},data:function(e,t,n){return i(e,t,n,!1)},removeData:function(e,t){return o(e,t,!1)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)},acceptData:function(e){var t=e.nodeName&&st.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),st.fn.extend({data:function(e,n){var r,i,o=this[0],s=0,u=null;if(e===t){if(this.length&&(u=st.data(o),1===o.nodeType&&!st._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>s;s++)i=r[s].name,i.indexOf("data-")||(i=st.camelCase(i.substring(5)),a(o,i,u[i]));st._data(o,"parsedAttrs",!0)}return u}return"object"==typeof e?this.each(function(){st.data(this,e)}):st.access(this,function(n){return n===t?o?a(o,e,st.data(o,e)):null:(this.each(function(){st.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){st.removeData(this,e)})}}),st.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=st._data(e,n),r&&(!i||st.isArray(r)?i=st._data(e,n,st.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=st.queue(e,t),r=n.length,i=n.shift(),o=st._queueHooks(e,t),a=function(){st.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return st._data(e,n)||st._data(e,n,{empty:st.Callbacks("once memory").add(function(){st._removeData(e,t+"queue"),st._removeData(e,n)})})}}),st.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?st.queue(this[0],e):n===t?this:this.each(function(){var t=st.queue(this,e,n);st._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&st.dequeue(this,e)})},dequeue:function(e){return this.each(function(){st.dequeue(this,e)})},delay:function(e,t){return e=st.fx?st.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=st.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=st._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var Ct,kt,Et=/[\t\r\n]/g,St=/\r/g,At=/^(?:input|select|textarea|button|object)$/i,jt=/^(?:a|area)$/i,Dt=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Lt=/^(?:checked|selected)$/i,Ht=st.support.getSetAttribute,Mt=st.support.input;st.fn.extend({attr:function(e,t){return st.access(this,st.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){st.removeAttr(this,e)})},prop:function(e,t){return st.access(this,st.prop,e,t,arguments.length>1)},removeProp:function(e){return e=st.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):" ")){for(o=0;i=t[o++];)0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=st.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(st.isFunction(e))return this.each(function(t){st(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(lt)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(Et," "):"")){for(o=0;i=t[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");n.className=e?st.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return st.isFunction(e)?this.each(function(n){st(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=st(this),s=t,u=e.match(lt)||[];i=u[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&st._data(this,"__className__",this.className),this.className=this.className||e===!1?"":st._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(Et," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=st.isFunction(e),this.each(function(r){var o,a=st(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":st.isArray(o)&&(o=st.map(o,function(e){return null==e?"":e+""})),n=st.valHooks[this.type]||st.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=st.valHooks[o.type]||st.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(St,""):null==r?"":r)}}}),st.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(st.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&st.nodeName(n.parentNode,"optgroup"))){if(t=st(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=st.makeArray(t);return st(e).find("option").each(function(){this.selected=st.inArray(st(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return e.getAttribute===t?st.prop(e,n,r):(a=1!==s||!st.isXMLDoc(e),a&&(n=n.toLowerCase(),o=st.attrHooks[n]||(Dt.test(n)?kt:Ct)),r===t?o&&a&&"get"in o&&null!==(i=o.get(e,n))?i:(e.getAttribute!==t&&(i=e.getAttribute(n)),null==i?t:i):null!==r?o&&a&&"set"in o&&(i=o.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):(st.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(lt);if(o&&1===e.nodeType)for(;n=o[i++];)r=st.propFix[n]||n,Dt.test(n)?!Ht&&Lt.test(n)?e[st.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:st.attr(e,n,""),e.removeAttribute(Ht?n:r)},attrHooks:{type:{set:function(e,t){if(!st.support.radioValue&&"radio"===t&&st.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!st.isXMLDoc(e),a&&(n=st.propFix[n]||n,o=st.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):At.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:t}}}}),kt={get:function(e,n){var r=st.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?Mt&&Ht?null!=i:Lt.test(n)?e[st.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?st.removeAttr(e,n):Mt&&Ht||!Lt.test(n)?e.setAttribute(!Ht&&st.propFix[n]||n,n):e[st.camelCase("default-"+n)]=e[n]=!0,n}},Mt&&Ht||(st.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return st.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t
4},set:function(e,n,r){return st.nodeName(e,"input")?(e.defaultValue=n,t):Ct&&Ct.set(e,n,r)}}),Ht||(Ct=st.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},st.attrHooks.contenteditable={get:Ct.get,set:function(e,t,n){Ct.set(e,""===t?!1:t,n)}},st.each(["width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),st.support.hrefNormalized||(st.each(["href","src","width","height"],function(e,n){st.attrHooks[n]=st.extend(st.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),st.each(["href","src"],function(e,t){st.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),st.support.style||(st.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),st.support.optSelected||(st.propHooks.selected=st.extend(st.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),st.support.enctype||(st.propFix.enctype="encoding"),st.support.checkOn||st.each(["radio","checkbox"],function(){st.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),st.each(["radio","checkbox"],function(){st.valHooks[this]=st.extend(st.valHooks[this],{set:function(e,n){return st.isArray(n)?e.checked=st.inArray(st(e).val(),n)>=0:t}})});var qt=/^(?:input|select|textarea)$/i,_t=/^key/,Ft=/^(?:mouse|contextmenu)|click/,Ot=/^(?:focusinfocus|focusoutblur)$/,Bt=/^([^.]*)(?:\.(.+)|)$/;st.event={global:{},add:function(e,n,r,i,o){var a,s,u,l,c,f,p,d,h,g,m,y=3!==e.nodeType&&8!==e.nodeType&&st._data(e);if(y){for(r.handler&&(a=r,r=a.handler,o=a.selector),r.guid||(r.guid=st.guid++),(l=y.events)||(l=y.events={}),(s=y.handle)||(s=y.handle=function(e){return st===t||e&&st.event.triggered===e.type?t:st.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=(n||"").match(lt)||[""],c=n.length;c--;)u=Bt.exec(n[c])||[],h=m=u[1],g=(u[2]||"").split(".").sort(),p=st.event.special[h]||{},h=(o?p.delegateType:p.bindType)||h,p=st.event.special[h]||{},f=st.extend({type:h,origType:m,data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&st.expr.match.needsContext.test(o),namespace:g.join(".")},a),(d=l[h])||(d=l[h]=[],d.delegateCount=0,p.setup&&p.setup.call(e,i,g,s)!==!1||(e.addEventListener?e.addEventListener(h,s,!1):e.attachEvent&&e.attachEvent("on"+h,s))),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=r.guid)),o?d.splice(d.delegateCount++,0,f):d.push(f),st.event.global[h]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,m=st.hasData(e)&&st._data(e);if(m&&(u=m.events)){for(t=(t||"").match(lt)||[""],l=t.length;l--;)if(s=Bt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){for(f=st.event.special[d]||{},d=(r?f.delegateType:f.bindType)||d,p=u[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;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&&f.teardown.call(e,h,m.handle)!==!1||st.removeEvent(e,d,m.handle),delete u[d])}else for(d in u)st.event.remove(e,d+t[l],n,r,!0);st.isEmptyObject(u)&&(delete m.handle,st._removeData(e,"events"))}},trigger:function(n,r,i,o){var a,s,u,l,c,f,p,d=[i||V],h=n.type||n,g=n.namespace?n.namespace.split("."):[];if(s=u=i=i||V,3!==i.nodeType&&8!==i.nodeType&&!Ot.test(h+st.event.triggered)&&(h.indexOf(".")>=0&&(g=h.split("."),h=g.shift(),g.sort()),c=0>h.indexOf(":")&&"on"+h,n=n[st.expando]?n:new st.Event(h,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=g.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:st.makeArray(r,[n]),p=st.event.special[h]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!st.isWindow(i)){for(l=p.delegateType||h,Ot.test(l+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),u=s;u===(i.ownerDocument||V)&&d.push(u.defaultView||u.parentWindow||e)}for(a=0;(s=d[a++])&&!n.isPropagationStopped();)n.type=a>1?l:p.bindType||h,f=(st._data(s,"events")||{})[n.type]&&st._data(s,"handle"),f&&f.apply(s,r),f=c&&s[c],f&&st.acceptData(s)&&f.apply&&f.apply(s,r)===!1&&n.preventDefault();if(n.type=h,!(o||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===h&&st.nodeName(i,"a")||!st.acceptData(i)||!c||!i[h]||st.isWindow(i))){u=i[c],u&&(i[c]=null),st.event.triggered=h;try{i[h]()}catch(m){}st.event.triggered=t,u&&(i[c]=u)}return n.result}},dispatch:function(e){e=st.event.fix(e);var n,r,i,o,a,s=[],u=nt.call(arguments),l=(st._data(this,"events")||{})[e.type]||[],c=st.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(s=st.event.handlers.call(this,e,l),n=0;(o=s[n++])&&!e.isPropagationStopped();)for(e.currentTarget=o.elem,r=0;(a=o.handlers[r++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(a.namespace))&&(e.handleObj=a,e.data=a.data,i=((st.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u),i!==t&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==e.type){for(i=[],r=0;u>r;r++)a=n[r],o=a.selector+" ",i[o]===t&&(i[o]=a.needsContext?st(o,this).index(l)>=0:st.find(o,this,null,[l]).length),i[o]&&i.push(a);i.length&&s.push({elem:l,handlers:i})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[st.expando])return e;var t,n,r=e,i=st.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=new st.Event(r),t=o.length;t--;)n=o[t],e[n]=r[n];return e.target||(e.target=r.srcElement||V),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||V,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return st.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==V.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===V.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=st.extend(new st.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?st.event.trigger(i,null,t):st.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},st.removeEvent=V.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},st.Event=function(e,n){return this instanceof st.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?u:l):this.type=e,n&&st.extend(this,n),this.timeStamp=e&&e.timeStamp||st.now(),this[st.expando]=!0,t):new st.Event(e,n)},st.Event.prototype={isDefaultPrevented:l,isPropagationStopped:l,isImmediatePropagationStopped:l,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=u,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=u,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u,this.stopPropagation()}},st.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){st.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!st.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),st.support.submitBubbles||(st.event.special.submit={setup:function(){return st.nodeName(this,"form")?!1:(st.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=st.nodeName(n,"input")||st.nodeName(n,"button")?n.form:t;r&&!st._data(r,"submitBubbles")&&(st.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),st._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&st.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return st.nodeName(this,"form")?!1:(st.event.remove(this,"._submit"),t)}}),st.support.changeBubbles||(st.event.special.change={setup:function(){return qt.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(st.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),st.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),st.event.simulate("change",this,e,!0)})),!1):(st.event.add(this,"beforeactivate._change",function(e){var t=e.target;qt.test(t.nodeName)&&!st._data(t,"changeBubbles")&&(st.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||st.event.simulate("change",this.parentNode,e,!0)}),st._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return st.event.remove(this,"._change"),!qt.test(this.nodeName)}}),st.support.focusinBubbles||st.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){st.event.simulate(t,e.target,st.event.fix(e),!0)};st.event.special[t]={setup:function(){0===n++&&V.addEventListener(e,r,!0)},teardown:function(){0===--n&&V.removeEventListener(e,r,!0)}}}),st.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(s in e)this.on(s,n,r,e[s],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=l;else if(!i)return this;return 1===o&&(a=i,i=function(e){return st().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=st.guid++)),this.each(function(){st.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,st(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=l),this.each(function(){st.event.remove(this,e,r,n)})},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)},trigger:function(e,t){return this.each(function(){st.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?st.event.trigger(e,n,r,!0):t},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),st.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){st.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)},_t.test(t)&&(st.event.fixHooks[t]=st.event.keyHooks),Ft.test(t)&&(st.event.fixHooks[t]=st.event.mouseHooks)}),function(e,t){function n(e){return ht.test(e+"")}function r(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>C.cacheLength&&delete e[t.shift()],e[n]=r}}function i(e){return e[P]=!0,e}function o(e){var t=L.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function a(e,t,n,r){var i,o,a,s,u,l,c,d,h,g;if((t?t.ownerDocument||t:R)!==L&&D(t),t=t||L,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!M&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Q.apply(n,K.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&W.getByClassName&&t.getElementsByClassName)return Q.apply(n,K.call(t.getElementsByClassName(a),0)),n}if(W.qsa&&!q.test(e)){if(c=!0,d=P,h=t,g=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=f(e),(c=t.getAttribute("id"))?d=c.replace(vt,"\\$&"):t.setAttribute("id",d),d="[id='"+d+"'] ",u=l.length;u--;)l[u]=d+p(l[u]);h=dt.test(e)&&t.parentNode||t,g=l.join(",")}if(g)try{return Q.apply(n,K.call(h.querySelectorAll(g),0)),n}catch(m){}finally{c||t.removeAttribute("id")}}}return x(e.replace(at,"$1"),t,n,r)}function s(e,t){for(var n=e&&t&&e.nextSibling;n;n=n.nextSibling)if(n===t)return-1;return e?1:-1}function u(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return i(function(t){return t=+t,i(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function f(e,t){var n,r,i,o,s,u,l,c=X[e+" "];if(c)return t?0:c.slice(0);for(s=e,u=[],l=C.preFilter;s;){(!n||(r=ut.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(i=[])),n=!1,(r=lt.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),s=s.slice(n.length));for(o in C.filter)!(r=pt[o].exec(s))||l[o]&&!(r=l[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?a.error(e):X(e,u).slice(0)}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,u,l,c=$+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(l=t[P]||(t[P]={}),(u=l[r])&&u[0]===c){if((s=u[1])===!0||s===N)return s===!0}else if(u=l[r]=[c],u[1]=e(t,n,a)||N,u[1]===!0)return!0}}function h(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function m(e,t,n,r,o,a){return r&&!r[P]&&(r=m(r)),o&&!o[P]&&(o=m(o,a)),i(function(i,a,s,u){var l,c,f,p=[],d=[],h=a.length,m=i||b(t||"*",s.nodeType?[s]:s,[]),y=!e||!i&&t?m:g(m,p,e,s,u),v=n?o||(i?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r)for(l=g(v,d),r(l,[],s,u),c=l.length;c--;)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f));if(i){if(o||e){if(o){for(l=[],c=v.length;c--;)(f=v[c])&&l.push(y[c]=f);o(null,v=[],l,u)}for(c=v.length;c--;)(f=v[c])&&(l=o?Z.call(i,f):p[c])>-1&&(i[l]=!(a[l]=f))}}else v=g(v===a?v.splice(h,v.length):v),o?o(null,a,v,u):Q.apply(a,v)})}function y(e){for(var t,n,r,i=e.length,o=C.relative[e[0].type],a=o||C.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return Z.call(t,e)>-1},a,!0),c=[function(e,n,r){return!o&&(r||n!==j)||((t=n).nodeType?u(e,n,r):l(e,n,r))}];i>s;s++)if(n=C.relative[e[s].type])c=[d(h(c),n)];else{if(n=C.filter[e[s].type].apply(null,e[s].matches),n[P]){for(r=++s;i>r&&!C.relative[e[r].type];r++);return m(s>1&&h(c),s>1&&p(e.slice(0,s-1)).replace(at,"$1"),n,r>s&&y(e.slice(s,r)),i>r&&y(e=e.slice(r)),i>r&&p(e))}c.push(n)}return h(c)}function v(e,t){var n=0,r=t.length>0,o=e.length>0,s=function(i,s,u,l,c){var f,p,d,h=[],m=0,y="0",v=i&&[],b=null!=c,x=j,T=i||o&&C.find.TAG("*",c&&s.parentNode||s),w=$+=null==x?1:Math.E;for(b&&(j=s!==L&&s,N=n);null!=(f=T[y]);y++){if(o&&f){for(p=0;d=e[p];p++)if(d(f,s,u)){l.push(f);break}b&&($=w,N=++n)}r&&((f=!d&&f)&&m--,i&&v.push(f))}if(m+=y,r&&y!==m){for(p=0;d=t[p];p++)d(v,h,s,u);if(i){if(m>0)for(;y--;)v[y]||h[y]||(h[y]=G.call(l));h=g(h)}Q.apply(l,h),b&&!i&&h.length>0&&m+t.length>1&&a.uniqueSort(l)}return b&&($=w,j=x),v};return r?i(s):s}function b(e,t,n){for(var r=0,i=t.length;i>r;r++)a(e,t[r],n);return n}function x(e,t,n,r){var i,o,a,s,u,l=f(e);if(!r&&1===l.length){if(o=l[0]=l[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&!M&&C.relative[o[1].type]){if(t=C.find.ID(a.matches[0].replace(xt,Tt),t)[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?-1:o.length-1;i>=0&&(a=o[i],!C.relative[s=a.type]);i--)if((u=C.find[s])&&(r=u(a.matches[0].replace(xt,Tt),dt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return Q.apply(n,K.call(r,0)),n;break}}return S(e,l)(r,t,M,n,dt.test(e)),n}function T(){}var w,N,C,k,E,S,A,j,D,L,H,M,q,_,F,O,B,P="sizzle"+-new Date,R=e.document,W={},$=0,I=0,z=r(),X=r(),U=r(),V=typeof t,Y=1<<31,J=[],G=J.pop,Q=J.push,K=J.slice,Z=J.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},et="[\\x20\\t\\r\\n\\f]",tt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",nt=tt.replace("w","w#"),rt="([*^$|!~]?=)",it="\\["+et+"*("+tt+")"+et+"*(?:"+rt+et+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+nt+")|)|)"+et+"*\\]",ot=":("+tt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+it.replace(3,8)+")*)|.*)\\)|)",at=RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),ut=RegExp("^"+et+"*,"+et+"*"),lt=RegExp("^"+et+"*([\\x20\\t\\r\\n\\f>+~])"+et+"*"),ct=RegExp(ot),ft=RegExp("^"+nt+"$"),pt={ID:RegExp("^#("+tt+")"),CLASS:RegExp("^\\.("+tt+")"),NAME:RegExp("^\\[name=['\"]?("+tt+")['\"]?\\]"),TAG:RegExp("^("+tt.replace("w","w*")+")"),ATTR:RegExp("^"+it),PSEUDO:RegExp("^"+ot),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),needsContext:RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},dt=/[\x20\t\r\n\f]*[+~]/,ht=/\{\s*\[native code\]\s*\}/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,mt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,vt=/'|\\/g,bt=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,Tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{K.call(H.childNodes,0)[0].nodeType}catch(wt){K=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}E=a.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},D=a.setDocument=function(e){var r=e?e.ownerDocument||e:R;return r!==L&&9===r.nodeType&&r.documentElement?(L=r,H=r.documentElement,M=E(r),W.tagNameNoComments=o(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),W.attributes=o(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),W.getByClassName=o(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),W.getByName=o(function(e){e.id=P+0,e.innerHTML="<a name='"+P+"'></a><div name='"+P+"'></div>",H.insertBefore(e,H.firstChild);var t=r.getElementsByName&&r.getElementsByName(P).length===2+r.getElementsByName(P+0).length;return W.getIdNotName=!r.getElementById(P),H.removeChild(e),t}),C.attrHandle=o(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==V&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},W.getIdNotName?(C.find.ID=function(e,t){if(typeof t.getElementById!==V&&!M){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){return e.getAttribute("id")===t}}):(C.find.ID=function(e,n){if(typeof n.getElementById!==V&&!M){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==V&&r.getAttributeNode("id").value===e?[r]:t:[]}},C.filter.ID=function(e){var t=e.replace(xt,Tt);return function(e){var n=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return n&&n.value===t}}),C.find.TAG=W.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==V?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i];i++)1===n.nodeType&&r.push(n);return r}return o},C.find.NAME=W.getByName&&function(e,n){return typeof n.getElementsByName!==V?n.getElementsByName(name):t},C.find.CLASS=W.getByClassName&&function(e,n){return typeof n.getElementsByClassName===V||M?t:n.getElementsByClassName(e)},_=[],q=[":focus"],(W.qsa=n(r.querySelectorAll))&&(o(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||q.push("\\["+et+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||q.push(":checked")}),o(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&q.push("[*^$]="+et+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),q.push(",.*:")})),(W.matchesSelector=n(F=H.matchesSelector||H.mozMatchesSelector||H.webkitMatchesSelector||H.oMatchesSelector||H.msMatchesSelector))&&o(function(e){W.disconnectedMatch=F.call(e,"div"),F.call(e,"[s!='']:x"),_.push("!=",ot)}),q=RegExp(q.join("|")),_=RegExp(_.join("|")),O=n(H.contains)||H.compareDocumentPosition?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)for(;t=t.parentNode;)if(t===e)return!0;return!1},B=H.compareDocumentPosition?function(e,t){var n;return e===t?(A=!0,0):(n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&n||e.parentNode&&11===e.parentNode.nodeType?e===r||O(R,e)?-1:t===r||O(R,t)?1:0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,a=t.parentNode,u=[e],l=[t];if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return(~t.sourceIndex||Y)-(O(R,e)&&~e.sourceIndex||Y);if(!o||!a)return e===r?-1:t===r?1:o?-1:a?1:0;if(o===a)return s(e,t);for(n=e;n=n.parentNode;)u.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;u[i]===l[i];)i++;return i?s(u[i],l[i]):u[i]===R?-1:l[i]===R?1:0},A=!1,[0,0].sort(B),W.detectDuplicates=A,L):L},a.matches=function(e,t){return a(e,null,null,t)},a.matchesSelector=function(e,t){if((e.ownerDocument||e)!==L&&D(e),t=t.replace(bt,"='$1']"),!(!W.matchesSelector||M||_&&_.test(t)||q.test(t)))try{var n=F.call(e,t);if(n||W.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return a(t,L,null,[e]).length>0},a.contains=function(e,t){return(e.ownerDocument||e)!==L&&D(e),O(e,t)},a.attr=function(e,t){var n;return(e.ownerDocument||e)!==L&&D(e),M||(t=t.toLowerCase()),(n=C.attrHandle[t])?n(e):M||W.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},a.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},a.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=!W.detectDuplicates,e.sort(B),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},k=a.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+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=k(t);return n},C=a.selectors={cacheLength:50,createPseudo:i,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,Tt),e[3]=(e[4]||e[5]||"").replace(xt,Tt),"~="===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]||a.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]&&a.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&ct.test(n)&&(t=f(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){return"*"===e?function(){return!0}:(e=e.replace(xt,Tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=z[e+" "];return t||(t=RegExp("(^|"+et+")"+e+"("+et+"|$)"))&&z(e,function(e){return t.test(e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=a.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.substr(i.length-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===y:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){for(c=m[P]||(m[P]={}),l=c[e]||[],d=l[0]===$&&l[1],p=l[0]===$&&l[2],f=d&&m.childNodes[d];f=++d&&f&&f[g]||(p=d=0)||h.pop();)if(1===f.nodeType&&++p&&f===t){c[e]=[$,d,p];break}}else if(v&&(l=(t[P]||(t[P]={}))[e])&&l[0]===$)p=l[1];else for(;(f=++d&&f&&f[g]||(p=d=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==y:1!==f.nodeType)||!++p||(v&&((f[P]||(f[P]={}))[e]=[$,p]),f!==t)););return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,r=C.pseudos[e]||C.setFilters[e.toLowerCase()]||a.error("unsupported pseudo: "+e);return r[P]?r(t):r.length>1?(n=[e,e,"",t],C.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,n){for(var i,o=r(e,t),a=o.length;a--;)i=Z.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:i(function(e){var t=[],n=[],r=S(e.replace(at,"$1"));return r[P]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:i(function(e){return function(t){return a(e,t).length>0}}),contains:i(function(e){return function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:i(function(e){return ft.test(e||"")||a.error("unsupported lang: "+e),e=e.replace(xt,Tt).toLowerCase(),function(t){var n;do if(n=M?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===H},focus:function(e){return e===L.activeElement&&(!L.hasFocus||L.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!C.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return mt.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"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}};for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})C.pseudos[w]=u(w);for(w in{submit:!0,reset:!0})C.pseudos[w]=l(w);S=a.compile=function(e,t){var n,r=[],i=[],o=U[e+" "];if(!o){for(t||(t=f(e)),n=t.length;n--;)o=y(t[n]),o[P]?r.push(o):i.push(o);o=U(e,v(i,r))}return o},C.pseudos.nth=C.pseudos.eq,C.filters=T.prototype=C.pseudos,C.setFilters=new T,D(),a.attr=st.attr,st.find=a,st.expr=a.selectors,st.expr[":"]=st.expr.pseudos,st.unique=a.uniqueSort,st.text=a.getText,st.isXMLDoc=a.isXML,st.contains=a.contains}(e);var Pt=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Wt=/^.[^:#\[\.,]*$/,$t=st.expr.match.needsContext,It={children:!0,contents:!0,next:!0,prev:!0};st.fn.extend({find:function(e){var t,n,r;if("string"!=typeof e)return r=this,this.pushStack(st(e).filter(function(){for(t=0;r.length>t;t++)if(st.contains(r[t],this))return!0}));for(n=[],t=0;this.length>t;t++)st.find(e,this[t],n);return n=this.pushStack(st.unique(n)),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=st(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(st.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(f(this,e,!1))},filter:function(e){return this.pushStack(f(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?$t.test(e)?st(e,this.context).index(this[0])>=0:st.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=$t.test(e)||"string"!=typeof e?st(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:st.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return this.pushStack(o.length>1?st.unique(o):o)},index:function(e){return e?"string"==typeof e?st.inArray(this[0],st(e)):st.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?st(e,t):st.makeArray(e&&e.nodeType?[e]:e),r=st.merge(this.get(),n);return this.pushStack(st.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),st.fn.andSelf=st.fn.addBack,st.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return st.dir(e,"parentNode")},parentsUntil:function(e,t,n){return st.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")
5},nextAll:function(e){return st.dir(e,"nextSibling")},prevAll:function(e){return st.dir(e,"previousSibling")},nextUntil:function(e,t,n){return st.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return st.dir(e,"previousSibling",n)},siblings:function(e){return st.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return st.sibling(e.firstChild)},contents:function(e){return st.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:st.merge([],e.childNodes)}},function(e,t){st.fn[e]=function(n,r){var i=st.map(this,t,n);return Pt.test(e)||(r=n),r&&"string"==typeof r&&(i=st.filter(r,i)),i=this.length>1&&!It[e]?st.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i)}}),st.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?st.find.matchesSelector(t[0],e)?[t[0]]:[]:st.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!st(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var zt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Xt=/ jQuery\d+="(?:null|\d+)"/g,Ut=RegExp("<(?:"+zt+")[\\s/>]","i"),Vt=/^\s+/,Yt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Jt=/<([\w:]+)/,Gt=/<tbody/i,Qt=/<|&#?\w+;/,Kt=/<(?:script|style|link)/i,Zt=/^(?:checkbox|radio)$/i,en=/checked\s*(?:[^=]|=\s*.checked.)/i,tn=/^$|\/(?:java|ecma)script/i,nn=/^true\/(.*)/,rn=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,on={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:st.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},an=p(V),sn=an.appendChild(V.createElement("div"));on.optgroup=on.option,on.tbody=on.tfoot=on.colgroup=on.caption=on.thead,on.th=on.td,st.fn.extend({text:function(e){return st.access(this,function(e){return e===t?st.text(this):this.empty().append((this[0]&&this[0].ownerDocument||V).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(st.isFunction(e))return this.each(function(t){st(this).wrapAll(e.call(this,t))});if(this[0]){var t=st(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return st.isFunction(e)?this.each(function(t){st(this).wrapInner(e.call(this,t))}):this.each(function(){var t=st(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=st.isFunction(e);return this.each(function(n){st(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){st.nodeName(this,"body")||st(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||st.filter(e,[n]).length>0)&&(t||1!==n.nodeType||st.cleanData(b(n)),n.parentNode&&(t&&st.contains(n.ownerDocument,n)&&m(b(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&st.cleanData(b(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&st.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return st.clone(this,e,t)})},html:function(e){return st.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Xt,""):t;if(!("string"!=typeof e||Kt.test(e)||!st.support.htmlSerialize&&Ut.test(e)||!st.support.leadingWhitespace&&Vt.test(e)||on[(Jt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(Yt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(st.cleanData(b(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=st.isFunction(e);return t||"string"==typeof e||(e=st(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;(n&&1===this.nodeType||11===this.nodeType)&&(st(this).remove(),t?t.parentNode.insertBefore(e,t):n.appendChild(e))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=et.apply([],e);var i,o,a,s,u,l,c=0,f=this.length,p=this,m=f-1,y=e[0],v=st.isFunction(y);if(v||!(1>=f||"string"!=typeof y||st.support.checkClone)&&en.test(y))return this.each(function(i){var o=p.eq(i);v&&(e[0]=y.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(f&&(i=st.buildFragment(e,this[0].ownerDocument,!1,this),o=i.firstChild,1===i.childNodes.length&&(i=o),o)){for(n=n&&st.nodeName(o,"tr"),a=st.map(b(i,"script"),h),s=a.length;f>c;c++)u=i,c!==m&&(u=st.clone(u,!0,!0),s&&st.merge(a,b(u,"script"))),r.call(n&&st.nodeName(this[c],"table")?d(this[c],"tbody"):this[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,st.map(a,g),c=0;s>c;c++)u=a[c],tn.test(u.type||"")&&!st._data(u,"globalEval")&&st.contains(l,u)&&(u.src?st.ajax({url:u.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):st.globalEval((u.text||u.textContent||u.innerHTML||"").replace(rn,"")));i=o=null}return this}}),st.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){st.fn[e]=function(e){for(var n,r=0,i=[],o=st(e),a=o.length-1;a>=r;r++)n=r===a?this:this.clone(!0),st(o[r])[t](n),tt.apply(i,n.get());return this.pushStack(i)}}),st.extend({clone:function(e,t,n){var r,i,o,a,s,u=st.contains(e.ownerDocument,e);if(st.support.html5Clone||st.isXMLDoc(e)||!Ut.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(sn.innerHTML=e.outerHTML,sn.removeChild(s=sn.firstChild)),!(st.support.noCloneEvent&&st.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||st.isXMLDoc(e)))for(r=b(s),i=b(e),a=0;null!=(o=i[a]);++a)r[a]&&v(o,r[a]);if(t)if(n)for(i=i||b(e),r=r||b(s),a=0;null!=(o=i[a]);a++)y(o,r[a]);else y(e,s);return r=b(s,"script"),r.length>0&&m(r,!u&&b(e,"script")),r=i=o=null,s},buildFragment:function(e,t,n,r){for(var i,o,a,s,u,l,c,f=e.length,d=p(t),h=[],g=0;f>g;g++)if(o=e[g],o||0===o)if("object"===st.type(o))st.merge(h,o.nodeType?[o]:o);else if(Qt.test(o)){for(s=s||d.appendChild(t.createElement("div")),a=(Jt.exec(o)||["",""])[1].toLowerCase(),u=on[a]||on._default,s.innerHTML=u[1]+o.replace(Yt,"<$1></$2>")+u[2],c=u[0];c--;)s=s.lastChild;if(!st.support.leadingWhitespace&&Vt.test(o)&&h.push(t.createTextNode(Vt.exec(o)[0])),!st.support.tbody)for(o="table"!==a||Gt.test(o)?"<table>"!==u[1]||Gt.test(o)?0:s:s.firstChild,c=o&&o.childNodes.length;c--;)st.nodeName(l=o.childNodes[c],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(st.merge(h,s.childNodes),s.textContent="";s.firstChild;)s.removeChild(s.firstChild);s=d.lastChild}else h.push(t.createTextNode(o));for(s&&d.removeChild(s),st.support.appendChecked||st.grep(b(h,"input"),x),g=0;o=h[g++];)if((!r||-1===st.inArray(o,r))&&(i=st.contains(o.ownerDocument,o),s=b(d.appendChild(o),"script"),i&&m(s),n))for(c=0;o=s[c++];)tn.test(o.type||"")&&n.push(o);return s=null,d},cleanData:function(e,n){for(var r,i,o,a,s=0,u=st.expando,l=st.cache,c=st.support.deleteExpando,f=st.event.special;null!=(o=e[s]);s++)if((n||st.acceptData(o))&&(i=o[u],r=i&&l[i])){if(r.events)for(a in r.events)f[a]?st.event.remove(o,a):st.removeEvent(o,a,r.handle);l[i]&&(delete l[i],c?delete o[u]:o.removeAttribute!==t?o.removeAttribute(u):o[u]=null,K.push(i))}}});var un,ln,cn,fn=/alpha\([^)]*\)/i,pn=/opacity\s*=\s*([^)]*)/,dn=/^(top|right|bottom|left)$/,hn=/^(none|table(?!-c[ea]).+)/,gn=/^margin/,mn=RegExp("^("+ut+")(.*)$","i"),yn=RegExp("^("+ut+")(?!px)[a-z%]+$","i"),vn=RegExp("^([+-])=("+ut+")","i"),bn={BODY:"block"},xn={position:"absolute",visibility:"hidden",display:"block"},Tn={letterSpacing:0,fontWeight:400},wn=["Top","Right","Bottom","Left"],Nn=["Webkit","O","Moz","ms"];st.fn.extend({css:function(e,n){return st.access(this,function(e,n,r){var i,o,a={},s=0;if(st.isArray(n)){for(i=ln(e),o=n.length;o>s;s++)a[n[s]]=st.css(e,n[s],!1,i);return a}return r!==t?st.style(e,n,r):st.css(e,n)},e,n,arguments.length>1)},show:function(){return N(this,!0)},hide:function(){return N(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:w(this))?st(this).show():st(this).hide()})}}),st.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=un(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":st.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=st.camelCase(n),l=e.style;if(n=st.cssProps[u]||(st.cssProps[u]=T(l,u)),s=st.cssHooks[n]||st.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=vn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(st.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||st.cssNumber[u]||(r+="px"),st.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=st.camelCase(n);return n=st.cssProps[u]||(st.cssProps[u]=T(e.style,u)),s=st.cssHooks[n]||st.cssHooks[u],s&&"get"in s&&(o=s.get(e,!0,r)),o===t&&(o=un(e,n,i)),"normal"===o&&n in Tn&&(o=Tn[n]),r?(a=parseFloat(o),r===!0||st.isNumeric(a)?a||0:o):o},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(ln=function(t){return e.getComputedStyle(t,null)},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||st.contains(e.ownerDocument,e)||(u=st.style(e,n)),yn.test(u)&&gn.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):V.documentElement.currentStyle&&(ln=function(e){return e.currentStyle},un=function(e,n,r){var i,o,a,s=r||ln(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),yn.test(u)&&!dn.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u}),st.each(["height","width"],function(e,n){st.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&hn.test(st.css(e,"display"))?st.swap(e,xn,function(){return E(e,n,i)}):E(e,n,i):t},set:function(e,t,r){var i=r&&ln(e);return C(e,t,r?k(e,n,r,st.support.boxSizing&&"border-box"===st.css(e,"boxSizing",!1,i),i):0)}}}),st.support.opacity||(st.cssHooks.opacity={get:function(e,t){return pn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=st.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===st.trim(o.replace(fn,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=fn.test(o)?o.replace(fn,i):o+" "+i)}}),st(function(){st.support.reliableMarginRight||(st.cssHooks.marginRight={get:function(e,n){return n?st.swap(e,{display:"inline-block"},un,[e,"marginRight"]):t}}),!st.support.pixelPosition&&st.fn.position&&st.each(["top","left"],function(e,n){st.cssHooks[n]={get:function(e,r){return r?(r=un(e,n),yn.test(r)?st(e).position()[n]+"px":r):t}}})}),st.expr&&st.expr.filters&&(st.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!st.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||st.css(e,"display"))},st.expr.filters.visible=function(e){return!st.expr.filters.hidden(e)}),st.each({margin:"",padding:"",border:"Width"},function(e,t){st.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+wn[r]+t]=o[r]||o[r-2]||o[0];return i}},gn.test(e)||(st.cssHooks[e+t].set=C)});var Cn=/%20/g,kn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset)$/i,An=/^(?:input|select|textarea|keygen)/i;st.fn.extend({serialize:function(){return st.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=st.prop(this,"elements");return e?st.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!st(this).is(":disabled")&&An.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!Zt.test(e))}).map(function(e,t){var n=st(this).val();return null==n?null:st.isArray(n)?st.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}}),st.param=function(e,n){var r,i=[],o=function(e,t){t=st.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=st.ajaxSettings&&st.ajaxSettings.traditional),st.isArray(e)||e.jquery&&!st.isPlainObject(e))st.each(e,function(){o(this.name,this.value)});else for(r in e)j(r,e[r],n,o);return i.join("&").replace(Cn,"+")};var jn,Dn,Ln=st.now(),Hn=/\?/,Mn=/#.*$/,qn=/([?&])_=[^&]*/,_n=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Bn=/^\/\//,Pn=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Rn=st.fn.load,Wn={},$n={},In="*/".concat("*");try{Dn=Y.href}catch(zn){Dn=V.createElement("a"),Dn.href="",Dn=Dn.href}jn=Pn.exec(Dn.toLowerCase())||[],st.fn.load=function(e,n,r){if("string"!=typeof e&&Rn)return Rn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),st.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),s.length>0&&st.ajax({url:e,type:o,dataType:"html",data:n}).done(function(e){a=arguments,s.html(i?st("<div>").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":In,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):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):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window);
6//@ sourceMappingURL=jquery.min.map
6
7/* End */
8;
9; /* Start:"a:4:{s:4:"full";s:82:"/bitrix/templates/aura-flowers-new/js/swiper/swiper-bundle.min.js?1715628634148471";s:6:"source";s:65:"/bitrix/templates/aura-flowers-new/js/swiper/swiper-bundle.min.js";s:3:"min";s:65:"/bitrix/templates/aura-flowers-new/js/swiper/swiper-bundle.min.js";s:3:"map";s:69:"/bitrix/templates/aura-flowers-new/js/swiper/swiper-bundle.min.js.map";}"*/
10/**
11 * Swiper 11.0.5
12 * Most modern mobile touch slider and framework with hardware accelerated transitions
13 * https://swiperjs.com
14 *
15 * Copyright 2014-2023 Vladimir Kharlampidi
16 *
17 * Released under the MIT License
18 *
19 * Released on: November 22, 2023
20 */
21
22var Swiper=function(){"use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(s,a){void 0===s&&(s={}),void 0===a&&(a={}
vendor: 30,403 bytes, line 22
22),Object.keys(a).forEach((i=>{void 0===s[i]?s[i]=a[i]:e(a[i])&&e(s[i])&&Object.keys(a[i]).length>0&&t(s[i],a[i])}))}const s={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function a(){const e="undefined"!=typeof document?document:{};return t(e,s),e}const i={document:s,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:e=>"undefined"==typeof setTimeout?(e(),null):setTimeout(e,0),cancelAnimationFrame(e){"undefined"!=typeof setTimeout&&clearTimeout(e)}};function r(){const e="undefined"!=typeof window?window:{};return t(e,i),e}function n(e){return void 0===e&&(e=""),e.trim().split(" ").filter((e=>!!e.trim()))}function l(e,t){return void 0===t&&(t=0),setTimeout(e,t)}function o(){return Date.now()}function d(e,t){void 0===t&&(t="x");const s=r();let a,i,n;const l=function(e){const t=r();let s;return t.getComputedStyle&&(s=t.getComputedStyle(e,null)),!s&&e.currentStyle&&(s=e.currentStyle),s||(s=e.style),s}(e);return s.WebKitCSSMatrix?(i=l.transform||l.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map((e=>e.replace(",","."))).join(", ")),n=new s.WebKitCSSMatrix("none"===i?"":i)):(n=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),a=n.toString().split(",")),"x"===t&&(i=s.WebKitCSSMatrix?n.m41:16===a.length?parseFloat(a[12]):parseFloat(a[4])),"y"===t&&(i=s.WebKitCSSMatrix?n.m42:16===a.length?parseFloat(a[13]):parseFloat(a[5])),i||0}function c(e){return"object"==typeof e&&null!==e&&e.constructor&&"Object"===Object.prototype.toString.call(e).slice(8,-1)}function p(){const e=Object(arguments.length<=0?void 0:arguments[0]),t=["__proto__","constructor","prototype"];for(let a=1;a<arguments.length;a+=1){const i=a<0||arguments.length<=a?void 0:arguments[a];if(null!=i&&(s=i,!("undefined"!=typeof window&&void 0!==window.HTMLElement?s instanceof HTMLElement:s&&(1===s.nodeType||11===s.nodeType)))){const s=Object.keys(Object(i)).filter((e=>t.indexOf(e)<0));for(let t=0,a=s.length;t<a;t+=1){const a=s[t],r=Object.getOwnPropertyDescriptor(i,a);void 0!==r&&r.enumerable&&(c(e[a])&&c(i[a])?i[a].__swiper__?e[a]=i[a]:p(e[a],i[a]):!c(e[a])&&c(i[a])?(e[a]={},i[a].__swiper__?e[a]=i[a]:p(e[a],i[a])):e[a]=i[a])}}}var s;return e}function u(e,t,s){e.style.setProperty(t,s)}function m(e){let{swiper:t,targetPosition:s,side:a}=e;const i=r(),n=-t.translate;let l,o=null;const d=t.params.speed;t.wrapperEl.style.scrollSnapType="none",i.cancelAnimationFrame(t.cssModeFrameID);const c=s>n?"next":"prev",p=(e,t)=>"next"===c&&e>=t||"prev"===c&&e<=t,u=()=>{l=(new Date).getTime(),null===o&&(o=l);const e=Math.max(Math.min((l-o)/d,1),0),r=.5-Math.cos(e*Math.PI)/2;let c=n+r*(s-n);if(p(c,s)&&(c=s),t.wrapperEl.scrollTo({[a]:c}),p(c,s))return t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.scrollSnapType="",setTimeout((()=>{t.wrapperEl.style.overflow="",t.wrapperEl.scrollTo({[a]:c})})),void i.cancelAnimationFrame(t.cssModeFrameID);t.cssModeFrameID=i.requestAnimationFrame(u)};u()}function h(e){return e.querySelector(".swiper-slide-transform")||e.shadowRoot&&e.shadowRoot.querySelector(".swiper-slide-transform")||e}function f(e,t){return void 0===t&&(t=""),[...e.children].filter((e=>e.matches(t)))}function g(e){try{return void console.warn(e)}catch(e){}}function v(e,t){void 0===t&&(t=[]);const s=document.createElement(e);return s.classList.add(...Array.isArray(t)?t:n(t)),s}function w(e){const t=r(),s=a(),i=e.getBoundingClientRect(),n=s.body,l=e.clientTop||n.clientTop||0,o=e.clientLeft||n.clientLeft||0,d=e===t?t.scrollY:e.scrollTop,c=e===t?t.scrollX:e.scrollLeft;return{top:i.top+d-l,left:i.left+c-o}}function b(e,t){return r().getComputedStyle(e,null).getPropertyValue(t)}function y(e){let t,s=e;if(s){for(t=0;null!==(s=s.previousSibling);)1===s.nodeType&&(t+=1);return t}}function E(e,t){const s=[];let a=e.parentElement;for(;a;)t?a.matches(t)&&s.push(a):s.push(a),a=a.parentElement;return s}function x(e,t){t&&e.addEventListener("transitionend",(function s(a){a.target===e&&(t.call(e,a),e.removeEventListener("transitionend",s))}))}function S(e,t,s){const a=r();return s?e["width"===t?"offsetWidth":"offsetHeight"]+parseFloat(a.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-right":"margin-top"))+parseFloat(a.getComputedStyle(e,null).getPropertyValue("width"===t?"margin-left":"margin-bottom")):e.offsetWidth}let T,M,C;function P(){return T||(T=function(){const e=r(),t=a();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}()),T}function L(e){return void 0===e&&(e={}),M||(M=function(e){let{userAgent:t}=void 0===e?{}:e;const s=P(),a=r(),i=a.navigator.platform,n=t||a.navigator.userAgent,l={ios:!1,android:!1},o=a.screen.width,d=a.screen.height,c=n.match(/(Android);?[\s\/]+([\d.]+)?/);let p=n.match(/(iPad).*OS\s([\d_]+)/);const u=n.match(/(iPod)(.*OS\s([\d_]+))?/),m=!p&&n.match(/(iPhone\sOS|iOS)\s([\d_]+)/),h="Win32"===i;let f="MacIntel"===i;return!p&&f&&s.touch&&["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"].indexOf(`${o}x${d}`)>=0&&(p=n.match(/(Version)\/([\d.]+)/),p||(p=[0,1,"13_0_0"]),f=!1),c&&!h&&(l.os="android",l.android=!0),(p||m||u)&&(l.os="ios",l.ios=!0),l}(e)),M}function A(){return C||(C=function(){const e=r();let t=!1;function s(){const t=e.navigator.userAgent.toLowerCase();return t.indexOf("safari")>=0&&t.indexOf("chrome")<0&&t.indexOf("android")<0}if(s()){const s=String(e.navigator.userAgent);if(s.includes("Version/")){const[e,a]=s.split("Version/")[1].split(" ")[0].split(".").map((e=>Number(e)));t=e<16||16===e&&a<2}}return{isSafari:t||s(),needPerspectiveFix:t,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent)}}()),C}var I={on(e,t,s){const a=this;if(!a.eventsListeners||a.destroyed)return a;if("function"!=typeof t)return a;const i=s?"unshift":"push";return e.split(" ").forEach((e=>{a.eventsListeners[e]||(a.eventsListeners[e]=[]),a.eventsListeners[e][i](t)})),a},once(e,t,s){const a=this;if(!a.eventsListeners||a.destroyed)return a;if("function"!=typeof t)return a;function i(){a.off(e,i),i.__emitterProxy&&delete i.__emitterProxy;for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];t.apply(a,r)}return i.__emitterProxy=t,a.on(e,i,s)},onAny(e,t){const s=this;if(!s.eventsListeners||s.destroyed)return s;if("function"!=typeof e)return s;const a=t?"unshift":"push";return s.eventsAnyListeners.indexOf(e)<0&&s.eventsAnyListeners[a](e),s},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed)return t;if(!t.eventsAnyListeners)return t;const s=t.eventsAnyListeners.indexOf(e);return s>=0&&t.eventsAnyListeners.splice(s,1),t},off(e,t){const s=this;return!s.eventsListeners||s.destroyed?s:s.eventsListeners?(e.split(" ").forEach((e=>{void 0===t?s.eventsListeners[e]=[]:s.eventsListeners[e]&&s.eventsListeners[e].forEach(((a,i)=>{(a===t||a.__emitterProxy&&a.__emitterProxy===t)&&s.eventsListeners[e].splice(i,1)}))})),s):s},emit(){const e=this;if(!e.eventsListeners||e.destroyed)return e;if(!e.eventsListeners)return e;let t,s,a;for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];"string"==typeof r[0]||Array.isArray(r[0])?(t=r[0],s=r.slice(1,r.length),a=e):(t=r[0].events,s=r[0].data,a=r[0].context||e),s.unshift(a);return(Array.isArray(t)?t:t.split(" ")).forEach((t=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach((e=>{e.apply(a,[t,...s])})),e.eventsListeners&&e.eventsListeners[t]&&e.eventsListeners[t].forEach((e=>{e.apply(a,s)}))})),e}};const z=(e,t)=>{if(!e||e.destroyed||!e.params)return;const s=t.closest(e.isElement?"swiper-slide":`.${e.params.slideClass}`);if(s){let t=s.querySelector(`.${e.params.lazyPreloaderClass}`);!t&&e.isElement&&(s.shadowRoot?t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame((()=>{s.shadowRoot&&(t=s.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),t&&t.remove())}))),t&&t.remove()}},$=(e,t)=>{if(!e.slides[t])return;const s=e.slides[t].querySelector('[loading="lazy"]');s&&s.removeAttribute("loading")},k=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const s=e.slides.length;if(!s||!t||t<0)return;t=Math.min(t,s);const a="auto"===e.params.slidesPerView?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=i,r=[s-t];return r.push(...Array.from({length:t}).map(((e,t)=>s+a+t))),void e.slides.forEach(((t,s)=>{r.includes(t.column)&&$(e,s)}))}const r=i+a-1;if(e.params.rewind||e.params.loop)for(let a=i-t;a<=r+t;a+=1){const t=(a%s+s)%s;(t<i||t>r)&&$(e,t)}else for(let a=Math.max(i-t,0);a<=Math.min(r+t,s-1);a+=1)a!==i&&(a>r||a<i)&&$(e,a)};var O={updateSize:function(){const e=this;let t,s;const a=e.el;t=void 0!==e.params.width&&null!==e.params.width?e.params.width:a.clientWidth,s=void 0!==e.params.height&&null!==e.params.height?e.params.height:a.clientHeight,0===t&&e.isHorizontal()||0===s&&e.isVertical()||(t=t-parseInt(b(a,"padding-left")||0,10)-parseInt(b(a,"padding-right")||0,10),s=s-parseInt(b(a,"padding-top")||0,10)-parseInt(b(a,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(s)&&(s=0),Object.assign(e,{width:t,height:s,size:e.isHorizontal()?t:s}))},updateSlides:function(){const e=this;function t(t,s){return parseFloat(t.getPropertyValue(e.getDirectionLabel(s))||0)}const s=e.params,{wrapperEl:a,slidesEl:i,size:r,rtlTranslate:n,wrongRTL:l}=e,o=e.virtual&&s.virtual.enabled,d=o?e.virtual.slides.length:e.slides.length,c=f(i,`.${e.params.slideClass}, swiper-slide`),p=o?e.virtual.slides.length:c.length;let m=[];const h=[],g=[];let v=s.slidesOffsetBefore;"function"==typeof v&&(v=s.slidesOffsetBefore.call(e));let w=s.slidesOffsetAfter;"function"==typeof w&&(w=s.slidesOffsetAfter.call(e));const y=e.snapGrid.length,E=e.slidesGrid.length;let x=s.spaceBetween,T=-v,M=0,C=0;if(void 0===r)return;"string"==typeof x&&x.indexOf("%")>=0?x=parseFloat(x.replace("%",""))/100*r:"string"==typeof x&&(x=parseFloat(x)),e.virtualSize=-x,c.forEach((e=>{n?e.style.marginLeft="":e.style.marginRight="",e.style.marginBottom="",e.style.marginTop=""})),s.centeredSlides&&s.cssMode&&(u(a,"--swiper-centered-offset-before",""),u(a,"--swiper-centered-offset-after",""));const P=s.grid&&s.grid.rows>1&&e.grid;let L;P?e.grid.initSlides(c):e.grid&&e.grid.unsetSlides();const A="auto"===s.slidesPerView&&s.breakpoints&&Object.keys(s.breakpoints).filter((e=>void 0!==s.breakpoints[e].slidesPerView)).length>0;for(let a=0;a<p;a+=1){let i;if(L=0,c[a]&&(i=c[a]),P&&e.grid.updateSlide(a,i,c),!c[a]||"none"!==b(i,"display")){if("auto"===s.slidesPerView){A&&(c[a].style[e.getDirectionLabel("width")]="");const r=getComputedStyle(i),n=i.style.transform,l=i.style.webkitTransform;if(n&&(i.style.transform="none"),l&&(i.style.webkitTransform="none"),s.roundLengths)L=e.isHorizontal()?S(i,"width",!0):S(i,"height",!0);else{const e=t(r,"width"),s=t(r,"padding-left"),a=t(r,"padding-right"),n=t(r,"margin-left"),l=t(r,"margin-right"),o=r.getPropertyValue("box-sizing");if(o&&"border-box"===o)L=e+n+l;else{const{clientWidth:t,offsetWidth:r}=i;L=e+s+a+n+l+(r-t)}}n&&(i.style.transform=n),l&&(i.style.webkitTransform=l),s.roundLengths&&(L=Math.floor(L))}else L=(r-(s.slidesPerView-1)*x)/s.slidesPerView,s.roundLengths&&(L=Math.floor(L)),c[a]&&(c[a].style[e.getDirectionLabel("width")]=`${L}px`);c[a]&&(c[a].swiperSlideSize=L),g.push(L),s.centeredSlides?(T=T+L/2+M/2+x,0===M&&0!==a&&(T=T-r/2-x),0===a&&(T=T-r/2-x),Math.abs(T)<.001&&(T=0),s.roundLengths&&(T=Math.floor(T)),C%s.slidesPerGroup==0&&m.push(T),h.push(T)):(s.roundLengths&&(T=Math.floor(T)),(C-Math.min(e.params.slidesPerGroupSkip,C))%e.params.slidesPerGroup==0&&m.push(T),h.push(T),T=T+L+x),e.virtualSize+=L+x,M=L,C+=1}}if(e.virtualSize=Math.max(e.virtualSize,r)+w,n&&l&&("slide"===s.effect||"coverflow"===s.effect)&&(a.style.width=`${e.virtualSize+x}px`),s.setWrapperSize&&(a.style[e.getDirectionLabel("width")]=`${e.virtualSize+x}px`),P&&e.grid.updateWrapperSize(L,m),!s.centeredSlides){const t=[];for(let a=0;a<m.length;a+=1){let i=m[a];s.roundLengths&&(i=Math.floor(i)),m[a]<=e.virtualSize-r&&t.push(i)}m=t,Math.floor(e.virtualSize-r)-Math.floor(m[m.length-1])>1&&m.push(e.virtualSize-r)}if(o&&s.loop){const t=g[0]+x;if(s.slidesPerGroup>1){const a=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/s.slidesPerGroup),i=t*s.slidesPerGroup;for(let e=0;e<a;e+=1)m.push(m[m.length-1]+i)}for(let a=0;a<e.virtual.slidesBefore+e.virtual.slidesAfter;a+=1)1===s.slidesPerGroup&&m.push(m[m.length-1]+t),h.push(h[h.length-1]+t),e.virtualSize+=t}if(0===m.length&&(m=[0]),0!==x){const t=e.isHorizontal()&&n?"marginLeft":e.getDirectionLabel("marginRight");c.filter(((e,t)=>!(s.cssMode&&!s.loop)||t!==c.length-1)).forEach((e=>{e.style[t]=`${x}px`}))}if(s.centeredSlides&&s.centeredSlidesBounds){let e=0;g.forEach((t=>{e+=t+(x||0)})),e-=x;const t=e-r;m=m.map((e=>e<=0?-v:e>t?t+w:e))}if(s.centerInsufficientSlides){let e=0;if(g.forEach((t=>{e+=t+(x||0)})),e-=x,e<r){const t=(r-e)/2;m.forEach(((e,s)=>{m[s]=e-t})),h.forEach(((e,s)=>{h[s]=e+t}))}}if(Object.assign(e,{slides:c,snapGrid:m,slidesGrid:h,slidesSizesGrid:g}),s.centeredSlides&&s.cssMode&&!s.centeredSlidesBounds){u(a,"--swiper-centered-offset-before",-m[0]+"px"),u(a,"--swiper-centered-offset-after",e.size/2-g[g.length-1]/2+"px");const t=-e.snapGrid[0],s=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map((e=>e+t)),e.slidesGrid=e.slidesGrid.map((e=>e+s))}if(p!==d&&e.emit("slidesLengthChange"),m.length!==y&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),h.length!==E&&e.emit("slidesGridLengthChange"),s.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!(o||s.cssMode||"slide"!==s.effect&&"fade"!==s.effect)){const t=`${s.containerModifierClass}backface-hidden`,a=e.el.classList.contains(t);p<=s.maxBackfaceHiddenSlides?a||e.el.classList.add(t):a&&e.el.classList.remove(t)}},updateAutoHeight:function(e){const t=this,s=[],a=t.virtual&&t.params.virtual.enabled;let i,r=0;"number"==typeof e?t.setTransition(e):!0===e&&t.setTransition(t.params.speed);const n=e=>a?t.slides[t.getSlideIndexByData(e)]:t.slides[e];if("auto"!==t.params.slidesPerView&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach((e=>{s.push(e)}));else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const e=t.activeIndex+i;if(e>t.slides.length&&!a)break;s.push(n(e))}else s.push(n(t.activeIndex));for(i=0;i<s.length;i+=1)if(void 0!==s[i]){const e=s[i].offsetHeight;r=e>r?e:r}(r||0===r)&&(t.wrapperEl.style.height=`${r}px`)},updateSlidesOffset:function(){const e=this,t=e.slides,s=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let a=0;a<t.length;a+=1)t[a].swiperSlideOffset=(e.isHorizontal()?t[a].offsetLeft:t[a].offsetTop)-s-e.cssOverflowAdjustment()},updateSlidesProgress:function(e){void 0===e&&(e=this&&this.translate||0);const t=this,s=t.params,{slides:a,rtlTranslate:i,snapGrid:r}=t;if(0===a.length)return;void 0===a[0].swiperSlideOffset&&t.updateSlidesOffset();let n=-e;i&&(n=e),a.forEach((e=>{e.classList.remove(s.slideVisibleClass,s.slideFullyVisibleClass)})),t.visibleSlidesIndexes=[],t.visibleSlides=[];let l=s.spaceBetween;"string"==typeof l&&l.indexOf("%")>=0?l=parseFloat(l.replace("%",""))/100*t.size:"string"==typeof l&&(l=parseFloat(l));for(let e=0;e<a.length;e+=1){const o=a[e];let d=o.swiperSlideOffset;s.cssMode&&s.centeredSlides&&(d-=a[0].swiperSlideOffset);const c=(n+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),p=(n-r[0]+(s.centeredSlides?t.minTranslate():0)-d)/(o.swiperSlideSize+l),u=-(n-d),m=u+t.slidesSizesGrid[e],h=u>=0&&u<=t.size-t.slidesSizesGrid[e];(u>=0&&u<t.size-1||m>1&&m<=t.size||u<=0&&m>=t.size)&&(t.visibleSlides.push(o),t.visibleSlidesIndexes.push(e),a[e].classList.add(s.slideVisibleClass)),h&&a[e].classList.add(s.slideFullyVisibleClass),o.progress=i?-c:c,o.originalProgress=i?-p:p}},updateProgress:function(e){const t=this;if(void 0===e){const s=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*s||0}const s=t.params,a=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:r,isEnd:n,progressLoop:l}=t;const o=r,d=n;if(0===a)i=0,r=!0,n=!0;else{i=(e-t.minTranslate())/a;const s=Math.abs(e-t.minTranslate())<1,l=Math.abs(e-t.maxTranslate())<1;r=s||i<=0,n=l||i>=1,s&&(i=0),l&&(i=1)}if(s.loop){const s=t.getSlideIndexByData(0),a=t.getSlideIndexByData(t.slides.length-1),i=t.slidesGrid[s],r=t.slidesGrid[a],n=t.slidesGrid[t.slidesGrid.length-1],o=Math.abs(e);l=o>=i?(o-i)/n:(o+n-r)/n,l>1&&(l-=1)}Object.assign(t,{progress:i,progressLoop:l,isBeginning:r,isEnd:n}),(s.watchSlidesProgress||s.centeredSlides&&s.autoHeight)&&t.updateSlidesProgress(e),r&&!o&&t.emit("reachBeginning toEdge"),n&&!d&&t.emit("reachEnd toEdge"),(o&&!r||d&&!n)&&t.emit("fromEdge"),t.emit("progress",i)},updateSlidesClasses:function(){const e=this,{slides:t,params:s,slidesEl:a,activeIndex:i}=e,r=e.virtual&&s.virtual.enabled,n=e.grid&&s.grid&&s.grid.rows>1,l=e=>f(a,`.${s.slideClass}${e}, swiper-slide${e}`)[0];let o,d,c;if(t.forEach((e=>{e.classList.remove(s.slideActiveClass,s.slideNextClass,s.slidePrevClass)})),r)if(s.loop){let t=i-e.virtual.slidesBefore;t<0&&(t=e.virtual.slides.length+t),t>=e.virtual.slides.length&&(t-=e.virtual.slides.length),o=l(`[data-swiper-slide-index="${t}"]`)}else o=l(`[data-swiper-slide-index="${i}"]`);else n?(o=t.filter((e=>e.column===i))[0],c=t.filter((e=>e.column===i+1))[0],d=t.filter((e=>e.column===i-1))[0]):o=t[i];o&&(o.classList.add(s.slideActiveClass),n?(c&&c.classList.add(s.slideNextClass),d&&d.classList.add(s.slidePrevClass)):(c=function(e,t){const s=[];for(;e.nextElementSibling;){const a=e.nextElementSibling;t?a.matches(t)&&s.push(a):s.push(a),e=a}return s}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&!c&&(c=t[0]),c&&c.classList.add(s.slideNextClass),d=function(e,t){const s=[];for(;e.previousElementSibling;){const a=e.previousElementSibling;t?a.matches(t)&&s.push(a):s.push(a),e=a}return s}(o,`.${s.slideClass}, swiper-slide`)[0],s.loop&&0===!d&&(d=t[t.length-1]),d&&d.classList.add(s.slidePrevClass))),e.emitSlidesClasses()},updateActiveIndex:function(e){const t=this,s=t.rtlTranslate?t.translate:-t.translate,{snapGrid:a,params:i,activeIndex:r,realIndex:n,snapIndex:l}=t;let o,d=e;const c=e=>{let s=e-t.virtual.slidesBefore;return s<0&&(s=t.virtual.slides.length+s),s>=t.virtual.slides.length&&(s-=t.virtual.slides.length),s};if(void 0===d&&(d=function(e){const{slidesGrid:t,params:s}=e,a=e.rtlTranslate?e.translate:-e.translate;let i;for(let e=0;e<t.length;e+=1)void 0!==t[e+1]?a>=t[e]&&a<t[e+1]-(t[e+1]-t[e])/2?i=e:a>=t[e]&&a<t[e+1]&&(i=e+1):a>=t[e]&&(i=e);return s.normalizeSlideIndex&&(i<0||void 0===i)&&(i=0),i}(t)),a.indexOf(s)>=0)o=a.indexOf(s);else{const e=Math.min(i.slidesPerGroupSkip,d);o=e+Math.floor((d-e)/i.slidesPerGroup)}if(o>=a.length&&(o=a.length-1),d===r&&!t.params.loop)return void(o!==l&&(t.snapIndex=o,t.emit("snapIndexChange")));if(d===r&&t.params.loop&&t.virtual&&t.params.virtual.enabled)return void(t.realIndex=c(d));const p=t.grid&&i.grid&&i.grid.rows>1;let u;if(t.virtual&&i.virtual.enabled&&i.loop)u=c(d);else if(p){const e=t.slides.filter((e=>e.column===d))[0];let s=parseInt(e.getAttribute("data-swiper-slide-index"),10);Number.isNaN(s)&&(s=Math.max(t.slides.indexOf(e),0)),u=Math.floor(s/i.grid.rows)}else if(t.slides[d]){const e=t.slides[d].getAttribute("data-swiper-slide-index");u=e?parseInt(e,10):d}else u=d;Object.assign(t,{previousSnapIndex:l,snapIndex:o,previousRealIndex:n,realIndex:u,previousIndex:r,activeIndex:d}),t.initialized&&k(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(n!==u&&t.emit("realIndexChange"),t.emit("slideChange"))},updateClickedSlide:function(e,t){const s=this,a=s.params;let i=e.closest(`.${a.slideClass}, swiper-slide`);!i&&s.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach((e=>{!i&&e.matches&&e.matches(`.${a.slideClass}, swiper-slide`)&&(i=e)}));let r,n=!1;if(i)for(let e=0;e<s.slides.length;e+=1)if(s.slides[e]===i){n=!0,r=e;break}if(!i||!n)return s.clickedSlide=void 0,void(s.clickedIndex=void 0);s.clickedSlide=i,s.virtual&&s.params.virtual.enabled?s.clickedIndex=parseInt(i.getAttribute("data-swiper-slide-index"),10):s.clickedIndex=r,a.slideToClickedSlide&&void 0!==s.clickedIndex&&s.clickedIndex!==s.activeIndex&&s.slideToClickedSlide()}};var D={getTranslate:function(e){void 0===e&&(e=this.isHorizontal()?"x":"y");const{params:t,rtlTranslate:s,translate:a,wrapperEl:i}=this;if(t.virtualTranslate)return s?-a:a;if(t.cssMode)return a;let r=d(i,e);return r+=this.cssOverflowAdjustment(),s&&(r=-r),r||0},setTranslate:function(e,t){const s=this,{rtlTranslate:a,params:i,wrapperEl:r,progress:n}=s;let l,o=0,d=0;s.isHorizontal()?o=a?-e:e:d=e,i.roundLengths&&(o=Math.floor(o),d=Math.floor(d)),s.previousTranslate=s.translate,s.translate=s.isHorizontal()?o:d,i.cssMode?r[s.isHorizontal()?"scrollLeft":"scrollTop"]=s.isHorizontal()?-o:-d:i.virtualTranslate||(s.isHorizontal()?o-=s.cssOverflowAdjustment():d-=s.cssOverflowAdjustment(),r.style.transform=`translate3d(${o}px, ${d}px, 0px)`);const c=s.maxTranslate()-s.minTranslate();l=0===c?0:(e-s.minTranslate())/c,l!==n&&s.updateProgress(e),s.emit("setTranslate",s.translate,t)},minTranslate:function(){return-this.snapGrid[0]},maxTranslate:function(){return-this.snapGrid[this.snapGrid.length-1]},translateTo:function(e,t,s,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),void 0===a&&(a=!0);const r=this,{params:n,wrapperEl:l}=r;if(r.animating&&n.preventInteractionOnTransition)return!1;const o=r.minTranslate(),d=r.maxTranslate();let c;if(c=a&&e>o?o:a&&e<d?d:e,r.updateProgress(c),n.cssMode){const e=r.isHorizontal();if(0===t)l[e?"scrollLeft":"scrollTop"]=-c;else{if(!r.support.smoothScroll)return m({swiper:r,targetPosition:-c,side:e?"left":"top"}),!0;l.scrollTo({[e?"left":"top"]:-c,behavior:"smooth"})}return!0}return 0===t?(r.setTransition(0),r.setTranslate(c),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionEnd"))):(r.setTransition(t),r.setTranslate(c),s&&(r.emit("beforeTransitionStart",t,i),r.emit("transitionStart")),r.animating||(r.animating=!0,r.onTranslateToWrapperTransitionEnd||(r.onTranslateToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.wrapperEl.removeEventListener("transitionend",r.onTranslateToWrapperTransitionEnd),r.onTranslateToWrapperTransitionEnd=null,delete r.onTranslateToWrapperTransitionEnd,s&&r.emit("transitionEnd"))}),r.wrapperEl.addEventListener("transitionend",r.onTranslateToWrapperTransitionEnd))),!0}};function G(e){let{swiper:t,runCallbacks:s,direction:a,step:i}=e;const{activeIndex:r,previousIndex:n}=t;let l=a;if(l||(l=r>n?"next":r<n?"prev":"reset"),t.emit(`transition${i}`),s&&r!==n){if("reset"===l)return void t.emit(`slideResetTransition${i}`);t.emit(`slideChangeTransition${i}`),"next"===l?t.emit(`slideNextTransition${i}`):t.emit(`slidePrevTransition${i}`)}}var X={slideTo:function(e,t,s,a,i){void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),"string"==typeof e&&(e=parseInt(e,10));const r=this;let n=e;n<0&&(n=0);const{params:l,snapGrid:o,slidesGrid:d,previousIndex:c,activeIndex:p,rtlTranslate:u,wrapperEl:h,enabled:f}=r;if(r.animating&&l.preventInteractionOnTransition||!f&&!a&&!i)return!1;const g=Math.min(r.params.slidesPerGroupSkip,n);let v=g+Math.floor((n-g)/r.params.slidesPerGroup);v>=o.length&&(v=o.length-1);const w=-o[v];if(l.normalizeSlideIndex)for(let e=0;e<d.length;e+=1){const t=-Math.floor(100*w),s=Math.floor(100*d[e]),a=Math.floor(100*d[e+1]);void 0!==d[e+1]?t>=s&&t<a-(a-s)/2?n=e:t>=s&&t<a&&(n=e+1):t>=s&&(n=e)}if(r.initialized&&n!==p){if(!r.allowSlideNext&&(u?w>r.translate&&w>r.minTranslate():w<r.translate&&w<r.minTranslate()))return!1;if(!r.allowSlidePrev&&w>r.translate&&w>r.maxTranslate()&&(p||0)!==n)return!1}let b;if(n!==(c||0)&&s&&r.emit("beforeSlideChangeStart"),r.updateProgress(w),b=n>p?"next":n<p?"prev":"reset",u&&-w===r.translate||!u&&w===r.translate)return r.updateActiveIndex(n),l.autoHeight&&r.updateAutoHeight(),r.updateSlidesClasses(),"slide"!==l.effect&&r.setTranslate(w),"reset"!==b&&(r.transitionStart(s,b),r.transitionEnd(s,b)),!1;if(l.cssMode){const e=r.isHorizontal(),s=u?w:-w;if(0===t){const t=r.virtual&&r.params.virtual.enabled;t&&(r.wrapperEl.style.scrollSnapType="none",r._immediateVirtual=!0),t&&!r._cssModeVirtualInitialSet&&r.params.initialSlide>0?(r._cssModeVirtualInitialSet=!0,requestAnimationFrame((()=>{h[e?"scrollLeft":"scrollTop"]=s}))):h[e?"scrollLeft":"scrollTop"]=s,t&&requestAnimationFrame((()=>{r.wrapperEl.style.scrollSnapType="",r._immediateVirtual=!1}))}else{if(!r.support.smoothScroll)return m({swiper:r,targetPosition:s,side:e?"left":"top"}),!0;h.scrollTo({[e?"left":"top"]:s,behavior:"smooth"})}return!0}return r.setTransition(t),r.setTranslate(w),r.updateActiveIndex(n),r.updateSlidesClasses(),r.emit("beforeTransitionStart",t,a),r.transitionStart(s,b),0===t?r.transitionEnd(s,b):r.animating||(r.animating=!0,r.onSlideToWrapperTransitionEnd||(r.onSlideToWrapperTransitionEnd=function(e){r&&!r.destroyed&&e.target===this&&(r.wrapperEl.removeEventListener("transitionend",r.onSlideToWrapperTransitionEnd),r.onSlideToWrapperTransitionEnd=null,delete r.onSlideToWrapperTransitionEnd,r.transitionEnd(s,b))}),r.wrapperEl.addEventListener("transitionend",r.onSlideToWrapperTransitionEnd)),!0},slideToLoop:function(e,t,s,a){if(void 0===e&&(e=0),void 0===t&&(t=this.params.speed),void 0===s&&(s=!0),"string"==typeof e){e=parseInt(e,10)}const i=this,r=i.grid&&i.params.grid&&i.params.grid.rows>1;let n=e;if(i.params.loop)if(i.virtual&&i.params.virtual.enabled)n+=i.virtual.slidesBefore;else{let e;if(r){const t=n*i.params.grid.rows;e=i.slides.filter((e=>1*e.getAttribute("data-swiper-slide-index")===t))[0].column}else e=i.getSlideIndexByData(n);const t=r?Math.ceil(i.slides.length/i.params.grid.rows):i.slides.length,{centeredSlides:s}=i.params;let a=i.params.slidesPerView;"auto"===a?a=i.slidesPerViewDynamic():(a=Math.ceil(parseFloat(i.params.slidesPerView,10)),s&&a%2==0&&(a+=1));let l=t-e<a;if(s&&(l=l||e<Math.ceil(a/2)),l){const a=s?e<i.activeIndex?"prev":"next":e-i.activeIndex-1<i.params.slidesPerView?"next":"prev";i.loopFix({direction:a,slideTo:!0,activeSlideIndex:"next"===a?e+1:e-t+1,slideRealIndex:"next"===a?i.realIndex:void 0})}if(r){const e=n*i.params.grid.rows;n=i.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0].column}else n=i.getSlideIndexByData(n)}return requestAnimationFrame((()=>{i.slideTo(n,t,s,a)})),i},slideNext:function(e,t,s){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const a=this,{enabled:i,params:r,animating:n}=a;if(!i)return a;let l=r.slidesPerGroup;"auto"===r.slidesPerView&&1===r.slidesPerGroup&&r.slidesPerGroupAuto&&(l=Math.max(a.slidesPerViewDynamic("current",!0),1));const o=a.activeIndex<r.slidesPerGroupSkip?1:l,d=a.virtual&&r.virtual.enabled;if(r.loop){if(n&&!d&&r.loopPreventsSliding)return!1;if(a.loopFix({direction:"next"}),a._clientLeft=a.wrapperEl.clientLeft,a.activeIndex===a.slides.length-1&&r.cssMode)return requestAnimationFrame((()=>{a.slideTo(a.activeIndex+o,e,t,s)})),!0}return r.rewind&&a.isEnd?a.slideTo(0,e,t,s):a.slideTo(a.activeIndex+o,e,t,s)},slidePrev:function(e,t,s){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0);const a=this,{params:i,snapGrid:r,slidesGrid:n,rtlTranslate:l,enabled:o,animating:d}=a;if(!o)return a;const c=a.virtual&&i.virtual.enabled;if(i.loop){if(d&&!c&&i.loopPreventsSliding)return!1;a.loopFix({direction:"prev"}),a._clientLeft=a.wrapperEl.clientLeft}function p(e){return e<0?-Math.floor(Math.abs(e)):Math.floor(e)}const u=p(l?a.translate:-a.translate),m=r.map((e=>p(e)));let h=r[m.indexOf(u)-1];if(void 0===h&&i.cssMode){let e;r.forEach(((t,s)=>{u>=t&&(e=s)})),void 0!==e&&(h=r[e>0?e-1:e])}let f=0;if(void 0!==h&&(f=n.indexOf(h),f<0&&(f=a.activeIndex-1),"auto"===i.slidesPerView&&1===i.slidesPerGroup&&i.slidesPerGroupAuto&&(f=f-a.slidesPerViewDynamic("previous",!0)+1,f=Math.max(f,0))),i.rewind&&a.isBeginning){const i=a.params.virtual&&a.params.virtual.enabled&&a.virtual?a.virtual.slides.length-1:a.slides.length-1;return a.slideTo(i,e,t,s)}return i.loop&&0===a.activeIndex&&i.cssMode?(requestAnimationFrame((()=>{a.slideTo(f,e,t,s)})),!0):a.slideTo(f,e,t,s)},slideReset:function(e,t,s){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,s)},slideToClosest:function(e,t,s,a){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===a&&(a=.5);const i=this;let r=i.activeIndex;const n=Math.min(i.params.slidesPerGroupSkip,r),l=n+Math.floor((r-n)/i.params.slidesPerGroup),o=i.rtlTranslate?i.translate:-i.translate;if(o>=i.snapGrid[l]){const e=i.snapGrid[l];o-e>(i.snapGrid[l+1]-e)*a&&(r+=i.params.slidesPerGroup)}else{const e=i.snapGrid[l-1];o-e<=(i.snapGrid[l]-e)*a&&(r-=i.params.slidesPerGroup)}return r=Math.max(r,0),r=Math.min(r,i.slidesGrid.length-1),i.slideTo(r,e,t,s)},slideToClickedSlide:function(){const e=this,{params:t,slidesEl:s}=e,a="auto"===t.slidesPerView?e.slidesPerViewDynamic():t.slidesPerView;let i,r=e.clickedIndex;const n=e.isElement?"swiper-slide":`.${t.slideClass}`;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?r<e.loopedSlides-a/2||r>e.slides.length-e.loopedSlides+a/2?(e.loopFix(),r=e.getSlideIndex(f(s,`${n}[data-swiper-slide-index="${i}"]`)[0]),l((()=>{e.slideTo(r)}))):e.slideTo(r):r>e.slides.length-a?(e.loopFix(),r=e.getSlideIndex(f(s,`${n}[data-swiper-slide-index="${i}"]`)[0]),l((()=>{e.slideTo(r)}))):e.slideTo(r)}else e.slideTo(r)}};var H
vendor: 5,330 bytes, line 22
22={loopCreate:function(e){const t=this,{params:s,slidesEl:a}=t;if(!s.loop||t.virtual&&t.params.virtual.enabled)return;const i=()=>{f(a,`.${s.slideClass}, swiper-slide`).forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t)}))},r=t.grid&&s.grid&&s.grid.rows>1,n=s.slidesPerGroup*(r?s.grid.rows:1),l=t.slides.length%n!=0,o=r&&t.slides.length%s.grid.rows!=0,d=e=>{for(let a=0;a<e;a+=1){const e=t.isElement?v("swiper-slide",[s.slideBlankClass]):v("div",[s.slideClass,s.slideBlankClass]);t.slidesEl.append(e)}};if(l){if(s.loopAddBlankSlides){d(n-t.slides.length%n),t.recalcSlides(),t.updateSlides()}else g("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(o){if(s.loopAddBlankSlides){d(s.grid.rows-t.slides.length%s.grid.rows),t.recalcSlides(),t.updateSlides()}else g("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();t.loopFix({slideRealIndex:e,direction:s.centeredSlides?void 0:"next"})},loopFix:function(e){let{slideRealIndex:t,slideTo:s=!0,direction:a,setTranslate:i,activeSlideIndex:r,byController:n,byMousewheel:l}=void 0===e?{}:e;const o=this;if(!o.params.loop)return;o.emit("beforeLoopFix");const{slides:d,allowSlidePrev:c,allowSlideNext:p,slidesEl:u,params:m}=o,{centeredSlides:h}=m;if(o.allowSlidePrev=!0,o.allowSlideNext=!0,o.virtual&&m.virtual.enabled)return s&&(m.centeredSlides||0!==o.snapIndex?m.centeredSlides&&o.snapIndex<m.slidesPerView?o.slideTo(o.virtual.slides.length+o.snapIndex,0,!1,!0):o.snapIndex===o.snapGrid.length-1&&o.slideTo(o.virtual.slidesBefore,0,!1,!0):o.slideTo(o.virtual.slides.length,0,!1,!0)),o.allowSlidePrev=c,o.allowSlideNext=p,void o.emit("loopFix");let f=m.slidesPerView;"auto"===f?f=o.slidesPerViewDynamic():(f=Math.ceil(parseFloat(m.slidesPerView,10)),h&&f%2==0&&(f+=1));const v=m.slidesPerGroupAuto?f:m.slidesPerGroup;let w=v;w%v!=0&&(w+=v-w%v),w+=m.loopAdditionalSlides,o.loopedSlides=w;const b=o.grid&&m.grid&&m.grid.rows>1;d.length<f+w?g("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled and not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):b&&"row"===m.grid.fill&&g("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const y=[],E=[];let x=o.activeIndex;void 0===r?r=o.getSlideIndex(d.filter((e=>e.classList.contains(m.slideActiveClass)))[0]):x=r;const S="next"===a||!a,T="prev"===a||!a;let M=0,C=0;const P=b?Math.ceil(d.length/m.grid.rows):d.length,L=(b?d[r].column:r)+(h&&void 0===i?-f/2+.5:0);if(L<w){M=Math.max(w-L,v);for(let e=0;e<w-L;e+=1){const t=e-Math.floor(e/P)*P;if(b){const e=P-t-1;for(let t=d.length-1;t>=0;t-=1)d[t].column===e&&y.push(t)}else y.push(P-t-1)}}else if(L+f>P-w){C=Math.max(L-(P-2*w),v);for(let e=0;e<C;e+=1){const t=e-Math.floor(e/P)*P;b?d.forEach(((e,s)=>{e.column===t&&E.push(s)})):E.push(t)}}if(o.__preventObserver__=!0,requestAnimationFrame((()=>{o.__preventObserver__=!1})),T&&y.forEach((e=>{d[e].swiperLoopMoveDOM=!0,u.prepend(d[e]),d[e].swiperLoopMoveDOM=!1})),S&&E.forEach((e=>{d[e].swiperLoopMoveDOM=!0,u.append(d[e]),d[e].swiperLoopMoveDOM=!1})),o.recalcSlides(),"auto"===m.slidesPerView?o.updateSlides():b&&(y.length>0&&T||E.length>0&&S)&&o.slides.forEach(((e,t)=>{o.grid.updateSlide(t,e,o.slides)})),m.watchSlidesProgress&&o.updateSlidesOffset(),s)if(y.length>0&&T){if(void 0===t){const e=o.slidesGrid[x],t=o.slidesGrid[x+M]-e;l?o.setTranslate(o.translate-t):(o.slideTo(x+M,0,!1,!0),i&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else if(i){const e=b?y.length/m.grid.rows:y.length;o.slideTo(o.activeIndex+e,0,!1,!0),o.touchEventsData.currentTranslate=o.translate}}else if(E.length>0&&S)if(void 0===t){const e=o.slidesGrid[x],t=o.slidesGrid[x-C]-e;l?o.setTranslate(o.translate-t):(o.slideTo(x-C,0,!1,!0),i&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-t,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-t))}else{const e=b?E.length/m.grid.rows:E.length;o.slideTo(o.activeIndex-e,0,!1,!0)}if(o.allowSlidePrev=c,o.allowSlideNext=p,o.controller&&o.controller.control&&!n){const e={slideRealIndex:t,direction:a,setTranslate:i,activeSlideIndex:r,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach((t=>{!t.destroyed&&t.params.loop&&t.loopFix({...e,slideTo:t.params.slidesPerView===m.slidesPerView&&s})})):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix({...e,slideTo:o.controller.control.params.slidesPerView===m.slidesPerView&&s})}o.emit("loopFix")},loopDestroy:function(){const e=this,{params:t,slidesEl:s}=e;if(!t.loop||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const a=[];e.slides.forEach((e=>{const t=void 0===e.swiperSlideIndex?1*e.getAttribute("data-swiper-slide-index"):e.swiperSlideIndex;a[t]=e})),e.slides.forEach((e=>{e.removeAttribute("data-swiper-slide-index")})),a.forEach((e=>{s.append(e)})),e.recalcSlides(),e.slideTo(e.realIndex,0)}};function 
vendor: 2,288 bytes, line 22
22N(e,t,s){const a=r(),{params:i}=e,n=i.edgeSwipeDetection,l=i.edgeSwipeThreshold;return!n||!(s<=l||s>=a.innerWidth-l)||"prevent"===n&&(t.preventDefault(),!0)}function Y(e){const t=this,s=a();let i=e;i.originalEvent&&(i=i.originalEvent);const n=t.touchEventsData;if("pointerdown"===i.type){if(null!==n.pointerId&&n.pointerId!==i.pointerId)return;n.pointerId=i.pointerId}else"touchstart"===i.type&&1===i.targetTouches.length&&(n.touchId=i.targetTouches[0].identifier);if("touchstart"===i.type)return void N(t,i,i.targetTouches[0].pageX);const{params:l,touches:d,enabled:c}=t;if(!c)return;if(!l.simulateTouch&&"mouse"===i.pointerType)return;if(t.animating&&l.preventInteractionOnTransition)return;!t.animating&&l.cssMode&&l.loop&&t.loopFix();let p=i.target;if("wrapper"===l.touchEventsTarget&&!t.wrapperEl.contains(p))return;if("which"in i&&3===i.which)return;if("button"in i&&i.button>0)return;if(n.isTouched&&n.isMoved)return;const u=!!l.noSwipingClass&&""!==l.noSwipingClass,m=i.composedPath?i.composedPath():i.path;u&&i.target&&i.target.shadowRoot&&m&&(p=m[0]);const h=l.noSwipingSelector?l.noSwipingSelector:`.${l.noSwipingClass}`,f=!(!i.target||!i.target.shadowRoot);if(l.noSwiping&&(f?function(e,t){return void 0===t&&(t=this),function t(s){if(!s||s===a()||s===r())return null;s.assignedSlot&&(s=s.assignedSlot);const i=s.closest(e);return i||s.getRootNode?i||t(s.getRootNode().host):null}(t)}(h,p):p.closest(h)))return void(t.allowClick=!0);if(l.swipeHandler&&!p.closest(l.swipeHandler))return;d.currentX=i.pageX,d.currentY=i.pageY;const g=d.currentX,v=d.currentY;if(!N(t,i,g))return;Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),d.startX=g,d.startY=v,n.touchStartTime=o(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,l.threshold>0&&(n.allowThresholdMove=!1);let w=!0;p.matches(n.focusableElements)&&(w=!1,"SELECT"===p.nodeName&&(n.isTouched=!1)),s.activeElement&&s.activeElement.matches(n.focusableElements)&&s.activeElement!==p&&s.activeElement.blur();const b=w&&t.allowTouchMove&&l.touchStartPreventDefault;!l.touchStartForcePreventDefault&&!b||p.isContentEditable||i.preventDefault(),l.freeMode&&l.freeMode.enabled&&t.freeMode&&t.animating&&!l.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",i)}function B
vendor: 4,997 bytes, line 22
22(e){const t=a(),s=this,i=s.touchEventsData,{params:r,touches:n,rtlTranslate:l,enabled:d}=s;if(!d)return;if(!r.simulateTouch&&"mouse"===e.pointerType)return;let c,p=e;if(p.originalEvent&&(p=p.originalEvent),"pointermove"===p.type){if(null!==i.touchId)return;if(p.pointerId!==i.pointerId)return}if("touchmove"===p.type){if(c=[...p.changedTouches].filter((e=>e.identifier===i.touchId))[0],!c||c.identifier!==i.touchId)return}else c=p;if(!i.isTouched)return void(i.startMoving&&i.isScrolling&&s.emit("touchMoveOpposite",p));const u=c.pageX,m=c.pageY;if(p.preventedByNestedSwiper)return n.startX=u,void(n.startY=m);if(!s.allowTouchMove)return p.target.matches(i.focusableElements)||(s.allowClick=!1),void(i.isTouched&&(Object.assign(n,{startX:u,startY:m,currentX:u,currentY:m}),i.touchStartTime=o()));if(r.touchReleaseOnEdges&&!r.loop)if(s.isVertical()){if(m<n.startY&&s.translate<=s.maxTranslate()||m>n.startY&&s.translate>=s.minTranslate())return i.isTouched=!1,void(i.isMoved=!1)}else if(u<n.startX&&s.translate<=s.maxTranslate()||u>n.startX&&s.translate>=s.minTranslate())return;if(t.activeElement&&p.target===t.activeElement&&p.target.matches(i.focusableElements))return i.isMoved=!0,void(s.allowClick=!1);i.allowTouchCallbacks&&s.emit("touchMove",p),n.previousX=n.currentX,n.previousY=n.currentY,n.currentX=u,n.currentY=m;const h=n.currentX-n.startX,f=n.currentY-n.startY;if(s.params.threshold&&Math.sqrt(h**2+f**2)<s.params.threshold)return;if(void 0===i.isScrolling){let e;s.isHorizontal()&&n.currentY===n.startY||s.isVertical()&&n.currentX===n.startX?i.isScrolling=!1:h*h+f*f>=25&&(e=180*Math.atan2(Math.abs(f),Math.abs(h))/Math.PI,i.isScrolling=s.isHorizontal()?e>r.touchAngle:90-e>r.touchAngle)}if(i.isScrolling&&s.emit("touchMoveOpposite",p),void 0===i.startMoving&&(n.currentX===n.startX&&n.currentY===n.startY||(i.startMoving=!0)),i.isScrolling)return void(i.isTouched=!1);if(!i.startMoving)return;s.allowClick=!1,!r.cssMode&&p.cancelable&&p.preventDefault(),r.touchMoveStopPropagation&&!r.nested&&p.stopPropagation();let g=s.isHorizontal()?h:f,v=s.isHorizontal()?n.currentX-n.previousX:n.currentY-n.previousY;r.oneWayMovement&&(g=Math.abs(g)*(l?1:-1),v=Math.abs(v)*(l?1:-1)),n.diff=g,g*=r.touchRatio,l&&(g=-g,v=-v);const w=s.touchesDirection;s.swipeDirection=g>0?"prev":"next",s.touchesDirection=v>0?"prev":"next";const b=s.params.loop&&!r.cssMode,y="next"===s.touchesDirection&&s.allowSlideNext||"prev"===s.touchesDirection&&s.allowSlidePrev;if(!i.isMoved){if(b&&y&&s.loopFix({direction:s.swipeDirection}),i.startTranslate=s.getTranslate(),s.setTransition(0),s.animating){const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});s.wrapperEl.dispatchEvent(e)}i.allowMomentumBounce=!1,!r.grabCursor||!0!==s.allowSlideNext&&!0!==s.allowSlidePrev||s.setGrabCursor(!0),s.emit("sliderFirstMove",p)}if((new Date).getTime(),i.isMoved&&i.allowThresholdMove&&w!==s.touchesDirection&&b&&y&&Math.abs(g)>=1)return Object.assign(n,{startX:u,startY:m,currentX:u,currentY:m,startTranslate:i.currentTranslate}),i.loopSwapReset=!0,void(i.startTranslate=i.currentTranslate);s.emit("sliderMove",p),i.isMoved=!0,i.currentTranslate=g+i.startTranslate;let E=!0,x=r.resistanceRatio;if(r.touchReleaseOnEdges&&(x=0),g>0?(b&&y&&i.allowThresholdMove&&i.currentTranslate>(r.centeredSlides?s.minTranslate()-s.slidesSizesGrid[s.activeIndex+1]:s.minTranslate())&&s.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),i.currentTranslate>s.minTranslate()&&(E=!1,r.resistance&&(i.currentTranslate=s.minTranslate()-1+(-s.minTranslate()+i.startTranslate+g)**x))):g<0&&(b&&y&&i.allowThresholdMove&&i.currentTranslate<(r.centeredSlides?s.maxTranslate()+s.slidesSizesGrid[s.slidesSizesGrid.length-1]:s.maxTranslate())&&s.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:s.slides.length-("auto"===r.slidesPerView?s.slidesPerViewDynamic():Math.ceil(parseFloat(r.slidesPerView,10)))}),i.currentTranslate<s.maxTranslate()&&(E=!1,r.resistance&&(i.currentTranslate=s.maxTranslate()+1-(s.maxTranslate()-i.startTranslate-g)**x))),E&&(p.preventedByNestedSwiper=!0),!s.allowSlideNext&&"next"===s.swipeDirection&&i.currentTranslate<i.startTranslate&&(i.currentTranslate=i.startTranslate),!s.allowSlidePrev&&"prev"===s.swipeDirection&&i.currentTranslate>i.startTranslate&&(i.currentTranslate=i.startTranslate),s.allowSlidePrev||s.allowSlideNext||(i.currentTranslate=i.startTranslate),r.threshold>0){if(!(Math.abs(g)>r.threshold||i.allowThresholdMove))return void(i.currentTranslate=i.startTranslate);if(!i.allowThresholdMove)return i.allowThresholdMove=!0,n.startX=n.currentX,n.startY=n.currentY,i.currentTranslate=i.startTranslate,void(n.diff=s.isHorizontal()?n.currentX-n.startX:n.currentY-n.startY)}r.followFinger&&!r.cssMode&&((r.freeMode&&r.freeMode.enabled&&s.freeMode||r.watchSlidesProgress)&&(s.updateActiveIndex(),s.updateSlidesClasses()),r.freeMode&&r.freeMode.enabled&&s.freeMode&&s.freeMode.onTouchMove(),s.updateProgress(i.currentTranslate),s.setTranslate(i.currentTranslate))}function 
vendor: 63,570 bytes, line 22
22R(e){const t=this,s=t.touchEventsData;let a,i=e;i.originalEvent&&(i=i.originalEvent);if("touchend"===i.type||"touchcancel"===i.type){if(a=[...i.changedTouches].filter((e=>e.identifier===s.touchId))[0],!a||a.identifier!==s.touchId)return}else{if(null!==s.touchId)return;if(i.pointerId!==s.pointerId)return;a=i}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(i.type)){if(!(["pointercancel","contextmenu"].includes(i.type)&&(t.browser.isSafari||t.browser.isWebView)))return}s.pointerId=null,s.touchId=null;const{params:r,touches:n,rtlTranslate:d,slidesGrid:c,enabled:p}=t;if(!p)return;if(!r.simulateTouch&&"mouse"===i.pointerType)return;if(s.allowTouchCallbacks&&t.emit("touchEnd",i),s.allowTouchCallbacks=!1,!s.isTouched)return s.isMoved&&r.grabCursor&&t.setGrabCursor(!1),s.isMoved=!1,void(s.startMoving=!1);r.grabCursor&&s.isMoved&&s.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);const u=o(),m=u-s.touchStartTime;if(t.allowClick){const e=i.path||i.composedPath&&i.composedPath();t.updateClickedSlide(e&&e[0]||i.target,e),t.emit("tap click",i),m<300&&u-s.lastClickTime<300&&t.emit("doubleTap doubleClick",i)}if(s.lastClickTime=o(),l((()=>{t.destroyed||(t.allowClick=!0)})),!s.isTouched||!s.isMoved||!t.swipeDirection||0===n.diff&&!s.loopSwapReset||s.currentTranslate===s.startTranslate&&!s.loopSwapReset)return s.isTouched=!1,s.isMoved=!1,void(s.startMoving=!1);let h;if(s.isTouched=!1,s.isMoved=!1,s.startMoving=!1,h=r.followFinger?d?t.translate:-t.translate:-s.currentTranslate,r.cssMode)return;if(r.freeMode&&r.freeMode.enabled)return void t.freeMode.onTouchEnd({currentPos:h});const f=h>=-t.maxTranslate()&&!t.params.loop;let g=0,v=t.slidesSizesGrid[0];for(let e=0;e<c.length;e+=e<r.slidesPerGroupSkip?1:r.slidesPerGroup){const t=e<r.slidesPerGroupSkip-1?1:r.slidesPerGroup;void 0!==c[e+t]?(f||h>=c[e]&&h<c[e+t])&&(g=e,v=c[e+t]-c[e]):(f||h>=c[e])&&(g=e,v=c[c.length-1]-c[c.length-2])}let w=null,b=null;r.rewind&&(t.isBeginning?b=r.virtual&&r.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(w=0));const y=(h-c[g])/v,E=g<r.slidesPerGroupSkip-1?1:r.slidesPerGroup;if(m>r.longSwipesMs){if(!r.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(y>=r.longSwipesRatio?t.slideTo(r.rewind&&t.isEnd?w:g+E):t.slideTo(g)),"prev"===t.swipeDirection&&(y>1-r.longSwipesRatio?t.slideTo(g+E):null!==b&&y<0&&Math.abs(y)>r.longSwipesRatio?t.slideTo(b):t.slideTo(g))}else{if(!r.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(i.target===t.navigation.nextEl||i.target===t.navigation.prevEl)?i.target===t.navigation.nextEl?t.slideTo(g+E):t.slideTo(g):("next"===t.swipeDirection&&t.slideTo(null!==w?w:g+E),"prev"===t.swipeDirection&&t.slideTo(null!==b?b:g))}}function q(){const e=this,{params:t,el:s}=e;if(s&&0===s.offsetWidth)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:a,allowSlidePrev:i,snapGrid:r}=e,n=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const l=n&&t.loop;!("auto"===t.slidesPerView||t.slidesPerView>1)||!e.isEnd||e.isBeginning||e.params.centeredSlides||l?e.params.loop&&!n?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0):e.slideTo(e.slides.length-1,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout((()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()}),500)),e.allowSlidePrev=i,e.allowSlideNext=a,e.params.watchOverflow&&r!==e.snapGrid&&e.checkOverflow()}function V(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function _(){const e=this,{wrapperEl:t,rtlTranslate:s,enabled:a}=e;if(!a)return;let i;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,0===e.translate&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();const r=e.maxTranslate()-e.minTranslate();i=0===r?0:(e.translate-e.minTranslate())/r,i!==e.progress&&e.updateProgress(s?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function F(e){const t=this;z(t,e.target),t.params.cssMode||"auto"!==t.params.slidesPerView&&!t.params.autoHeight||t.update()}function j(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const W=(e,t)=>{const s=a(),{params:i,el:r,wrapperEl:n,device:l}=e,o=!!i.nested,d="on"===t?"addEventListener":"removeEventListener",c=t;s[d]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:o}),r[d]("touchstart",e.onTouchStart,{passive:!1}),r[d]("pointerdown",e.onTouchStart,{passive:!1}),s[d]("touchmove",e.onTouchMove,{passive:!1,capture:o}),s[d]("pointermove",e.onTouchMove,{passive:!1,capture:o}),s[d]("touchend",e.onTouchEnd,{passive:!0}),s[d]("pointerup",e.onTouchEnd,{passive:!0}),s[d]("pointercancel",e.onTouchEnd,{passive:!0}),s[d]("touchcancel",e.onTouchEnd,{passive:!0}),s[d]("pointerout",e.onTouchEnd,{passive:!0}),s[d]("pointerleave",e.onTouchEnd,{passive:!0}),s[d]("contextmenu",e.onTouchEnd,{passive:!0}),(i.preventClicks||i.preventClicksPropagation)&&r[d]("click",e.onClick,!0),i.cssMode&&n[d]("scroll",e.onScroll),i.updateOnWindowResize?e[c](l.ios||l.android?"resize orientationchange observerUpdate":"resize observerUpdate",q,!0):e[c]("observerUpdate",q,!0),r[d]("load",e.onLoad,{capture:!0})};const U=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;var K={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function Z(e,t){return function(s){void 0===s&&(s={});const a=Object.keys(s)[0],i=s[a];"object"==typeof i&&null!==i?(!0===e[a]&&(e[a]={enabled:!0}),"navigation"===a&&e[a]&&e[a].enabled&&!e[a].prevEl&&!e[a].nextEl&&(e[a].auto=!0),["pagination","scrollbar"].indexOf(a)>=0&&e[a]&&e[a].enabled&&!e[a].el&&(e[a].auto=!0),a in e&&"enabled"in i?("object"!=typeof e[a]||"enabled"in e[a]||(e[a].enabled=!0),e[a]||(e[a]={enabled:!1}),p(t,s)):p(t,s)):p(t,s)}}const Q={eventsEmitter:I,update:O,translate:D,transition:{setTransition:function(e,t){const s=this;s.params.cssMode||(s.wrapperEl.style.transitionDuration=`${e}ms`,s.wrapperEl.style.transitionDelay=0===e?"0ms":""),s.emit("setTransition",e,t)},transitionStart:function(e,t){void 0===e&&(e=!0);const s=this,{params:a}=s;a.cssMode||(a.autoHeight&&s.updateAutoHeight(),G({swiper:s,runCallbacks:e,direction:t,step:"Start"}))},transitionEnd:function(e,t){void 0===e&&(e=!0);const s=this,{params:a}=s;s.animating=!1,a.cssMode||(s.setTransition(0),G({swiper:s,runCallbacks:e,direction:t,step:"End"}))}},slide:X,loop:H,grabCursor:{setGrabCursor:function(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const s="container"===t.params.touchEventsTarget?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),s.style.cursor="move",s.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame((()=>{t.__preventObserver__=!1}))},unsetGrabCursor:function(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e["container"===e.params.touchEventsTarget?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame((()=>{e.__preventObserver__=!1})))}},events:{attachEvents:function(){const e=this,{params:t}=e;e.onTouchStart=Y.bind(e),e.onTouchMove=B.bind(e),e.onTouchEnd=R.bind(e),e.onDocumentTouchStart=j.bind(e),t.cssMode&&(e.onScroll=_.bind(e)),e.onClick=V.bind(e),e.onLoad=F.bind(e),W(e,"on")},detachEvents:function(){W(this,"off")}},breakpoints:{setBreakpoint:function(){const e=this,{realIndex:t,initialized:s,params:a,el:i}=e,r=a.breakpoints;if(!r||r&&0===Object.keys(r).length)return;const n=e.getBreakpoint(r,e.params.breakpointsBase,e.el);if(!n||e.currentBreakpoint===n)return;const l=(n in r?r[n]:void 0)||e.originalParams,o=U(e,a),d=U(e,l),c=a.enabled;o&&!d?(i.classList.remove(`${a.containerModifierClass}grid`,`${a.containerModifierClass}grid-column`),e.emitContainerClasses()):!o&&d&&(i.classList.add(`${a.containerModifierClass}grid`),(l.grid.fill&&"column"===l.grid.fill||!l.grid.fill&&"column"===a.grid.fill)&&i.classList.add(`${a.containerModifierClass}grid-column`),e.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach((t=>{if(void 0===l[t])return;const s=a[t]&&a[t].enabled,i=l[t]&&l[t].enabled;s&&!i&&e[t].disable(),!s&&i&&e[t].enable()}));const u=l.direction&&l.direction!==a.direction,m=a.loop&&(l.slidesPerView!==a.slidesPerView||u),h=a.loop;u&&s&&e.changeDirection(),p(e.params,l);const f=e.params.enabled,g=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),c&&!f?e.disable():!c&&f&&e.enable(),e.currentBreakpoint=n,e.emit("_beforeBreakpoint",l),s&&(m?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!h&&g?(e.loopCreate(t),e.updateSlides()):h&&!g&&e.loopDestroy()),e.emit("breakpoint",l)},getBreakpoint:function(e,t,s){if(void 0===t&&(t="window"),!e||"container"===t&&!s)return;let a=!1;const i=r(),n="window"===t?i.innerHeight:s.clientHeight,l=Object.keys(e).map((e=>{if("string"==typeof e&&0===e.indexOf("@")){const t=parseFloat(e.substr(1));return{value:n*t,point:e}}return{value:e,point:e}}));l.sort(((e,t)=>parseInt(e.value,10)-parseInt(t.value,10)));for(let e=0;e<l.length;e+=1){const{point:r,value:n}=l[e];"window"===t?i.matchMedia(`(min-width: ${n}px)`).matches&&(a=r):n<=s.clientWidth&&(a=r)}return a||"max"}},checkOverflow:{checkOverflow:function(){const e=this,{isLocked:t,params:s}=e,{slidesOffsetBefore:a}=s;if(a){const t=e.slides.length-1,s=e.slidesGrid[t]+e.slidesSizesGrid[t]+2*a;e.isLocked=e.size>s}else e.isLocked=1===e.snapGrid.length;!0===s.allowSlideNext&&(e.allowSlideNext=!e.isLocked),!0===s.allowSlidePrev&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}},classes:{addClasses:function(){const e=this,{classNames:t,params:s,rtl:a,el:i,device:r}=e,n=function(e,t){const s=[];return e.forEach((e=>{"object"==typeof e?Object.keys(e).forEach((a=>{e[a]&&s.push(t+a)})):"string"==typeof e&&s.push(t+e)})),s}(["initialized",s.direction,{"free-mode":e.params.freeMode&&s.freeMode.enabled},{autoheight:s.autoHeight},{rtl:a},{grid:s.grid&&s.grid.rows>1},{"grid-column":s.grid&&s.grid.rows>1&&"column"===s.grid.fill},{android:r.android},{ios:r.ios},{"css-mode":s.cssMode},{centered:s.cssMode&&s.centeredSlides},{"watch-progress":s.watchSlidesProgress}],s.containerModifierClass);t.push(...n),i.classList.add(...t),e.emitContainerClasses()},removeClasses:function(){const{el:e,classNames:t}=this;e.classList.remove(...t),this.emitContainerClasses()}}},J={};class ee{constructor(){let e,t;for(var s=arguments.length,i=new Array(s),r=0;r<s;r++)i[r]=arguments[r];1===i.length&&i[0].constructor&&"Object"===Object.prototype.toString.call(i[0]).slice(8,-1)?t=i[0]:[e,t]=i,t||(t={}),t=p({},t),e&&!t.el&&(t.el=e);const n=a();if(t.el&&"string"==typeof t.el&&n.querySelectorAll(t.el).length>1){const e=[];return n.querySelectorAll(t.el).forEach((s=>{const a=p({},t,{el:s});e.push(new ee(a))})),e}const l=this;l.__swiper__=!0,l.support=P(),l.device=L({userAgent:t.userAgent}),l.browser=A(),l.eventsListeners={},l.eventsAnyListeners=[],l.modules=[...l.__modules__],t.modules&&Array.isArray(t.modules)&&l.modules.push(...t.modules);const o={};l.modules.forEach((e=>{e({params:t,swiper:l,extendParams:Z(t,o),on:l.on.bind(l),once:l.once.bind(l),off:l.off.bind(l),emit:l.emit.bind(l)})}));const d=p({},K,o);return l.params=p({},d,J,t),l.originalParams=p({},l.params),l.passedParams=p({},t),l.params&&l.params.on&&Object.keys(l.params.on).forEach((e=>{l.on(e,l.params.on[e])})),l.params&&l.params.onAny&&l.onAny(l.params.onAny),Object.assign(l,{enabled:l.params.enabled,el:e,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:()=>"horizontal"===l.params.direction,isVertical:()=>"vertical"===l.params.direction,activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:l.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.emit("_swiper"),l.params.init&&l.init(),l}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}getSlideIndex(e){const{slidesEl:t,params:s}=this,a=y(f(t,`.${s.slideClass}, swiper-slide`)[0]);return y(e)-a}getSlideIndexByData(e){return this.getSlideIndex(this.slides.filter((t=>1*t.getAttribute("data-swiper-slide-index")===e))[0])}recalcSlides(){const{slidesEl:e,params:t}=this;this.slides=f(e,`.${t.slideClass}, swiper-slide`)}enable(){const e=this;e.enabled||(e.enabled=!0,e.params.grabCursor&&e.setGrabCursor(),e.emit("enable"))}disable(){const e=this;e.enabled&&(e.enabled=!1,e.params.grabCursor&&e.unsetGrabCursor(),e.emit("disable"))}setProgress(e,t){const s=this;e=Math.min(Math.max(e,0),1);const a=s.minTranslate(),i=(s.maxTranslate()-a)*e+a;s.translateTo(i,void 0===t?0:t),s.updateActiveIndex(),s.updateSlidesClasses()}emitContainerClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=e.el.className.split(" ").filter((t=>0===t.indexOf("swiper")||0===t.indexOf(e.params.containerModifierClass)));e.emit("_containerClasses",t.join(" "))}getSlideClasses(e){const t=this;return t.destroyed?"":e.className.split(" ").filter((e=>0===e.indexOf("swiper-slide")||0===e.indexOf(t.params.slideClass))).join(" ")}emitSlidesClasses(){const e=this;if(!e.params._emitClasses||!e.el)return;const t=[];e.slides.forEach((s=>{const a=e.getSlideClasses(s);t.push({slideEl:s,classNames:a}),e.emit("_slideClass",s,a)})),e.emit("_slideClasses",t)}slidesPerViewDynamic(e,t){void 0===e&&(e="current"),void 0===t&&(t=!1);const{params:s,slides:a,slidesGrid:i,slidesSizesGrid:r,size:n,activeIndex:l}=this;let o=1;if("number"==typeof s.slidesPerView)return s.slidesPerView;if(s.centeredSlides){let e,t=a[l]?a[l].swiperSlideSize:0;for(let s=l+1;s<a.length;s+=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0));for(let s=l-1;s>=0;s-=1)a[s]&&!e&&(t+=a[s].swiperSlideSize,o+=1,t>n&&(e=!0))}else if("current"===e)for(let e=l+1;e<a.length;e+=1){(t?i[e]+r[e]-i[l]<n:i[e]-i[l]<n)&&(o+=1)}else for(let e=l-1;e>=0;e-=1){i[l]-i[e]<n&&(o+=1)}return o}update(){const e=this;if(!e||e.destroyed)return;const{snapGrid:t,params:s}=e;function a(){const t=e.rtlTranslate?-1*e.translate:e.translate,s=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(s),e.updateActiveIndex(),e.updateSlidesClasses()}let i;if(s.breakpoints&&e.setBreakpoint(),[...e.el.querySelectorAll('[loading="lazy"]')].forEach((t=>{t.complete&&z(e,t)})),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),s.freeMode&&s.freeMode.enabled&&!s.cssMode)a(),s.autoHeight&&e.updateAutoHeight();else{if(("auto"===s.slidesPerView||s.slidesPerView>1)&&e.isEnd&&!s.centeredSlides){const t=e.virtual&&s.virtual.enabled?e.virtual.slides:e.slides;i=e.slideTo(t.length-1,0,!1,!0)}else i=e.slideTo(e.activeIndex,0,!1,!0);i||a()}s.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,t){void 0===t&&(t=!0);const s=this,a=s.params.direction;return e||(e="horizontal"===a?"vertical":"horizontal"),e===a||"horizontal"!==e&&"vertical"!==e||(s.el.classList.remove(`${s.params.containerModifierClass}${a}`),s.el.classList.add(`${s.params.containerModifierClass}${e}`),s.emitContainerClasses(),s.params.direction=e,s.slides.forEach((t=>{"vertical"===e?t.style.width="":t.style.height=""})),s.emit("changeDirection"),t&&s.update()),s}changeLanguageDirection(e){const t=this;t.rtl&&"rtl"===e||!t.rtl&&"ltr"===e||(t.rtl="rtl"===e,t.rtlTranslate="horizontal"===t.params.direction&&t.rtl,t.rtl?(t.el.classList.add(`${t.params.containerModifierClass}rtl`),t.el.dir="rtl"):(t.el.classList.remove(`${t.params.containerModifierClass}rtl`),t.el.dir="ltr"),t.update())}mount(e){const t=this;if(t.mounted)return!0;let s=e||t.params.el;if("string"==typeof s&&(s=document.querySelector(s)),!s)return!1;s.swiper=t,s.parentNode&&s.parentNode.host&&"SWIPER-CONTAINER"===s.parentNode.host.nodeName&&(t.isElement=!0);const a=()=>`.${(t.params.wrapperClass||"").trim().split(" ").join(".")}`;let i=(()=>{if(s&&s.shadowRoot&&s.shadowRoot.querySelector){return s.shadowRoot.querySelector(a())}return f(s,a())[0]})();return!i&&t.params.createElements&&(i=v("div",t.params.wrapperClass),s.append(i),f(s,`.${t.params.slideClass}`).forEach((e=>{i.append(e)}))),Object.assign(t,{el:s,wrapperEl:i,slidesEl:t.isElement&&!s.parentNode.host.slideSlots?s.parentNode.host:i,hostEl:t.isElement?s.parentNode.host:s,mounted:!0,rtl:"rtl"===s.dir.toLowerCase()||"rtl"===b(s,"direction"),rtlTranslate:"horizontal"===t.params.direction&&("rtl"===s.dir.toLowerCase()||"rtl"===b(s,"direction")),wrongRTL:"-webkit-box"===b(i,"display")}),!0}init(e){const t=this;if(t.initialized)return t;if(!1===t.mount(e))return t;t.emit("beforeInit"),t.params.breakpoints&&t.setBreakpoint(),t.addClasses(),t.updateSize(),t.updateSlides(),t.params.watchOverflow&&t.checkOverflow(),t.params.grabCursor&&t.enabled&&t.setGrabCursor(),t.params.loop&&t.virtual&&t.params.virtual.enabled?t.slideTo(t.params.initialSlide+t.virtual.slidesBefore,0,t.params.runCallbacksOnInit,!1,!0):t.slideTo(t.params.initialSlide,0,t.params.runCallbacksOnInit,!1,!0),t.params.loop&&t.loopCreate(),t.attachEvents();const s=[...t.el.querySelectorAll('[loading="lazy"]')];return t.isElement&&s.push(...t.hostEl.querySelectorAll('[loading="lazy"]')),s.forEach((e=>{e.complete?z(t,e):e.addEventListener("load",(e=>{z(t,e.target)}))})),k(t),t.initialized=!0,k(t),t.emit("init"),t.emit("afterInit"),t}destroy(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);const s=this,{params:a,el:i,wrapperEl:r,slides:n}=s;return void 0===s.params||s.destroyed||(s.emit("beforeDestroy"),s.initialized=!1,s.detachEvents(),a.loop&&s.loopDestroy(),t&&(s.removeClasses(),i.removeAttribute("style"),r.removeAttribute("style"),n&&n.length&&n.forEach((e=>{e.classList.remove(a.slideVisibleClass,a.slideFullyVisibleClass,a.slideActiveClass,a.slideNextClass,a.slidePrevClass),e.removeAttribute("style"),e.removeAttribute("data-swiper-slide-index")}))),s.emit("destroy"),Object.keys(s.eventsListeners).forEach((e=>{s.off(e)})),!1!==e&&(s.el.swiper=null,function(e){const t=e;Object.keys(t).forEach((e=>{try{t[e]=null}catch(e){}try{delete t[e]}catch(e){}}))}(s)),s.destroyed=!0),null}static extendDefaults(e){p(J,e)}static get extendedDefaults(){return J}static get defaults(){return K}static installModule(e){ee.prototype.__modules__||(ee.prototype.__modules__=[]);const t=ee.prototype.__modules__;"function"==typeof e&&t.indexOf(e)<0&&t.push(e)}static use(e){return Array.isArray(e)?(e.forEach((e=>ee.installModule(e))),ee):(ee.installModule(e),ee)}}function te(e,t,s,a){return e.params.createElements&&Object.keys(a).forEach((i=>{if(!s[i]&&!0===s.auto){let r=f(e.el,`.${a[i]}`)[0];r||(r=v("div",a[i]),r.className=a[i],e.el.append(r)),s[i]=r,t[i]=r}})),s}function se(e){return void 0===e&&(e=""),`.${e.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function ae(e){const t=this,{params:s,slidesEl:a}=t;s.loop&&t.loopDestroy();const i=e=>{if("string"==typeof e){const t=document.createElement("div");t.innerHTML=e,a.append(t.children[0]),t.innerHTML=""}else a.append(e)};if("object"==typeof e&&"length"in e)for(let t=0;t<e.length;t+=1)e[t]&&i(e[t]);else i(e);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update()}function ie(e){const t=this,{params:s,activeIndex:a,slidesEl:i}=t;s.loop&&t.loopDestroy();let r=a+1;const n=e=>{if("string"==typeof e){const t=document.createElement("div");t.innerHTML=e,i.prepend(t.children[0]),t.innerHTML=""}else i.prepend(e)};if("object"==typeof e&&"length"in e){for(let t=0;t<e.length;t+=1)e[t]&&n(e[t]);r=a+e.length}else n(e);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update(),t.slideTo(r,0,!1)}function re(e,t){const s=this,{params:a,activeIndex:i,slidesEl:r}=s;let n=i;a.loop&&(n-=s.loopedSlides,s.loopDestroy(),s.recalcSlides());const l=s.slides.length;if(e<=0)return void s.prependSlide(t);if(e>=l)return void s.appendSlide(t);let o=n>e?n+1:n;const d=[];for(let t=l-1;t>=e;t-=1){const e=s.slides[t];e.remove(),d.unshift(e)}if("object"==typeof t&&"length"in t){for(let e=0;e<t.length;e+=1)t[e]&&r.append(t[e]);o=n>e?n+t.length:n}else r.append(t);for(let e=0;e<d.length;e+=1)r.append(d[e]);s.recalcSlides(),a.loop&&s.loopCreate(),a.observer&&!s.isElement||s.update(),a.loop?s.slideTo(o+s.loopedSlides,0,!1):s.slideTo(o,0,!1)}function ne(e){const t=this,{params:s,activeIndex:a}=t;let i=a;s.loop&&(i-=t.loopedSlides,t.loopDestroy());let r,n=i;if("object"==typeof e&&"length"in e){for(let s=0;s<e.length;s+=1)r=e[s],t.slides[r]&&t.slides[r].remove(),r<n&&(n-=1);n=Math.max(n,0)}else r=e,t.slides[r]&&t.slides[r].remove(),r<n&&(n-=1),n=Math.max(n,0);t.recalcSlides(),s.loop&&t.loopCreate(),s.observer&&!t.isElement||t.update(),s.loop?t.slideTo(n+t.loopedSlides,0,!1):t.slideTo(n,0,!1)}function le(){const e=this,t=[];for(let s=0;s<e.slides.length;s+=1)t.push(s);e.removeSlide(t)}function oe(e){const{effect:t,swiper:s,on:a,setTranslate:i,setTransition:r,overwriteParams:n,perspective:l,recreateShadows:o,getEffectParams:d}=e;let c;a("beforeInit",(()=>{if(s.params.effect!==t)return;s.classNames.push(`${s.params.containerModifierClass}${t}`),l&&l()&&s.classNames.push(`${s.params.containerModifierClass}3d`);const e=n?n():{};Object.assign(s.params,e),Object.assign(s.originalParams,e)})),a("setTranslate",(()=>{s.params.effect===t&&i()})),a("setTransition",((e,a)=>{s.params.effect===t&&r(a)})),a("transitionEnd",(()=>{if(s.params.effect===t&&o){if(!d||!d().slideShadows)return;s.slides.forEach((e=>{e.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((e=>e.remove()))})),o()}})),a("virtualUpdate",(()=>{s.params.effect===t&&(s.slides.length||(c=!0),requestAnimationFrame((()=>{c&&s.slides&&s.slides.length&&(i(),c=!1)})))}))}function de(e,t){const s=h(t);return s!==t&&(s.style.backfaceVisibility="hidden",s.style["-webkit-backface-visibility"]="hidden"),s}function ce(e){let{swiper:t,duration:s,transformElements:a,allSlides:i}=e;const{activeIndex:r}=t;if(t.params.virtualTranslate&&0!==s){let e,s=!1;e=i?a:a.filter((e=>{const s=e.classList.contains("swiper-slide-transform")?(e=>{if(!e.parentElement)return t.slides.filter((t=>t.shadowRoot&&t.shadowRoot===e.parentNode))[0];return e.parentElement})(e):e;return t.getSlideIndex(s)===r})),e.forEach((e=>{x(e,(()=>{if(s)return;if(!t||t.destroyed)return;s=!0,t.animating=!1;const e=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(e)}))}))}}function pe(e,t,s){const a=`swiper-slide-shadow${s?`-${s}`:""}${e?` swiper-slide-shadow-${e}`:""}`,i=h(t);let r=i.querySelector(`.${a.split(" ").join(".")}`);return r||(r=v("div",a.split(" ")),i.append(r)),r}Object.keys(Q).forEach((e=>{Object.keys(Q[e]).forEach((t=>{ee.prototype[t]=Q[e][t]}))})),ee.use([function(e){let{swiper:t,on:s,emit:a}=e;const i=r();let n=null,l=null;const o=()=>{t&&!t.destroyed&&t.initialized&&(a("beforeResize"),a("resize"))},d=()=>{t&&!t.destroyed&&t.initialized&&a("orientationchange")};s("init",(()=>{t.params.resizeObserver&&void 0!==i.ResizeObserver?t&&!t.destroyed&&t.initialized&&(n=new ResizeObserver((e=>{l=i.requestAnimationFrame((()=>{const{width:s,height:a}=t;let i=s,r=a;e.forEach((e=>{let{contentBoxSize:s,contentRect:a,target:n}=e;n&&n!==t.el||(i=a?a.width:(s[0]||s).inlineSize,r=a?a.height:(s[0]||s).blockSize)})),i===s&&r===a||o()}))})),n.observe(t.el)):(i.addEventListener("resize",o),i.addEventListener("orientationchange",d))})),s("destroy",(()=>{l&&i.cancelAnimationFrame(l),n&&n.unobserve&&t.el&&(n.unobserve(t.el),n=null),i.removeEventListener("resize",o),i.removeEventListener("orientationchange",d)}))},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const n=[],l=r(),o=function(e,s){void 0===s&&(s={});const a=new(l.MutationObserver||l.WebkitMutationObserver)((e=>{if(t.__preventObserver__)return;if(1===e.length)return void i("observerUpdate",e[0]);const s=function(){i("observerUpdate",e[0])};l.requestAnimationFrame?l.requestAnimationFrame(s):l.setTimeout(s,0)}));a.observe(e,{attributes:void 0===s.attributes||s.attributes,childList:void 0===s.childList||s.childList,characterData:void 0===s.characterData||s.characterData}),n.push(a)};s({observer:!1,observeParents:!1,observeSlideChildren:!1}),a("init",(()=>{if(t.params.observer){if(t.params.observeParents){const e=E(t.hostEl);for(let t=0;t<e.length;t+=1)o(e[t])}o(t.hostEl,{childList:t.params.observeSlideChildren}),o(t.wrapperEl,{attributes:!1})}})),a("destroy",(()=>{n.forEach((e=>{e.disconnect()})),n.splice(0,n.length)}))}]);const ue=[function(e){let t,{swiper:s,extendParams:i,on:r,emit:n}=e;i({virtual:{enabled:!1,slides:[],cache:!0,renderSlide:null,renderExternal:null,renderExternalUpdate:!0,addSlidesBefore:0,addSlidesAfter:0}});const l=a();s.virtual={cache:{},from:void 0,to:void 0,slides:[],offset:0,slidesGrid:[]};const o=l.createElement("div");function d(e,t){const a=s.params.virtual;if(a.cache&&s.virtual.cache[t])return s.virtual.cache[t];let i;return a.renderSlide?(i=a.renderSlide.call(s,e,t),"string"==typeof i&&(o.innerHTML=i,i=o.children[0])):i=s.isElement?v("swiper-slide"):v("div",s.params.slideClass),i.setAttribute("data-swiper-slide-index",t),a.renderSlide||(i.innerHTML=e),a.cache&&(s.virtual.cache[t]=i),i}function c(e){const{slidesPerView:t,slidesPerGroup:a,centeredSlides:i,loop:r}=s.params,{addSlidesBefore:l,addSlidesAfter:o}=s.params.virtual,{from:c,to:p,slides:u,slidesGrid:m,offset:h}=s.virtual;s.params.cssMode||s.updateActiveIndex();const g=s.activeIndex||0;let v,w,b;v=s.rtlTranslate?"right":s.isHorizontal()?"left":"top",i?(w=Math.floor(t/2)+a+o,b=Math.floor(t/2)+a+l):(w=t+(a-1)+o,b=(r?t:a)+l);let y=g-b,E=g+w;r||(y=Math.max(y,0),E=Math.min(E,u.length-1));let x=(s.slidesGrid[y]||0)-(s.slidesGrid[0]||0);function S(){s.updateSlides(),s.updateProgress(),s.updateSlidesClasses(),n("virtualUpdate")}if(r&&g>=b?(y-=b,i||(x+=s.slidesGrid[0])):r&&g<b&&(y=-b,i&&(x+=s.slidesGrid[0])),Object.assign(s.virtual,{from:y,to:E,offset:x,slidesGrid:s.slidesGrid,slidesBefore:b,slidesAfter:w}),c===y&&p===E&&!e)return s.slidesGrid!==m&&x!==h&&s.slides.forEach((e=>{e.style[v]=x-Math.abs(s.cssOverflowAdjustment())+"px"})),s.updateProgress(),void n("virtualUpdate");if(s.params.virtual.renderExternal)return s.params.virtual.renderExternal.call(s,{offset:x,from:y,to:E,slides:function(){const e=[];for(let t=y;t<=E;t+=1)e.push(u[t]);return e}()}),void(s.params.virtual.renderExternalUpdate?S():n("virtualUpdate"));const T=[],M=[],C=e=>{let t=e;return e<0?t=u.length+e:t>=u.length&&(t-=u.length),t};if(e)s.slides.filter((e=>e.matches(`.${s.params.slideClass}, swiper-slide`))).forEach((e=>{e.remove()}));else for(let e=c;e<=p;e+=1)if(e<y||e>E){const t=C(e);s.slides.filter((e=>e.matches(`.${s.params.slideClass}[data-swiper-slide-index="${t}"], swiper-slide[data-swiper-slide-index="${t}"]`))).forEach((e=>{e.remove()}))}const P=r?-u.length:0,L=r?2*u.length:u.length;for(let t=P;t<L;t+=1)if(t>=y&&t<=E){const s=C(t);void 0===p||e?M.push(s):(t>p&&M.push(s),t<c&&T.push(s))}if(M.forEach((e=>{s.slidesEl.append(d(u[e],e))})),r)for(let e=T.length-1;e>=0;e-=1){const t=T[e];s.slidesEl.prepend(d(u[t],t))}else T.sort(((e,t)=>t-e)),T.forEach((e=>{s.slidesEl.prepend(d(u[e],e))}));f(s.slidesEl,".swiper-slide, swiper-slide").forEach((e=>{e.style[v]=x-Math.abs(s.cssOverflowAdjustment())+"px"})),S()}r("beforeInit",(()=>{if(!s.params.virtual.enabled)return;let e;if(void 0===s.passedParams.virtual.slides){const t=[...s.slidesEl.children].filter((e=>e.matches(`.${s.params.slideClass}, swiper-slide`)));t&&t.length&&(s.virtual.slides=[...t],e=!0,t.forEach(((e,t)=>{e.setAttribute("data-swiper-slide-index",t),s.virtual.cache[t]=e,e.remove()})))}e||(s.virtual.slides=s.params.virtual.slides),s.classNames.push(`${s.params.containerModifierClass}virtual`),s.params.watchSlidesProgress=!0,s.originalParams.watchSlidesProgress=!0,c()})),r("setTranslate",(()=>{s.params.virtual.enabled&&(s.params.cssMode&&!s._immediateVirtual?(clearTimeout(t),t=setTimeout((()=>{c()}),100)):c())})),r("init update resize",(()=>{s.params.virtual.enabled&&s.params.cssMode&&u(s.wrapperEl,"--swiper-virtual-size",`${s.virtualSize}px`)})),Object.assign(s.virtual,{appendSlide:function(e){if("object"==typeof e&&"length"in e)for(let t=0;t<e.length;t+=1)e[t]&&s.virtual.slides.push(e[t]);else s.virtual.slides.push(e);c(!0)},prependSlide:function(e){const t=s.activeIndex;let a=t+1,i=1;if(Array.isArray(e)){for(let t=0;t<e.length;t+=1)e[t]&&s.virtual.slides.unshift(e[t]);a=t+e.length,i=e.length}else s.virtual.slides.unshift(e);if(s.params.virtual.cache){const e=s.virtual.cache,t={};Object.keys(e).forEach((s=>{const a=e[s],r=a.getAttribute("data-swiper-slide-index");r&&a.setAttribute("data-swiper-slide-index",parseInt(r,10)+i),t[parseInt(s,10)+i]=a})),s.virtual.cache=t}c(!0),s.slideTo(a,0)},removeSlide:function(e){if(null==e)return;let t=s.activeIndex;if(Array.isArray(e))for(let a=e.length-1;a>=0;a-=1)s.params.virtual.cache&&(delete s.virtual.cache[e[a]],Object.keys(s.virtual.cache).forEach((t=>{t>e&&(s.virtual.cache[t-1]=s.virtual.cache[t],s.virtual.cache[t-1].setAttribute("data-swiper-slide-index",t-1),delete s.virtual.cache[t])}))),s.virtual.slides.splice(e[a],1),e[a]<t&&(t-=1),t=Math.max(t,0);else s.params.virtual.cache&&(delete s.virtual.cache[e],Object.keys(s.virtual.cache).forEach((t=>{t>e&&(s.virtual.cache[t-1]=s.virtual.cache[t],s.virtual.cache[t-1].setAttribute("data-swiper-slide-index",t-1),delete s.virtual.cache[t])}))),s.virtual.slides.splice(e,1),e<t&&(t-=1),t=Math.max(t,0);c(!0),s.slideTo(t,0)},removeAllSlides:function(){s.virtual.slides=[],s.params.virtual.cache&&(s.virtual.cache={}),c(!0),s.slideTo(0,0)},update:c})},function(e){let{swiper:t,extendParams:s,on:i,emit:n}=e;const l=a(),o=r();function d(e){if(!t.enabled)return;const{rtlTranslate:s}=t;let a=e;a.originalEvent&&(a=a.originalEvent);const i=a.keyCode||a.charCode,r=t.params.keyboard.pageUpDown,d=r&&33===i,c=r&&34===i,p=37===i,u=39===i,m=38===i,h=40===i;if(!t.allowSlideNext&&(t.isHorizontal()&&u||t.isVertical()&&h||c))return!1;if(!t.allowSlidePrev&&(t.isHorizontal()&&p||t.isVertical()&&m||d))return!1;if(!(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey||l.activeElement&&l.activeElement.nodeName&&("input"===l.activeElement.nodeName.toLowerCase()||"textarea"===l.activeElement.nodeName.toLowerCase()))){if(t.params.keyboard.onlyInViewport&&(d||c||p||u||m||h)){let e=!1;if(E(t.el,`.${t.params.slideClass}, swiper-slide`).length>0&&0===E(t.el,`.${t.params.slideActiveClass}`).length)return;const a=t.el,i=a.clientWidth,r=a.clientHeight,n=o.innerWidth,l=o.innerHeight,d=w(a);s&&(d.left-=a.scrollLeft);const c=[[d.left,d.top],[d.left+i,d.top],[d.left,d.top+r],[d.left+i,d.top+r]];for(let t=0;t<c.length;t+=1){const s=c[t];if(s[0]>=0&&s[0]<=n&&s[1]>=0&&s[1]<=l){if(0===s[0]&&0===s[1])continue;e=!0}}if(!e)return}t.isHorizontal()?((d||c||p||u)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),((c||u)&&!s||(d||p)&&s)&&t.slideNext(),((d||p)&&!s||(c||u)&&s)&&t.slidePrev()):((d||c||m||h)&&(a.preventDefault?a.preventDefault():a.returnValue=!1),(c||h)&&t.slideNext(),(d||m)&&t.slidePrev()),n("keyPress",i)}}function c(){t.keyboard.enabled||(l.addEventListener("keydown",d),t.keyboard.enabled=!0)}function p(){t.keyboard.enabled&&(l.removeEventListener("keydown",d),t.keyboard.enabled=!1)}t.keyboard={enabled:!1},s({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}}),i("init",(()=>{t.params.keyboard.enabled&&c()})),i("destroy",(()=>{t.keyboard.enabled&&p()})),Object.assign(t.keyboard,{enable:c,disable:p})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const n=r();let d;s({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null,noMousewheelClass:"swiper-no-mousewheel"}}),t.mousewheel={enabled:!1};let c,p=o();const u=[];function m(){t.enabled&&(t.mouseEntered=!0)}function h(){t.enabled&&(t.mouseEntered=!1)}function f(e){return!(t.params.mousewheel.thresholdDelta&&e.delta<t.params.mousewheel.thresholdDelta)&&(!(t.params.mousewheel.thresholdTime&&o()-p<t.params.mousewheel.thresholdTime)&&(e.delta>=6&&o()-p<60||(e.direction<0?t.isEnd&&!t.params.loop||t.animating||(t.slideNext(),i("scroll",e.raw)):t.isBeginning&&!t.params.loop||t.animating||(t.slidePrev(),i("scroll",e.raw)),p=(new n.Date).getTime(),!1)))}function g(e){let s=e,a=!0;if(!t.enabled)return;if(e.target.closest(`.${t.params.mousewheel.noMousewheelClass}`))return;const r=t.params.mousewheel;t.params.cssMode&&s.preventDefault();let n=t.el;"container"!==t.params.mousewheel.eventsTarget&&(n=document.querySelector(t.params.mousewheel.eventsTarget));const p=n&&n.contains(s.target);if(!t.mouseEntered&&!p&&!r.releaseOnEdges)return!0;s.originalEvent&&(s=s.originalEvent);let m=0;const h=t.rtlTranslate?-1:1,g=function(e){let t=0,s=0,a=0,i=0;return"detail"in e&&(s=e.detail),"wheelDelta"in e&&(s=-e.wheelDelta/120),"wheelDeltaY"in e&&(s=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=s,s=0),a=10*t,i=10*s,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(a=e.deltaX),e.shiftKey&&!a&&(a=i,i=0),(a||i)&&e.deltaMode&&(1===e.deltaMode?(a*=40,i*=40):(a*=800,i*=800)),a&&!t&&(t=a<1?-1:1),i&&!s&&(s=i<1?-1:1),{spinX:t,spinY:s,pixelX:a,pixelY:i}}(s);if(r.forceToAxis)if(t.isHorizontal()){if(!(Math.abs(g.pixelX)>Math.abs(g.pixelY)))return!0;m=-g.pixelX*h}else{if(!(Math.abs(g.pixelY)>Math.abs(g.pixelX)))return!0;m=-g.pixelY}else m=Math.abs(g.pixelX)>Math.abs(g.pixelY)?-g.pixelX*h:-g.pixelY;if(0===m)return!0;r.invert&&(m=-m);let v=t.getTranslate()+m*r.sensitivity;if(v>=t.minTranslate()&&(v=t.minTranslate()),v<=t.maxTranslate()&&(v=t.maxTranslate()),a=!!t.params.loop||!(v===t.minTranslate()||v===t.maxTranslate()),a&&t.params.nested&&s.stopPropagation(),t.params.freeMode&&t.params.freeMode.enabled){const e={time:o(),delta:Math.abs(m),direction:Math.sign(m)},a=c&&e.time<c.time+500&&e.delta<=c.delta&&e.direction===c.direction;if(!a){c=void 0;let n=t.getTranslate()+m*r.sensitivity;const o=t.isBeginning,p=t.isEnd;if(n>=t.minTranslate()&&(n=t.minTranslate()),n<=t.maxTranslate()&&(n=t.maxTranslate()),t.setTransition(0),t.setTranslate(n),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses(),(!o&&t.isBeginning||!p&&t.isEnd)&&t.updateSlidesClasses(),t.params.loop&&t.loopFix({direction:e.direction<0?"next":"prev",byMousewheel:!0}),t.params.freeMode.sticky){clearTimeout(d),d=void 0,u.length>=15&&u.shift();const s=u.length?u[u.length-1]:void 0,a=u[0];if(u.push(e),s&&(e.delta>s.delta||e.direction!==s.direction))u.splice(0);else if(u.length>=15&&e.time-a.time<500&&a.delta-e.delta>=1&&e.delta<=6){const s=m>0?.8:.2;c=e,u.splice(0),d=l((()=>{t.slideToClosest(t.params.speed,!0,void 0,s)}),0)}d||(d=l((()=>{c=e,u.splice(0),t.slideToClosest(t.params.speed,!0,void 0,.5)}),500))}if(a||i("scroll",s),t.params.autoplay&&t.params.autoplayDisableOnInteraction&&t.autoplay.stop(),r.releaseOnEdges&&(n===t.minTranslate()||n===t.maxTranslate()))return!0}}else{const s={time:o(),delta:Math.abs(m),direction:Math.sign(m),raw:e};u.length>=2&&u.shift();const a=u.length?u[u.length-1]:void 0;if(u.push(s),a?(s.direction!==a.direction||s.delta>a.delta||s.time>a.time+150)&&f(s):f(s),function(e){const s=t.params.mousewheel;if(e.direction<0){if(t.isEnd&&!t.params.loop&&s.releaseOnEdges)return!0}else if(t.isBeginning&&!t.params.loop&&s.releaseOnEdges)return!0;return!1}(s))return!0}return s.preventDefault?s.preventDefault():s.returnValue=!1,!1}function v(e){let s=t.el;"container"!==t.params.mousewheel.eventsTarget&&(s=document.querySelector(t.params.mousewheel.eventsTarget)),s[e]("mouseenter",m),s[e]("mouseleave",h),s[e]("wheel",g)}function w(){return t.params.cssMode?(t.wrapperEl.removeEventListener("wheel",g),!0):!t.mousewheel.enabled&&(v("addEventListener"),t.mousewheel.enabled=!0,!0)}function b(){return t.params.cssMode?(t.wrapperEl.addEventListener(event,g),!0):!!t.mousewheel.enabled&&(v("removeEventListener"),t.mousewheel.enabled=!1,!0)}a("init",(()=>{!t.params.mousewheel.enabled&&t.params.cssMode&&b(),t.params.mousewheel.enabled&&w()})),a("destroy",(()=>{t.params.cssMode&&w(),t.mousewheel.enabled&&b()})),Object.assign(t.mousewheel,{enable:w,disable:b})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;s({navigation:{nextEl:null,prevEl:null,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),t.navigation={nextEl:null,prevEl:null};const r=e=>(Array.isArray(e)?e:[e]).filter((e=>!!e));function n(e){let s;return e&&"string"==typeof e&&t.isElement&&(s=t.el.querySelector(e),s)?s:(e&&("string"==typeof e&&(s=[...document.querySelectorAll(e)]),t.params.uniqueNavElements&&"string"==typeof e&&s.length>1&&1===t.el.querySelectorAll(e).length&&(s=t.el.querySelector(e))),e&&!s?e:s)}function l(e,s){const a=t.params.navigation;(e=r(e)).forEach((e=>{e&&(e.classList[s?"add":"remove"](...a.disabledClass.split(" ")),"BUTTON"===e.tagName&&(e.disabled=s),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](a.lockClass))}))}function o(){const{nextEl:e,prevEl:s}=t.navigation;if(t.params.loop)return l(s,!1),void l(e,!1);l(s,t.isBeginning&&!t.params.rewind),l(e,t.isEnd&&!t.params.rewind)}function d(e){e.preventDefault(),(!t.isBeginning||t.params.loop||t.params.rewind)&&(t.slidePrev(),i("navigationPrev"))}function c(e){e.preventDefault(),(!t.isEnd||t.params.loop||t.params.rewind)&&(t.slideNext(),i("navigationNext"))}function p(){const e=t.params.navigation;if(t.params.navigation=te(t,t.originalParams.navigation,t.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!e.nextEl&&!e.prevEl)return;let s=n(e.nextEl),a=n(e.prevEl);Object.assign(t.navigation,{nextEl:s,prevEl:a}),s=r(s),a=r(a);const i=(s,a)=>{s&&s.addEventListener("click","next"===a?c:d),!t.enabled&&s&&s.classList.add(...e.lockClass.split(" "))};s.forEach((e=>i(e,"next"))),a.forEach((e=>i(e,"prev")))}function u(){let{nextEl:e,prevEl:s}=t.navigation;e=r(e),s=r(s);const a=(e,s)=>{e.removeEventListener("click","next"===s?c:d),e.classList.remove(...t.params.navigation.disabledClass.split(" "))};e.forEach((e=>a(e,"next"))),s.forEach((e=>a(e,"prev")))}a("init",(()=>{!1===t.params.navigation.enabled?m():(p(),o())})),a("toEdge fromEdge lock unlock",(()=>{o()})),a("destroy",(()=>{u()})),a("enable disable",(()=>{let{nextEl:e,prevEl:s}=t.navigation;e=r(e),s=r(s),t.enabled?o():[...e,...s].filter((e=>!!e)).forEach((e=>e.classList.add(t.params.navigation.lockClass)))})),a("click",((e,s)=>{let{nextEl:a,prevEl:n}=t.navigation;a=r(a),n=r(n);const l=s.target;if(t.params.navigation.hideOnClick&&!n.includes(l)&&!a.includes(l)){if(t.pagination&&t.params.pagination&&t.params.pagination.clickable&&(t.pagination.el===l||t.pagination.el.contains(l)))return;let e;a.length?e=a[0].classList.contains(t.params.navigation.hiddenClass):n.length&&(e=n[0].classList.contains(t.params.navigation.hiddenClass)),i(!0===e?"navigationShow":"navigationHide"),[...a,...n].filter((e=>!!e)).forEach((e=>e.classList.toggle(t.params.navigation.hiddenClass)))}}));const m=()=>{t.el.classList.add(...t.params.navigation.navigationDisabledClass.split(" ")),u()};Object.assign(t.navigation,{enable:()=>{t.el.classList.remove(...t.params.navigation.navigationDisabledClass.split(" ")),p(),o()},disable:m,update:o,init:p,destroy:u})},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const r="swiper-pagination";let n;s({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:e=>e,formatFractionTotal:e=>e,bulletClass:`${r}-bullet`,bulletActiveClass:`${r}-bullet-active`,modifierClass:`${r}-`,currentClass:`${r}-current`,totalClass:`${r}-total`,hiddenClass:`${r}-hidden`,progressbarFillClass:`${r}-progressbar-fill`,progressbarOppositeClass:`${r}-progressbar-opposite`,clickableClass:`${r}-clickable`,lockClass:`${r}-lock`,horizontalClass:`${r}-horizontal`,verticalClass:`${r}-vertical`,paginationDisabledClass:`${r}-disabled`}}),t.pagination={el:null,bullets:[]};let l=0;const o=e=>(Array.isArray(e)?e:[e]).filter((e=>!!e));function d(){return!t.params.pagination.el||!t.pagination.el||Array.isArray(t.pagination.el)&&0===t.pagination.el.length}function c(e,s){const{bulletActiveClass:a}=t.params.pagination;e&&(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&(e.classList.add(`${a}-${s}`),(e=e[("prev"===s?"previous":"next")+"ElementSibling"])&&e.classList.add(`${a}-${s}-${s}`))}function p(e){const s=e.target.closest(se(t.params.pagination.bulletClass));if(!s)return;e.preventDefault();const a=y(s)*t.params.slidesPerGroup;if(t.params.loop){if(t.realIndex===a)return;t.slideToLoop(a)}else t.slideTo(a)}function u(){const e=t.rtl,s=t.params.pagination;if(d())return;let a,r,p=t.pagination.el;p=o(p);const u=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.slides.length,m=t.params.loop?Math.ceil(u/t.params.slidesPerGroup):t.snapGrid.length;if(t.params.loop?(r=t.previousRealIndex||0,a=t.params.slidesPerGroup>1?Math.floor(t.realIndex/t.params.slidesPerGroup):t.realIndex):void 0!==t.snapIndex?(a=t.snapIndex,r=t.previousSnapIndex):(r=t.previousIndex||0,a=t.activeIndex||0),"bullets"===s.type&&t.pagination.bullets&&t.pagination.bullets.length>0){const i=t.pagination.bullets;let o,d,u;if(s.dynamicBullets&&(n=S(i[0],t.isHorizontal()?"width":"height",!0),p.forEach((e=>{e.style[t.isHorizontal()?"width":"height"]=n*(s.dynamicMainBullets+4)+"px"})),s.dynamicMainBullets>1&&void 0!==r&&(l+=a-(r||0),l>s.dynamicMainBullets-1?l=s.dynamicMainBullets-1:l<0&&(l=0)),o=Math.max(a-l,0),d=o+(Math.min(i.length,s.dynamicMainBullets)-1),u=(d+o)/2),i.forEach((e=>{const t=[...["","-next","-next-next","-prev","-prev-prev","-main"].map((e=>`${s.bulletActiveClass}${e}`))].map((e=>"string"==typeof e&&e.includes(" ")?e.split(" "):e)).flat();e.classList.remove(...t)})),p.length>1)i.forEach((e=>{const i=y(e);i===a?e.classList.add(...s.bulletActiveClass.split(" ")):t.isElement&&e.setAttribute("part","bullet"),s.dynamicBullets&&(i>=o&&i<=d&&e.classList.add(...`${s.bulletActiveClass}-main`.split(" ")),i===o&&c(e,"prev"),i===d&&c(e,"next"))}));else{const e=i[a];if(e&&e.classList.add(...s.bulletActiveClass.split(" ")),t.isElement&&i.forEach(((e,t)=>{e.setAttribute("part",t===a?"bullet-active":"bullet")})),s.dynamicBullets){const e=i[o],t=i[d];for(let e=o;e<=d;e+=1)i[e]&&i[e].classList.add(...`${s.bulletActiveClass}-main`.split(" "));c(e,"prev"),c(t,"next")}}if(s.dynamicBullets){const a=Math.min(i.length,s.dynamicMainBullets+4),r=(n*a-n)/2-u*n,l=e?"right":"left";i.forEach((e=>{e.style[t.isHorizontal()?l:"top"]=`${r}px`}))}}p.forEach(((e,r)=>{if("fraction"===s.type&&(e.querySelectorAll(se(s.currentClass)).forEach((e=>{e.textContent=s.formatFractionCurrent(a+1)})),e.querySelectorAll(se(s.totalClass)).forEach((e=>{e.textContent=s.formatFractionTotal(m)}))),"progressbar"===s.type){let i;i=s.progressbarOpposite?t.isHorizontal()?"vertical":"horizontal":t.isHorizontal()?"horizontal":"vertical";const r=(a+1)/m;let n=1,l=1;"horizontal"===i?n=r:l=r,e.querySelectorAll(se(s.progressbarFillClass)).forEach((e=>{e.style.transform=`translate3d(0,0,0) scaleX(${n}) scaleY(${l})`,e.style.transitionDuration=`${t.params.speed}ms`}))}"custom"===s.type&&s.renderCustom?(e.innerHTML=s.renderCustom(t,a+1,m),0===r&&i("paginationRender",e)):(0===r&&i("paginationRender",e),i("paginationUpdate",e)),t.params.watchOverflow&&t.enabled&&e.classList[t.isLocked?"add":"remove"](s.lockClass)}))}function m(){const e=t.params.pagination;if(d())return;const s=t.virtual&&t.params.virtual.enabled?t.virtual.slides.length:t.grid&&t.params.grid.rows>1?t.slides.length/Math.ceil(t.params.grid.rows):t.slides.length;let a=t.pagination.el;a=o(a);let r="";if("bullets"===e.type){let a=t.params.loop?Math.ceil(s/t.params.slidesPerGroup):t.snapGrid.length;t.params.freeMode&&t.params.freeMode.enabled&&a>s&&(a=s);for(let s=0;s<a;s+=1)e.renderBullet?r+=e.renderBullet.call(t,s,e.bulletClass):r+=`<${e.bulletElement} ${t.isElement?'part="bullet"':""} class="${e.bulletClass}"></${e.bulletElement}>`}"fraction"===e.type&&(r=e.renderFraction?e.renderFraction.call(t,e.currentClass,e.totalClass):`<span class="${e.currentClass}"></span> / <span class="${e.totalClass}"></span>`),"progressbar"===e.type&&(r=e.renderProgressbar?e.renderProgressbar.call(t,e.progressbarFillClass):`<span class="${e.progressbarFillClass}"></span>`),t.pagination.bullets=[],a.forEach((s=>{"custom"!==e.type&&(s.innerHTML=r||""),"bullets"===e.type&&t.pagination.bullets.push(...s.querySelectorAll(se(e.bulletClass)))})),"custom"!==e.type&&i("paginationRender",a[0])}function h(){t.params.pagination=te(t,t.originalParams.pagination,t.params.pagination,{el:"swiper-pagination"});const e=t.params.pagination;if(!e.el)return;let s;"string"==typeof e.el&&t.isElement&&(s=t.el.querySelector(e.el)),s||"string"!=typeof e.el||(s=[...document.querySelectorAll(e.el)]),s||(s=e.el),s&&0!==s.length&&(t.params.uniqueNavElements&&"string"==typeof e.el&&Array.isArray(s)&&s.length>1&&(s=[...t.el.querySelectorAll(e.el)],s.length>1&&(s=s.filter((e=>E(e,".swiper")[0]===t.el))[0])),Array.isArray(s)&&1===s.length&&(s=s[0]),Object.assign(t.pagination,{el:s}),s=o(s),s.forEach((s=>{"bullets"===e.type&&e.clickable&&s.classList.add(...(e.clickableClass||"").split(" ")),s.classList.add(e.modifierClass+e.type),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass),"bullets"===e.type&&e.dynamicBullets&&(s.classList.add(`${e.modifierClass}${e.type}-dynamic`),l=0,e.dynamicMainBullets<1&&(e.dynamicMainBullets=1)),"progressbar"===e.type&&e.progressbarOpposite&&s.classList.add(e.progressbarOppositeClass),e.clickable&&s.addEventListener("click",p),t.enabled||s.classList.add(e.lockClass)})))}function f(){const e=t.params.pagination;if(d())return;let s=t.pagination.el;s&&(s=o(s),s.forEach((s=>{s.classList.remove(e.hiddenClass),s.classList.remove(e.modifierClass+e.type),s.classList.remove(t.isHorizontal()?e.horizontalClass:e.verticalClass),e.clickable&&(s.classList.remove(...(e.clickableClass||"").split(" ")),s.removeEventListener("click",p))}))),t.pagination.bullets&&t.pagination.bullets.forEach((t=>t.classList.remove(...e.bulletActiveClass.split(" "))))}a("changeDirection",(()=>{if(!t.pagination||!t.pagination.el)return;const e=t.params.pagination;let{el:s}=t.pagination;s=o(s),s.forEach((s=>{s.classList.remove(e.horizontalClass,e.verticalClass),s.classList.add(t.isHorizontal()?e.horizontalClass:e.verticalClass)}))})),a("init",(()=>{!1===t.params.pagination.enabled?g():(h(),m(),u())})),a("activeIndexChange",(()=>{void 0===t.snapIndex&&u()})),a("snapIndexChange",(()=>{u()})),a("snapGridLengthChange",(()=>{m(),u()})),a("destroy",(()=>{f()})),a("enable disable",(()=>{let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList[t.enabled?"remove":"add"](t.params.pagination.lockClass))))})),a("lock unlock",(()=>{u()})),a("click",((e,s)=>{const a=s.target,r=o(t.pagination.el);if(t.params.pagination.el&&t.params.pagination.hideOnClick&&r&&r.length>0&&!a.classList.contains(t.params.pagination.bulletClass)){if(t.navigation&&(t.navigation.nextEl&&a===t.navigation.nextEl||t.navigation.prevEl&&a===t.navigation.prevEl))return;const e=r[0].classList.contains(t.params.pagination.hiddenClass);i(!0===e?"paginationShow":"paginationHide"),r.forEach((e=>e.classList.toggle(t.params.pagination.hiddenClass)))}}));const g=()=>{t.el.classList.add(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList.add(t.params.pagination.paginationDisabledClass)))),f()};Object.assign(t.pagination,{enable:()=>{t.el.classList.remove(t.params.pagination.paginationDisabledClass);let{el:e}=t.pagination;e&&(e=o(e),e.forEach((e=>e.classList.remove(t.params.pagination.paginationDisabledClass)))),h(),m(),u()},disable:g,render:m,update:u,init:h,destroy:f})},function(e){let{swiper:t,extendParams:s,on:i,emit:r}=e;const o=a();let d,c,p,u,m=!1,h=null,f=null;function g(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e,rtlTranslate:s}=t,{dragEl:a,el:i}=e,r=t.params.scrollbar,n=t.params.loop?t.progressLoop:t.progress;let l=c,o=(p-c)*n;s?(o=-o,o>0?(l=c-o,o=0):-o+c>p&&(l=p+o)):o<0?(l=c+o,o=0):o+c>p&&(l=p-o),t.isHorizontal()?(a.style.transform=`translate3d(${o}px, 0, 0)`,a.style.width=`${l}px`):(a.style.transform=`translate3d(0px, ${o}px, 0)`,a.style.height=`${l}px`),r.hide&&(clearTimeout(h),i.style.opacity=1,h=setTimeout((()=>{i.style.opacity=0,i.style.transitionDuration="400ms"}),1e3))}function b(){if(!t.params.scrollbar.el||!t.scrollbar.el)return;const{scrollbar:e}=t,{dragEl:s,el:a}=e;s.style.width="",s.style.height="",p=t.isHorizontal()?a.offsetWidth:a.offsetHeight,u=t.size/(t.virtualSize+t.params.slidesOffsetBefore-(t.params.centeredSlides?t.snapGrid[0]:0)),c="auto"===t.params.scrollbar.dragSize?p*u:parseInt(t.params.scrollbar.dragSize,10),t.isHorizontal()?s.style.width=`${c}px`:s.style.height=`${c}px`,a.style.display=u>=1?"none":"",t.params.scrollbar.hide&&(a.style.opacity=0),t.params.watchOverflow&&t.enabled&&e.el.classList[t.isLocked?"add":"remove"](t.params.scrollbar.lockClass)}function y(e){return t.isHorizontal()?e.clientX:e.clientY}function E(e){const{scrollbar:s,rtlTranslate:a}=t,{el:i}=s;let r;r=(y(e)-w(i)[t.isHorizontal()?"left":"top"]-(null!==d?d:c/2))/(p-c),r=Math.max(Math.min(r,1),0),a&&(r=1-r);const n=t.minTranslate()+(t.maxTranslate()-t.minTranslate())*r;t.updateProgress(n),t.setTranslate(n),t.updateActiveIndex(),t.updateSlidesClasses()}function x(e){const s=t.params.scrollbar,{scrollbar:a,wrapperEl:i}=t,{el:n,dragEl:l}=a;m=!0,d=e.target===l?y(e)-e.target.getBoundingClientRect()[t.isHorizontal()?"left":"top"]:null,e.preventDefault(),e.stopPropagation(),i.style.transitionDuration="100ms",l.style.transitionDuration="100ms",E(e),clearTimeout(f),n.style.transitionDuration="0ms",s.hide&&(n.style.opacity=1),t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="none"),r("scrollbarDragStart",e)}function S(e){const{scrollbar:s,wrapperEl:a}=t,{el:i,dragEl:n}=s;m&&(e.preventDefault?e.preventDefault():e.returnValue=!1,E(e),a.style.transitionDuration="0ms",i.style.transitionDuration="0ms",n.style.transitionDuration="0ms",r("scrollbarDragMove",e))}function T(e){const s=t.params.scrollbar,{scrollbar:a,wrapperEl:i}=t,{el:n}=a;m&&(m=!1,t.params.cssMode&&(t.wrapperEl.style["scroll-snap-type"]="",i.style.transitionDuration=""),s.hide&&(clearTimeout(f),f=l((()=>{n.style.opacity=0,n.style.transitionDuration="400ms"}),1e3)),r("scrollbarDragEnd",e),s.snapOnRelease&&t.slideToClosest())}function M(e){const{scrollbar:s,params:a}=t,i=s.el;if(!i)return;const r=i,n=!!a.passiveListeners&&{passive:!1,capture:!1},l=!!a.passiveListeners&&{passive:!0,capture:!1};if(!r)return;const d="on"===e?"addEventListener":"removeEventListener";r[d]("pointerdown",x,n),o[d]("pointermove",S,n),o[d]("pointerup",T,l)}function C(){const{scrollbar:e,el:s}=t;t.params.scrollbar=te(t,t.originalParams.scrollbar,t.params.scrollbar,{el:"swiper-scrollbar"});const a=t.params.scrollbar;if(!a.el)return;let i,r;if("string"==typeof a.el&&t.isElement&&(i=t.el.querySelector(a.el)),i||"string"!=typeof a.el)i||(i=a.el);else if(i=o.querySelectorAll(a.el),!i.length)return;t.params.uniqueNavElements&&"string"==typeof a.el&&i.length>1&&1===s.querySelectorAll(a.el).length&&(i=s.querySelector(a.el)),i.length>0&&(i=i[0]),i.classList.add(t.isHorizontal()?a.horizontalClass:a.verticalClass),i&&(r=i.querySelector(se(t.params.scrollbar.dragClass)),r||(r=v("div",t.params.scrollbar.dragClass),i.append(r))),Object.assign(e,{el:i,dragEl:r}),a.draggable&&t.params.scrollbar.el&&t.scrollbar.el&&M("on"),i&&i.classList[t.enabled?"remove":"add"](...n(t.params.scrollbar.lockClass))}function P(){const e=t.params.scrollbar,s=t.scrollbar.el;s&&s.classList.remove(...n(t.isHorizontal()?e.horizontalClass:e.verticalClass)),t.params.scrollbar.el&&t.scrollbar.el&&M("off")}s({scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag",scrollbarDisabledClass:"swiper-scrollbar-disabled",horizontalClass:"swiper-scrollbar-horizontal",verticalClass:"swiper-scrollbar-vertical"}}),t.scrollbar={el:null,dragEl:null},i("init",(()=>{!1===t.params.scrollbar.enabled?L():(C(),b(),g())})),i("update resize observerUpdate lock unlock",(()=>{b()})),i("setTranslate",(()=>{g()})),i("setTransition",((e,s)=>{!function(e){t.params.scrollbar.el&&t.scrollbar.el&&(t.scrollbar.dragEl.style.transitionDuration=`${e}ms`)}(s)})),i("enable disable",(()=>{const{el:e}=t.scrollbar;e&&e.classList[t.enabled?"remove":"add"](...n(t.params.scrollbar.lockClass))})),i("destroy",(()=>{P()}));const L=()=>{t.el.classList.add(...n(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.add(...n(t.params.scrollbar.scrollbarDisabledClass)),P()};Object.assign(t.scrollbar,{enable:()=>{t.el.classList.remove(...n(t.params.scrollbar.scrollbarDisabledClass)),t.scrollbar.el&&t.scrollbar.el.classList.remove(...n(t.params.scrollbar.scrollbarDisabledClass)),C(),b(),g()},disable:L,updateSize:b,setTranslate:g,init:C,destroy:P})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({parallax:{enabled:!1}});const i="[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]",r=(e,s)=>{const{rtl:a}=t,i=a?-1:1,r=e.getAttribute("data-swiper-parallax")||"0";let n=e.getAttribute("data-swiper-parallax-x"),l=e.getAttribute("data-swiper-parallax-y");const o=e.getAttribute("data-swiper-parallax-scale"),d=e.getAttribute("data-swiper-parallax-opacity"),c=e.getAttribute("data-swiper-parallax-rotate");if(n||l?(n=n||"0",l=l||"0"):t.isHorizontal()?(n=r,l="0"):(l=r,n="0"),n=n.indexOf("%")>=0?parseInt(n,10)*s*i+"%":n*s*i+"px",l=l.indexOf("%")>=0?parseInt(l,10)*s+"%":l*s+"px",null!=d){const t=d-(d-1)*(1-Math.abs(s));e.style.opacity=t}let p=`translate3d(${n}, ${l}, 0px)`;if(null!=o){p+=` scale(${o-(o-1)*(1-Math.abs(s))})`}if(c&&null!=c){p+=` rotate(${c*s*-1}deg)`}e.style.transform=p},n=()=>{const{el:e,slides:s,progress:a,snapGrid:n,isElement:l}=t,o=f(e,i);t.isElement&&o.push(...f(t.hostEl,i)),o.forEach((e=>{r(e,a)})),s.forEach(((e,s)=>{let l=e.progress;t.params.slidesPerGroup>1&&"auto"!==t.params.slidesPerView&&(l+=Math.ceil(s/2)-a*(n.length-1)),l=Math.min(Math.max(l,-1),1),e.querySelectorAll(`${i}, [data-swiper-parallax-rotate]`).forEach((e=>{r(e,l)}))}))};a("beforeInit",(()=>{t.params.parallax.enabled&&(t.params.watchSlidesProgress=!0,t.originalParams.watchSlidesProgress=!0)})),a("init",(()=>{t.params.parallax.enabled&&n()})),a("setTranslate",(()=>{t.params.parallax.enabled&&n()})),a("setTransition",((e,s)=>{t.params.parallax.enabled&&function(e){void 0===e&&(e=t.params.speed);const{el:s,hostEl:a}=t,r=[...s.querySelectorAll(i)];t.isElement&&r.push(...a.querySelectorAll(i)),r.forEach((t=>{let s=parseInt(t.getAttribute("data-swiper-parallax-duration"),10)||e;0===e&&(s=0),t.style.transitionDuration=`${s}ms`}))}(s)}))},function(e){let{swiper:t,extendParams:s,on:a,emit:i}=e;const n=r();s({zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}}),t.zoom={enabled:!1};let l,o,c=1,p=!1;const u=[],m={originX:0,originY:0,slideEl:void 0,slideWidth:void 0,slideHeight:void 0,imageEl:void 0,imageWrapEl:void 0,maxRatio:3},h={isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},g={x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0};let v=1;function b(){if(u.length<2)return 1;const e=u[0].pageX,t=u[0].pageY,s=u[1].pageX,a=u[1].pageY;return Math.sqrt((s-e)**2+(a-t)**2)}function y(e){const s=t.isElement?"swiper-slide":`.${t.params.slideClass}`;return!!e.target.matches(s)||t.slides.filter((t=>t.contains(e.target))).length>0}function x(e){if("mouse"===e.pointerType&&u.splice(0,u.length),!y(e))return;const s=t.params.zoom;if(l=!1,o=!1,u.push(e),!(u.length<2)){if(l=!0,m.scaleStart=b(),!m.slideEl){m.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`),m.slideEl||(m.slideEl=t.slides[t.activeIndex]);let a=m.slideEl.querySelector(`.${s.containerClass}`);if(a&&(a=a.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=a,m.imageWrapEl=a?E(m.imageEl,`.${s.containerClass}`)[0]:void 0,!m.imageWrapEl)return void(m.imageEl=void 0);m.maxRatio=m.imageWrapEl.getAttribute("data-swiper-zoom")||s.maxRatio}if(m.imageEl){const[e,t]=function(){if(u.length<2)return{x:null,y:null};const e=m.imageEl.getBoundingClientRect();return[(u[0].pageX+(u[1].pageX-u[0].pageX)/2-e.x-n.scrollX)/c,(u[0].pageY+(u[1].pageY-u[0].pageY)/2-e.y-n.scrollY)/c]}();m.originX=e,m.originY=t,m.imageEl.style.transitionDuration="0ms"}p=!0}}function S(e){if(!y(e))return;const s=t.params.zoom,a=t.zoom,i=u.findIndex((t=>t.pointerId===e.pointerId));i>=0&&(u[i]=e),u.length<2||(o=!0,m.scaleMove=b(),m.imageEl&&(a.scale=m.scaleMove/m.scaleStart*c,a.scale>m.maxRatio&&(a.scale=m.maxRatio-1+(a.scale-m.maxRatio+1)**.5),a.scale<s.minRatio&&(a.scale=s.minRatio+1-(s.minRatio-a.scale+1)**.5),m.imageEl.style.transform=`translate3d(0,0,0) scale(${a.scale})`))}function T(e){if(!y(e))return;if("mouse"===e.pointerType&&"pointerout"===e.type)return;const s=t.params.zoom,a=t.zoom,i=u.findIndex((t=>t.pointerId===e.pointerId));i>=0&&u.splice(i,1),l&&o&&(l=!1,o=!1,m.imageEl&&(a.scale=Math.max(Math.min(a.scale,m.maxRatio),s.minRatio),m.imageEl.style.transitionDuration=`${t.params.speed}ms`,m.imageEl.style.transform=`translate3d(0,0,0) scale(${a.scale})`,c=a.scale,p=!1,a.scale>1&&m.slideEl?m.slideEl.classList.add(`${s.zoomedSlideClass}`):a.scale<=1&&m.slideEl&&m.slideEl.classList.remove(`${s.zoomedSlideClass}`),1===a.scale&&(m.originX=0,m.originY=0,m.slideEl=void 0)))}function M(e){if(!y(e)||!function(e){const s=`.${t.params.zoom.containerClass}`;return!!e.target.matches(s)||[...t.hostEl.querySelectorAll(s)].filter((t=>t.contains(e.target))).length>0}(e))return;const s=t.zoom;if(!m.imageEl)return;if(!h.isTouched||!m.slideEl)return;h.isMoved||(h.width=m.imageEl.offsetWidth,h.height=m.imageEl.offsetHeight,h.startX=d(m.imageWrapEl,"x")||0,h.startY=d(m.imageWrapEl,"y")||0,m.slideWidth=m.slideEl.offsetWidth,m.slideHeight=m.slideEl.offsetHeight,m.imageWrapEl.style.transitionDuration="0ms");const a=h.width*s.scale,i=h.height*s.scale;if(a<m.slideWidth&&i<m.slideHeight)return;h.minX=Math.min(m.slideWidth/2-a/2,0),h.maxX=-h.minX,h.minY=Math.min(m.slideHeight/2-i/2,0),h.maxY=-h.minY,h.touchesCurrent.x=u.length>0?u[0].pageX:e.pageX,h.touchesCurrent.y=u.length>0?u[0].pageY:e.pageY;if(Math.max(Math.abs(h.touchesCurrent.x-h.touchesStart.x),Math.abs(h.touchesCurrent.y-h.touchesStart.y))>5&&(t.allowClick=!1),!h.isMoved&&!p){if(t.isHorizontal()&&(Math.floor(h.minX)===Math.floor(h.startX)&&h.touchesCurrent.x<h.touchesStart.x||Math.floor(h.maxX)===Math.floor(h.startX)&&h.touchesCurrent.x>h.touchesStart.x))return void(h.isTouched=!1);if(!t.isHorizontal()&&(Math.floor(h.minY)===Math.floor(h.startY)&&h.touchesCurrent.y<h.touchesStart.y||Math.floor(h.maxY)===Math.floor(h.startY)&&h.touchesCurrent.y>h.touchesStart.y))return void(h.isTouched=!1)}e.cancelable&&e.preventDefault(),e.stopPropagation(),h.isMoved=!0;const r=(s.scale-c)/(m.maxRatio-t.params.zoom.minRatio),{originX:n,originY:l}=m;h.currentX=h.touchesCurrent.x-h.touchesStart.x+h.startX+r*(h.width-2*n),h.currentY=h.touchesCurrent.y-h.touchesStart.y+h.startY+r*(h.height-2*l),h.currentX<h.minX&&(h.currentX=h.minX+1-(h.minX-h.currentX+1)**.8),h.currentX>h.maxX&&(h.currentX=h.maxX-1+(h.currentX-h.maxX+1)**.8),h.currentY<h.minY&&(h.currentY=h.minY+1-(h.minY-h.currentY+1)**.8),h.currentY>h.maxY&&(h.currentY=h.maxY-1+(h.currentY-h.maxY+1)**.8),g.prevPositionX||(g.prevPositionX=h.touchesCurrent.x),g.prevPositionY||(g.prevPositionY=h.touchesCurrent.y),g.prevTime||(g.prevTime=Date.now()),g.x=(h.touchesCurrent.x-g.prevPositionX)/(Date.now()-g.prevTime)/2,g.y=(h.touchesCurrent.y-g.prevPositionY)/(Date.now()-g.prevTime)/2,Math.abs(h.touchesCurrent.x-g.prevPositionX)<2&&(g.x=0),Math.abs(h.touchesCurrent.y-g.prevPositionY)<2&&(g.y=0),g.prevPositionX=h.touchesCurrent.x,g.prevPositionY=h.touchesCurrent.y,g.prevTime=Date.now(),m.imageWrapEl.style.transform=`translate3d(${h.currentX}px, ${h.currentY}px,0)`}function C(){const e=t.zoom;m.slideEl&&t.activeIndex!==t.slides.indexOf(m.slideEl)&&(m.imageEl&&(m.imageEl.style.transform="translate3d(0,
220,0) scale(1)"),m.imageWrapEl&&(m.imageWrapEl.style.transform="translate3d(0,0,0)"),m.slideEl.classList.remove(`${t.params.zoom.zoomedSlideClass}`),e.scale=1,c=1,m.slideEl=void 0,m.imageEl=void 0,m.imageWrapEl=void 0,m.originX=0,m.originY=0)}function P(e){const s=t.zoom,a=t.params.zoom;if(!m.slideEl){e&&e.target&&(m.slideEl=e.target.closest(`.${t.params.slideClass}, swiper-slide`)),m.slideEl||(t.params.virtual&&t.params.virtual.enabled&&t.virtual?m.slideEl=f(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:m.slideEl=t.slides[t.activeIndex]);let s=m.slideEl.querySelector(`.${a.containerClass}`);s&&(s=s.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=s,m.imageWrapEl=s?E(m.imageEl,`.${a.containerClass}`)[0]:void 0}if(!m.imageEl||!m.imageWrapEl)return;let i,r,l,o,d,p,u,g,v,b,y,x,S,T,M,C,P,L;t.params.cssMode&&(t.wrapperEl.style.overflow="hidden",t.wrapperEl.style.touchAction="none"),m.slideEl.classList.add(`${a.zoomedSlideClass}`),void 0===h.touchesStart.x&&e?(i=e.pageX,r=e.pageY):(i=h.touchesStart.x,r=h.touchesStart.y);const A="number"==typeof e?e:null;1===c&&A&&(i=void 0,r=void 0),s.scale=A||m.imageWrapEl.getAttribute("data-swiper-zoom")||a.maxRatio,c=A||m.imageWrapEl.getAttribute("data-swiper-zoom")||a.maxRatio,!e||1===c&&A?(u=0,g=0):(P=m.slideEl.offsetWidth,L=m.slideEl.offsetHeight,l=w(m.slideEl).left+n.scrollX,o=w(m.slideEl).top+n.scrollY,d=l+P/2-i,p=o+L/2-r,v=m.imageEl.offsetWidth,b=m.imageEl.offsetHeight,y=v*s.scale,x=b*s.scale,S=Math.min(P/2-y/2,0),T=Math.min(L/2-x/2,0),M=-S,C=-T,u=d*s.scale,g=p*s.scale,u<S&&(u=S),u>M&&(u=M),g<T&&(g=T),g>C&&(g=C)),A&&1===s.scale&&(m.originX=0,m.originY=0),m.imageWrapEl.style.transitionDuration="300ms",m.imageWrapEl.style.transform=`translate3d(${u}px, ${g}px,0)`,m.imageEl.style.transitionDuration="300ms",m.imageEl.style.transform=`translate3d(0,0,0) scale(${s.scale})`}function L(){const e=t.zoom,s=t.params.zoom;if(!m.slideEl){t.params.virtual&&t.params.virtual.enabled&&t.virtual?m.slideEl=f(t.slidesEl,`.${t.params.slideActiveClass}`)[0]:m.slideEl=t.slides[t.activeIndex];let e=m.slideEl.querySelector(`.${s.containerClass}`);e&&(e=e.querySelectorAll("picture, img, svg, canvas, .swiper-zoom-target")[0]),m.imageEl=e,m.imageWrapEl=e?E(m.imageEl,`.${s.containerClass}`)[0]:void 0}m.imageEl&&m.imageWrapEl&&(t.params.cssMode&&(t.wrapperEl.style.overflow="",t.wrapperEl.style.touchAction=""),e.scale=1,c=1,m.imageWrapEl.style.transitionDuration="300ms",m.imageWrapEl.style.transform="translate3d(0,0,0)",m.imageEl.style.transitionDuration="300ms",m.imageEl.style.transform="translate3d(0,0,0) scale(1)",m.slideEl.classList.remove(`${s.zoomedSlideClass}`),m.slideEl=void 0,m.originX=0,m.originY=0)}function A(e){const s=t.zoom;s.scale&&1!==s.scale?L():P(e)}function I(){return{passiveListener:!!t.params.passiveListeners&&{passive:!0,capture:!1},activeListenerWithCapture:!t.params.passiveListeners||{passive:!1,capture:!0}}}function z(){const e=t.zoom;if(e.enabled)return;e.enabled=!0;const{passiveListener:s,activeListenerWithCapture:a}=I();t.wrapperEl.addEventListener("pointerdown",x,s),t.wrapperEl.addEventListener("pointermove",S,a),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.addEventListener(e,T,s)}
vendor: 16,712 bytes, line 22
22)),t.wrapperEl.addEventListener("pointermove",M,a)}function $(){const e=t.zoom;if(!e.enabled)return;e.enabled=!1;const{passiveListener:s,activeListenerWithCapture:a}=I();t.wrapperEl.removeEventListener("pointerdown",x,s),t.wrapperEl.removeEventListener("pointermove",S,a),["pointerup","pointercancel","pointerout"].forEach((e=>{t.wrapperEl.removeEventListener(e,T,s)})),t.wrapperEl.removeEventListener("pointermove",M,a)}Object.defineProperty(t.zoom,"scale",{get:()=>v,set(e){if(v!==e){const t=m.imageEl,s=m.slideEl;i("zoomChange",e,t,s)}v=e}}),a("init",(()=>{t.params.zoom.enabled&&z()})),a("destroy",(()=>{$()})),a("touchStart",((e,s)=>{t.zoom.enabled&&function(e){const s=t.device;if(!m.imageEl)return;if(h.isTouched)return;s.android&&e.cancelable&&e.preventDefault(),h.isTouched=!0;const a=u.length>0?u[0]:e;h.touchesStart.x=a.pageX,h.touchesStart.y=a.pageY}(s)})),a("touchEnd",((e,s)=>{t.zoom.enabled&&function(){const e=t.zoom;if(!m.imageEl)return;if(!h.isTouched||!h.isMoved)return h.isTouched=!1,void(h.isMoved=!1);h.isTouched=!1,h.isMoved=!1;let s=300,a=300;const i=g.x*s,r=h.currentX+i,n=g.y*a,l=h.currentY+n;0!==g.x&&(s=Math.abs((r-h.currentX)/g.x)),0!==g.y&&(a=Math.abs((l-h.currentY)/g.y));const o=Math.max(s,a);h.currentX=r,h.currentY=l;const d=h.width*e.scale,c=h.height*e.scale;h.minX=Math.min(m.slideWidth/2-d/2,0),h.maxX=-h.minX,h.minY=Math.min(m.slideHeight/2-c/2,0),h.maxY=-h.minY,h.currentX=Math.max(Math.min(h.currentX,h.maxX),h.minX),h.currentY=Math.max(Math.min(h.currentY,h.maxY),h.minY),m.imageWrapEl.style.transitionDuration=`${o}ms`,m.imageWrapEl.style.transform=`translate3d(${h.currentX}px, ${h.currentY}px,0)`}()})),a("doubleTap",((e,s)=>{!t.animating&&t.params.zoom.enabled&&t.zoom.enabled&&t.params.zoom.toggle&&A(s)})),a("transitionEnd",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&C()})),a("slideChange",(()=>{t.zoom.enabled&&t.params.zoom.enabled&&t.params.cssMode&&C()})),Object.assign(t.zoom,{enable:z,disable:$,in:P,out:L,toggle:A})},function(e){let{swiper:t,extendParams:s,on:a}=e;function i(e,t){const s=function(){let e,t,s;return(a,i)=>{for(t=-1,e=a.length;e-t>1;)s=e+t>>1,a[s]<=i?t=s:e=s;return e}}();let a,i;return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(i=s(this.x,e),a=i-1,(e-this.x[a])*(this.y[i]-this.y[a])/(this.x[i]-this.x[a])+this.y[a]):0},this}function r(){t.controller.control&&t.controller.spline&&(t.controller.spline=void 0,delete t.controller.spline)}s({controller:{control:void 0,inverse:!1,by:"slide"}}),t.controller={control:void 0},a("beforeInit",(()=>{if("undefined"!=typeof window&&("string"==typeof t.params.controller.control||t.params.controller.control instanceof HTMLElement)){const e=document.querySelector(t.params.controller.control);if(e&&e.swiper)t.controller.control=e.swiper;else if(e){const s=a=>{t.controller.control=a.detail[0],t.update(),e.removeEventListener("init",s)};e.addEventListener("init",s)}}else t.controller.control=t.params.controller.control})),a("update",(()=>{r()})),a("resize",(()=>{r()})),a("observerUpdate",(()=>{r()})),a("setTranslate",((e,s,a)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTranslate(s,a)})),a("setTransition",((e,s,a)=>{t.controller.control&&!t.controller.control.destroyed&&t.controller.setTransition(s,a)})),Object.assign(t.controller,{setTranslate:function(e,s){const a=t.controller.control;let r,n;const l=t.constructor;function o(e){if(e.destroyed)return;const s=t.rtlTranslate?-t.translate:t.translate;"slide"===t.params.controller.by&&(!function(e){t.controller.spline=t.params.loop?new i(t.slidesGrid,e.slidesGrid):new i(t.snapGrid,e.snapGrid)}(e),n=-t.controller.spline.interpolate(-s)),n&&"container"!==t.params.controller.by||(r=(e.maxTranslate()-e.minTranslate())/(t.maxTranslate()-t.minTranslate()),!Number.isNaN(r)&&Number.isFinite(r)||(r=1),n=(s-t.minTranslate())*r+e.minTranslate()),t.params.controller.inverse&&(n=e.maxTranslate()-n),e.updateProgress(n),e.setTranslate(n,t),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(a))for(let e=0;e<a.length;e+=1)a[e]!==s&&a[e]instanceof l&&o(a[e]);else a instanceof l&&s!==a&&o(a)},setTransition:function(e,s){const a=t.constructor,i=t.controller.control;let r;function n(s){s.destroyed||(s.setTransition(e,t),0!==e&&(s.transitionStart(),s.params.autoHeight&&l((()=>{s.updateAutoHeight()})),x(s.wrapperEl,(()=>{i&&s.transitionEnd()}))))}if(Array.isArray(i))for(r=0;r<i.length;r+=1)i[r]!==s&&i[r]instanceof a&&n(i[r]);else i instanceof a&&s!==i&&n(i)}})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null}}),t.a11y={clicked:!1};let i=null;function r(e){const t=i;0!==t.length&&(t.innerHTML="",t.innerHTML=e)}const n=e=>(Array.isArray(e)?e:[e]).filter((e=>!!e));function l(e){(e=n(e)).forEach((e=>{e.setAttribute("tabIndex","0")}))}function o(e){(e=n(e)).forEach((e=>{e.setAttribute("tabIndex","-1")}))}function d(e,t){(e=n(e)).forEach((e=>{e.setAttribute("role",t)}))}function c(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-roledescription",t)}))}function p(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-label",t)}))}function u(e){(e=n(e)).forEach((e=>{e.setAttribute("aria-disabled",!0)}))}function m(e){(e=n(e)).forEach((e=>{e.setAttribute("aria-disabled",!1)}))}function h(e){if(13!==e.keyCode&&32!==e.keyCode)return;const s=t.params.a11y,a=e.target;t.pagination&&t.pagination.el&&(a===t.pagination.el||t.pagination.el.contains(e.target))&&!e.target.matches(se(t.params.pagination.bulletClass))||(t.navigation&&t.navigation.nextEl&&a===t.navigation.nextEl&&(t.isEnd&&!t.params.loop||t.slideNext(),t.isEnd?r(s.lastSlideMessage):r(s.nextSlideMessage)),t.navigation&&t.navigation.prevEl&&a===t.navigation.prevEl&&(t.isBeginning&&!t.params.loop||t.slidePrev(),t.isBeginning?r(s.firstSlideMessage):r(s.prevSlideMessage)),t.pagination&&a.matches(se(t.params.pagination.bulletClass))&&a.click())}function f(){return t.pagination&&t.pagination.bullets&&t.pagination.bullets.length}function g(){return f()&&t.params.pagination.clickable}const w=(e,t,s)=>{l(e),"BUTTON"!==e.tagName&&(d(e,"button"),e.addEventListener("keydown",h)),p(e,s),function(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-controls",t)}))}(e,t)},b=()=>{t.a11y.clicked=!0},E=()=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{t.destroyed||(t.a11y.clicked=!1)}))}))},x=e=>{if(t.a11y.clicked)return;const s=e.target.closest(`.${t.params.slideClass}, swiper-slide`);if(!s||!t.slides.includes(s))return;const a=t.slides.indexOf(s)===t.activeIndex,i=t.params.watchSlidesProgress&&t.visibleSlides&&t.visibleSlides.includes(s);a||i||e.sourceCapabilities&&e.sourceCapabilities.firesTouchEvents||(t.isHorizontal()?t.el.scrollLeft=0:t.el.scrollTop=0,t.slideTo(t.slides.indexOf(s),0))},S=()=>{const e=t.params.a11y;e.itemRoleDescriptionMessage&&c(t.slides,e.itemRoleDescriptionMessage),e.slideRole&&d(t.slides,e.slideRole);const s=t.slides.length;e.slideLabelMessage&&t.slides.forEach(((a,i)=>{const r=t.params.loop?parseInt(a.getAttribute("data-swiper-slide-index"),10):i;p(a,e.slideLabelMessage.replace(/\{\{index\}\}/,r+1).replace(/\{\{slidesLength\}\}/,s))}))},T=()=>{const e=t.params.a11y;t.el.append(i);const s=t.el;e.containerRoleDescriptionMessage&&c(s,e.containerRoleDescriptionMessage),e.containerMessage&&p(s,e.containerMessage);const a=t.wrapperEl,r=e.id||a.getAttribute("id")||`swiper-wrapper-${l=16,void 0===l&&(l=16),"x".repeat(l).replace(/x/g,(()=>Math.round(16*Math.random()).toString(16)))}`;var l;const o=t.params.autoplay&&t.params.autoplay.enabled?"off":"polite";var d;d=r,n(a).forEach((e=>{e.setAttribute("id",d)})),function(e,t){(e=n(e)).forEach((e=>{e.setAttribute("aria-live",t)}))}(a,o),S();let{nextEl:u,prevEl:m}=t.navigation?t.navigation:{};if(u=n(u),m=n(m),u&&u.forEach((t=>w(t,r,e.nextSlideMessage))),m&&m.forEach((t=>w(t,r,e.prevSlideMessage))),g()){n(t.pagination.el).forEach((e=>{e.addEventListener("keydown",h)}))}t.el.addEventListener("focus",x,!0),t.el.addEventListener("pointerdown",b,!0),t.el.addEventListener("pointerup",E,!0)};a("beforeInit",(()=>{i=v("span",t.params.a11y.notificationClass),i.setAttribute("aria-live","assertive"),i.setAttribute("aria-atomic","true")})),a("afterInit",(()=>{t.params.a11y.enabled&&T()})),a("slidesLengthChange snapGridLengthChange slidesGridLengthChange",(()=>{t.params.a11y.enabled&&S()})),a("fromEdge toEdge afterInit lock unlock",(()=>{t.params.a11y.enabled&&function(){if(t.params.loop||t.params.rewind||!t.navigation)return;const{nextEl:e,prevEl:s}=t.navigation;s&&(t.isBeginning?(u(s),o(s)):(m(s),l(s))),e&&(t.isEnd?(u(e),o(e)):(m(e),l(e)))}()})),a("paginationUpdate",(()=>{t.params.a11y.enabled&&function(){const e=t.params.a11y;f()&&t.pagination.bullets.forEach((s=>{t.params.pagination.clickable&&(l(s),t.params.pagination.renderBullet||(d(s,"button"),p(s,e.paginationBulletMessage.replace(/\{\{index\}\}/,y(s)+1)))),s.matches(se(t.params.pagination.bulletActiveClass))?s.setAttribute("aria-current","true"):s.removeAttribute("aria-current")}))}()})),a("destroy",(()=>{t.params.a11y.enabled&&function(){i&&i.remove();let{nextEl:e,prevEl:s}=t.navigation?t.navigation:{};e=n(e),s=n(s),e&&e.forEach((e=>e.removeEventListener("keydown",h))),s&&s.forEach((e=>e.removeEventListener("keydown",h))),g()&&n(t.pagination.el).forEach((e=>{e.removeEventListener("keydown",h)}));t.el.removeEventListener("focus",x,!0),t.el.removeEventListener("pointerdown",b,!0),t.el.removeEventListener("pointerup",E,!0)}()}))},function(e){let{swiper:t,extendParams:s,on:a}=e;s({history:{enabled:!1,root:"",replaceState:!1,key:"slides",keepQuery:!1}});let i=!1,n={};const l=e=>e.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,""),o=e=>{const t=r();let s;s=e?new URL(e):t.location;const a=s.pathname.slice(1).split("/").filter((e=>""!==e)),i=a.length;return{key:a[i-2],value:a[i-1]}},d=(e,s)=>{const a=r();if(!i||!t.params.history.enabled)return;let n;n=t.params.url?new URL(t.params.url):a.location;const o=t.slides[s];let d=l(o.getAttribute("data-history"));if(t.params.history.root.length>0){let s=t.params.history.root;"/"===s[s.length-1]&&(s=s.slice(0,s.length-1)),d=`${s}/${e?`${e}/`:""}${d}`}else n.pathname.includes(e)||(d=`${e?`${e}/`:""}${d}`);t.params.history.keepQuery&&(d+=n.search);const c=a.history.state;c&&c.value===d||(t.params.history.replaceState?a.history.replaceState({value:d},null,d):a.history.pushState({value:d},null,d))},c=(e,s,a)=>{if(s)for(let i=0,r=t.slides.length;i<r;i+=1){const r=t.slides[i];if(l(r.getAttribute("data-history"))===s){const s=t.getSlideIndex(r);t.slideTo(s,e,a)}}else t.slideTo(0,e,a)},p=()=>{n=o(t.params.url),c(t.params.speed,n.value,!1)};a("init",(()=>{t.params.history.enabled&&(()=>{const e=r();if(t.params.history){if(!e.history||!e.history.pushState)return t.params.history.enabled=!1,void(t.params.hashNavigation.enabled=!0);i=!0,n=o(t.params.url),n.key||n.value?(c(0,n.value,t.params.runCallbacksOnInit),t.params.history.replaceState||e.addEventListener("popstate",p)):t.params.history.replaceState||e.addEventListener("popstate",p)}})()})),a("destroy",(()=>{t.params.history.enabled&&(()=>{const e=r();t.params.history.replaceState||e.removeEventListener("popstate",p)})()})),a("transitionEnd _freeModeNoMomentumRelease",(()=>{i&&d(t.params.history.key,t.activeIndex)})),a("slideChange",(()=>{i&&t.params.cssMode&&d(t.params.history.key,t.activeIndex)}))},function(e){let{swiper:t,extendParams:s,emit:i,on:n}=e,l=!1;const o=a(),d=r();s({hashNavigation:{enabled:!1,replaceState:!1,watchState:!1,getSlideIndex(e,s){if(t.virtual&&t.params.virtual.enabled){const e=t.slides.filter((e=>e.getAttribute("data-hash")===s))[0];if(!e)return 0;return parseInt(e.getAttribute("data-swiper-slide-index"),10)}return t.getSlideIndex(f(t.slidesEl,`.${t.params.slideClass}[data-hash="${s}"], swiper-slide[data-hash="${s}"]`)[0])}}});const c=()=>{i("hashChange");const e=o.location.hash.replace("#",""),s=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex];if(e!==(s?s.getAttribute("data-hash"):"")){const s=t.params.hashNavigation.getSlideIndex(t,e);if(void 0===s||Number.isNaN(s))return;t.slideTo(s)}},p=()=>{if(!l||!t.params.hashNavigation.enabled)return;const e=t.virtual&&t.params.virtual.enabled?t.slidesEl.querySelector(`[data-swiper-slide-index="${t.activeIndex}"]`):t.slides[t.activeIndex],s=e?e.getAttribute("data-hash")||e.getAttribute("data-history"):"";t.params.hashNavigation.replaceState&&d.history&&d.history.replaceState?(d.history.replaceState(null,null,`#${s}`||""),i("hashSet")):(o.location.hash=s||"",i("hashSet"))};n("init",(()=>{t.params.hashNavigation.enabled&&(()=>{if(!t.params.hashNavigation.enabled||t.params.history&&t.params.history.enabled)return;l=!0;const e=o.location.hash.replace("#","");if(e){const s=0,a=t.params.hashNavigation.getSlideIndex(t,e);t.slideTo(a||0,s,t.params.runCallbacksOnInit,!0)}t.params.hashNavigation.watchState&&d.addEventListener("hashchange",c)})()})),n("destroy",(()=>{t.params.hashNavigation.enabled&&t.params.hashNavigation.watchState&&d.removeEventListener("hashchange",c)})),n("transitionEnd _freeModeNoMomentumRelease",(()=>{l&&p()})),n("slideChange",(()=>{l&&t.params.cssMode&&p()}))},function(e){let t,s,{swiper:i,extendParams:r,on:n,emit:l,params:o}=e;i.autoplay={running:!1,paused:!1,timeLeft:0},r({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let d,c,p,u,m,h,f,g,v=o&&o.autoplay?o.autoplay.delay:3e3,w=o&&o.autoplay?o.autoplay.delay:3e3,b=(new Date).getTime();function y(e){i&&!i.destroyed&&i.wrapperEl&&e.target===i.wrapperEl&&(i.wrapperEl.removeEventListener("transitionend",y),g||C())}const E=()=>{if(i.destroyed||!i.autoplay.running)return;i.autoplay.paused?c=!0:c&&(w=d,c=!1);const e=i.autoplay.paused?d:b+w-(new Date).getTime();i.autoplay.timeLeft=e,l("autoplayTimeLeft",e,e/v),s=requestAnimationFrame((()=>{E()}))},x=e=>{if(i.destroyed||!i.autoplay.running)return;cancelAnimationFrame(s),E();let a=void 0===e?i.params.autoplay.delay:e;v=i.params.autoplay.delay,w=i.params.autoplay.delay;const r=(()=>{let e;if(e=i.virtual&&i.params.virtual.enabled?i.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:i.slides[i.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(r)&&r>0&&void 0===e&&(a=r,v=r,w=r),d=a;const n=i.params.speed,o=()=>{i&&!i.destroyed&&(i.params.autoplay.reverseDirection?!i.isBeginning||i.params.loop||i.params.rewind?(i.slidePrev(n,!0,!0),l("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(i.slides.length-1,n,!0,!0),l("autoplay")):!i.isEnd||i.params.loop||i.params.rewind?(i.slideNext(n,!0,!0),l("autoplay")):i.params.autoplay.stopOnLastSlide||(i.slideTo(0,n,!0,!0),l("autoplay")),i.params.cssMode&&(b=(new Date).getTime(),requestAnimationFrame((()=>{x()}))))};return a>0?(clearTimeout(t),t=setTimeout((()=>{o()}),a)):requestAnimationFrame((()=>{o()})),a},S=()=>{b=(new Date).getTime(),i.autoplay.running=!0,x(),l("autoplayStart")},T=()=>{i.autoplay.running=!1,clearTimeout(t),cancelAnimationFrame(s),l("autoplayStop")},M=(e,s)=>{if(i.destroyed||!i.autoplay.running)return;clearTimeout(t),e||(f=!0);const a=()=>{l("autoplayPause"),i.params.autoplay.waitForTransition?i.wrapperEl.addEventListener("transitionend",y):C()};if(i.autoplay.paused=!0,s)return h&&(d=i.params.autoplay.delay),h=!1,void a();const r=d||i.params.autoplay.delay;d=r-((new Date).getTime()-b),i.isEnd&&d<0&&!i.params.loop||(d<0&&(d=0),a())},C=()=>{i.isEnd&&d<0&&!i.params.loop||i.destroyed||!i.autoplay.running||(b=(new Date).getTime(),f?(f=!1,x(d)):x(),i.autoplay.paused=!1,l("autoplayResume"))},P=()=>{if(i.destroyed||!i.autoplay.running)return;const e=a();"hidden"===e.visibilityState&&(f=!0,M(!0)),"visible"===e.visibilityState&&C()},L=e=>{"mouse"===e.pointerType&&(f=!0,g=!0,i.animating||i.autoplay.paused||M(!0))},A=e=>{"mouse"===e.pointerType&&(g=!1,i.autoplay.paused&&C())};n("init",(()=>{i.params.autoplay.enabled&&(i.params.autoplay.pauseOnMouseEnter&&(i.el.addEventListener("pointerenter",L),i.el.addEventListener("pointerleave",A)),a().addEventListener("visibilitychange",P),S())})),n("destroy",(()=>{i.el.removeEventListener("pointerenter",L),i.el.removeEventListener("pointerleave",A
vendor: 9,531 bytes, line 22
22),a().removeEventListener("visibilitychange",P),i.autoplay.running&&T()})),n("_freeModeStaticRelease",(()=>{(u||f)&&C()})),n("_freeModeNoMomentumRelease",(()=>{i.params.autoplay.disableOnInteraction?T():M(!0,!0)})),n("beforeTransitionStart",((e,t,s)=>{!i.destroyed&&i.autoplay.running&&(s||!i.params.autoplay.disableOnInteraction?M(!0,!0):T())})),n("sliderFirstMove",(()=>{!i.destroyed&&i.autoplay.running&&(i.params.autoplay.disableOnInteraction?T():(p=!0,u=!1,f=!1,m=setTimeout((()=>{f=!0,u=!0,M(!0)}),200)))})),n("touchEnd",(()=>{if(!i.destroyed&&i.autoplay.running&&p){if(clearTimeout(m),clearTimeout(t),i.params.autoplay.disableOnInteraction)return u=!1,void(p=!1);u&&i.params.cssMode&&C(),u=!1,p=!1}})),n("slideChange",(()=>{!i.destroyed&&i.autoplay.running&&(h=!0)})),Object.assign(i.autoplay,{start:S,stop:T,pause:M,resume:C})},function(e){let{swiper:t,extendParams:s,on:i}=e;s({thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-thumbs"}});let r=!1,n=!1;function l(){const e=t.thumbs.swiper;if(!e||e.destroyed)return;const s=e.clickedIndex,a=e.clickedSlide;if(a&&a.classList.contains(t.params.thumbs.slideThumbActiveClass))return;if(null==s)return;let i;i=e.params.loop?parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10):s,t.params.loop?t.slideToLoop(i):t.slideTo(i)}function o(){const{thumbs:e}=t.params;if(r)return!1;r=!0;const s=t.constructor;if(e.swiper instanceof s)t.thumbs.swiper=e.swiper,Object.assign(t.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),Object.assign(t.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper.update();else if(c(e.swiper)){const a=Object.assign({},e.swiper);Object.assign(a,{watchSlidesProgress:!0,slideToClickedSlide:!1}),t.thumbs.swiper=new s(a),n=!0}return t.thumbs.swiper.el.classList.add(t.params.thumbs.thumbsContainerClass),t.thumbs.swiper.on("tap",l),!0}function d(e){const s=t.thumbs.swiper;if(!s||s.destroyed)return;const a="auto"===s.params.slidesPerView?s.slidesPerViewDynamic():s.params.slidesPerView;let i=1;const r=t.params.thumbs.slideThumbActiveClass;if(t.params.slidesPerView>1&&!t.params.centeredSlides&&(i=t.params.slidesPerView),t.params.thumbs.multipleActiveThumbs||(i=1),i=Math.floor(i),s.slides.forEach((e=>e.classList.remove(r))),s.params.loop||s.params.virtual&&s.params.virtual.enabled)for(let e=0;e<i;e+=1)f(s.slidesEl,`[data-swiper-slide-index="${t.realIndex+e}"]`).forEach((e=>{e.classList.add(r)}));else for(let e=0;e<i;e+=1)s.slides[t.realIndex+e]&&s.slides[t.realIndex+e].classList.add(r);const n=t.params.thumbs.autoScrollOffset,l=n&&!s.params.loop;if(t.realIndex!==s.realIndex||l){const i=s.activeIndex;let r,o;if(s.params.loop){const e=s.slides.filter((e=>e.getAttribute("data-swiper-slide-index")===`${t.realIndex}`))[0];r=s.slides.indexOf(e),o=t.activeIndex>t.previousIndex?"next":"prev"}else r=t.realIndex,o=r>t.previousIndex?"next":"prev";l&&(r+="next"===o?n:-1*n),s.visibleSlidesIndexes&&s.visibleSlidesIndexes.indexOf(r)<0&&(s.params.centeredSlides?r=r>i?r-Math.floor(a/2)+1:r+Math.floor(a/2)-1:r>i&&s.params.slidesPerGroup,s.slideTo(r,e?0:void 0))}}t.thumbs={swiper:null},i("beforeInit",(()=>{const{thumbs:e}=t.params;if(e&&e.swiper)if("string"==typeof e.swiper||e.swiper instanceof HTMLElement){const s=a(),i=()=>{const a="string"==typeof e.swiper?s.querySelector(e.swiper):e.swiper;if(a&&a.swiper)e.swiper=a.swiper,o(),d(!0);else if(a){const s=i=>{e.swiper=i.detail[0],a.removeEventListener("init",s),o(),d(!0),e.swiper.update(),t.update()};a.addEventListener("init",s)}return a},r=()=>{if(t.destroyed)return;i()||requestAnimationFrame(r)};requestAnimationFrame(r)}else o(),d(!0)})),i("slideChange update resize observerUpdate",(()=>{d()})),i("setTransition",((e,s)=>{const a=t.thumbs.swiper;a&&!a.destroyed&&a.setTransition(s)})),i("beforeDestroy",(()=>{const e=t.thumbs.swiper;e&&!e.destroyed&&n&&e.destroy()})),Object.assign(t.thumbs,{init:o,update:d})},function(e){let{swiper:t,extendParams:s,emit:a,once:i}=e;s({freeMode:{enabled:!1,momentum:!0,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,momentumVelocityRatio:1,sticky:!1,minimumVelocity:.02}}),Object.assign(t,{freeMode:{onTouchStart:function(){if(t.params.cssMode)return;const e=t.getTranslate();t.setTranslate(e),t.setTransition(0),t.touchEventsData.velocities.length=0,t.freeMode.onTouchEnd({currentPos:t.rtl?t.translate:-t.translate})},onTouchMove:function(){if(t.params.cssMode)return;const{touchEventsData:e,touches:s}=t;0===e.velocities.length&&e.velocities.push({position:s[t.isHorizontal()?"startX":"startY"],time:e.touchStartTime}),e.velocities.push({position:s[t.isHorizontal()?"currentX":"currentY"],time:o()})},onTouchEnd:function(e){let{currentPos:s}=e;if(t.params.cssMode)return;const{params:r,wrapperEl:n,rtlTranslate:l,snapGrid:d,touchEventsData:c}=t,p=o()-c.touchStartTime;if(s<-t.minTranslate())t.slideTo(t.activeIndex);else if(s>-t.maxTranslate())t.slides.length<d.length?t.slideTo(d.length-1):t.slideTo(t.slides.length-1);else{if(r.freeMode.momentum){if(c.velocities.length>1){const e=c.velocities.pop(),s=c.velocities.pop(),a=e.position-s.position,i=e.time-s.time;t.velocity=a/i,t.velocity/=2,Math.abs(t.velocity)<r.freeMode.minimumVelocity&&(t.velocity=0),(i>150||o()-e.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=r.freeMode.momentumVelocityRatio,c.velocities.length=0;let e=1e3*r.freeMode.momentumRatio;const s=t.velocity*e;let p=t.translate+s;l&&(p=-p);let u,m=!1;const h=20*Math.abs(t.velocity)*r.freeMode.momentumBounceRatio;let f;if(p<t.maxTranslate())r.freeMode.momentumBounce?(p+t.maxTranslate()<-h&&(p=t.maxTranslate()-h),u=t.maxTranslate(),m=!0,c.allowMomentumBounce=!0):p=t.maxTranslate(),r.loop&&r.centeredSlides&&(f=!0);else if(p>t.minTranslate())r.freeMode.momentumBounce?(p-t.minTranslate()>h&&(p=t.minTranslate()+h),u=t.minTranslate(),m=!0,c.allowMomentumBounce=!0):p=t.minTranslate(),r.loop&&r.centeredSlides&&(f=!0);else if(r.freeMode.sticky){let e;for(let t=0;t<d.length;t+=1)if(d[t]>-p){e=t;break}p=Math.abs(d[e]-p)<Math.abs(d[e-1]-p)||"next"===t.swipeDirection?d[e]:d[e-1],p=-p}if(f&&i("transitionEnd",(()=>{t.loopFix()})),0!==t.velocity){if(e=l?Math.abs((-p-t.translate)/t.velocity):Math.abs((p-t.translate)/t.velocity),r.freeMode.sticky){const s=Math.abs((l?-p:p)-t.translate),a=t.slidesSizesGrid[t.activeIndex];e=s<a?r.speed:s<2*a?1.5*r.speed:2.5*r.speed}}else if(r.freeMode.sticky)return void t.slideToClosest();r.freeMode.momentumBounce&&m?(t.updateProgress(u),t.setTransition(e),t.setTranslate(p),t.transitionStart(!0,t.swipeDirection),t.animating=!0,x(n,(()=>{t&&!t.destroyed&&c.allowMomentumBounce&&(a("momentumBounce"),t.setTransition(r.speed),setTimeout((()=>{t.setTranslate(u),x(n,(()=>{t&&!t.destroyed&&t.transitionEnd()}))}),0))}))):t.velocity?(a("_freeModeNoMomentumRelease"),t.updateProgress(p),t.setTransition(e),t.setTranslate(p),t.transitionStart(!0,t.swipeDirection),t.animating||(t.animating=!0,x(n,(()=>{t&&!t.destroyed&&t.transitionEnd()})))):t.updateProgress(p),t.updateActiveIndex(),t.updateSlidesClasses()}else{if(r.freeMode.sticky)return void t.slideToClosest();r.freeMode&&a("_freeModeNoMomentumRelease")}(!r.freeMode.momentum||p>=r.longSwipesMs)&&(a("_freeModeStaticRelease"),t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}}}})},function(e){let t,s,a,i,{swiper:r,extendParams:n,on:l}=e;n({grid:{rows:1,fill:"column"}});const o=()=>{let e=r.params.spaceBetween;return"string"==typeof e&&e.indexOf("%")>=0?e=parseFloat(e.replace("%",""))/100*r.size:"string"==typeof e&&(e=parseFloat(e)),e};l("init",(()=>{i=r.params.grid&&r.params.grid.rows>1})),l("update",(()=>{const{params:e,el:t}=r,s=e.grid&&e.grid.rows>1;i&&!s?(t.classList.remove(`${e.containerModifierClass}grid`,`${e.containerModifierClass}grid-column`),a=1,r.emitContainerClasses()):!i&&s&&(t.classList.add(`${e.containerModifierClass}grid`),"column"===e.grid.fill&&t.classList.add(`${e.containerModifierClass}grid-column`),r.emitContainerClasses()),i=s})),r.grid={initSlides:e=>{const{slidesPerView:i}=r.params,{rows:n,fill:l}=r.params.grid,o=r.virtual&&r.params.virtual.enabled?r.virtual.slides.length:e.length;a=Math.floor(o/n),t=Math.floor(o/n)===o/n?o:Math.ceil(o/n)*n,"auto"!==i&&"row"===l&&(t=Math.max(t,i*n)),s=t/n},unsetSlides:()=>{r.slides&&r.slides.forEach((e=>{e.swiperSlideGridSet&&(e.style.height="",e.style[r.getDirectionLabel("margin-top")]="")}))},updateSlide:(e,i,n)=>{const{slidesPerGroup:l}=r.params,d=o(),{rows:c,fill:p}=r.params.grid,u=r.virtual&&r.params.virtual.enabled?r.virtual.slides.length:n.length;let m,h,f;if("row"===p&&l>1){const s=Math.floor(e/(l*c)),a=e-c*l*s,r=0===s?l:Math.min(Math.ceil((u-s*c*l)/c),l);f=Math.floor(a/r),h=a-f*r+s*l,m=h+f*t/c,i.style.order=m}else"column"===p?(h=Math.floor(e/c),f=e-h*c,(h>a||h===a&&f===c-1)&&(f+=1,f>=c&&(f=0,h+=1))):(f=Math.floor(e/s),h=e-f*s);i.row=f,i.column=h,i.style.height=`calc((100% - ${(c-1)*d}px) / ${c})`,i.style[r.getDirectionLabel("margin-top")]=0!==f?d&&`${d}px`:"",i.swiperSlideGridSet=!0},updateWrapperSize:(e,s)=>{const{centeredSlides:a,roundLengths:i}=r.params,n=o(),{rows:l}=r.params.grid;if(r.virtualSize=(e+n)*t,r.virtualSize=Math.ceil(r.virtualSize/l)-n,r.params.cssMode||(r.wrapperEl.style[r.getDirectionLabel("width")]=`${r.virtualSize+n}px`),a){const e=[];for(let t=0;t<s.length;t+=1){let a=s[t];i&&(a=Math.floor(a)),s[t]<r.virtualSize+s[0]&&e.push(a)}s.splice(0,s.length),s.push(...e)}}}},function(e){let{swiper:t}=e;Object.assign(t,{appendSlide:
vendor: 12,067 bytes, lines 22-25
22ae.bind(t),prependSlide:ie.bind(t),addSlide:re.bind(t),removeSlide:ne.bind(t),removeAllSlides:le.bind(t)})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({fadeEffect:{crossFade:!1}}),oe({effect:"fade",swiper:t,on:a,setTranslate:()=>{const{slides:e}=t;t.params.fadeEffect;for(let s=0;s<e.length;s+=1){const e=t.slides[s];let a=-e.swiperSlideOffset;t.params.virtualTranslate||(a-=t.translate);let i=0;t.isHorizontal()||(i=a,a=0);const r=t.params.fadeEffect.crossFade?Math.max(1-Math.abs(e.progress),0):1+Math.min(Math.max(e.progress,-1),0),n=de(0,e);n.style.opacity=r,n.style.transform=`translate3d(${a}px, ${i}px, 0px)`}},setTransition:e=>{const s=t.slides.map((e=>h(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`})),ce({swiper:t,duration:e,transformElements:s,allSlides:!0})},overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}});const i=(e,t,s)=>{let a=s?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),i=s?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=v("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"left":"top")).split(" ")),e.append(a)),i||(i=v("div",("swiper-slide-shadow-cube swiper-slide-shadow-"+(s?"right":"bottom")).split(" ")),e.append(i)),a&&(a.style.opacity=Math.max(-t,0)),i&&(i.style.opacity=Math.max(t,0))};oe({effect:"cube",swiper:t,on:a,setTranslate:()=>{const{el:e,wrapperEl:s,slides:a,width:r,height:n,rtlTranslate:l,size:o,browser:d}=t,c=t.params.cubeEffect,p=t.isHorizontal(),u=t.virtual&&t.params.virtual.enabled;let m,h=0;c.shadow&&(p?(m=t.wrapperEl.querySelector(".swiper-cube-shadow"),m||(m=v("div","swiper-cube-shadow"),t.wrapperEl.append(m)),m.style.height=`${r}px`):(m=e.querySelector(".swiper-cube-shadow"),m||(m=v("div","swiper-cube-shadow"),e.append(m))));for(let e=0;e<a.length;e+=1){const s=a[e];let r=e;u&&(r=parseInt(s.getAttribute("data-swiper-slide-index"),10));let n=90*r,d=Math.floor(n/360);l&&(n=-n,d=Math.floor(-n/360));const m=Math.max(Math.min(s.progress,1),-1);let f=0,g=0,v=0;r%4==0?(f=4*-d*o,v=0):(r-1)%4==0?(f=0,v=4*-d*o):(r-2)%4==0?(f=o+4*d*o,v=o):(r-3)%4==0&&(f=-o,v=3*o+4*o*d),l&&(f=-f),p||(g=f,f=0);const w=`rotateX(${p?0:-n}deg) rotateY(${p?n:0}deg) translate3d(${f}px, ${g}px, ${v}px)`;m<=1&&m>-1&&(h=90*r+90*m,l&&(h=90*-r-90*m),t.browser&&t.browser.isSafari&&Math.abs(h)/90%2==1&&(h+=.001)),s.style.transform=w,c.slideShadows&&i(s,m,p)}if(s.style.transformOrigin=`50% 50% -${o/2}px`,s.style["-webkit-transform-origin"]=`50% 50% -${o/2}px`,c.shadow)if(p)m.style.transform=`translate3d(0px, ${r/2+c.shadowOffset}px, ${-r/2}px) rotateX(89.99deg) rotateZ(0deg) scale(${c.shadowScale})`;else{const e=Math.abs(h)-90*Math.floor(Math.abs(h)/90),t=1.5-(Math.sin(2*e*Math.PI/360)/2+Math.cos(2*e*Math.PI/360)/2),s=c.shadowScale,a=c.shadowScale/t,i=c.shadowOffset;m.style.transform=`scale3d(${s}, 1, ${a}) translate3d(0px, ${n/2+i}px, ${-n/2/a}px) rotateX(-89.99deg)`}const f=(d.isSafari||d.isWebView)&&d.needPerspectiveFix?-o/2:0;s.style.transform=`translate3d(0px,0,${f}px) rotateX(${t.isHorizontal()?0:h}deg) rotateY(${t.isHorizontal()?-h:0}deg)`,s.style.setProperty("--swiper-cube-translate-z",`${f}px`)},setTransition:e=>{const{el:s,slides:a}=t;if(a.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),t.params.cubeEffect.shadow&&!t.isHorizontal()){const t=s.querySelector(".swiper-cube-shadow");t&&(t.style.transitionDuration=`${e}ms`)}},recreateShadows:()=>{const e=t.isHorizontal();t.slides.forEach((t=>{const s=Math.max(Math.min(t.progress,1),-1);i(t,s,e)}))},getEffectParams:()=>t.params.cubeEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({flipEffect:{slideShadows:!0,limitRotation:!0}});const i=(e,s)=>{let a=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-left"):e.querySelector(".swiper-slide-shadow-top"),i=t.isHorizontal()?e.querySelector(".swiper-slide-shadow-right"):e.querySelector(".swiper-slide-shadow-bottom");a||(a=pe("flip",e,t.isHorizontal()?"left":"top")),i||(i=pe("flip",e,t.isHorizontal()?"right":"bottom")),a&&(a.style.opacity=Math.max(-s,0)),i&&(i.style.opacity=Math.max(s,0))};oe({effect:"flip",swiper:t,on:a,setTranslate:()=>{const{slides:e,rtlTranslate:s}=t,a=t.params.flipEffect;for(let r=0;r<e.length;r+=1){const n=e[r];let l=n.progress;t.params.flipEffect.limitRotation&&(l=Math.max(Math.min(n.progress,1),-1));const o=n.swiperSlideOffset;let d=-180*l,c=0,p=t.params.cssMode?-o-t.translate:-o,u=0;t.isHorizontal()?s&&(d=-d):(u=p,p=0,c=-d,d=0),t.browser&&t.browser.isSafari&&(Math.abs(d)/90%2==1&&(d+=.001),Math.abs(c)/90%2==1&&(c+=.001)),n.style.zIndex=-Math.abs(Math.round(l))+e.length,a.slideShadows&&i(n,l);const m=`translate3d(${p}px, ${u}px, 0px) rotateX(${c}deg) rotateY(${d}deg)`;de(0,n).style.transform=m}},setTransition:e=>{const s=t.slides.map((e=>h(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),ce({swiper:t,duration:e,transformElements:s})},recreateShadows:()=>{t.params.flipEffect,t.slides.forEach((e=>{let s=e.progress;t.params.flipEffect.limitRotation&&(s=Math.max(Math.min(e.progress,1),-1)),i(e,s)}))},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}}),oe({effect:"coverflow",swiper:t,on:a,setTranslate:()=>{const{width:e,height:s,slides:a,slidesSizesGrid:i}=t,r=t.params.coverflowEffect,n=t.isHorizontal(),l=t.translate,o=n?e/2-l:s/2-l,d=n?r.rotate:-r.rotate,c=r.depth;for(let e=0,s=a.length;e<s;e+=1){const s=a[e],l=i[e],p=(o-s.swiperSlideOffset-l/2)/l,u="function"==typeof r.modifier?r.modifier(p):p*r.modifier;let m=n?d*u:0,h=n?0:d*u,f=-c*Math.abs(u),g=r.stretch;"string"==typeof g&&-1!==g.indexOf("%")&&(g=parseFloat(r.stretch)/100*l);let v=n?0:g*u,w=n?g*u:0,b=1-(1-r.scale)*Math.abs(u);Math.abs(w)<.001&&(w=0),Math.abs(v)<.001&&(v=0),Math.abs(f)<.001&&(f=0),Math.abs(m)<.001&&(m=0),Math.abs(h)<.001&&(h=0),Math.abs(b)<.001&&(b=0),t.browser&&t.browser.isSafari&&(Math.abs(m)/90%2==1&&(m+=.001),Math.abs(h)/90%2==1&&(h+=.001));const y=`translate3d(${w}px,${v}px,${f}px)  rotateX(${h}deg) rotateY(${m}deg) scale(${b})`;if(de(0,s).style.transform=y,s.style.zIndex=1-Math.abs(Math.round(u)),r.slideShadows){let e=n?s.querySelector(".swiper-slide-shadow-left"):s.querySelector(".swiper-slide-shadow-top"),t=n?s.querySelector(".swiper-slide-shadow-right"):s.querySelector(".swiper-slide-shadow-bottom");e||(e=pe("coverflow",s,n?"left":"top")),t||(t=pe("coverflow",s,n?"right":"bottom")),e&&(e.style.opacity=u>0?u:0),t&&(t.style.opacity=-u>0?-u:0)}}},setTransition:e=>{t.slides.map((e=>h(e))).forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))}))},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const i=e=>"string"==typeof e?e:`${e}px`;oe({effect:"creative",swiper:t,on:a,setTranslate:()=>{const{slides:e,wrapperEl:s,slidesSizesGrid:a}=t,r=t.params.creativeEffect,{progressMultiplier:n}=r,l=t.params.centeredSlides;if(l){const e=a[0]/2-t.params.slidesOffsetBefore||0;s.style.transform=`translateX(calc(50% - ${e}px))`}for(let s=0;s<e.length;s+=1){const a=e[s],o=a.progress,d=Math.min(Math.max(a.progress,-r.limitProgress),r.limitProgress);let c=d;l||(c=Math.min(Math.max(a.originalProgress,-r.limitProgress),r.limitProgress));const p=a.swiperSlideOffset,u=[t.params.cssMode?-p-t.translate:-p,0,0],m=[0,0,0];let h=!1;t.isHorizontal()||(u[1]=u[0],u[0]=0);let f={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};d<0?(f=r.next,h=!0):d>0&&(f=r.prev,h=!0),u.forEach(((e,t)=>{u[t]=`calc(${e}px + (${i(f.translate[t])} * ${Math.abs(d*n)}))`})),m.forEach(((e,s)=>{let a=f.rotate[s]*Math.abs(d*n);t.browser&&t.browser.isSafari&&Math.abs(a)/90%2==1&&(a+=.001),m[s]=a})),a.style.zIndex=-Math.abs(Math.round(o))+e.length;const g=u.join(", "),v=`rotateX(${m[0]}deg) rotateY(${m[1]}deg) rotateZ(${m[2]}deg)`,w=c<0?`scale(${1+(1-f.scale)*c*n})`:`scale(${1-(1-f.scale)*c*n})`,b=c<0?1+(1-f.opacity)*c*n:1-(1-f.opacity)*c*n,y=`translate3d(${g}) ${v} ${w}`;if(h&&f.shadow||!h){let e=a.querySelector(".swiper-slide-shadow");if(!e&&f.shadow&&(e=pe("creative",a)),e){const t=r.shadowPerProgress?d*(1/r.limitProgress):d;e.style.opacity=Math.min(Math.max(Math.abs(t),0),1)}}const E=de(0,a);E.style.transform=y,E.style.opacity=b,f.origin&&(E.style.transformOrigin=f.origin)}},setTransition:e=>{const s=t.slides.map((e=>h(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),ce({swiper:t,duration:e,transformElements:s,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})},function(e){let{swiper:t,extendParams:s,on:a}=e;s({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}}),oe({effect:"cards",swiper:t,on:a,setTranslate:()=>{const{slides:e,activeIndex:s,rtlTranslate:a}=t,i=t.params.cardsEffect,{startTranslate:r,isTouched:n}=t.touchEventsData,l=a?-t.translate:t.translate;for(let o=0;o<e.length;o+=1){const d=e[o],c=d.progress,p=Math.min(Math.max(c,-4),4);let u=d.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(u-=e[0].swiperSlideOffset);let m=t.params.cssMode?-u-t.translate:-u,h=0;const f=-100*Math.abs(p);let g=1,v=-i.perSlideRotate*p,w=i.perSlideOffset-.75*Math.abs(p);const b=t.virtual&&t.params.virtual.enabled?t.virtual.from+o:o,y=(b===s||b===s-1)&&p>0&&p<1&&(n||t.params.cssMode)&&l<r,E=(b===s||b===s+1)&&p<0&&p>-1&&(n||t.params.cssMode)&&l>r;if(y||E){const e=(1-Math.abs((Math.abs(p)-.5)/.5))**.5;v+=-28*p*e,g+=-.5*e,w+=96*e,h=-25*e*Math.abs(p)+"%"}if(m=p<0?`calc(${m}px ${a?"-":"+"} (${w*Math.abs(p)}%))`:p>0?`calc(${m}px ${a?"-":"+"} (-${w*Math.abs(p)}%))`:`${m}px`,!t.isHorizontal()){const e=h;h=m,m=e}const x=p<0?""+(1+(1-g)*p):""+(1-(1-g)*p),S=`\n        translate3d(${m}, ${h}, ${f}px)\n        rotateZ(${i.rotate?a?-v:v:0}deg)\n        scale(${x})\n      `;if(i.slideShadows){let e=d.querySelector(".swiper-slide-shadow");e||(e=pe("cards",d)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(p)-.5)/.5,0),1))}d.style.zIndex=-Math.abs(Math.round(c))+e.length;de(0,d).style.transform=S}},setTransition:e=>{const s=t.slides.map((e=>h(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),ce({swiper:t,duration:e,transformElements:s})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}];return ee.use(ue),ee}();
23/* End */
24;
25; /* Start:"a:4:{s:4:"full";s:77:"/bitrix/templates/aura-flowers-new/js/jquery.fancybox.pack.js?171562863423135";s:6:"source";
vendor: 4,144 bytes, lines 25-34
25s:61:"/bitrix/templates/aura-flowers-new/js/jquery.fancybox.pack.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
26/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
27(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&E(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,
28width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},
29keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
30(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
31openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
32isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
33c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
34k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;
34a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
35b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
36setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;
37d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=
38a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null);b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),
39b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),
40y:n.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");n.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;
41if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==v)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&
42(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1
vendor: 9,967 bytes, lines 42-62
42)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&&b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,
43{},b.helpers[d].defaults,e),c)});p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,
44mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=
45!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))});b.trigger("onReady");if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");
46"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=
47this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);
48f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,
49e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,
50outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case "image":e=a.tpl.image.replace("{href}",
51g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");a.inner.css("overflow","yes"===k?"scroll":
52"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?
53h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]),v,z,t,C,A,F,B,D,H;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");x=l(k.outerWidth(!0)-k.width());v=l(k.outerHeight(!0)-k.height());z=y+x;t=r+v;C=E(c)?(a.w-z)*l(c)/100:c;A=E(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else if(h.autoWidth||
54h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp");c=l(C);j=l(A);D=C/A;m=l(E(m)?l(m,"w")-z:m);n=l(E(n)?l(n,"w")-z:n);u=l(E(u)?l(u,"h")-t:u);p=l(E(p)?l(p,"h")-t:p);F=n;B=p;h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p));z=a.w-y;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),c<m&&(c=m,j=l(c/D)),j<u&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&
55"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p)));if(h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),c<m&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&("auto"===s&&j<A&&c+x+q<z)&&(c+=q);g.width(c).height(j);e.width(c+x);a=e.width();
56y=e.height();e=(a>z||y>r)&&c>m&&j>u;c=h.aspectRatio?c<F&&j<B&&c<C&&j<A:(c<F||j<B)&&(c<C||j<A);f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j});!H&&(h.autoHeight&&j>u&&j<p&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};d.autoCenter&&d.fixed&&
57!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),
58b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
59a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
60(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
61f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
62{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})}
62,changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
63b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=
64f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent);this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?
65b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%");I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),
66p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&(this.fixed&&b.fixed)&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===
67f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=
68b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(q(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,
69e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.o
69pen(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):p.undelegate(c,"click.fb-start").delegate(c+
70":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===v){a=f.support;d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===
71d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(r).width();J.addClass("fancybox-lock-test");d=f(r).width();J.removeClass("fancybox-lock-test");f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})})(window,document,jQuery);
72/* End */
73;
74; /* Start:"a:4:{s:4:"full";s:88:"/bitrix/templates/aura-flowers-new/js/owl-carousel-2/owl.carousel.min.js?171562863479152";s:6:"source";s:72:"/bitrix/templates/aura-flowers-new/js/owl-carousel-2/owl.carousel.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
75/**
76 * Owl carousel
77 * @version 2.0.0
78 * @author Bartosz Wojciechowski
79 * @license The MIT License (MIT)
80 * @todo Lazy Load Icon
81 * @todo prevent animationend bubling
82 * @todo itemsScaleUp
83 * @todo Test Zepto
84 * @todo stagePadding calculate wrong active classes
85 */
86;(function($, window, document, undefined) {
87
88	var drag, state, e;
89
90	/**
91	 * Template for status information about drag and touch events.
92	 * @private
93	 */
94	drag = {
95		start: 0,
96		startX: 0,
97		startY: 0,
98		current: 0,
99		currentX: 0,
100		currentY: 0,
101		offsetX: 0,
102		offsetY: 0,
103		distance: null,
104		startTime: 0,
105		endTime: 0,
106		updatedX: 0,
107		targetEl: null
108	};
109
110	/**
111	 * Template for some status informations.
112	 * @private
113	 */
114	state = {
115		isTouch: false,
116		isScrolling: false,
117		isSwiping: false,
118		direction: false,
119		inMotion: false
120	};
121
122	/**
123	 * Event functions references.
124	 * @private
125	 */
126	e = {
127		_onDragStart: null,
128		_onDragMove: null,
129		_onDragEnd: null,
130		_transitionEnd: null,
131		_resizer: null,
132		_responsiveCall: null,
133		_goToLoop: null,
134		_checkVisibile: null
135	};
136
137	/**
138	 * Creates a carousel.
139	 * @class The Owl Carousel.
140	 * @public
141	 * @param {HTMLElement|jQuery} element - The element to create the carousel for.
142	 * @param {Object} [options] - The options
143	 */
144	function Owl(element, options) {
145
146		/**
147		 * Current settings for the carousel.
148		 * @public
149		 */
150		this.settings = null;
151
152		/**
153		 * Current options set by the caller including defaults.
154		 * @public
155		 */
156		this.options = $.extend({}, Owl.Defaults, options);
157
158		/**
159		 * Plugin element.
160		 * @public
161		 */
162		this.$element = $(element);
163
164		/**
165		 * Caches informations about drag and touch events.
166		 */
167		this.drag = $.extend({}, drag);
168
169		/**
170		 * Caches some status informations.
171		 * @protected
172		 */
173		this.state = $.extend({}, state);
174
175		/**
176		 * @protected
177		 * @todo Must be documented
178		 */
179		this.e = $.extend({}, e);
180
181		/**
182		 * References to the running plugins of this carousel.
183		 * @protected
184		 */
185		this._plugins = {};
186
187		/**
188		 * Currently suppressed events to prevent them from beeing retriggered.
189		 * @protected
190		 */
191		this._supress = {};
192
193		/**
194		 * Absolute current position.
195		 * @protected
196		 */
197		this._current = null;
198
199		/**
200		 * Animation speed in milliseconds.
201		 * @protected
202		 */
203		this._speed = null;
204
205		/**
206		 * Coordinates of all items in pixel.
207		 * @todo The name of this member is missleading.
208		 * @protected
209		 */
210		this._coordinates = [];
211
212		/**
213		 * Current breakpoint.
214		 * @todo Real media queries would be nice.
215		 * @protected
216		 */
217		this._breakpoint = null;
218
219		/**
220		 * Current width of the plugin element.
221		 */
222		this._width = null;
223
224		/**
225		 * All real items.
226		 * @protected
227		 */
228		this._items = [];
229
230		/**
231		 * All cloned items.
232		 * @protected
233		 */
234		this._clones = [];
235
236		/**
237		 * Merge values of all items.
238		 * @todo Maybe this could be part of a plugin.
239		 * @protected
240		 */
241		this._mergers = [];
242
243		/**
244		 * Invalidated parts within the update process.
245		 * @protected
246		 */
247		this._invalidated = {};
248
249		/**
250		 * Ordered list of workers for the update process.
251		 * @protected
252		 */
253		this._pipe = [];
254
255		$.each(Owl.Plugins, $.proxy(function(key, plugin) {
256			this._plugins[key[0].toLowerCase() + key.slice(1)]
257				= new plugin(this);
258		}, this));
259
260		$.each(Owl.Pipe, $.proxy(function(priority, worker) {
261			this._pipe.push({
262				'filter': worker.filter,
263				'run': $.proxy(worker.run, this)
264			});
265		}, this));
266
267		this.setup();
268		this.initialize();
269	}
270
271	/**
272	 * Default options for the carousel.
273	 * @public
274	 */
275	Owl.Defaults = {
276		items: 3,
277		loop: false,
278		center: false,
279
280		mouseDrag: true,
281		touchDrag: true,
282		pullDrag: true,
283		freeDrag: false,
284
285		margin: 0,
286		stagePadding: 0,
287
288		merge: false,
289		mergeFit: true,
290		autoWidth: false,
291
292		startPosition: 0,
293		rtl: false,
294
295		smartSpeed: 500,
296		fluidSpeed: false,
297		dragEndSpeed: false,
298
299		responsive: {},
300		responsiveRefreshRate: 200,
301		responsiveBaseElement: window,
302		responsiveClass: false,
303
304		fallbackEasing: 'swing',
305
306		info: false,
307
308		nestedItemSelector: false,
309		itemElement: 'div',
310		stageElement: 'div',
311
312		// Classes and Names
313		themeClass: 'owl-theme',
314		baseClass: 'owl-carousel',
315		itemClass: 'owl-item',
316		centerClass: 'center',
317		activeClass: 'active'
318	};
319
320	/**
321	 * Enumeration for width.
322	 * @public
323	 * @readonly
324	 * @enum {String}
325	 */
326	Owl.Width = {
327		Default: 'default',
328		Inner: 'inner',
329		Outer: 'outer'
330	};
331
332	/**
333	 * Contains all registered plugins.
334	 * @public
335	 */
336	Owl.Plugins = {};
337
338	/**
339	 * Update pipe.
340	 */
341	Owl.Pipe = [ {
342		filter: [ 'width', 'items', 'settings' ],
343		run: function(cache) {
344			cache.current = this._items && this._items[this.relative(this._current)];
345		}
346	}, {
347		filter: [ 'items', 'settings' ],
348		run: function() {
349			var cached = this._clones,
350				clones = this.$stage.children('.cloned');
351
352			if (clones.length !== cached.length || (!this.settings.loop && cached.length > 0)) {
353				this.$stage.children('.cloned').remove();
354				this._clones = [];
355			}
356		}
357	}, {
358		filter: [ 'items', 'settings' ],
359		run: function() {
360			var i, n,
361				clones = this._clones,
362				items = this._items,
363				delta = this.settings.loop ? clones.length - Math.max(this.settings.items * 2, 4) : 0;
364
365			for (i = 0, n = Math.abs(delta / 2); i < n; i++) {
366				if (delta > 0) {
367					this.$stage.children().eq(items.length + clones.length - 1).remove();
368					clones.pop();
369					this.$stage.children().eq(0).remove();
370					clones.pop();
371				} else {
372					clones.push(clones.length / 2);
373					this.$stage.append(items[clones[clones.length - 1]].clone().addClass('cloned'));
374					clones.push(items.length - 1 - (clones.length - 1) / 2);
375					this.$stage.prepend(items[clones[clones.length - 1]].clone().addClass('cloned'));
376				}
377			}
378		}
379	}, {
380		filter: [ 'width', 'items', 'settings' ],
381		run: function() {
382			var rtl = (this.settings.rtl ? 1 : -1),
383				width = (this.width() / this.settings.items).toFixed(3),
384				coordinate = 0, merge, i, n;
385
386			this._coordinates = [];
387			for (i = 0, n = this._clones.length + this._items.length; i < n; i++) {
388				merge = this._mergers[this.relative(i)];
389				merge = (this.settings.mergeFit && Math.min(merge, this.settings.items)) || merge;
390				coordinate += (this.settings.autoWidth ? this._items[this.relative(i)].width() + this.settings.margin : width * merge) * rtl;
391
392				this._coordinates.push(coordinate);
393			}
394		}
395	}, {
396		filter: [ 'width', 'items', 'settings' ],
397		run: function() {
398			var i, n, width = (this.width() / this.settings.items).toFixed(3), css = {
399				'width': Math.abs(this._coordinates[this._coordinates.length - 1]) + this.settings.stagePadding * 2,
400				'padding-left': this.settings.stagePadding || '',
401				'padding-right': this.settings.stagePadding || ''
402			};
403
404			this.$stage.css(css);
405
406			css = { 'width': this.settings.autoWidth ? 'auto' : width - this.settings.margin };
407			css[this.settings.rtl ? 'margin-left' : 'margin-right'] = this.settings.margin;
408
409			if (!this.settings.autoWidth && $.grep(this._mergers, function(v) { return v > 1 }).length > 0) {
410				for (i = 0, n = this._coordinates.length; i < n; i++) {
411					css.width = Math.abs(this._coordinates[i]) - Math.abs(this._coordinates[i - 1] || 0) - this.settings.margin;
412					this.$stage.children().eq(i).css(css);
413				}
414			} else {
415				this.$stage.children().css(css);
416			}
417		}
418	}, {
419		filter: [ 'width', 'items', 'settings' ],
420		run: function(cache) {
421			cache.current && this.reset(this.$stage.children().index(cache.current));
422		}
423	}, {
424		filter: [ 'position' ],
425		run: function() {
426			this.animate(this.coordinates(this._current));
427		}
428	}, {
429		filter: [ 'width', 'position', 'items', 'settings' ],
430		run: function() {
431			var rtl = this.settings.rtl ? 1 : -1,
432				padding = this.settings.stagePadding * 2,
433				begin = this.coordinates(this.current()) + padding,
434				end = begin + this.width() * rtl,
435				inner, outer, matches = [], i, n;
436
437			for (i = 0, n = this._coordinates.length; i < n; i++) {
438				inner = this._coordinates[i - 1] || 0;
439				outer = Math.abs(this._coordinates[i]) + padding * rtl;
440
441				if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
442					|| (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
443					matches.push(i);
444				}
445			}
446
447			this.$stage.children('.' + this.settings.activeClass).removeClass(this.settings.activeClass);
448			this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass(this.settings.activeClass);
449
450			if (this.settings.center) {
451				this.$stage.children('.' + this.settings.centerClass).removeClass(this.settings.centerClass);
452				this.$stage.children().eq(this.current()).addClass(this.settings.centerClass);
453			}
454		}
455	} ];
456
457	/**
458	 * Initializes the carousel.
459	 * @protected
460	 */
461	Owl.prototype.initialize = function() {
462		this.trigger('initialize');
463
464		this.$element
465			.addClass(this.settings.baseClass)
466			.addClass(this.settings.themeClass)
467			.toggleClass('owl-rtl', this.settings.rtl);
468
469		// check support
470		this.browserSupport();
471
472		if (this.settings.autoWidth && this.state.imagesLoaded !== true) {
473			var imgs, nestedSelector, width;
474			imgs = this.$element.find('img');
475			nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
476			width = this.$element.children(nestedSelector).width();
477
478			if (imgs.length && width <= 0) {
479				this.preloadAutoWidthImages(imgs);
480				return false;
481			}
482		}
483
484		this.$element.addClass('owl-loading');
485
486		// create stage
487		this.$stage = $('<' + this.settings.stageElement + ' class="owl-stage"/>')
488			.wrap('<div class="owl-stage-outer">');
489
490		// append stage
491		this.$element.append(this.$stage.parent());
492
493		// append content
494		this.replace(this.$element.children().not(this.$stage.parent()));
495
496		// set view width
497		this._width = this.$element.width();
498
499		// update view
500		this.refresh();
501
502		this.$element.removeClass('owl-loading').addClass('owl-loaded');
503
504		// attach generic events
505		this.eventsCall();
506
507		// attach generic events
508		this.internalEvents();
509
510		// attach custom control events
511		this.addTriggerableEvents();
512
513		this.trigger('initialized');
514	};
515
516	/**
517	 * Setups the current settings.
518	 * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
519	 * @todo Support for media queries by using `matchMedia` would be nice.
520	 * @public
521	 */
522	Owl.prototype.setup = function() {
523		var viewport = this.viewport(),
524			overwrites = this.options.responsive,
525			match = -1,
526			settings = null;
527
528		if (!overwrites) {
529			settings = $.extend({}, this.options);
530		} else {
531			$.each(overwrites, function(breakpoint) {
532				if (breakpoint <= viewport && breakpoint > match) {
533					match = Number(breakpoint);
534				}
535			});
536
537			settings = $.extend({}, this.options, overwrites[match]);
538			delete settings.responsive;
539
540			// responsive class
541			if (settings.responsiveClass) {
542				this.$element.attr('class', function(i, c) {
543					return c.replace(/\b owl-responsive-\S+/g, '');
544				}).addClass('owl-responsive-' + match);
545			}
546		}
547
548		if (this.settings === null || this._breakpoint !== match) {
549			this.trigger('change', { property: { name: 'settings', value: settings } });
550			this._breakpoint = match;
551			this.settings = settings;
552			this.invalidate('settings');
553			this.trigger('changed', { property: { name: 'settings', value: this.settings } });
554		}
555	};
556
557	/**
558	 * Updates option logic if necessery.
559	 * @protected
560	 */
561	Owl.prototype.optionsLogic = function() {
562		// Toggle Center class
563		this.$element.toggleClass('owl-center', this.settings.center);
564
565		// if items number is less than in body
566		if (this.settings.loop && this._items.length < this.settings.items) {
567			this.settings.loop = false;
568		}
569
570		if (this.settings.autoWidth) {
571			this.settings.stagePadding = false;
572			this.settings.merge = false;
573		}
574	};
575
576	/**
577	 * Prepares an item before add.
578	 * @todo Rename event parameter `content` to `item`.
579	 * @protected
580	 * @returns {jQuery|HTMLElement} - The item container.
581	 */
582	Owl.prototype.prepare = function(item) {
583		var event = this.trigger('prepare', { content: item });
584
585		if (!event.data) {
586			event.data = $('<' + this.settings.itemElement + '/>')
587				.addClass(this.settings.itemClass).append(item)
588		}
589
590		this.trigger('prepared', { content: event.data });
591
592		return event.data;
593	};
594
595	/**
596	 * Updates the view.
597	 * @public
598	 */
599	Owl.prototype.update = function() {
600		var i = 0,
601			n = this._pipe.length,
602			filter = $.proxy(function(p) { return this[p] }, this._invalidated),
603			cache = {};
604
605		while (i < n) {
606			if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
607				this._pipe[i].run(cache);
608			}
609			i++;
610		}
611
612		this._invalidated = {};
613	};
614
615	/**
616	 * Gets the width of the view.
617	 * @public
618	 * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
619	 * @returns {Number} - The width of the view in pixel.
620	 */
621	Owl.prototype.width = function(dimension) {
622		dimension = dimension || Owl.Width.Default;
623		switch (dimension) {
624			case Owl.Width.Inner:
625			case Owl.Width.Outer:
626				return this._width;
627			default:
628				return this._width - this.settings.stagePadding * 2 + this.settings.margin;
629		}
630	};
631
632	/**
633	 * Refreshes the carousel primarily for adaptive purposes.
634	 * @public
635	 */
636	Owl.prototype.refresh = function() {
637		if (this._items.length === 0) {
638			return false;
639		}
640
641		var start = new Date().getTime();
642
643		this.trigger('refresh');
644
645		this.setup();
646
647		this.optionsLogic();
648
649		// hide and show methods helps here to set a proper widths,
650		// this prevents scrollbar to be calculated in stage width
651		this.$stage.addClass('owl-refresh');
652
653		this.update();
654
655		this.$stage.removeClass('owl-refresh');
656
657		this.state.orientation = window.orientation;
658
659		this.watchVisibility();
660
661		this.trigger('refreshed');
662	};
663
664	/**
665	 * Save internal event references and add event based functions.
666	 * @protected
667	 */
668	Owl.prototype.eventsCall = function() {
669		// Save events references
670		this.e._onDragStart = $.proxy(function(e) {
671			this.onDragStart(e);
672		}, this);
673		this.e._onDragMove = $.proxy(function(e) {
674			this.onDragMove(e);
675		}, this);
676		this.e._onDragEnd = $.proxy(function(e) {
677			this.onDragEnd(e);
678		}, this);
679		this.e._onResize = $.proxy(function(e) {
680			this.onResize(e);
681		}, this);
682		this.e._transitionEnd = $.proxy(function(e) {
683			this.transitionEnd(e);
684		}, this);
685		this.e._preventClick = $.proxy(function(e) {
686			this.preventClick(e);
687		}, this);
688	};
689
690	/**
691	 * Checks window `resize` event.
692	 * @protected
693	 */
694	Owl.prototype.onThrottledResize = function() {
695		window.clearTimeout(this.resizeTimer);
696		this.resizeTimer = window.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate);
697	};
698
699	/**
700	 * Checks window `resize` event.
701	 * @protected
702	 */
703	Owl.prototype.onResize = function() {
704		if (!this._items.length) {
705			return false;
706		}
707
708		if (this._width === this.$element.width()) {
709			return false;
710		}
711
712		if (this.trigger('resize').isDefaultPrevented()) {
713			return false;
714		}
715
716		this._width = this.$element.width();
717
718		this.invalidate('width');
719
720		this.refresh();
721
722		this.trigger('resized');
723	};
724
725	/**
726	 * Checks for touch/mouse drag event type and add run event handlers.
727	 * @protected
728	 */
729	Owl.prototype.eventsRouter = function(event) {
730		var type = event.type;
731
732		if (type === "mousedown" || type === "touchstart") {
733			this.onDragStart(event);
734		} else if (type === "mousemove" || type === "touchmove") {
735			this.onDragMove(event);
736		} else if (type === "mouseup" || type === "touchend") {
737			this.onDragEnd(event);
738		} else if (type === "touchcancel") {
739			this.onDragEnd(event);
740		}
741	};
742
743	/**
744	 * Checks for touch/mouse drag options and add necessery event handlers.
745	 * @protected
746	 */
747	Owl.prototype.internalEvents = function() {
748		var isTouch = isTouchSupport(),
749			isTouchIE = isTouchSupportIE();
750
751		if (this.settings.mouseDrag){
752			this.$stage.on('mousedown', $.proxy(function(event) { this.eventsRouter(event) }, this));
753			this.$stage.on('dragstart', function() { return false });
754			this.$stage.get(0).onselectstart = function() { return false };
755		} else {
756			this.$element.addClass('owl-text-select-on');
757		}
758
759		if (this.settings.touchDrag && !isTouchIE){
760			this.$stage.on('touchstart touchcancel', $.proxy(function(event) { this.eventsRouter(event) }, this));
761		}
762
763		// catch transitionEnd event
764		if (this.transitionEndVendor) {
765			this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, false);
766		}
767
768		// responsive
769		if (this.settings.responsive !== false) {
770			this.on(window, 'resize', $.proxy(this.onThrottledResize, this));
771		}
772	};
773
774	/**
775	 * Handles touchstart/mousedown event.
776	 * @protected
777	 * @param {Event} event - The event arguments.
778	 */
779	Owl.prototype.onDragStart = function(event) {
780		var ev, isTouchEvent, pageX, pageY, animatedPos;
781
782		ev = event.originalEvent || event || window.event;
783
784		// prevent right click
785		if (ev.which === 3 || this.state.isTouch) {
786			return false;
787		}
788
789		if (ev.type === 'mousedown') {
790			this.$stage.addClass('owl-grab');
791		}
792
793		this.trigger('drag');
794		this.drag.startTime = new Date().getTime();
795		this.speed(0);
796		this.state.isTouch = true;
797		this.state.isScrolling = false;
798		this.state.isSwiping = false;
799		this.drag.distance = 0;
800
801		pageX = getTouches(ev).x;
802		pageY = getTouches(ev).y;
803
804		// get stage position left
805		this.drag.offsetX = this.$stage.position().left;
806		this.drag.offsetY = this.$stage.position().top;
807
808		if (this.settings.rtl) {
809			this.drag.offsetX = this.$stage.position().left + this.$stage.width() - this.width()
810				+ this.settings.margin;
811		}
812
813		// catch position // ie to fix
814		if (this.state.inMotion && this.support3d) {
815			animatedPos = this.getTransformProperty();
816			this.drag.offsetX = animatedPos;
817			this.animate(animatedPos);
818			this.state.inMotion = true;
819		} else if (this.state.inMotion && !this.support3d) {
820			this.state.inMotion = false;
821			return false;
822		}
823
824		this.drag.startX = pageX - this.drag.offsetX;
825		this.drag.startY = pageY - this.drag.offsetY;
826
827		this.drag.start = pageX - this.drag.startX;
828		this.drag.targetEl = ev.target || ev.srcElement;
829		this.drag.updatedX = this.drag.start;
830
831		// to do/check
832		// prevent links and images dragging;
833		if (this.drag.targetEl.tagName === "IMG" || this.drag.targetEl.tagName === "A") {
834			this.drag.targetEl.draggable = false;
835		}
836
837		$(document).on('mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents', $.proxy(function(event) {this.eventsRouter(event)},this));
838	};
839
840	/**
841	 * Handles the touchmove/mousemove events.
842	 * @todo Simplify
843	 * @protected
844	 * @param {Event} event - The event arguments.
845	 */
846	Owl.prototype.onDragMove = function(event) {
847		var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull;
848
849		if (!this.state.isTouch) {
850			return;
851		}
852
853		if (this.state.isScrolling) {
854			return;
855		}
856
857		ev = event.originalEvent || event || window.event;
858
859		pageX = getTouches(ev).x;
860		pageY = getTouches(ev).y;
861
862		// Drag Direction
863		this.drag.currentX = pageX - this.drag.startX;
864		this.drag.currentY = pageY - this.drag.startY;
865		this.drag.distance = this.drag.currentX - this.drag.offsetX;
866
867		// Check move direction
868		if (this.drag.distance < 0) {
869			this.state.direction = this.settings.rtl ? 'right' : 'left';
870		} else if (this.drag.distance > 0) {
871			this.state.direction = this.settings.rtl ? 'left' : 'right';
872		}
873		// Loop
874		if (this.settings.loop) {
875			if (this.op(this.drag.currentX, '>', this.coordinates(this.minimum())) && this.state.direction === 'right') {
876				this.drag.currentX -= (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length);
877			} else if (this.op(this.drag.currentX, '<', this.coordinates(this.maximum())) && this.state.direction === 'left') {
878				this.drag.currentX += (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length);
879			}
880		} else {
881			// pull
882			minValue = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
883			maxValue = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
884			pull = this.settings.pullDrag ? this.drag.distance / 5 : 0;
885			this.drag.currentX = Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull);
886		}
887
888		// Lock browser if swiping horizontal
889
890		if ((this.drag.distance > 8 || this.drag.distance < -8)) {
891			if (ev.preventDefault !== undefined) {
892				ev.preventDefault();
893			} else {
894				ev.returnValue = false;
895			}
896			this.state.isSwiping = true;
897		}
898
899		this.drag.updatedX = this.drag.currentX;
900
901		// Lock Owl if scrolling
902		if ((this.drag.currentY > 16 || this.drag.currentY < -16) && this.state.isSwiping === false) {
903			this.state.isScrolling = true;
904			this.drag.updatedX = this.drag.start;
905		}
906
907		this.animate(this.drag.updatedX);
908	};
909
910	/**
911	 * Handles the touchend/mouseup events.
912	 * @protected
913	 */
914	Owl.prototype.onDragEnd = function(event) {
915		var compareTimes, distanceAbs, closest;
916
917		if (!this.state.isTouch) {
918			return;
919		}
920
921		if (event.type === 'mouseup') {
922			this.$stage.removeClass('owl-grab');
923		}
924
925		this.trigger('dragged');
926
927		// prevent links and images dragging;
928		this.drag.targetEl.removeAttribute("draggable");
929
930		// remove drag event listeners
931
932		this.state.isTouch = false;
933		this.state.isScrolling = false;
934		this.state.isSwiping = false;
935
936		// to check
937		if (this.drag.distance === 0 && this.state.inMotion !== true) {
938			this.state.inMotion = false;
939			return false;
940		}
941
942		// prevent clicks while scrolling
943
944		this.drag.endTime = new Date().getTime();
945		compareTimes = this.drag.endTime - this.drag.startTime;
946		distanceAbs = Math.abs(this.drag.distance);
947
948		// to test
949		if (distanceAbs > 3 || compareTimes > 300) {
950			this.removeClick(this.drag.targetEl);
951		}
952
953		closest = this.closest(this.drag.updatedX);
954
955		this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
956		this.current(closest);
957		this.invalidate('position');
958		this.update();
959
960		// if pullDrag is off then fire transitionEnd event manually when stick
961		// to border
962		if (!this.settings.pullDrag && this.drag.updatedX === this.coordinates(closest)) {
963			this.transitionEnd();
964		}
965
966		this.drag.distance = 0;
967
968		$(document).off('.owl.dragEvents');
969	};
970
971	/**
972	 * Attaches `preventClick` to disable link while swipping.
973	 * @protected
974	 * @param {HTMLElement} [target] - The target of the `click` event.
975	 */
976	Owl.prototype.removeClick = function(target) {
977		this.drag.targetEl = target;
978		$(target).on('click.preventClick', this.e._preventClick);
979		// to make sure click is removed:
980		window.setTimeout(function() {
981			$(target).off('click.preventClick');
982		}, 300);
983	};
984
985	/**
986	 * Suppresses click event.
987	 * @protected
988	 * @param {Event} ev - The event arguments.
989	 */
990	Owl.prototype.preventClick = function(ev) {
991		if (ev.preventDefault) {
992			ev.preventDefault();
993		} else {
994			ev.returnValue = false;
995		}
996		if (ev.stopPropagation) {
997			ev.stopPropagation();
998		}
999		$(ev.target).off('click.preventClick');
1000	};
1001
1002	/**
1003	 * Catches stage position while animate (only CSS3).
1004	 * @protected
1005	 * @returns
1006	 */
1007	Owl.prototype.getTransformProperty = function() {
1008		var transform, matrix3d;
1009
1010		transform = window.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + 'transform');
1011		// var transform = this.$stage.css(this.vendorName + 'transform')
1012		transform = transform.replace(/matrix(3d)?\(|\)/g, '').split(',');
1013		matrix3d = transform.length === 16;
1014
1015		return matrix3d !== true ? transform[4] : transform[12];
1016	};
1017
1018	/**
1019	 * Gets absolute position of the closest item for a coordinate.
1020	 * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
1021	 * @protected
1022	 * @param {Number} coordinate - The coordinate in pixel.
1023	 * @return {Number} - The absolute position of the closest item.
1024	 */
1025	Owl.prototype.closest = function(coordinate) {
1026		var position = -1, pull = 30, width = this.width(), coordinates = this.coordinates();
1027
1028		if (!this.settings.freeDrag) {
1029			// check closest item
1030			$.each(coordinates, $.proxy(function(index, value) {
1031				if (coordinate > value - pull && coordinate < value + pull) {
1032					position = index;
1033				} else if (this.op(coordinate, '<', value)
1034					&& this.op(coordinate, '>', coordinates[index + 1] || value - width)) {
1035					position = this.state.direction === 'left' ? index + 1 : index;
1036				}
1037				return position === -1;
1038			}, this));
1039		}
1040
1041		if (!this.settings.loop) {
1042			// non loop boundries
1043			if (this.op(coordinate, '>', coordinates[this.minimum()])) {
1044				position = coordinate = this.minimum();
1045			} else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
1046				position = coordinate = this.maximum();
1047			}
1048		}
1049
1050		return position;
1051	};
1052
1053	/**
1054	 * Animates the stage.
1055	 * @public
1056	 * @param {Number} coordinate - The coordinate in pixels.
1057	 */
1058	Owl.prototype.animate = function(coordinate) {
1059		this.trigger('translate');
1060		this.state.inMotion = this.speed() > 0;
1061
1062		if (this.support3d) {
1063			this.$stage.css({
1064				transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)',
1065				transition: (this.speed() / 1000) + 's'
1066			});
1067		} else if (this.state.isTouch) {
1068			this.$stage.css({
1069				left: coordinate + 'px'
1070			});
1071		} else {
1072			this.$stage.animate({
1073				left: coordinate
1074			}, this.speed() / 1000, this.settings.fallbackEasing, $.proxy(function() {
1075				if (this.state.inMotion) {
1076					this.transitionEnd();
1077				}
1078			}, this));
1079		}
1080	};
1081
1082	/**
1083	 * Sets the absolute position of the current item.
1084	 * @public
1085	 * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
1086	 * @returns {Number} - The absolute position of the current item.
1087	 */
1088	Owl.prototype.current = function(position) {
1089		if (position === undefined) {
1090			return this._current;
1091		}
1092
1093		if (this._items.length === 0) {
1094			return undefined;
1095		}
1096
1097		position = this.normalize(position);
1098
1099		if (this._current !== position) {
1100			var event = this.trigger('change', { property: { name: 'position', value: position } });
1101
1102			if (event.data !== undefined) {
1103				position = this.normalize(event.data);
1104			}
1105
1106			this._current = position;
1107
1108			this.invalidate('position');
1109
1110			this.trigger('changed', { property: { name: 'position', value: this._current } });
1111		}
1112
1113		return this._current;
1114	};
1115
1116	/**
1117	 * Invalidates the given part of the update routine.
1118	 * @param {String}
1118 part - The part to invalidate.
1119	 */
1120	Owl.prototype.invalidate = function(part) {
1121		this._invalidated[part] = true;
1122	}
1123
1124	/**
1125	 * Resets the absolute position of the current item.
1126	 * @public
1127	 * @param {Number} position - The absolute position of the new item.
1128	 */
1129	Owl.prototype.reset = function(position) {
1130		position = this.normalize(position);
1131
1132		if (position === undefined) {
1133			return;
1134		}
1135
1136		this._speed = 0;
1137		this._current = position;
1138
1139		this.suppress([ 'translate', 'translated' ]);
1140
1141		this.animate(this.coordinates(position));
1142
1143		this.release([ 'translate', 'translated' ]);
1144	};
1145
1146	/**
1147	 * Normalizes an absolute or a relative position for an item.
1148	 * @public
1149	 * @param {Number} position - The absolute or relative position to normalize.
1150	 * @param {Boolean} [relative=false] - Whether the given position is relative or not.
1151	 * @returns {Number} - The normalized position.
1152	 */
1153	Owl.prototype.normalize = function(position, relative) {
1154		var n = (relative ? this._items.length : this._items.length + this._clones.length);
1155
1156		if (!$.isNumeric(position) || n < 1) {
1157			return undefined;
1158		}
1159
1160		if (this._clones.length) {
1161			position = ((position % n) + n) % n;
1162		} else {
1163			position = Math.max(this.minimum(relative), Math.min(this.maximum(relative), position));
1164		}
1165
1166		return position;
1167	};
1168
1169	/**
1170	 * Converts an absolute position for an item into a relative position.
1171	 * @public
1172	 * @param {Number} position - The absolute position to convert.
1173	 * @returns {Number} - The converted position.
1174	 */
1175	Owl.prototype.relative = function(position) {
1176		position = this.normalize(position);
1177		position = position - this._clones.length / 2;
1178		return this.normalize(position, true);
1179	};
1180
1181	/**
1182	 * Gets the maximum position for an item.
1183	 * @public
1184	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1185	 * @returns {Number}
1186	 */
1187	Owl.prototype.maximum = function(relative) {
1188		var maximum, width, i = 0, coordinate,
1189			settings = this.settings;
1190
1191		if (relative) {
1192			return this._items.length - 1;
1193		}
1194
1195		if (!settings.loop && settings.center) {
1196			maximum = this._items.length - 1;
1197		} else if (!settings.loop && !settings.center) {
1198			maximum = this._items.length - settings.items;
1199		} else if (settings.loop || settings.center) {
1200			maximum = this._items.length + settings.items;
1201		} else if (settings.autoWidth || settings.merge) {
1202			revert = settings.rtl ? 1 : -1;
1203			width = this.$stage.width() - this.$element.width();
1204			while (coordinate = this.coordinates(i)) {
1205				if (coordinate * revert >= width) {
1206					break;
1207				}
1208				maximum = ++i;
1209			}
1210		} else {
1211			throw 'Can not detect maximum absolute position.'
1212		}
1213
1214		return maximum;
1215	};
1216
1217	/**
1218	 * Gets the minimum position for an item.
1219	 * @public
1220	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1221	 * @returns {Number}
1222	 */
1223	Owl.prototype.minimum = function(relative) {
1224		if (relative) {
1225			return 0;
1226		}
1227
1228		return this._clones.length / 2;
1229	};
1230
1231	/**
1232	 * Gets an item at the specified relative position.
1233	 * @public
1234	 * @param {Number} [position] - The relative position of the item.
1235	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1236	 */
1237	Owl.prototype.items = function(position) {
1238		if (position === undefined) {
1239			return this._items.slice();
1240		}
1241
1242		position = this.normalize(position, true);
1243		return this._items[position];
1244	};
1245
1246	/**
1247	 * Gets an item at the specified relative position.
1248	 * @public
1249	 * @param {Number} [position] - The relative position of the item.
1250	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1251	 */
1252	Owl.prototype.mergers = function(position) {
1253		if (position === undefined) {
1254			return this._mergers.slice();
1255		}
1256
1257		position = this.normalize(position, true);
1258		return this._mergers[position];
1259	};
1260
1261	/**
1262	 * Gets the absolute positions of clones for an item.
1263	 * @public
1264	 * @param {Number} [position] - The relative position of the item.
1265	 * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
1266	 */
1267	Owl.prototype.clones = function(position) {
1268		var odd = this._clones.length / 2,
1269			even = odd + this._items.length,
1270			map = function(index) { return index % 2 === 0 ? even + index / 2 : odd 
1270- (index + 1) / 2 };
1271
1272		if (position === undefined) {
1273			return $.map(this._clones, function(v, i) { return map(i) });
1274		}
1275
1276		return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
1277	};
1278
1279	/**
1280	 * Sets the current animation speed.
1281	 * @public
1282	 * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
1283	 * @returns {Number} - The current animation speed in milliseconds.
1284	 */
1285	Owl.prototype.speed = function(speed) {
1286		if (speed !== undefined) {
1287			this._speed = speed;
1288		}
1289
1290		return this._speed;
1291	};
1292
1293	/**
1294	 * Gets the coordinate of an item.
1295	 * @todo The name of this method is missleanding.
1296	 * @public
1297	 * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
1298	 * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1299	 */
1300	Owl.prototype.coordinates = function(position) {
1301		var coordinate = null;
1302
1303		if (position === undefined) {
1304			return $.map(this._coordinates, $.proxy(function(coordinate, index) {
1305				return this.coordinates(index);
1306			}, this));
1307		}
1308
1309		if (this.settings.center) {
1310			coordinate = this._coordinates[position];
1311			coordinate += (this.width() - coordinate + (this._coordinates[position - 1] || 0)) / 2 * (this.settings.rtl ? -1 : 1);
1312		} else {
1313			coordinate = this._coordinates[position - 1] || 0;
1314		}
1315
1316		return coordinate;
1317	};
1318
1319	/**
1320	 * Calculates the speed for a translation.
1321	 * @protected
1322	 * @param {Number} from - The absolute position of the start item.
1323	 * @param {Number} to - The absolute position of the target item.
1324	 * @param {Number} [factor=undefined] - The time factor in milliseconds.
1325	 * @returns {Number} - The time in milliseconds for the translation.
1326	 */
1327	Owl.prototype.duration = function(from, to, factor) {
1328		return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1329	};
1330
1331	/**
1332	 * Slides to the specified item.
1333	 * @public
1334	 * @param {Number} position - The position of the item.
1335	 * @param {Number} [speed] - The time in milliseconds for the transition.
1336	 */
1337	Owl.prototype.to = function(position, speed) {
1338		if (this.settings.loop) {
1339			var distance = position - this.relative(this.current()),
1340				revert = this.current(),
1341				before = this.current(),
1342				after = this.current() + distance,
1343				direction = before - after < 0 ? true : false,
1344				items = this._clones.length + this._items.length;
1345
1346			if (after < this.settings.items && direction === false) {
1347				revert = before + this._items.length;
1348				this.reset(revert);
1349			} else if (after >= items - this.settings.items && direction === true) {
1350				revert = before - this._items.length;
1351				this.reset(revert);
1352			}
1353			window.clearTimeout(this.e._goToLoop);
1354			this.e._goToLoop = window.setTimeout($.proxy(function() {
1355				this.speed(this.duration(this.current(), revert + distance, speed));
1356				this.current(revert + distance);
1357				this.update();
1358			}, this), 30);
1359		} else {
1360			this.speed(this.duration(this.current(), position, speed));
1361			this.current(position);
1362			this.update();
1363		}
1364	};
1365
1366	/**
1367	 * Slides to the next item.
1368	 * @public
1369	 * @param {Number} [speed] - The time in milliseconds for the transition.
1370	 */
1371	Owl.prototype.next = function(speed) {
1372		speed = speed || false;
1373		this.to(this.relative(this.current()) + 1, speed);
1374	};
1375
1376	/**
1377	 * Slides to the previous item.
1378	 * @public
1379	 * @param {Number} [speed] - The time in milliseconds for the transition.
1380	 */
1381	Owl.prototype.prev = function(speed) {
1382		speed = speed || false;
1383		this.to(this.relative(this.current()) - 1, speed);
1384	};
1385
1386	/**
1387	 * Handles the end of an animation.
1388	 * @protected
1389	 * @param {Event} event - The event arguments.
1390	 */
1391	Owl.prototype.transitionEnd = function(event) {
1392
1393		// if css2 animation then event object is undefined
1394		if (event !== undefined) {
1395			event.stopPropagation();
1396
1397			// Catch only owl-stage transitionEnd event
1398			if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
1399				return false;
1400			}
1401		}
1402
1403		this.state.inMotion = false;
1404		this.trigger('translated');
1405	};
1406
1407	/**
1408	 * Gets viewport width.
1409	 * @protected
1410	 * @return {Number} - The width in pixel.
1411	 */
1412	Owl.prototype.viewport = function() {
1413		var width;
1414		if (this.options.responsiveBaseElement !== window) {
1415			width = $(this.options.responsiveBaseElement).width();
1416		} else if (window.innerWidth) {
1417			width = window.innerWidth;
1418		} else if (document.documentElement && document.documentElement.clientWidth) {
1419			width = document.documentElement.clientWidth;
1420		} else {
1421			throw 'Can not detect viewport width.';
1422		}
1423		return width;
1424	};
1425
1426	/**
1427	 * Replaces the current content.
1428	 * @public
1429	 * @param {HTMLElement|jQuery|String} content - The new content.
1430	 */
1431	Owl.prototype.replace = function(content) {
1432		this.$stage.empty();
1433		this._items = [];
1434
1435		if (content) {
1436			content = (content instanceof jQuery) ? content : $(content);
1437		}
1438
1439		if (this.settings.nestedItemSelector) {
1440			content = content.find('.' + this.settings.nestedItemSelector);
1441		}
1442
1443		content.filter(function() {
1444			return this.nodeType === 1;
1445		}).each($.proxy(function(index, item) {
1446			item = this.prepare(item);
1447			this.$stage.append(item);
1448			this._items.push(item);
1449			this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
1450		}, this));
1451
1452		this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
1453
1454		this.invalidate('items');
1455	};
1456
1457	/**
1458	 * Adds an item.
1459	 * @todo Use `item` instead of `content` for the event arguments.
1460	 * @public
1461	 * @param {HTMLElement|jQuery|String} content - The item content to add.
1462	 * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
1463	 */
1464	Owl.prototype.add = function(content, position) {
1465		position = position === undefined ? this._items.length : this.normalize(position, true);
1466
1467		this.trigger('add', { content: content, position: position });
1468
1469		if (this._items.length === 0 || position === this._items.length) {
1470			this.$stage.append(content);
1471			this._items.push(content);
1472			this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
1473		} else {
1474			this._items[position].before(content);
1475			this._items.splice(position, 0, content);
1476			this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
1477		}
1478
1479		this.invalidate('items');
1480
1481		this.trigger('added', { content: content, position: position });
1482	};
1483
1484	/**
1485	 * Removes an item by its position.
1486	 * @todo Use `item` instead of `content` for the event arguments.
1487	 * @public
1488	 * @param {Number} position - The relative position of the item to remove.
1489	 */
1490	Owl.prototype.remove = function(position) {
1491		position = this.normalize(position, true);
1492
1493		if (position === undefined) {
1494			return;
1495		}
1496
1497		this.trigger('remove', { content: this._items[position], position: position });
1498
1499		this._items[position].remove();
1500		this._items.splice(position, 1);
1501		this._mergers.splice(position, 1);
1502
1503		this.invalidate('items');
1504
1505		this.trigger('removed', { content: null, position: position });
1506	};
1507
1508	/**
1509	 * Adds triggerable events.
1510	 * @protected
1511	 */
1512	Owl.prototype.addTriggerableEvents = function() {
1513		var handler = $.proxy(function(callback, event) {
1514			return $.proxy(function(e) {
1515				if (e.relatedTarget !== this) {
1516					this.suppress([ event ]);
1517					callback.apply(this, [].slice.call(arguments, 1));
1518					this.release([ event ]);
1519				}
1520			}, this);
1521		}, this);
1522
1523		$.each({
1524			'next': this.next,
1525			'prev': this.prev,
1526			'to': this.to,
1527			'destroy': this.destroy,
1528			'refresh': this.refresh,
1529			'replace': this.replace,
1530			'add': this.add,
1531			'remove': this.remove
1532		}, $.proxy(function(event, callback) {
1533			this.$element.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel'));
1534		}, this));
1535
1536	};
1537
1538	/**
1539	 * Watches the visibility of the carousel element.
1540	 * @protected
1541	 */
1542	Owl.prototype.watchVisibility = function() {
1543
1544		// test on zepto
1545		if (!isElVisible(this.$element.get(0))) {
1546			this.$element.addClass('owl-hidden');
1547			window.clearInterval(this.e._checkVisibile);
1548			this.e._checkVisibile = window.setInterval($.proxy(checkVisible, this), 500);
1549		}
1550
1551		function isElVisible(el) {
1552			return el.offsetWidth > 0 && el.offsetHeight > 0;
1553		}
1554
1555		function checkVisible() {
1556			if (isElVisible(this.$element.get(0))) {
1557				this.$element.removeClass('owl-hidden');
1558				this.refresh();
1559				window.clearInterval(this.e._checkVisibile);
1560			}
1561		}
1562	};
1563
1564	/**
1565	 * Preloads images with auto width.
1566	 * @protected
1567	 * @todo Still to test
1568	 */
1569	Owl.prototype.preloadAutoWidthImages = function(imgs) {
1570		var loaded, that, $el, img;
1571
1572		loaded = 0;
1573		that = this;
1574		imgs.each(function(i, el) {
1575			$el = $(el);
1576			img = new Image();
1577
1578			img.onload = function() {
1579				loaded++;
1580				$el.attr('src', img.src);
1581				$el.css('opacity', 1);
1582				if (loaded >= imgs.length) {
1583					that.state.imagesLoaded = true;
1584					that.initialize();
1585				}
1586			};
1587
1588			img.src = $el.attr('src') || $el.attr('data-src') || $el.attr('data-src-retina');
1589		});
1590	};
1591
1592	/**
1593	 * Destroys the carousel.
1594	 * @public
1595	 */
1596	Owl.prototype.destroy = function() {
1597
1598		if (this.$element.hasClass(this.settings.themeClass)) {
1599			this.$element.removeClass(this.settings.themeClass);
1600		}
1601
1602		if (this.settings.responsive !== false) {
1603			$(window).off('resize.owl.carousel');
1604		}
1605
1606		if (this.transitionEndVendor) {
1607			this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd);
1608		}
1609
1610		for ( var i in this._plugins) {
1611			this._plugins[i].destroy();
1612		}
1613
1614		if (this.settings.mouseDrag || this.settings.touchDrag) {
1615			this.$stage.off('mousedown touchstart touchcancel');
1616			$(document).off('.owl.dragEvents');
1617			this.$stage.get(0).onselectstart = function() {};
1618			this.$stage.off('dragstart', function() { return false });
1619		}
1620
1621		// remove event handlers in the ".owl.carousel" namespace
1622		this.$element.off('.owl');
1623
1624		this.$stage.children('.cloned').remove();
1625		this.e = null;
1626		this.$element.removeData('owlCarousel');
1627
1628		this.$stage.children().contents().unwrap();
1629		this.$stage.children().unwrap();
1630		this.$stage.unwrap();
1631	};
1632
1633	/**
1634	 * Operators to calculate right-to-left and left-to-right.
1635	 * @protected
1636	 * @param {Number} [a] - The left side operand.
1637	 * @param {String} [o] - The operator.
1638	 * @param {Number} [b] - The right side operand.
1639	 */
1640	Owl.prototype.op = function(a, o, b) {
1641		var rtl = this.settings.rtl;
1642		switch (o) {
1643			case '<':
1644				return rtl ? a > b : a < b;
1645			case '>':
1646				return rtl ? a < b : a > b;
1647			case '>=':
1648				return rtl ? a <= b : a >= b;
1649			case '<=':
1650				return rtl ? a >= b : a <= b;
1651			default:
1652				break;
1653		}
1654	};
1655
1656	/**
1657	 * Attaches to an internal event.
1658	 * @protected
1659	 * @param {HTMLElement} element - The event source.
1660	 * @param {String} event - The event name.
1661	 * @param {Function} listener - The event handler to attach.
1662	 * @param {Boolean} capture - Wether the event should be handled at the capturing p
1662hase or not.
1663	 */
1664	Owl.prototype.on = function(element, event, listener, capture) {
1665		if (element.addEventListener) {
1666			element.addEventListener(event, listener, capture);
1667		} else if (element.attachEvent) {
1668			element.attachEvent('on' + event, listener);
1669		}
1670	};
1671
1672	/**
1673	 * Detaches from an internal event.
1674	 * @protected
1675	 * @param {HTMLElement} element - The event source.
1676	 * @param {String} event - The event name.
1677	 * @param {Function} listener - The attached event handler to detach.
1678	 * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1679	 */
1680	Owl.prototype.off = function(element, event, listener, capture) {
1681		if (element.removeEventListener) {
1682			element.removeEventListener(event, listener, capture);
1683		} else if (element.detachEvent) {
1684			element.detachEvent('on' + event, listener);
1685		}
1686	};
1687
1688	/**
1689	 * Triggers an public event.
1690	 * @protected
1691	 * @param {String} name - The event name.
1692	 * @param {*} [data=null] - The event data.
1693	 * @param {String} [namespace=.owl.carousel] - The event namespace.
1694	 * @returns {Event} - The event arguments.
1695	 */
1696	Owl.prototype.trigger = function(name, data, namespace) {
1697		var status = {
1698			item: { count: this._items.length, index: this.current() }
1699		}, handler = $.camelCase(
1700			$.grep([ 'on', name, namespace ], function(v) { return v })
1701				.join('-').toLowerCase()
1702		), event = $.Event(
1703			[ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1704			$.extend({ relatedTarget: this }, status, data)
1705		);
1706
1707		if (!this._supress[name]) {
1708			$.each(this._plugins, function(name, plugin) {
1709				if (plugin.onTrigger) {
1710					plugin.onTrigger(event);
1711				}
1712			});
1713
1714			this.$element.trigger(event);
1715
1716			if (this.settings && typeof this.settings[handler] === 'function') {
1717				this.settings[handler].apply(this, event);
1718			}
1719		}
1720
1721		return event;
1722	};
1723
1724	/**
1725	 * Suppresses events.
1726	 * @protected
1727	 * @param {Array.<String>} events - The events to suppress.
1728	 */
1729	Owl.prototype.suppress = function(events) {
1730		$.each(events, $.proxy(function(index, event) {
1731			this._supress[event] = true;
1732		}, this));
1733	}
1734
1735	/**
1736	 * Releases suppressed events.
1737	 * @protected
1738	 * @param {Array.<String>} events - The events to release.
1739	 */
1740	Owl.prototype.release = function(events) {
1741		$.each(events, $.proxy(function(index, event) {
1742			delete this._supress[event];
1743		}, this));
1744	}
1745
1746	/**
1747	 * Checks the availability of some browser features.
1748	 * @protected
1749	 */
1750	Owl.prototype.browserSupport = function() {
1751		this.support3d = isPerspective();
1752
1753		if (this.support3d) {
1754			this.transformVendor = isTransform();
1755
1756			// take transitionend event name by detecting transition
1757			var endVendors = [ 'transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd' ];
1758			this.transitionEndVendor = endVendors[isTransition()];
1759
1760			// take vendor name from transform name
1761			this.vendorName = this.transformVendor.replace(/Transform/i, '');
1762			this.vendorName = this.vendorName !== '' ? '-' + this.vendorName.toLowerCase() + '-' : '';
1763		}
1764
1765		this.state.orientation = window.orientation;
1766	};
1767
1768	/**
1769	 * Get touch/drag coordinats.
1770	 * @private
1771	 * @param {event} - mousedown/touchstart event
1772	 * @returns {object} - Contains X and Y of current mouse/touch position
1773	 */
1774
1775	function getTouches(event) {
1776		if (event.touches !== undefined) {
1777			return {
1778				x: event.touches[0].pageX,
1779				y: event.touches[0].pageY
1780			};
1781		}
1782
1783		if (event.touches === undefined) {
1784			if (event.pageX !== undefined) {
1785				return {
1786					x: event.pageX,
1787					y: event.pageY
1788				};
1789			}
1790
1791		if (event.pageX === undefined) {
1792			return {
1793					x: event.clientX,
1794					y: event.clientY
1795				};
1796			}
1797		}
1798	}
1799
1800	/**
1801	 * Checks for CSS support.
1802	 * @private
1803	 * @param {Array} array - The CSS properties to check for.
1804	 * @returns {Array} - Contains the supported CSS property name and its index or `false`.
1805	 */
1806	function isStyleSupported(array) {
1807		var p, s, fake = document.createElement('div'), list = array;
1808		for (p in list) {
1809			s = list[p];
1810			if (typeof fake.style[s] !== 'undefined') {
1811				fake = null;
1812				return [ s, p ];
1813			}
1814		}
1815		return [ false ];
1816	}
1817
1818	/**
1819	 * Checks for CSS transition support.
1820	 * @private
1821	 * @todo Realy bad design
1822	 * @returns {Number}
1823	 */
1824	function isTransition() {
1825		return isStyleSupported([ 'transition', 'WebkitTransition', 'MozTransition', 'OTransition' ])[1];
1826	}
1827
1828	/**
1829	 * Checks for CSS transform support.
1830	 * @private
1831	 * @returns {String} The supported property name or false.
1832	 */
1833	function isTransform() {
1834		return isStyleSupported([ 'transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ])[0];
1835	}
1836
1837	/**
1838	 * Checks for CSS perspective support.
1839	 * @private
1840	 * @returns {String} The supported property name or false.
1841	 */
1842	function isPerspective() {
1843		return isStyleSupported([ 'perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective' ])[0];
1844	}
1845
1846	/**
1847	 * Checks wether touch is supported or not.
1848	 * @private
1849	 * @returns {Boolean}
1850	 */
1851	function isTouchSupport() {
1852		return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints);
1853	}
1854
1855	/**
1856	 * Checks wether touch is supported or not for IE.
1857	 * @private
1858	 * @returns {Boolean}
1859	 */
1860	function isTouchSupportIE() {
1861		return window.navigator.msPointerEnabled;
1862	}
1863
1864	/**
1865	 * The jQuery Plugin for the Owl Carousel
1866	 * @public
1867	 */
1868	$.fn.owlCarousel = function(options) {
1869		return this.each(function() {
1870			if (!$(this).data('owlCarousel')) {
1871				$(this).data('owlCarousel', new Owl(this, options));
1872			}
1873		});
1874	};
1875
1876	/**
1877	 * The constructor for the jQuery Plugin
1878	 * @public
1879	 */
1880	$.fn.owlCarousel.Constructor = Owl;
1881
1882})(window.Zepto || window.jQuery, window, document);
1883
1884/**
1885 * Lazy Plugin
1886 * @version 2.0.0
1887 * @author Bartosz Wojciechowski
1888 * @license The MIT License (MIT)
1889 */
1890;(function($, window, document, undefined) {
1891
1892	/**
1893	 * Creates the lazy plugin.
1894	 * @class The Lazy Plugin
1895	 * @param {Owl} carousel - The Owl Carousel
1896	 */
1897	var Lazy = function(carousel) {
1898
1899		/**
1900		 * Reference to the core.
1901		 * @protected
1902		 * @type {Owl}
1903		 */
1904		this._core = carousel;
1905
1906		/**
1907		 * Already loaded items.
1908		 * @protected
1909		 * @type {Array.<jQuery>}
1910		 */
1911		this._loaded = [];
1912
1913		/**
1914		 * Event handlers.
1915		 * @protected
1916		 * @type {Object}
1917		 */
1918		this._handlers = {
1919			'initialized.owl.carousel change.owl.carousel': $.proxy(function(e) {
1920				if (!e.namespace) {
1921					return;
1922				}
1923
1924				if (!this._core.settings || !this._core.settings.lazyLoad) {
1925					return;
1926				}
1927
1928				if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
1929					var settings = this._core.settings,
1930						n = (settings.center && Math.ceil(settings.items / 2) || settings.items),
1931						i = ((settings.center && n * -1) || 0),
1932						position = ((e.property && e.property.value) || this._core.current()) + i,
1933						clones = this._core.clones().length,
1934						load = $.proxy(function(i, v) { this.load(v) }, this);
1935
1936					while (i++ < n) {
1937						this.load(clones / 2 + this._core.relative(position));
1938						clones && $.each(this._core.clones(this._core.relative(position++)), load);
1939					}
1940				}
1941			}, this)
1942		};
1943
1944		// set the default options
1945		this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
1946
1947		// register event handler
1948		this._core.$element.on(this._handlers);
1949	}
1950
1951	/**
1952	 * Default options.
1953	 * @public
1954	 */
1955	Lazy.Defaults = {
1956		lazyLoad: false
1957	}
1958
1959	/**
1960	 * Loads all resources of an item at the specified position.
1961	 * @param {Number} position - The absolute position of the item.
1962	 * @protected
1963	 */
1964	Lazy.prototype.load = function(position) {
1965		var $item = this._core.$stage.children().eq(position),
1966			$elements = $item && $item.find('.owl-lazy');
1967
1968		if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
1969			return;
1970		}
1971
1972		$elements.each($.proxy(function(index, element) {
1973			var $element = $(element), image,
1974				url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src');
1975
1976			this._core.trigger('load', { element: $element, url: url }, 'lazy');
1977
1978			if ($element.is('img')) {
1979				$element.one('load.owl.lazy', $.proxy(function() {
1980					$element.css('opacity', 1);
1981					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
1982				}, this)).attr('src', url);
1983			} else {
1984				image = new Image();
1985				image.onload = $.proxy(function() {
1986					$element.css({
1987						'background-image': 'url(' + url + ')',
1988						'opacity': '1'
1989					});
1990					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
1991				}, this);
1992				image.src = url;
1993			}
1994		}, this));
1995
1996		this._loaded.push($item.get(0));
1997	}
1998
1999	/**
2000	 * Destroys the plugin.
2001	 * @public
2002	 */
2003	Lazy.prototype.destroy = function() {
2004		var handler, property;
2005
2006		for (handler in this.handlers) {
2007			this._core.$element.off(handler, this.handlers[handler]);
2008		}
2009		for (property in Object.getOwnPropertyNames(this)) {
2010			typeof this[property] != 'function' && (this[property] = null);
2011		}
2012	}
2013
2014	$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
2015
2016})(window.Zepto || window.jQuery, window, document);
2017
2018/**
2019 * AutoHeight Plugin
2020 * @version 2.0.0
2021 * @author Bartosz Wojciechowski
2022 * @license The MIT License (MIT)
2023 */
2024;(function($, window, document, undefined) {
2025
2026	/**
2027	 * Creates the auto height plugin.
2028	 * @class The Auto Height Plugin
2029	 * @param {Owl} carousel - The Owl Carousel
2030	 */
2031	var AutoHeight = function(carousel) {
2032		/**
2033		 * Reference to the core.
2034		 * @protected
2035		 * @type {Owl}
2036		 */
2037		this._core = carousel;
2038
2039		/**
2040		 * All event handlers.
2041		 * @protected
2042		 * @type {Object}
2043		 */
2044		this._handlers = {
2045			'initialized.owl.carousel': $.proxy(function() {
2046				if (this._core.settings.autoHeight) {
2047					this.update();
2048				}
2049			}, this),
2050			'changed.owl.carousel': $.proxy(function(e) {
2051				if (this._core.settings.autoHeight && e.property.name == 'position'){
2052					this.update();
2053				}
2054			}, this),
2055			'loaded.owl.lazy': $.proxy(function(e) {
2056				if (this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass)
2057					=== this._core.$stage.children().eq(this._core.current())) {
2058					this.update();
2059				}
2060			}, this)
2061		};
2062
2063		// set default options
2064		this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
2065
2066		// register event handlers
2067		this._core.$element.on(this._handlers);
2068	};
2069
2070	/**
2071	 * Default options.
2072	 * @public
2073	 */
2074	AutoHeight.Defaults = {
2075		autoHeight: false,
2076		autoHeightClass: 'owl-height'
2077	};
2078
2079	/**
2080	 * Updates the view.
2081	 */
2082	AutoHeight.prototype.update = function() {
2083		this._core.$stage.parent()
2084			.height(this._core.$stage.children().eq(this._core.current()).height())
2085			.addClass(this._core.settings.autoHeightClass);
2086	};
2087
2088	AutoHeight.prototype.destroy = function() {
2089		var handler, property;
2090
2091		for (handler in this._handlers) {
2092			this._core.$element.off(handler, this._handlers[handler]);
2093		}
2094		for (property in Object.getOwnPropertyNames(this)) {
2095			typeof this[property] != 'function' && (this[property] = null);
2096		}
2097	};
2098
2099	$.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
2100
2101})(window.Zepto || window.jQuery, window, document);
2102
2103/**
2104 * Video Plugin
2105 * @version 2.0.0
2106 * @author Bartosz Wojciechowski
2107 * @license The MIT License (MIT)
2108 */
2109;(function($, window, document, undefined) {
2110
2111	/**
2112	 * Creates the video plugin.
2113	 * @class The Video Plugin
2114	 * @param {Owl} carousel - The Owl Carousel
vendor: 5,485 bytes, lines 2115-2328
2115	 */
2116	var Video = function(carousel) {
2117		/**
2118		 * Reference to the core.
2119		 * @protected
2120		 * @type {Owl}
2121		 */
2122		this._core = carousel;
2123
2124		/**
2125		 * Cache all video URLs.
2126		 * @protected
2127		 * @type {Object}
2128		 */
2129		this._videos = {};
2130
2131		/**
2132		 * Current playing item.
2133		 * @protected
2134		 * @type {jQuery}
2135		 */
2136		this._playing = null;
2137
2138		/**
2139		 * Whether this is in fullscreen or not.
2140		 * @protected
2141		 * @type {Boolean}
2142		 */
2143		this._fullscreen = false;
2144
2145		/**
2146		 * All event handlers.
2147		 * @protected
2148		 * @type {Object}
2149		 */
2150		this._handlers = {
2151			'resize.owl.carousel': $.proxy(function(e) {
2152				if (this._core.settings.video && !this.isInFullScreen()) {
2153					e.preventDefault();
2154				}
2155			}, this),
2156			'refresh.owl.carousel changed.owl.carousel': $.proxy(function(e) {
2157				if (this._playing) {
2158					this.stop();
2159				}
2160			}, this),
2161			'prepared.owl.carousel': $.proxy(function(e) {
2162				var $element = $(e.content).find('.owl-video');
2163				if ($element.length) {
2164					$element.css('display', 'none');
2165					this.fetch($element, $(e.content));
2166				}
2167			}, this)
2168		};
2169
2170		// set default options
2171		this._core.options = $.extend({}, Video.Defaults, this._core.options);
2172
2173		// register event handlers
2174		this._core.$element.on(this._handlers);
2175
2176		this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2177			this.play(e);
2178		}, this));
2179	};
2180
2181	/**
2182	 * Default options.
2183	 * @public
2184	 */
2185	Video.Defaults = {
2186		video: false,
2187		videoHeight: false,
2188		videoWidth: false
2189	};
2190
2191	/**
2192	 * Gets the video ID and the type (YouTube/Vimeo only).
2193	 * @protected
2194	 * @param {jQuery} target - The target containing the video data.
2195	 * @param {jQuery} item - The item containing the video.
2196	 */
2197	Video.prototype.fetch = function(target, item) {
2198
2199		var type = target.attr('data-vimeo-id') ? 'vimeo' : 'youtube',
2200			id = target.attr('data-vimeo-id') || target.attr('data-youtube-id'),
2201			width = target.attr('data-width') || this._core.settings.videoWidth,
2202			height = target.attr('data-height') || this._core.settings.videoHeight,
2203			url = target.attr('href');
2204
2205		if (url) {
2206			id = url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
2207
2208			if (id[3].indexOf('youtu') > -1) {
2209				type = 'youtube';
2210			} else if (id[3].indexOf('vimeo') > -1) {
2211				type = 'vimeo';
2212			} else {
2213				throw new Error('Video URL not supported.');
2214			}
2215			id = id[6];
2216		} else {
2217			throw new Error('Missing video URL.');
2218		}
2219
2220		this._videos[url] = {
2221			type: type,
2222			id: id,
2223			width: width,
2224			height: height
2225		};
2226
2227		item.attr('data-video', url);
2228
2229		this.thumbnail(target, this._videos[url]);
2230	};
2231
2232	/**
2233	 * Creates video thumbnail.
2234	 * @protected
2235	 * @param {jQuery} target - The target containing the video data.
2236	 * @param {Object} info - The video info object.
2237	 * @see `fetch`
2238	 */
2239	Video.prototype.thumbnail = function(target, video) {
2240
2241		var tnLink,
2242			icon,
2243			path,
2244			dimensions = video.width && video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"' : '',
2245			customTn = target.find('img'),
2246			srcType = 'src',
2247			lazyClass = '',
2248			settings = this._core.settings,
2249			create = function(path) {
2250				icon = '<div class="owl-video-play-icon"></div>';
2251
2252				if (settings.lazyLoad) {
2253					tnLink = '<div class="owl-video-tn ' + lazyClass + '" ' + srcType + '="' + path + '"></div>';
2254				} else {
2255					tnLink = '<div class="owl-video-tn" style="opacity:1;background-image:url(' + path + ')"></div>';
2256				}
2257				target.after(tnLink);
2258				target.after(icon);
2259			};
2260
2261		// wrap video content into owl-video-wrapper div
2262		target.wrap('<div class="owl-video-wrapper"' + dimensions + '></div>');
2263
2264		if (this._core.settings.lazyLoad) {
2265			srcType = 'data-src';
2266			lazyClass = 'owl-lazy';
2267		}
2268
2269		// custom thumbnail
2270		if (customTn.length) {
2271			create(customTn.attr(srcType));
2272			customTn.remove();
2273			return false;
2274		}
2275
2276		if (video.type === 'youtube') {
2277			path = "http://img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
2278			create(path);
2279		} else if (video.type === 'vimeo') {
2280			$.ajax({
2281				type: 'GET',
2282				url: 'http://vimeo.com/api/v2/video/' + video.id + '.json',
2283				jsonp: 'callback',
2284				dataType: 'jsonp',
2285				success: function(data) {
2286					path = data[0].thumbnail_large;
2287					create(path);
2288				}
2289			});
2290		}
2291	};
2292
2293	/**
2294	 * Stops the current video.
2295	 * @public
2296	 */
2297	Video.prototype.stop = function() {
2298		this._core.trigger('stop', null, 'video');
2299		this._playing.find('.owl-video-frame').remove();
2300		this._playing.removeClass('owl-video-playing');
2301		this._playing = null;
2302	};
2303
2304	/**
2305	 * Starts the current video.
2306	 * @public
2307	 * @param {Event} ev - The event arguments.
2308	 */
2309	Video.prototype.play = function(ev) {
2310		this._core.trigger('play', null, 'video');
2311
2312		if (this._playing) {
2313			this.stop();
2314		}
2315
2316		var target = $(ev.target || ev.srcElement),
2317			item = target.closest('.' + this._core.settings.itemClass),
2318			video = this._videos[item.attr('data-video')],
2319			width = video.width || '100%',
2320			height = video.height || this._core.$stage.height(),
2321			html, wrap;
2322
2323		if (video.type === 'youtube') {
2324			html = '<iframe width="' + width + '" height="' + height + '" src="http://www.youtube.com/embed/'
2325				+ video.id + '?autoplay=1&v=' + video.id + '" frameborder="0" allowfullscreen></iframe>';
2326		} else if (video.type === 'vimeo') {
2327			html = '<iframe src="http://player.vimeo.com/video/' + video.id + '?autoplay=1" width="' + width
2328				+ '" height="' + height
2329				+ '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
2330		}
2331
2332		item.addClass('owl-video-playing');
2333		this._playing = item;
2334
2335		wrap = $('<div style="height:' + height + 'px; width:' + width + 'px" class="owl-video-frame">'
2336			+ html + '</div>');
2337		target.after(wrap);
2338	};
2339
2340	/**
2341	 * Checks whether an video is currently in full screen mode or not.
2342	 * @todo Bad style because looks like a readonly method but changes members.
2343	 * @protected
2344	 * @returns {Boolean}
2345	 */
2346	Video.prototype.isInFullScreen = function() {
2347
2348		// if Vimeo Fullscreen mode
2349		var element = document.fullscreenElement || document.mozFullScreenElement
2350			|| document.webkitFullscreenElement;
2351
2352		if (element && $(element).parent().hasClass('owl-video-frame')) {
2353			this._core.speed(0);
2354			this._fullscreen = true;
2355		}
2356
2357		if (element && this._fullscreen && this._playing) {
2358			return false;
2359		}
2360
2361		// comming back from fullscreen
2362		if (this._fullscreen) {
2363			this._fullscreen = false;
2364			return false;
2365		}
2366
2367		// check full screen mode and window orientation
2368		if (this._playing) {
2369			if (this._core.state.orientation !== window.orientation) {
2370				this._core.state.orientation = window.orientation;
2371				return false;
2372			}
2373		}
2374
2375		return true;
2376	};
2377
2378	/**
2379	 * Destroys the plugin.
2380	 */
2381	Video.prototype.destroy = function() {
2382		var handler, property;
2383
2384		this._core.$element.off('click.owl.video');
2385
2386		for (handler in this._handlers) {
2387			this._core.$element.off(handler, this._handlers[handler]);
2388		}
2389		for (property in Object.getOwnPropertyNames(this)) {
2390			typeof this[property] != 'function' && (this[property] = null);
2391		}
2392	};
2393
2394	$.fn.owlCarousel.Constructor.Plugins.Video = Video;
2395
2396})(window.Zepto || window.jQuery, window, document);
2397
2398/**
2399 * Animate Plugin
2400 * @version 2.0.0
2401 * @author Bartosz Wojciechowski
2402 * @license The MIT License (MIT)
2403 */
2404;(function($, window, document, undefined) {
2405
2406	/**
2407	 * Creates the animate plugin.
2408	 * @class The Navigation Plugin
2409	 * @param {Owl} scope - The Owl Carousel
2410	 */
2411	var Animate = function(scope) {
2412		this.core = scope;
2413		this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2414		this.swapping = true;
2415		this.previous = undefined;
2416		this.next = undefined;
2417
2418		this.handlers = {
2419			'change.owl.carousel': $.proxy(function(e) {
2420				if (e.property.name == 'position') {
2421					this.previous = this.core.current();
2422					this.next = e.property.value;
2423				}
2424			}, this),
2425			'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2426				this.swapping = e.type == 'translated';
2427			}, this),
2428			'translate.owl.carousel': $.proxy(function(e) {
2429				if (this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2430					this.swap();
2431				}
2432			}, this)
2433		};
2434
2435		this.core.$element.on(this.handlers);
2436	};
2437
2438	/**
2439	 * Default options.
2440	 * @public
2441	 */
2442	Animate.Defaults = {
2443		animateOut: false,
2444		animateIn: false
2445	};
2446
2447	/**
2448	 * Toggles the animation classes whenever an translations starts.
2449	 * @protected
2450	 * @returns {Boolean|undefined}
2451	 */
2452	Animate.prototype.swap = function() {
2453
2454		if (this.core.settings.items !== 1 || !this.core.support3d) {
2455			return;
2456		}
2457
2458		this.core.speed(0);
2459
2460		var left,
2461			clear = $.proxy(this.clear, this),
2462			previous = this.core.$stage.children().eq(this.previous),
2463			next = this.core.$stage.children().eq(this.next),
2464			incoming = this.core.settings.animateIn,
2465			outgoing = this.core.settings.animateOut;
2466
2467		if (this.core.current() === this.previous) {
2468			return;
2469		}
2470
2471		if (outgoing) {
2472			left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2473			previous.css( { 'left': left + 'px' } )
2474				.addClass('animated owl-animated-out')
2475				.addClass(outgoing)
2476				.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
2477		}
2478
2479		if (incoming) {
2480			next.addClass('animated owl-animated-in')
2481				.addClass(incoming)
2482				.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
2483		}
2484	};
2485
2486	Animate.prototype.clear = function(e) {
2487		$(e.target).css( { 'left': '' } )
2488			.removeClass('animated owl-animated-out owl-animated-in')
2489			.removeClass(this.core.settings.animateIn)
2490			.removeClass(this.core.settings.animateOut);
2491		this.core.transitionEnd();
2492	}
2493
2494	/**
2495	 * Destroys the plugin.
2496	 * @public
2497	 */
2498	Animate.prototype.destroy = function() {
2499		var handler, property;
2500
2501		for (handler in this.handlers) {
2502			this.core.$element.off(handler, this.handlers[handler]);
2503		}
2504		for (property in Object.getOwnPropertyNames(this)) {
2505			typeof this[property] != 'function' && (this[property] = null);
2506		}
2507	};
2508
2509	$.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2510
2511})(window.Zepto || window.jQuery, window, document);
2512
2513/**
2514 * Autoplay Plugin
2515 * @version 2.0.0
2516 * @author Bartosz Wojciechowski
2517 * @license The MIT License (MIT)
2518 */
2519;(function($, window, document, undefined) {
2520
2521	/**
2522	 * Creates the autoplay plugin.
2523	 * @class The Autoplay Plugin
2524	 * @param {Owl} scope - The Owl Carousel
2525	 */
2526	var Autoplay = function(scope) {
2527		this.core = scope;
2528		this.core.options = $.extend({}, Autoplay.Defaults, this.core.options);
2529
2530		this.handlers = {
2531			'translated.owl.carousel refreshed.owl.carousel': $.proxy(function() {
2532				this.autoplay();
2533			}, this),
2534			'play.owl.autoplay': $.proxy(function(e, t, s) {
2535				this.play(t, s);
2536			}, this),
2537			'stop.owl.autoplay': $.proxy(function() {
2538				this.stop();
2539			}, this),
2540			'mouseover.owl.autoplay': $.proxy(function() {
2541				if (this.core.settings.autoplayHoverPause) {
2542					this.pause();
2543				}
2544			}, this),
2545			'mouseleave.owl.autoplay': $.proxy(function() {
2546				if (this.core.settings.autoplayHoverPause) {
2547					this.autoplay();
2548				}
2549			}, this)
2550		};
2551
2552		this.core.$element.on(this.handlers);
2553	};
2554
2555	/**
2556	 * Default options.
2557	 * @public
2558	 */
2559	Autoplay.Defaults = {
2560		autoplay: false,
2561		autoplayTimeout: 5000,
2562		autoplayHoverPause: false,
2563		autoplaySpeed: false
2564	};
2565
2566	/**
2567	 * @protected
2568	 * @todo Must be documented.
2569	 */
2570	Autoplay.prototype.autoplay = function() {
2571		if (this.core.settings.autoplay && !this.core.state.videoPlay) {
2572			window.clearInterval(this.interval);
2573
2574			this.interval = window.setInterval($.proxy(function() {
2575				this.play();
2576			}, this), this.core.settings.autoplayTimeout);
2577		} else {
2578			window.clearInterval(this.interval);
2579		}
2580	};
2581
2582	/**
2583	 * Starts the autoplay.
2584	 * @public
2585	 * @param {Number} [timeout] - ...
2586	 * @param {Number} [speed] - ...
2587	 * @returns {Boolean|undefined} - ...
2588	 * @todo Must be documented.
2589	 */
2590	Autoplay.prototype.play = function(timeout, speed) {
2591		// if tab is inactive - doesnt work in <IE10
2592		if (document.hidden === true) {
2593			return;
2594		}
2595
2596		if (this.core.state.isTouch || this.core.state.isScrolling
2597			|| this.core.state.isSwiping || this.core.state.inMotion) {
2598			return;
2599		}
2600
2601		if (this.core.settings.autoplay === false) {
2602			window.clearInterval(this.interval);
2603			return;
2604		}
2605
2606		this.core.next(this.core.settings.autoplaySpeed);
2607	};
2608
2609	/**
2610	 * Stops the autoplay.
2611	 * @public
2612	 */
2613	Autoplay.prototype.stop = function() {
2614		window.clearInterval(this.interval);
2615	};
2616
2617	/**
2618	 * Pauses the autoplay.
2619	 * @public
2620	 */
2621	Autoplay.prototype.pause = function() {
2622		window.clearInterval(this.interval);
2623	};
2624
2625	/**
2626	 * Destroys the plugin.
2627	 */
2628	Autoplay.prototype.destroy = function() {
2629		var handler, property;
2630
2631		window.clearInterval(this.interval);
2632
2633		for (handler in this.handlers) {
2634			this.core.$element.off(handler, this.handlers[handler]);
2635		}
2636		for (property in Object.getOwnPropertyNames(this)) {
2637			typeof this[property] != 'function' && (this[property] = null);
2638		}
2639	};
2640
2641	$.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2642
2643})(window.Zepto || window.jQuery, window, document);
2644
2645/**
2646 * Navigation Plugin
2647 * @version 2.0.0
2648 * @author Artus Kolanowski
2649 * @license The MIT License (MIT)
2650 */
2651;(function($, window, document, undefined) {
2652	'use strict';
2653
2654	/**
2655	 * Creates the navigation plugin.
2656	 * @class The Navigation Plugin
2657	 * @param {Owl} carousel - The Owl Carousel.
2658	 */
2659	var Navigation = function(carousel) {
2660		/**
2661		 * Reference to the core.
2662		 * @protected
2663		 * @type {Owl}
2664		 */
2665		this._core = carousel;
2666
2667		/**
2668		 * Indicates whether the plugin is initialized or not.
2669		 * @protected
2670		 * @type {Boolean}
2671		 */
2672		this._initialized = false;
2673
2674		/**
2675		 * The current paging indexes.
2676		 * @protected
2677		 * @type {Array}
2678		 */
2679		this._pages = [];
2680
2681		/**
2682		 * All DOM elements of the user interface.
2683		 * @protected
2684		 * @type {Object}
2685		 */
2686		this._controls = {};
2687
2688		/**
2689		 * Markup for an indicator.
2690		 * @protected
2691		 * @type {Array.<String>}
2692		 */
2693		this._templates = [];
2694
2695		/**
2696		 * The carousel element.
2697		 * @type {jQuery}
2698		 */
2699		this.$element = this._core.$element;
2700
2701		/**
2702		 * Overridden methods of the carousel.
2703		 * @protected
2704		 * @type {Object}
2705		 */
2706		this._overrides = {
2707			next: this._core.next,
2708			prev: this._core.prev,
2709			to: this._core.to
2710		};
2711
2712		/**
2713		 * All event handlers.
2714		 * @protected
2715		 * @type {Object}
2716		 */
2717		this._handlers = {
2718			'prepared.owl.carousel': $.proxy(function(e) {
2719				if (this._core.settings.dotsData) {
2720					this._templates.push($(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
2721				}
2722			}, this),
2723			'add.owl.carousel': $.proxy(function(e) {
2724				if (this._core.settings.dotsData) {
2725					this._templates.splice(e.position, 0, $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
2726				}
2727			}, this),
2728			'remove.owl.carousel prepared.owl.carousel': $.proxy(function(e) {
2729				if (this._core.settings.dotsData) {
2730					this._templates.splice(e.position, 1);
2731				}
2732			}, this),
2733			'change.owl.carousel': $.proxy(function(e) {
2734				if (e.property.name == 'position') {
2735					if (!this._core.state.revert && !this._core.settings.loop && this._core.settings.navRewind) {
2736						var current = this._core.current(),
2737							maximum = this._core.maximum(),
2738							minimum = this._core.minimum();
2739						e.data = e.property.value > maximum
2740							? current >= maximum ? minimum : maximum
2741							: e.property.value < minimum ? maximum : e.property.value;
2742					}
2743				}
2744			}, this),
2745			'changed.owl.carousel': $.proxy(function(e) {
2746				if (e.property.name == 'position') {
2747					this.draw();
2748				}
2749			}, this),
2750			'refreshed.owl.carousel': $.proxy(function() {
2751				if (!this._initialized) {
2752					this.initialize();
2753					this._initialized = true;
2754				}
2755				this._core.trigger('refresh', null, 'navigation');
2756				this.update();
2757				this.draw();
2758				this._core.trigger('refreshed', null, 'navigation');
2759			}, this)
2760		};
2761
2762		// set default options
2763		this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
2764
2765		// register event handlers
2766		this.$element.on(this._handlers);
2767	}
2768
2769	/**
2770	 * Default options.
2771	 * @public
2772	 * @todo Rename `slideBy` to `navBy`
2773	 */
2774	Navigation.Defaults = {
2775		nav: false,
2776		navRewind: true,
2777		navText: [ 'prev', 'next' ],
2778		navSpeed: false,
2779		navElement: 'div',
2780		navContainer: false,
2781		navContainerClass: 'owl-nav',
2782		navClass: [ 'owl-prev', 'owl-next' ],
2783		slideBy: 1,
2784		dotClass: 'owl-dot',
2785		dotsClass: 'owl-dots',
2786		dots: true,
2787		dotsEach: false,
2788		dotData: false,
2789		dotsSpeed: false,
2790		dotsContainer: false,
2791		controlsClass: 'owl-controls'
2792	}
2793
2794	/**
2795	 * Initializes the layout of the plugin and extends the carousel.
2796	 * @protected
2797	 */
2798	Navigation.prototype.initialize = function() {
2799		var $container, override,
2800			options = this._core.settings;
2801
2802		// create the indicator template
2803		if (!options.dotsData) {
2804			this._templates = [ $('<div>')
2805				.addClass(options.dotClass)
2806				.append($('<span>'))
2807				.prop('outerHTML') ];
2808		}
2809
2810		// create controls container if needed
2811		if (!options.navContainer || !options.dotsContainer) {
2812			this._controls.$container = $('<div>')
2813				.addClass(options.controlsClass)
2814				.appendTo(this.$element);
2815		}
2816
2817		// create DOM structure for absolute navigation
2818		this._controls.$indicators = options.dotsContainer ? $(options.dotsContainer)
2819			: $('<div>').hide().addClass(options.dotsClass).appendTo(this._controls.$container);
2820
2821		this._controls.$indicators.on('click', 'div', $.proxy(function(e) {
2822			var index = $(e.target).parent().is(this._controls.$indicators)
2823				? $(e.target).index() : $(e.target).parent().index();
2824
2825			e.preventDefault();
2826
2827			this.to(index, options.dotsSpeed);
2828		}, this));
2829
2830		// create DOM structure for relative navigation
2831		$container = options.navContainer ? $(options.navContainer)
2832			: $('<div>').addClass(options.navContainerClass).prependTo(this._controls.$container);
2833
2834		this._controls.$next = $('<' + options.navElement + '>');
2835		this._controls.$previous = this._controls.$next.clone();
2836
2837		this._controls.$previous
2838			.addClass(options.navClass[0])
2839			.html(options.navText[0])
2840			.hide()
2841			.prependTo($container)
2842			.on('click', $.proxy(function(e) {
2843				this.prev(options.navSpeed);
2844			}, this));
2845		this._controls.$next
2846			.addClass(options.navClass[1])
2847			.html(options.navText[1])
2848			.hide()
2849			.appendTo($container)
2850			.on('click', $.proxy(function(e) {
2851				this.next(options.navSpeed);
2852			}, this));
2853
2854		// override public methods of the carousel
2855		for (override in this._overrides) {
2856			this._core[override] = $.proxy(this[override], this);
2857		}
2858	}
2859
2860	/**
2861	 * Destroys the plugin.
2862	 * @protected
2863	 */
2864	Navigation.prototype.destroy = function() {
2865		var handler, control, property, override;
2866
2867		for (handler in this._handlers) {
2868			this.$element.off(handler, this._handlers[handler]);
2869		}
2870		for (control in this._controls) {
2871			this._controls[control].remove();
2872		}
2873		for (override in this.overides) {
2874			this._core[override] = this._overrides[override];
2875		}
2876		for (property in Object.getOwnPropertyNames(this)) {
2877			typeof this[property] != 'function' && (this[property] = null);
2878		}
2879	}
2880
2881	/**
2882	 * Updates the internal state.
2883	 * @protected
2884	 */
2885	Navigation.prototype.update = function() {
2886		var i, j, k,
2887			options = this._core.settings,
2888			lower = this._core.clones().length / 2,
2889			upper = lower + this._core.items().length,
2890			size = options.center || options.autoWidth || options.dotData
2891				? 1 : options.dotsEach || options.items;
2892
2893		if (options.slideBy !== 'page') {
2894			options.slideBy = Math.min(options.slideBy, options.items);
2895		}
2896
2897		if (options.dots || options.slideBy == 'page') {
2898			this._pages = [];
2899
2900			for (i = lower, j = 0, k = 0; i < upper; i++) {
2901				if (j >= size || j === 0) {
2902					this._pages.push({
2903						start: i - lower,
2904						end: i - lower + size - 1
2905					});
2906					j = 0, ++k;
2907				}
2908				j += this._core.mergers(this._core.relative(i));
2909			}
2910		}
2911	}
2912
2913	/**
2914	 * Draws the user interface.
2915	 * @todo The option `dotData` wont work.
2916	 * @protected
2917	 */
2918	Navigation.prototype.draw = function() {
2919		var difference, i, html = '',
2920			options = this._core.settings,
2921			$items = this._core.$stage.children(),
2922			index = this._core.relative(this._core.current());
2923
2924		if (options.nav && !options.loop && !options.navRewind) {
2925			this._controls.$previous.toggleClass('disabled', index <= 0);
2926			this._controls.$next.toggleClass('disabled', index >= this._core.maximum());
2927		}
2928
2929		this._controls.$previous.toggle(options.nav);
2930		this._controls.$next.toggle(options.nav);
2931
2932		if (options.dots) {
2933			difference = this._pages.length - this._controls.$indicators.children().length;
2934
2935			if (options.dotData && difference !== 0) {
2936				for (i = 0; i < this._controls.$indicators.children().length; i++) {
2937					html += this._templates[this._core.relative(i)];
2938				}
2939				this._controls.$indicators.html(html);
2940			} else if (difference > 0) {
2941				html = new Array(difference + 1).join(this._templates[0]);
2942				this._controls.$indicators.append(html);
2943			} else if (difference < 0) {
2944				this._controls.$indicators.children().slice(difference).remove();
2945			}
2946
2947			this._controls.$indicators.find('.active').removeClass('active');
2948			this._controls.$indicators.children().eq($.inArray(this.current(), this._pages)).addClass('active');
2949		}
2950
2951		this._controls.$indicators.toggle(options.dots);
2952	}
2953
2954	/**
2955	 * Extends event data.
2956	 * @protected
2957	 * @param {Event} event - The event object which gets thrown.
2958	 */
2959	Navigation.prototype.onTrigger = function(event) {
2960		var settings = this._core.settings;
2961
2962		event.page = {
2963			index: $.inArray(this.current(), this._pages),
2964			count: this._pages.length,
2965			size: settings && (settings.center || settings.autoWidth || settings.dotData
2966				? 1 : settings.dotsEach || settings.items)
2967		};
2968	}
2969
2970	/**
2971	 * Gets the current page position of the carousel.
2972	 * @protected
2973	 * @returns {Number}
2974	 */
2975	Navigation.prototype.current = function() {
2976		var index = this._core.relative(this._core.current());
2977		return $.grep(this._pages, function(o) {
2978			return o.start <= index && o.end >= index;
2979		}).pop();
2980	}
2981
2982	/**
2983	 * Gets the current succesor/predecessor position.
2984	 * @protected
2985	 * @returns {Number}
2986	 */
2987	Navigation.prototype.getPosition = function(successor) {
2988		var position, length,
2989			options = this._core.settings;
2990
2991		if (options.slideBy == 'page') {
2992			position = $.inArray(this.current(), this._pages);
2993			length = this._pages.length;
2994			successor ? ++position : --position;
2995			position = this._pages[((position % length) + length) % length].start;
2996		} else {
2997			position = this._core.relative(this._core.current());
2998			length = this._core.items().length;
2999			successor ? position += options.slideBy : position -= options.slideBy;
3000		}
3001		return position;
3002	}
3003
3004	/**
3005	 * Slides to the next item or page.
3006	 * @public
3007	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
3008	 */
3009	Navigation.prototype.next = function(speed) {
3010		$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
3011	}
3012
3013	/**
3014	 * Slides to the previous item or page.
3015	 * @public
3016	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
3017	 */
3018	Navigation.prototype.prev = function(speed) {
3019		$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
3020	}
3021
3022	/**
3023	 * Slides to the specified item or page.
3024	 * @public
3025	 * @param {Number} position - The position of the item or page.
3026	 * @param {Number} [speed] - The time in milliseconds for the transition.
3027	 * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
3028	 */
3029	Navigation.prototype.to = function(position, speed, standard) {
3030		var length;
3031
3032		if (!standard) {
3033			length = this._pages.length;
3034			$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3035		} else {
3036			$.proxy(this._overrides.to, this._core)(position, speed);
3037		}
3038	}
3039
3040	$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3041
3042})(window.Zepto || window.jQuery, window, document);
3043
3044/**
3045 * Hash Plugin
3046 * @version 2.0.0
3047 * @author Artus Kolanowski
3048 * @license The MIT License (MIT)
3049 */
3050;(function($, window, document, undefined) {
3051	'use strict';
3052
3053	/**
3054	 * Creates the hash plugin.
3055	 * @class The Hash Plugin
3056	 * @param {Owl} carousel - The Owl Carousel
3057	 */
3058	var Hash = function(carousel) {
3059		/**
3060		 * Reference to the core.
3061		 * @protected
3062		 * @type {Owl}
3063		 */
3064		this._core = carousel;
3065
3066		/**
3067		 * Hash table for the hashes.
3068		 * @protected
3069		 * @type {Object}
3070		 */
3071		this._hashes = {};
3072
3073		/**
3074		 * The carousel element.
3075		 * @type {jQuery}
3076		 */
3077		this.$element = this._core.$element;
3078
3079		/**
3080		 * All event handlers.
3081		 * @protected
3082		 * @type {Object}
3083		 */
3084		this._handlers = {
3085			'initialized.owl.carousel': $.proxy(function() {
3086				if (this._core.settings.startPosition == 'URLHash') {
3087					$(window).trigger('hashchange.owl.navigation');
3088				}
3089			}, this),
3090			'prepared.owl.carousel': $.proxy(function(e) {
3091				var hash = $(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash');
3092				this._hashes[hash] = e.content;
3093			}, this)
3094		};
3095
3096		// set default options
3097		this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3098
3099		// register the event handlers
3100		this.$element.on(this._handlers);
3101
3102		// register event listener for hash navigation
3103		$(window).on('hashchange.owl.navigation', $.proxy(function() {
3104			var hash = window.location.hash.substring(1),
3105				items = this._core.$stage.children(),
3106				position = this._hashes[hash] && items.index(this._hashes[hash]) || 0;
3107
3108			if (!hash) {
3109				return false;
3110			}
3111
3112			this._core.to(position, false, true);
3113		}, this));
3114	}
3115
3116	/**
3117	 * Default options.
3118	 * @public
3119	 */
3120	Hash.Defaults = {
3121		URLhashListener: false
3122	}
3123
3124	/**
3125	 * Destroys the plugin.
3126	 * @public
3127	 */
3128	Hash.prototype.destroy = function() {
3129		var handler, property;
3130
3131		$(window).off('hashchange.owl.navigation');
3132
3133		for (handler in this._handlers) {
3134			this._core.$element.off(handler, this._handlers[handler]);
3135		}
3136		for (property in Object.getOwnPropertyNames(this)) {
3137			typeof this[property] != 'function' && (this[property] = null);
3138		}
3139	}
3140
3141	$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3142
3143})(window.Zepto || window.jQuery, window, document);
3144
3145/* End */
3146;
3147; /* Start:"a:4:{s:4:"full";s:72:"/bitrix/templates/aura-flowers-new/js/doubletaptogo.min.js?1715628634585";s:6:"source";s:58:"/bitrix/templates/aura-flowers-new/js/doubletaptogo.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3148/*
3149	By Osvaldas Valutis, www.osvaldas.info
3150	Available for use under the MIT License
3151*/
3152
3153
3154
3155;(function(e,t,n,r){e.fn.doubleTapToGo=function(r){if(!("ontouchstart"in t)&&!navigator.msMaxTouchPoints&&!navigator.userAgent.toLowerCase().match(/windows phone os 7/i))return false;this.each(function(){var t=false;e(this).on("click",function(n){var r=e(this);if(r[0]!=t[0]){n.preventDefault();t=r}});e(n).on("click touchstart MSPointerDown",function(n){var r=true,i=e(n.target).parents();for(var s=0;s<i.length;s++)if(i[s]==t[0])r=false;if(r)t=false})});return this}})(jQuery,window,document);
3156/* End */
3157;
3158; /* Start:"a:4:{s:4:"full";s:74:"/bitrix/templates/aura-flowers-new/js/jquery.maskedinput.js?17156286347437";s:6:"source";s:59:"/bitrix/templates/aura-flowers-new/js/jquery.maskedinput.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3159/*
3160	Masked Input plugin for jQuery
3161	Copyright (c) 2007-2013 Josh Bush (digitalbush.com)
3162	Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
3163	Version: 1.3.1
3164*/
3165(function($) {
3166	function getPasteEvent() {
3167    var el = document.createElement('input'),
3168        name = 'onpaste';
3169    el.setAttribute(name, '');
3170    return (typeof el[name] === 'function')?'paste':'input';             
3171}
3172
3173var pasteEventName = getPasteEvent() + ".mask",
3174	ua = navigator.userAgent,
3175	iPhone = /iphone/i.test(ua),
3176	android=/android/i.test(ua),
3177	caretTimeoutId;
3178
3179$.mask = {
3180	//Predefined character definitions
3181	definitions: {
3182		'9': "[0-9]",
3183		'a': "[A-Za-z]",
3184		'*': "[A-Za-z0-9]"
3185	},
3186	dataName: "rawMaskFn",
3187	placeholder: '_',
3188};
3189
3190$.fn.extend({
3191	//Helper Function for Caret positioning
3192	caret: function(begin, end) {
3193		var range;
3194
3195		if (this.length === 0 || this.is(":hidden")) {
3196			return;
3197		}
3198
3199		if (typeof begin == 'number') {
3200			end = (typeof end === 'number') ? end : begin;
3201			return this.each(function() {
3202				if (this.setSelectionRange) {
3203					this.setSelectionRange(begin, end);
3204				} else if (this.createTextRange) {
3205					range = this.createTextRange();
3206					range.collapse(true);
3207					range.moveEnd('character', end);
3208					range.moveStart('character', begin);
3209					range.select();
3210				}
3211			});
3212		} else {
3213			if (this[0].setSelectionRange) {
3214				begin = this[0].selectionStart;
3215				end = this[0].selectionEnd;
3216			} else if (document.selection && document.selection.createRange) {
3217				range = document.selection.createRange();
3218				begin = 0 - range.duplicate().moveStart('character', -100000);
3219				end = begin + range.text.length;
3220			}
3221			return { begin: begin, end: end };
3222		}
3223	},
3224	unmask: function() {
3225		return this.trigger("unmask");
3226	},
3227	mask: function(mask, settings) {
3228		var input,
3229			defs,
3230			tests,
3231			partialPosition,
3232			firstNonMaskPos,
3233			len;
3234
3235		if (!mask && this.length > 0) {
3236			input = $(this[0]);
3237			return input.data($.mask.dataName)();
3238		}
3239		settings = $.extend({
3240			placeholder: $.mask.placeholder, // Load default placeholder
3241			completed: null
3242		}, settings);
3243
3244
3245		defs = $.mask.definitions;
3246		tests = [];
3247		partialPosition = len = mask.length;
3248		firstNonMaskPos = null;
3249
3250		$.each(mask.split(""), function(i, c) {
3251			if (c == '?') {
3252				len--;
3253				partialPosition = i;
3254			} else if (defs[c]) {
3255				tests.push(new RegExp(defs[c]));
3256				if (firstNonMaskPos === null) {
3257					firstNonMaskPos = tests.length - 1;
3258				}
3259			} else {
3260				tests.push(null);
3261			}
3262		});
3263
3264		return this.trigger("unmask").each(function() {
3265			var input = $(this),
3266				buffer = $.map(
3267				mask.split(""),
3268				function(c, i) {
3269					if (c != '?') {
3270						return defs[c] ? settings.placeholder : c;
3271					}
3272				}),
3273				focusText = input.val();
3274
3275			function seekNext(pos) {
3276				while (++pos < len && !tests[pos]);
3277				return pos;
3278			}
3279
3280			function seekPrev(pos) {
3281				while (--pos >= 0 && !tests[pos]);
3282				return pos;
3283			}
3284
3285			function shiftL(begin,end) {
3286				var i,
3287					j;
3288
3289				if (begin<0) {
3290					return;
3291				}
3292
3293				for (i = begin, j = seekNext(end); i < len; i++) {
3294					if (tests[i]) {
3295						if (j < len && tests[i].test(buffer[j])) {
3296							buffer[i] = buffer[j];
3297							buffer[j] = settings.placeholder;
3298						} else {
3299							break;
3300						}
3301
3302						j = seekNext(j);
3303					}
3304				}
3305				writeBuffer();
3306				input.caret(Math.max(firstNonMaskPos, begin));
3307			}
3308
3309			function shiftR(pos) {
3310				var i,
3311					c,
3312					j,
3313					t;
3314
3315				for (i = pos, c = settings.placeholder; i < len; i++) {
3316					if (tests[i]) {
3317						j = seekNext(i);
3318						t = buffer[i];
3319						buffer[i] = c;
3320						if (j < len && tests[j].test(t)) {
3321							c = t;
3322						} else {
3323							break;
3324						}
3325					}
3326				}
3327			}
3328
3329			function keydownEvent(e) {
3330				var k = e.which,
3331					pos,
3332					begin,
3333					end;
3334
3335				//backspace, delete, and escape get special treatment
3336				if (k === 8 || k === 46 || (iPhone && k === 127)) {
3337					pos = input.caret();
3338					begin = pos.begin;
3339					end = pos.end;
3340
3341					if (end - begin === 0) {
3342						begin=k!==46?seekPrev(begin):(end=seekNext(begin-1));
3343						end=k===46?seekNext(end):end;
3344					}
3345					clearBuffer(begin, end);
3346					shiftL(begin, end - 1);
3347
3348					e.preventDefault();
3349				} else if (k == 27) {//escape
3350					input.val(focusText);
3351					input.caret(0, checkVal());
3352					e.preventDefault();
3353				}
3354			}
3355
3356			function keypressEvent(e) {
3357				var k = e.which,
3358					pos = input.caret(),
3359					p,
3360					c,
3361					next;
3362
3363				if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore
3364					return;
3365				} else if (k) {
3366					if (pos.end - pos.begin !== 0){
3367						clearBuffer(pos.begin, pos.end);
3368						shiftL(pos.begin, pos.end-1);
3369					}
3370
3371					p = seekNext(pos.begin - 1);
3372					if (p < len) {
3373						c = String.fromCharCode(k);
3374						if (tests[p].test(c)) {
3375							shiftR(p);
3376
3377							buffer[p] = c;
3378							writeBuffer();
3379							next = seekNext(p);
3380
3381							if(android){
3382								setTimeout($.proxy($.fn.caret,input,next),0);
3383							}else{
3384								input.caret(next);
3385							}
3386
3387							if (settings.completed && next >= len) {
3388								settings.completed.call(input);
3389							}
3390						}
3391					}
3392					e.preventDefault();
3393				}
3394			}
3395
3396			function clearBuffer(start, end) {
3397				var i;
3398				for (i = start; i < end && i < len; i++) {
3399					if (tests[i]) {
3400						buffer[i] = settings.placeholder;
3401					}
3402				}
3403			}
3404
3405			function writeBuffer() { input.val(buffer.join('')); }
3406
3407			function checkVal(allow) {
3408				//try to place characters where they belong
3409				var test = input.val(),
3410					lastMatch = -1,
3411					i,
3412					c;
3413
3414				for (i = 0, pos = 0; i < len; i++) {
3415					if (tests[i]) {
3416						buffer[i] = settings.placeholder;
3417						while (pos++ < test.length) {
3418							c = test.charAt(pos - 1);
3419							if (tests[i].test(c)) {
3420								buffer[i] = c;
3421								lastMatch = i;
3422								break;
3423							}
3424						}
3425						if (pos > test.length) {
3426							break;
3427						}
3428					} else if (buffer[i] === test.charAt(pos) && i !== partialPosition) {
3429						pos++;
3430						lastMatch = i;
3431					}
3432				}
3433				if (allow) {
3434					writeBuffer();
3435				} else if (lastMatch + 1 < partialPosition) {
3436					input.val("");
3437					clearBuffer(0, len);
3438				} else {
3439					writeBuffer();
3440					input.val(input.val().substring(0, lastMatch + 1));
3441				}
3442				return (partialPosition ? i : firstNonMaskPos);
3443			}
3444
3445			input.data($.mask.dataName,function(){
3446				return $.map(buffer, function(c, i) {
3447					return tests[i]&&c!=settings.placeholder ? c : null;
3448				}).join('');
3449			});
3450
3451			if (!input.attr("readonly"))
3452				input
3453				.one("unmask", function() {
3454					input
3455						.unbind(".mask")
3456						.removeData($.mask.dataName);
3457				})
3458				.bind("focus.mask", function() {
3459					clearTimeout(caretTimeoutId);
3460					var pos,
3461						moveCaret;
3462
3463					focusText = input.val();
3464					pos = checkVal();
3465					
3466					caretTimeoutId = setTimeout(function(){
3467						writeBuffer();
3468						if (pos == mask.length) {
3469							input.caret(0, pos);
3470						} else {
3471							input.caret(pos);
3472						}
3473					}, 10);
3474				})
3475				.bind("blur.mask", function() {
3476					checkVal();
3477					if (input.val() != focusText)
3478						input.change();
3479				})
3480				.bind("keydown.mask", keydownEvent)
3481				.bind("keypress.mask", keypressEvent)
3482				.bind(pasteEventName, function() {
3483					setTimeout(function() { 
3484						var pos=checkVal(true);
3485						input.caret(pos); 
3486						if (settings.completed && pos == input.val().length)
3487							settings.completed.call(input);
3488					}, 0);
3489				});
3490			checkVal(); //Perform initial check for existing values
3491		});
3492	}
3493});
3494
3495
3496})(jQuery);
3497/* End */
3498;
3499; /* Start:"a:4:{s:4:"full";s:69:"/bitrix/templates/aura-flowers-new/js/jquery.cookie.js?17156286343121";s:6:"source";s:54:"/bitrix/templates/aura-flowers-new/js/jquery.cookie.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3500/*!
3501 * jQuery Cookie Plugin v1.4.1
3502 * https://github.com/carhartl/jquery-cookie
3503 *
3504 * Copyright 2013 Klaus Hartl
3505 * Released under the MIT license
3506 */
3507(function (factory) {
3508	if (typeof define === 'function' && define.amd) {
3509		// AMD
3510		define(['jquery'], factory);
3511	} else if (typeof exports === 'object') {
3512		// CommonJS
3513		factory(require('jquery'));
3514	} else {
3515		// Browser globals
3516		factory(jQuery);
3517	}
3518}(function ($) {
3519
3520	var pluses = /\+/g;
3521
3522	function encode(s) {
3523		return config.raw ? s : encodeURIComponent(s);
3524	}
3525
3526	function decode(s) {
3527		return config.raw ? s : decodeURIComponent(s);
3528	}
3529
3530	function stringifyCookieValue(value) {
3531		return encode(config.json ? JSON.stringify(value) : String(value));
3532	}
3533
3534	function parseCookieValue(s) {
3535		if (s.indexOf('"') === 0) {
3536			// This is a quoted cookie as according to RFC2068, unescape...
3537			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
3538		}
3539
3540		try {
3541			// Replace server-side written pluses with spaces.
3542			// If we can't decode the cookie, ignore it, it's unusable.
3543			// If we can't parse the cookie, ignore it, it's unusable.
3544			s = decodeURIComponent(s.replace(pluses, ' '));
3545			return config.json ? JSON.parse(s) : s;
3546		} catch(e) {}
3547	}
3548
3549	function read(s, converter) {
3550		var value = config.raw ? s : parseCookieValue(s);
3551		return $.isFunction(converter) ? converter(value) : value;
3552	}
3553
3554	var config = $.cookie = function (key, value, options) {
3555
3556		// Write
3557
3558		if (value !== undefined && !$.isFunction(value)) {
3559			options = $.extend({}, config.defaults, options);
3560
3561			if (typeof options.expires === 'number') {
3562				var days = options.expires, t = options.expires = new Date();
3563				t.setTime(+t + days * 864e+5);
3564			}
3565
3566			return (document.cookie = [
3567				encode(key), '=', stringifyCookieValue(value),
3568				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
3569				options.path    ? '; path=' + options.path : '',
3570				options.domain  ? '; domain=' + options.domain : '',
3571				options.secure  ? '; secure' : ''
3572			].join(''));
3573		}
3574
3575		// Read
3576
3577		var result = key ? undefined : {};
3578
3579		// To prevent the for loop in the first place assign an empty array
3580		// in case there are no cookies at all. Also prevents odd result when
3581		// calling $.cookie().
3582		var cookies = document.cookie ? document.cookie.split('; ') : [];
3583
3584		for (var i = 0, l = cookies.length; i < l; i++) {
3585			var parts = cookies[i].split('=');
3586			var name = decode(parts.shift());
3587			var cookie = parts.join('=');
3588
3589			if (key && key === name) {
3590				// If second argument (value) is a function it's a converter...
3591				result = read(cookie, value);
3592				break;
3593			}
3594
3595			// Prevent storing a cookie that we couldn't decode.
3596			if (!key && (cookie = read(cookie)) !== undefined) {
3597				result[name] = cookie;
3598			}
3599		}
3600
3601		return result;
3602	};
3603
3604	config.defaults = {};
3605
3606	$.removeCookie = function (key, options) {
3607		if ($.cookie(key) === undefined) {
3608			return false;
3609		}
3610
3611		// Must not alter options, thus extending a fresh object...
3612		$.cookie(key, '', $.extend({}, options, { expires: -1 }));
3613		return !$.cookie(key);
3614	};
3615
3616}));
3617
3618/* End */
3619;
3620; /* Start:"a:4:{s:4:"full";s:80:"/bitrix/templates/aura-flowers-new/js/jquery-ui-1.9.2.custom.js?1715628634235068";s:6:"source";s:63:"/bitrix/templates/aura-flowers-new/js/jquery-ui-1.9.2.custom.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3621/*! jQuery UI - v1.9.2 - 2013-11-19
3622* http://jqueryui.com
3623* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.datepicker.js
3624* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
3625
3626(function( $, undefined ) {
3627
3628var uuid = 0,
3629	runiqueId = /^ui-id-\d+$/;
3630
3631// prevent duplicate loading
3632// this is only a problem because we proxy existing functions
3633// and we don't want to double proxy them
3634$.ui = $.ui || {};
3635if ( $.ui.version ) {
3636	return;
3637}
3638
3639$.extend( $.ui, {
3640	version: "1.9.2",
3641
3642	keyCode: {
3643		BACKSPACE: 8,
3644		COMMA: 188,
3645		DELETE: 46,
3646		DOWN: 40,
3647		END: 35,
3648		ENTER: 13,
3649		ESCAPE: 27,
3650		HOME: 36,
3651		LEFT: 37,
3652		NUMPAD_ADD: 107,
3653		NUMPAD_DECIMAL: 110,
3654		NUMPAD_DIVIDE: 111,
3655		NUMPAD_ENTER: 108,
3656		NUMPAD_MULTIPLY: 106,
3657		NUMPAD_SUBTRACT: 109,
3658		PAGE_DOWN: 34,
3659		PAGE_UP: 33,
3660		PERIOD: 190,
3661		RIGHT: 39,
3662		SPACE: 32,
3663		TAB: 9,
3664		UP: 38
3665	}
3666});
3667
3668// plugins
3669$.fn.extend({
3670	_focus: $.fn.focus,
3671	focus: function( delay, fn ) {
vendor: 5,104 bytes, lines 3672-3847
3672		return typeof delay === "number" ?
3673			this.each(function() {
3674				var elem = this;
3675				setTimeout(function() {
3676					$( elem ).focus();
3677					if ( fn ) {
3678						fn.call( elem );
3679					}
3680				}, delay );
3681			}) :
3682			this._focus.apply( this, arguments );
3683	},
3684
3685	scrollParent: function() {
3686		var scrollParent;
3687		if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
3688			scrollParent = this.parents().filter(function() {
3689				return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
3690			}).eq(0);
3691		} else {
3692			scrollParent = this.parents().filter(function() {
3693				return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
3694			}).eq(0);
3695		}
3696
3697		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
3698	},
3699
3700	zIndex: function( zIndex ) {
3701		if ( zIndex !== undefined ) {
3702			return this.css( "zIndex", zIndex );
3703		}
3704
3705		if ( this.length ) {
3706			var elem = $( this[ 0 ] ), position, value;
3707			while ( elem.length && elem[ 0 ] !== document ) {
3708				// Ignore z-index if position is set to a value where z-index is ignored by the browser
3709				// This makes behavior of this function consistent across browsers
3710				// WebKit always returns auto if the element is positioned
3711				position = elem.css( "position" );
3712				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
3713					// IE returns 0 when zIndex is not specified
3714					// other browsers return a string
3715					// we ignore the case of nested elements with an explicit value of 0
3716					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
3717					value = parseInt( elem.css( "zIndex" ), 10 );
3718					if ( !isNaN( value ) && value !== 0 ) {
3719						return value;
3720					}
3721				}
3722				elem = elem.parent();
3723			}
3724		}
3725
3726		return 0;
3727	},
3728
3729	uniqueId: function() {
3730		return this.each(function() {
3731			if ( !this.id ) {
3732				this.id = "ui-id-" + (++uuid);
3733			}
3734		});
3735	},
3736
3737	removeUniqueId: function() {
3738		return this.each(function() {
3739			if ( runiqueId.test( this.id ) ) {
3740				$( this ).removeAttr( "id" );
3741			}
3742		});
3743	}
3744});
3745
3746// selectors
3747function focusable( element, isTabIndexNotNaN ) {
3748	var map, mapName, img,
3749		nodeName = element.nodeName.toLowerCase();
3750	if ( "area" === nodeName ) {
3751		map = element.parentNode;
3752		mapName = map.name;
3753		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
3754			return false;
3755		}
3756		img = $( "img[usemap=#" + mapName + "]" )[0];
3757		return !!img && visible( img );
3758	}
3759	return ( /input|select|textarea|button|object/.test( nodeName ) ?
3760		!element.disabled :
3761		"a" === nodeName ?
3762			element.href || isTabIndexNotNaN :
3763			isTabIndexNotNaN) &&
3764		// the element and all of its ancestors must be visible
3765		visible( element );
3766}
3767
3768function visible( element ) {
3769	return $.expr.filters.visible( element ) &&
3770		!$( element ).parents().andSelf().filter(function() {
3771			return $.css( this, "visibility" ) === "hidden";
3772		}).length;
3773}
3774
3775$.extend( $.expr[ ":" ], {
3776	data: $.expr.createPseudo ?
3777		$.expr.createPseudo(function( dataName ) {
3778			return function( elem ) {
3779				return !!$.data( elem, dataName );
3780			};
3781		}) :
3782		// support: jQuery <1.8
3783		function( elem, i, match ) {
3784			return !!$.data( elem, match[ 3 ] );
3785		},
3786
3787	focusable: function( element ) {
3788		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
3789	},
3790
3791	tabbable: function( element ) {
3792		var tabIndex = $.attr( element, "tabindex" ),
3793			isTabIndexNaN = isNaN( tabIndex );
3794		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
3795	}
3796});
3797
3798// support
3799$(function() {
3800	var body = document.body,
3801		div = body.appendChild( div = document.createElement( "div" ) );
3802
3803	// access offsetHeight before setting the style to prevent a layout bug
3804	// in IE 9 which causes the element to continue to take up space even
3805	// after it is removed from the DOM (#8026)
3806	div.offsetHeight;
3807
3808	$.extend( div.style, {
3809		minHeight: "100px",
3810		height: "auto",
3811		padding: 0,
3812		borderWidth: 0
3813	});
3814
3815	$.support.minHeight = div.offsetHeight === 100;
3816	$.support.selectstart = "onselectstart" in div;
3817
3818	// set display to none to avoid a layout bug in IE
3819	// http://dev.jquery.com/ticket/4014
3820	body.removeChild( div ).style.display = "none";
3821});
3822
3823// support: jQuery <1.8
3824if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
3825	$.each( [ "Width", "Height" ], function( i, name ) {
3826		var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
3827			type = name.toLowerCase(),
3828			orig = {
3829				innerWidth: $.fn.innerWidth,
3830				innerHeight: $.fn.innerHeight,
3831				outerWidth: $.fn.outerWidth,
3832				outerHeight: $.fn.outerHeight
3833			};
3834
3835		function reduce( elem, size, border, margin ) {
3836			$.each( side, function() {
3837				size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
3838				if ( border ) {
3839					size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
3840				}
3841				if ( margin ) {
3842					size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
3843				}
3844			});
3845			return size;
3846		}
3847
3848		$.fn[ "inner" + name ] = function( size ) {
3849			if ( size === undefined ) {
3850				return orig[ "inner" + name ].call( this );
3851			}
3852
3853			return this.each(function() {
3854				$( this ).css( type, reduce( this, size ) + "px" );
3855			});
3856		};
3857
3858		$.fn[ "outer" + name] = function( size, margin ) {
3859			if ( typeof size !== "number" ) {
3860				return orig[ "outer" + name ].call( this, size );
3861			}
3862
3863			return this.each(function() {
3864				$( this).css( type, reduce( this, size, true, margin ) + "px" );
3865			});
3866		};
3867	});
3868}
3869
3870// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
3871if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
3872	$.fn.removeData = (function( removeData ) {
3873		return function( key ) {
3874			if ( arguments.length ) {
3875				return removeData.call( this, $.camelCase( key ) );
3876			} else {
3877				return removeData.call( this );
3878			}
3879		};
3880	})( $.fn.removeData );
3881}
3882
3883
3884
3885
3886
3887// deprecated
3888
3889(function() {
3890	var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];
3891	$.ui.ie = uaMatch.length ? true : false;
3892	$.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;
3893})();
3894
3895$.fn.extend({
3896	disableSelection: function() {
3897		return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
3898			".ui-disableSelection", function( event ) {
3899				event.preventDefault();
3900			});
3901	},
3902
3903	enableSelection: function() {
3904		return this.unbind( ".ui-disableSelection" );
3905	}
3906});
3907
3908$.extend( $.ui, {
3909	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
3910	plugin: {
3911		add: function( module, option, set ) {
3912			var i,
3913				proto = $.ui[ module ].prototype;
3914			for ( i in set ) {
3915				proto.plugins[ i ] = proto.plugins[ i ] || [];
3916				proto.plugins[ i ].push( [ option, set[ i ] ] );
3917			}
3918		},
3919		call: function( instance, name, args ) {
3920			var i,
3921				set = instance.plugins[ name ];
3922			if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
3923				return;
3924			}
3925
3926			for ( i = 0; i < set.length; i++ ) {
3927				if ( instance.options[ set[ i ][ 0 ] ] ) {
3928					set[ i ][ 1 ].apply( instance.element, args );
3929				}
3930			}
3931		}
3932	},
3933
3934	contains: $.contains,
3935
3936	// only used by resizable
3937	hasScroll: function( el, a ) {
3938
3939		//If overflow is hidden, the element might have extra content, but the user wants to hide it
3940		if ( $( el ).css( "overflow" ) === "hidden") {
3941			return false;
3942		}
3943
3944		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
3945			has = false;
3946
3947		if ( el[ scroll ] > 0 ) {
3948			return true;
3949		}
3950
3951		// TODO: determine which cases actually cause this to happen
3952		// if the element doesn't have the scroll set, see if it's possible to
3953		// set the scroll
3954		el[ scroll ] = 1;
3955		has = ( el[ scroll ] > 0 );
3956		el[ scroll ] = 0;
3957		return has;
3958	},
3959
3960	// these are odd functions, fix the API or move into individual plugins
3961	isOverAxis: function( x, reference, size ) {
3962		//Determines when x coordinate is over "b" element axis
3963		return ( x > reference ) && ( x < ( reference + size ) );
3964	},
3965	isOver: function( y, x, top, left, height, width ) {
3966		//Determines when x, y coordinates is over "b" element
3967		return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
3968	}
3969});
3970
3971})( jQuery );
3972(function( $, undefined ) {
3973
3974var uuid = 0,
3975	slice = Array.prototype.slice,
3976	_cleanData = $.cleanData;
3977$.cleanData = function( elems ) {
3978	for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
3979		try {
3980			$( elem ).triggerHandler( "remove" );
3981		// http://bugs.jquery.com/ticket/8235
3982		} catch( e ) {}
3983	}
3984	_cleanData( elems );
3985};
3986
3987$.widget = function( name, base, prototype ) {
3988	var fullName, existingConstructor, constructor, basePrototype,
3989		namespace = name.split( "." )[ 0 ];
3990
3991	name = name.split( "." )[ 1 ];
3992	fullName = namespace + "-" + name;
3993
3994	if ( !prototype ) {
3995		prototype = base;
3996		base = $.Widget;
3997	}
3998
3999	// create selector for plugin
4000	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
4001		return !!$.data( elem, fullName );
4002	};
4003
4004	$[ namespace ] = $[ namespace ] || {};
4005	existingConstructor = $[ namespace ][ name ];
4006	constructor = $[ namespace ][ name ] = function( options, element ) {
4007		// allow instantiation without "new" keyword
4008		if ( !this._createWidget ) {
4009			return new constructor( options, element );
4010		}
4011
4012		// allow instantiation without initializing for simple inheritance
4013		// must use "new" keyword (the code above always passes args)
4014		if ( arguments.length ) {
4015			this._createWidget( options, element );
4016		}
4017	};
4018	// extend with the existing constructor to carry over any static properties
4019	$.extend( constructor, existingConstructor, {
4020		version: prototype.version,
4021		// copy the object used to create the prototype in case we need to
4022		// redefine the widget later
4023		_proto: $.extend( {}, prototype ),
4024		// track widgets that inherit from this widget in case this widget is
4025		// redefined after a widget inherits from it
4026		_childConstructors: []
4027	});
4028
4029	basePrototype = new base();
4030	// we need to make the options hash a property directly on the new instance
4031	// otherwise we'll modify the options hash on the prototype that we're
4032	// inheriting from
4033	basePrototype.options = $.widget.extend( {}, basePrototype.options );
4034	$.each( prototype, function( prop, value ) {
4035		if ( $.isFunction( value ) ) {
4036			prototype[ prop ] = (function() {
4037				var _super = function() {
4038						return base.prototype[ prop ].apply( this, arguments );
4039					},
4040					_superApply = function( args ) {
4041						return base.prototype[ prop ].apply( this, args );
4042					};
4043				return function() {
4044					var __super = this._super,
4045						__superApply = this._superApply,
4046						returnValue;
4047
4048					this._super = _super;
4049					this._superApply = _superApply;
4050
vendor: 12,147 bytes, lines 4051-4468
4051					returnValue = value.apply( this, arguments );
4052
4053					this._super = __super;
4054					this._superApply = __superApply;
4055
4056					return returnValue;
4057				};
4058			})();
4059		}
4060	});
4061	constructor.prototype = $.widget.extend( basePrototype, {
4062		// TODO: remove support for widgetEventPrefix
4063		// always use the name + a colon as the prefix, e.g., draggable:start
4064		// don't prefix for widgets that aren't DOM-based
4065		widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
4066	}, prototype, {
4067		constructor: constructor,
4068		namespace: namespace,
4069		widgetName: name,
4070		// TODO remove widgetBaseClass, see #8155
4071		widgetBaseClass: fullName,
4072		widgetFullName: fullName
4073	});
4074
4075	// If this widget is being redefined then we need to find all widgets that
4076	// are inheriting from it and redefine all of them so that they inherit from
4077	// the new version of this widget. We're essentially trying to replace one
4078	// level in the prototype chain.
4079	if ( existingConstructor ) {
4080		$.each( existingConstructor._childConstructors, function( i, child ) {
4081			var childPrototype = child.prototype;
4082
4083			// redefine the child widget using the same prototype that was
4084			// originally used, but inherit from the new version of the base
4085			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
4086		});
4087		// remove the list of existing child constructors from the old constructor
4088		// so the old child constructors can be garbage collected
4089		delete existingConstructor._childConstructors;
4090	} else {
4091		base._childConstructors.push( constructor );
4092	}
4093
4094	$.widget.bridge( name, constructor );
4095};
4096
4097$.widget.extend = function( target ) {
4098	var input = slice.call( arguments, 1 ),
4099		inputIndex = 0,
4100		inputLength = input.length,
4101		key,
4102		value;
4103	for ( ; inputIndex < inputLength; inputIndex++ ) {
4104		for ( key in input[ inputIndex ] ) {
4105			value = input[ inputIndex ][ key ];
4106			if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
4107				// Clone objects
4108				if ( $.isPlainObject( value ) ) {
4109					target[ key ] = $.isPlainObject( target[ key ] ) ?
4110						$.widget.extend( {}, target[ key ], value ) :
4111						// Don't extend strings, arrays, etc. with objects
4112						$.widget.extend( {}, value );
4113				// Copy everything else by reference
4114				} else {
4115					target[ key ] = value;
4116				}
4117			}
4118		}
4119	}
4120	return target;
4121};
4122
4123$.widget.bridge = function( name, object ) {
4124	var fullName = object.prototype.widgetFullName || name;
4125	$.fn[ name ] = function( options ) {
4126		var isMethodCall = typeof options === "string",
4127			args = slice.call( arguments, 1 ),
4128			returnValue = this;
4129
4130		// allow multiple hashes to be passed on init
4131		options = !isMethodCall && args.length ?
4132			$.widget.extend.apply( null, [ options ].concat(args) ) :
4133			options;
4134
4135		if ( isMethodCall ) {
4136			this.each(function() {
4137				var methodValue,
4138					instance = $.data( this, fullName );
4139				if ( !instance ) {
4140					return $.error( "cannot call methods on " + name + " prior to initialization; " +
4141						"attempted to call method '" + options + "'" );
4142				}
4143				if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
4144					return $.error( "no such method '" + options + "' for " + name + " widget instance" );
4145				}
4146				methodValue = instance[ options ].apply( instance, args );
4147				if ( methodValue !== instance && methodValue !== undefined ) {
4148					returnValue = methodValue && methodValue.jquery ?
4149						returnValue.pushStack( methodValue.get() ) :
4150						methodValue;
4151					return false;
4152				}
4153			});
4154		} else {
4155			this.each(function() {
4156				var instance = $.data( this, fullName );
4157				if ( instance ) {
4158					instance.option( options || {} )._init();
4159				} else {
4160					$.data( this, fullName, new object( options, this ) );
4161				}
4162			});
4163		}
4164
4165		return returnValue;
4166	};
4167};
4168
4169$.Widget = function( /* options, element */ ) {};
4170$.Widget._childConstructors = [];
4171
4172$.Widget.prototype = {
4173	widgetName: "widget",
4174	widgetEventPrefix: "",
4175	defaultElement: "<div>",
4176	options: {
4177		disabled: false,
4178
4179		// callbacks
4180		create: null
4181	},
4182	_createWidget: function( options, element ) {
4183		element = $( element || this.defaultElement || this )[ 0 ];
4184		this.element = $( element );
4185		this.uuid = uuid++;
4186		this.eventNamespace = "." + this.widgetName + this.uuid;
4187		this.options = $.widget.extend( {},
4188			this.options,
4189			this._getCreateOptions(),
4190			options );
4191
4192		this.bindings = $();
4193		this.hoverable = $();
4194		this.focusable = $();
4195
4196		if ( element !== this ) {
4197			// 1.9 BC for #7810
4198			// TODO remove dual storage
4199			$.data( element, this.widgetName, this );
4200			$.data( element, this.widgetFullName, this );
4201			this._on( true, this.element, {
4202				remove: function( event ) {
4203					if ( event.target === element ) {
4204						this.destroy();
4205					}
4206				}
4207			});
4208			this.document = $( element.style ?
4209				// element within the document
4210				element.ownerDocument :
4211				// element is window or document
4212				element.document || element );
4213			this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
4214		}
4215
4216		this._create();
4217		this._trigger( "create", null, this._getCreateEventData() );
4218		this._init();
4219	},
4220	_getCreateOptions: $.noop,
4221	_getCreateEventData: $.noop,
4222	_create: $.noop,
4223	_init: $.noop,
4224
4225	destroy: function() {
4226		this._destroy();
4227		// we can probably remove the unbind calls in 2.0
4228		// all event bindings should go through this._on()
4229		this.element
4230			.unbind( this.eventNamespace )
4231			// 1.9 BC for #7810
4232			// TODO remove dual storage
4233			.removeData( this.widgetName )
4234			.removeData( this.widgetFullName )
4235			// support: jquery <1.6.3
4236			// http://bugs.jquery.com/ticket/9413
4237			.removeData( $.camelCase( this.widgetFullName ) );
4238		this.widget()
4239			.unbind( this.eventNamespace )
4240			.removeAttr( "aria-disabled" )
4241			.removeClass(
4242				this.widgetFullName + "-disabled " +
4243				"ui-state-disabled" );
4244
4245		// clean up events and states
4246		this.bindings.unbind( this.eventNamespace );
4247		this.hoverable.removeClass( "ui-state-hover" );
4248		this.focusable.removeClass( "ui-state-focus" );
4249	},
4250	_destroy: $.noop,
4251
4252	widget: function() {
4253		return this.element;
4254	},
4255
4256	option: function( key, value ) {
4257		var options = key,
4258			parts,
4259			curOption,
4260			i;
4261
4262		if ( arguments.length === 0 ) {
4263			// don't return a reference to the internal hash
4264			return $.widget.extend( {}, this.options );
4265		}
4266
4267		if ( typeof key === "string" ) {
4268			// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
4269			options = {};
4270			parts = key.split( "." );
4271			key = parts.shift();
4272			if ( parts.length ) {
4273				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
4274				for ( i = 0; i < parts.length - 1; i++ ) {
4275					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
4276					curOption = curOption[ parts[ i ] ];
4277				}
4278				key = parts.pop();
4279				if ( value === undefined ) {
4280					return curOption[ key ] === undefined ? null : curOption[ key ];
4281				}
4282				curOption[ key ] = value;
4283			} else {
4284				if ( value === undefined ) {
4285					return this.options[ key ] === undefined ? null : this.options[ key ];
4286				}
4287				options[ key ] = value;
4288			}
4289		}
4290
4291		this._setOptions( options );
4292
4293		return this;
4294	},
4295	_setOptions: function( options ) {
4296		var key;
4297
4298		for ( key in options ) {
4299			this._setOption( key, options[ key ] );
4300		}
4301
4302		return this;
4303	},
4304	_setOption: function( key, value ) {
4305		this.options[ key ] = value;
4306
4307		if ( key === "disabled" ) {
4308			this.widget()
4309				.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
4310				.attr( "aria-disabled", value );
4311			this.hoverable.removeClass( "ui-state-hover" );
4312			this.focusable.removeClass( "ui-state-focus" );
4313		}
4314
4315		return this;
4316	},
4317
4318	enable: function() {
4319		return this._setOption( "disabled", false );
4320	},
4321	disable: function() {
4322		return this._setOption( "disabled", true );
4323	},
4324
4325	_on: function( suppressDisabledCheck, element, handlers ) {
4326		var delegateElement,
4327			instance = this;
4328
4329		// no suppressDisabledCheck flag, shuffle arguments
4330		if ( typeof suppressDisabledCheck !== "boolean" ) {
4331			handlers = element;
4332			element = suppressDisabledCheck;
4333			suppressDisabledCheck = false;
4334		}
4335
4336		// no element argument, shuffle and use this.element
4337		if ( !handlers ) {
4338			handlers = element;
4339			element = this.element;
4340			delegateElement = this.widget();
4341		} else {
4342			// accept selectors, DOM elements
4343			element = delegateElement = $( element );
4344			this.bindings = this.bindings.add( element );
4345		}
4346
4347		$.each( handlers, function( event, handler ) {
4348			function handlerProxy() {
4349				// allow widgets to customize the disabled handling
4350				// - disabled as an array instead of boolean
4351				// - disabled class as method for disabling individual parts
4352				if ( !suppressDisabledCheck &&
4353						( instance.options.disabled === true ||
4354							$( this ).hasClass( "ui-state-disabled" ) ) ) {
4355					return;
4356				}
4357				return ( typeof handler === "string" ? instance[ handler ] : handler )
4358					.apply( instance, arguments );
4359			}
4360
4361			// copy the guid so direct unbinding works
4362			if ( typeof handler !== "string" ) {
4363				handlerProxy.guid = handler.guid =
4364					handler.guid || handlerProxy.guid || $.guid++;
4365			}
4366
4367			var match = event.match( /^(\w+)\s*(.*)$/ ),
4368				eventName = match[1] + instance.eventNamespace,
4369				selector = match[2];
4370			if ( selector ) {
4371				delegateElement.delegate( selector, eventName, handlerProxy );
4372			} else {
4373				element.bind( eventName, handlerProxy );
4374			}
4375		});
4376	},
4377
4378	_off: function( element, eventName ) {
4379		eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
4380		element.unbind( eventName ).undelegate( eventName );
4381	},
4382
4383	_delay: function( handler, delay ) {
4384		function handlerProxy() {
4385			return ( typeof handler === "string" ? instance[ handler ] : handler )
4386				.apply( instance, arguments );
4387		}
4388		var instance = this;
4389		return setTimeout( handlerProxy, delay || 0 );
4390	},
4391
4392	_hoverable: function( element ) {
4393		this.hoverable = this.hoverable.add( element );
4394		this._on( element, {
4395			mouseenter: function( event ) {
4396				$( event.currentTarget ).addClass( "ui-state-hover" );
4397			},
4398			mouseleave: function( event ) {
4399				$( event.currentTarget ).removeClass( "ui-state-hover" );
4400			}
4401		});
4402	},
4403
4404	_focusable: function( element ) {
4405		this.focusable = this.focusable.add( element );
4406		this._on( element, {
4407			focusin: function( event ) {
4408				$( event.currentTarget ).addClass( "ui-state-focus" );
4409			},
4410			focusout: function( event ) {
4411				$( event.currentTarget ).removeClass( "ui-state-focus" );
4412			}
4413		});
4414	},
4415
4416	_trigger: function( type, event, data ) {
4417		var prop, orig,
4418			callback = this.options[ type ];
4419
4420		data = data || {};
4421		event = $.Event( event );
4422		event.type = ( type === this.widgetEventPrefix ?
4423			type :
4424			this.widgetEventPrefix + type ).toLowerCase();
4425		// the original event may come from any element
4426		// so we need to reset the target on the new event
4427		event.target = this.element[ 0 ];
4428
4429		// copy original event properties over to the new event
4430		orig = event.originalEvent;
4431		if ( orig ) {
4432			for ( prop in orig ) {
4433				if ( !( prop in event ) ) {
4434					event[ prop ] = orig[ prop ];
4435				}
4436			}
4437		}
4438
4439		this.element.trigger( event, data );
4440		return !( $.isFunction( callback ) &&
4441			callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
4442			event.isDefaultPrevented() );
4443	}
4444};
4445
4446$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
4447	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
4448		if ( typeof options === "string" ) {
4449			options = { effect: options };
4450		}
4451		var hasOptions,
4452			effectName = !options ?
4453				method :
4454				options === true || typeof options === "number" ?
4455					defaultEffect :
4456					options.effect || defaultEffect;
4457		options = options || {};
4458		if ( typeof options === "number" ) {
4459			options = { duration: options };
4460		}
4461		hasOptions = !$.isEmptyObject( options );
4462		options.complete = callback;
4463		if ( options.delay ) {
4464			element.delay( options.delay );
4465		}
4466		if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) {
4467			element[ method ]( options );
4468		} else if ( effectName !== method && element[ effectName ] ) {
vendor: 4,170 bytes, lines 4469-4623
4469			element[ effectName ]( options.duration, options.easing, callback );
4470		} else {
4471			element.queue(function( next ) {
4472				$( this )[ method ]();
4473				if ( callback ) {
4474					callback.call( element[ 0 ] );
4475				}
4476				next();
4477			});
4478		}
4479	};
4480});
4481
4482// DEPRECATED
4483if ( $.uiBackCompat !== false ) {
4484	$.Widget.prototype._getCreateOptions = function() {
4485		return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
4486	};
4487}
4488
4489})( jQuery );
4490(function( $, undefined ) {
4491
4492var mouseHandled = false;
4493$( document ).mouseup( function( e ) {
4494	mouseHandled = false;
4495});
4496
4497$.widget("ui.mouse", {
4498	version: "1.9.2",
4499	options: {
4500		cancel: 'input,textarea,button,select,option',
4501		distance: 1,
4502		delay: 0
4503	},
4504	_mouseInit: function() {
4505		var that = this;
4506
4507		this.element
4508			.bind('mousedown.'+this.widgetName, function(event) {
4509				return that._mouseDown(event);
4510			})
4511			.bind('click.'+this.widgetName, function(event) {
4512				if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) {
4513					$.removeData(event.target, that.widgetName + '.preventClickEvent');
4514					event.stopImmediatePropagation();
4515					return false;
4516				}
4517			});
4518
4519		this.started = false;
4520	},
4521
4522	// TODO: make sure destroying one instance of mouse doesn't mess with
4523	// other instances of mouse
4524	_mouseDestroy: function() {
4525		this.element.unbind('.'+this.widgetName);
4526		if ( this._mouseMoveDelegate ) {
4527			$(document)
4528				.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
4529				.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
4530		}
4531	},
4532
4533	_mouseDown: function(event) {
4534		// don't let more than one widget handle mouseStart
4535		if( mouseHandled ) { return; }
4536
4537		// we may have missed mouseup (out of window)
4538		(this._mouseStarted && this._mouseUp(event));
4539
4540		this._mouseDownEvent = event;
4541
4542		var that = this,
4543			btnIsLeft = (event.which === 1),
4544			// event.target.nodeName works around a bug in IE 8 with
4545			// disabled inputs (#7620)
4546			elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
4547		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
4548			return true;
4549		}
4550
4551		this.mouseDelayMet = !this.options.delay;
4552		if (!this.mouseDelayMet) {
4553			this._mouseDelayTimer = setTimeout(function() {
4554				that.mouseDelayMet = true;
4555			}, this.options.delay);
4556		}
4557
4558		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
4559			this._mouseStarted = (this._mouseStart(event) !== false);
4560			if (!this._mouseStarted) {
4561				event.preventDefault();
4562				return true;
4563			}
4564		}
4565
4566		// Click event may never have fired (Gecko & Opera)
4567		if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
4568			$.removeData(event.target, this.widgetName + '.preventClickEvent');
4569		}
4570
4571		// these delegates are required to keep context
4572		this._mouseMoveDelegate = function(event) {
4573			return that._mouseMove(event);
4574		};
4575		this._mouseUpDelegate = function(event) {
4576			return that._mouseUp(event);
4577		};
4578		$(document)
4579			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
4580			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
4581
4582		event.preventDefault();
4583
4584		mouseHandled = true;
4585		return true;
4586	},
4587
4588	_mouseMove: function(event) {
4589		// IE mouseup check - mouseup happened when mouse was out of window
4590		if ($.ui.ie && !(document.documentMode >= 9) && !event.button) {
4591			return this._mouseUp(event);
4592		}
4593
4594		if (this._mouseStarted) {
4595			this._mouseDrag(event);
4596			return event.preventDefault();
4597		}
4598
4599		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
4600			this._mouseStarted =
4601				(this._mouseStart(this._mouseDownEvent, event) !== false);
4602			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
4603		}
4604
4605		return !this._mouseStarted;
4606	},
4607
4608	_mouseUp: function(event) {
4609		$(document)
4610			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
4611			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
4612
4613		if (this._mouseStarted) {
4614			this._mouseStarted = false;
4615
4616			if (event.target === this._mouseDownEvent.target) {
4617				$.data(event.target, this.widgetName + '.preventClickEvent', true);
4618			}
4619
4620			this._mouseStop(event);
4621		}
4622
4623		return false;
4624	},
4625
4626	_mouseDistanceMet: function(event) {
4627		return (Math.max(
4628				Math.abs(this._mouseDownEvent.pageX - event.pageX),
4629				Math.abs(this._mouseDownEvent.pageY - event.pageY)
4630			) >= this.options.distance
4631		);
4632	},
4633
4634	_mouseDelayMet: function(event) {
4635		return this.mouseDelayMet;
4636	},
4637
4638	// These are placeholder methods, to be overriden by extending plugin
4639	_mouseStart: function(event) {},
4640	_mouseDrag: function(event) {},
4641	_mouseStop: function(event) {},
4642	_mouseCapture: function(event) { return true; }
4643});
4644
4645})(jQuery);
4646(function( $, undefined ) {
4647
4648$.ui = $.ui || {};
4649
4650var cachedScrollbarWidth,
4651	max = Math.max,
4652	abs = Math.abs,
4653	round = Math.round,
4654	rhorizontal = /left|center|right/,
4655	rvertical = /top|center|bottom/,
4656	roffset = /[\+\-]\d+%?/,
4657	rposition = /^\w+/,
4658	rpercent = /%$/,
4659	_position = $.fn.position;
4660
4661function getOffsets( offsets, width, height ) {
4662	return [
4663		parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
4664		parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
4665	];
4666}
4667function parseCss( element, property ) {
4668	return parseInt( $.css( element, property ), 10 ) || 0;
4669}
4670
4671$.position = {
4672	scrollbarWidth: function() {
4673		if ( cachedScrollbarWidth !== undefined ) {
4674			return cachedScrollbarWidth;
4675		}
4676		var w1, w2,
4677			div = $( "<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
4678			innerDiv = div.children()[0];
4679
4680		$( "body" ).append( div );
4681		w1 = innerDiv.offsetWidth;
4682		div.css( "overflow", "scroll" );
4683
4684		w2 = innerDiv.offsetWidth;
4685
4686		if ( w1 === w2 ) {
4687			w2 = div[0].clientWidth;
4688		}
4689
4690		div.remove();
4691
4692		return (cachedScrollbarWidth = w1 - w2);
4693	},
4694	getScrollInfo: function( within ) {
4695		var overflowX = within.isWindow ? "" : within.element.css( "overflow-x" ),
4696			overflowY = within.isWindow ? "" : within.element.css( "overflow-y" ),
4697			hasOverflowX = overflowX === "scroll" ||
4698				( overflowX === "auto" && within.width < within.element[0].scrollWidth ),
4699			hasOverflowY = overflowY === "scroll" ||
4700				( overflowY === "auto" && within.height < within.element[0].scrollHeight );
4701		return {
4702			width: hasOverflowX ? $.position.scrollbarWidth() : 0,
4703			height: hasOverflowY ? $.position.scrollbarWidth() : 0
4704		};
4705	},
4706	getWithinInfo: function( element ) {
4707		var withinElement = $( element || window ),
4708			isWindow = $.isWindow( withinElement[0] );
4709		return {
4710			element: withinElement,
4711			isWindow: isWindow,
4712			offset: withinElement.offset() || { left: 0, top: 0 },
4713			scrollLeft: withinElement.scrollLeft(),
4714			scrollTop: withinElement.scrollTop(),
4715			width: isWindow ? withinElement.width() : withinElement.outerWidth(),
4716			height: isWindow ? withinElement.height() : withinElement.outerHeight()
4717		};
4718	}
4719};
4720
4721$.fn.position = function( options ) {
4722	if ( !options || !options.of ) {
4723		return _position.apply( this, arguments );
4724	}
4725
4726	// make a copy, we don't want to modify arguments
4727	options = $.extend( {}, options );
4728
4729	var atOffset, targetWidth, targetHeight, targetOffset, basePosition,
4730		target = $( options.of ),
4731		within = $.position.getWithinInfo( options.within ),
4732		scrollInfo = $.position.getScrollInfo( within ),
4733		targetElem = target[0],
4734		collision = ( options.collision || "flip" ).split( " " ),
4735		offsets = {};
4736
4737	if ( targetElem.nodeType === 9 ) {
4738		targetWidth = target.width();
4739		targetHeight = target.height();
4740		targetOffset = { top: 0, left: 0 };
4741	} else if ( $.isWindow( targetElem ) ) {
4742		targetWidth = target.width();
4743		targetHeight = target.height();
4744		targetOffset = { top: target.scrollTop(), left: target.scrollLeft() };
4745	} else if ( targetElem.preventDefault ) {
4746		// force left top to allow flipping
4747		options.at = "left top";
4748		targetWidth = targetHeight = 0;
4749		targetOffset = { top: targetElem.pageY, left: targetElem.pageX };
4750	} else {
4751		targetWidth = target.outerWidth();
4752		targetHeight = target.outerHeight();
4753		targetOffset = target.offset();
4754	}
4755	// clone to reuse original targetOffset later
4756	basePosition = $.extend( {}, targetOffset );
4757
4758	// force my and at to have valid horizontal and vertical positions
4759	// if a value is missing or invalid, it will be converted to center
4760	$.each( [ "my", "at" ], function() {
4761		var pos = ( options[ this ] || "" ).split( " " ),
4762			horizontalOffset,
4763			verticalOffset;
4764
4765		if ( pos.length === 1) {
4766			pos = rhorizontal.test( pos[ 0 ] ) ?
vendor: 12,659 bytes, lines 4767-5164
4767				pos.concat( [ "center" ] ) :
4768				rvertical.test( pos[ 0 ] ) ?
4769					[ "center" ].concat( pos ) :
4770					[ "center", "center" ];
4771		}
4772		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
4773		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
4774
4775		// calculate offsets
4776		horizontalOffset = roffset.exec( pos[ 0 ] );
4777		verticalOffset = roffset.exec( pos[ 1 ] );
4778		offsets[ this ] = [
4779			horizontalOffset ? horizontalOffset[ 0 ] : 0,
4780			verticalOffset ? verticalOffset[ 0 ] : 0
4781		];
4782
4783		// reduce to just the positions without the offsets
4784		options[ this ] = [
4785			rposition.exec( pos[ 0 ] )[ 0 ],
4786			rposition.exec( pos[ 1 ] )[ 0 ]
4787		];
4788	});
4789
4790	// normalize collision option
4791	if ( collision.length === 1 ) {
4792		collision[ 1 ] = collision[ 0 ];
4793	}
4794
4795	if ( options.at[ 0 ] === "right" ) {
4796		basePosition.left += targetWidth;
4797	} else if ( options.at[ 0 ] === "center" ) {
4798		basePosition.left += targetWidth / 2;
4799	}
4800
4801	if ( options.at[ 1 ] === "bottom" ) {
4802		basePosition.top += targetHeight;
4803	} else if ( options.at[ 1 ] === "center" ) {
4804		basePosition.top += targetHeight / 2;
4805	}
4806
4807	atOffset = getOffsets( offsets.at, targetWidth, targetHeight );
4808	basePosition.left += atOffset[ 0 ];
4809	basePosition.top += atOffset[ 1 ];
4810
4811	return this.each(function() {
4812		var collisionPosition, using,
4813			elem = $( this ),
4814			elemWidth = elem.outerWidth(),
4815			elemHeight = elem.outerHeight(),
4816			marginLeft = parseCss( this, "marginLeft" ),
4817			marginTop = parseCss( this, "marginTop" ),
4818			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
4819			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
4820			position = $.extend( {}, basePosition ),
4821			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
4822
4823		if ( options.my[ 0 ] === "right" ) {
4824			position.left -= elemWidth;
4825		} else if ( options.my[ 0 ] === "center" ) {
4826			position.left -= elemWidth / 2;
4827		}
4828
4829		if ( options.my[ 1 ] === "bottom" ) {
4830			position.top -= elemHeight;
4831		} else if ( options.my[ 1 ] === "center" ) {
4832			position.top -= elemHeight / 2;
4833		}
4834
4835		position.left += myOffset[ 0 ];
4836		position.top += myOffset[ 1 ];
4837
4838		// if the browser doesn't support fractions, then round for consistent results
4839		if ( !$.support.offsetFractions ) {
4840			position.left = round( position.left );
4841			position.top = round( position.top );
4842		}
4843
4844		collisionPosition = {
4845			marginLeft: marginLeft,
4846			marginTop: marginTop
4847		};
4848
4849		$.each( [ "left", "top" ], function( i, dir ) {
4850			if ( $.ui.position[ collision[ i ] ] ) {
4851				$.ui.position[ collision[ i ] ][ dir ]( position, {
4852					targetWidth: targetWidth,
4853					targetHeight: targetHeight,
4854					elemWidth: elemWidth,
4855					elemHeight: elemHeight,
4856					collisionPosition: collisionPosition,
4857					collisionWidth: collisionWidth,
4858					collisionHeight: collisionHeight,
4859					offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ],
4860					my: options.my,
4861					at: options.at,
4862					within: within,
4863					elem : elem
4864				});
4865			}
4866		});
4867
4868		if ( $.fn.bgiframe ) {
4869			elem.bgiframe();
4870		}
4871
4872		if ( options.using ) {
4873			// adds feedback as second argument to using callback, if present
4874			using = function( props ) {
4875				var left = targetOffset.left - position.left,
4876					right = left + targetWidth - elemWidth,
4877					top = targetOffset.top - position.top,
4878					bottom = top + targetHeight - elemHeight,
4879					feedback = {
4880						target: {
4881							element: target,
4882							left: targetOffset.left,
4883							top: targetOffset.top,
4884							width: targetWidth,
4885							height: targetHeight
4886						},
4887						element: {
4888							element: elem,
4889							left: position.left,
4890							top: position.top,
4891							width: elemWidth,
4892							height: elemHeight
4893						},
4894						horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
4895						vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
4896					};
4897				if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
4898					feedback.horizontal = "center";
4899				}
4900				if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) {
4901					feedback.vertical = "middle";
4902				}
4903				if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) {
4904					feedback.important = "horizontal";
4905				} else {
4906					feedback.important = "vertical";
4907				}
4908				options.using.call( this, props, feedback );
4909			};
4910		}
4911
4912		elem.offset( $.extend( position, { using: using } ) );
4913	});
4914};
4915
4916$.ui.position = {
4917	fit: {
4918		left: function( position, data ) {
4919			var within = data.within,
4920				withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
4921				outerWidth = within.width,
4922				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
4923				overLeft = withinOffset - collisionPosLeft,
4924				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
4925				newOverRight;
4926
4927			// element is wider than within
4928			if ( data.collisionWidth > outerWidth ) {
4929				// element is initially over the left side of within
4930				if ( overLeft > 0 && overRight <= 0 ) {
4931					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
4932					position.left += overLeft - newOverRight;
4933				// element is initially over right side of within
4934				} else if ( overRight > 0 && overLeft <= 0 ) {
4935					position.left = withinOffset;
4936				// element is initially over both left and right sides of within
4937				} else {
4938					if ( overLeft > overRight ) {
4939						position.left = withinOffset + outerWidth - data.collisionWidth;
4940					} else {
4941						position.left = withinOffset;
4942					}
4943				}
4944			// too far left -> align with left edge
4945			} else if ( overLeft > 0 ) {
4946				position.left += overLeft;
4947			// too far right -> align with right edge
4948			} else if ( overRight > 0 ) {
4949				position.left -= overRight;
4950			// adjust based on position and margin
4951			} else {
4952				position.left = max( position.left - collisionPosLeft, position.left );
4953			}
4954		},
4955		top: function( position, data ) {
4956			var within = data.within,
4957				withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
4958				outerHeight = data.within.height,
4959				collisionPosTop = position.top - data.collisionPosition.marginTop,
4960				overTop = withinOffset - collisionPosTop,
4961				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
4962				newOverBottom;
4963
4964			// element is taller than within
4965			if ( data.collisionHeight > outerHeight ) {
4966				// element is initially over the top of within
4967				if ( overTop > 0 && overBottom <= 0 ) {
4968					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
4969					position.top += overTop - newOverBottom;
4970				// element is initially over bottom of within
4971				} else if ( overBottom > 0 && overTop <= 0 ) {
4972					position.top = withinOffset;
4973				// element is initially over both top and bottom of within
4974				} else {
4975					if ( overTop > overBottom ) {
4976						position.top = withinOffset + outerHeight - data.collisionHeight;
4977					} else {
4978						position.top = withinOffset;
4979					}
4980				}
4981			// too far up -> align with top
4982			} else if ( overTop > 0 ) {
4983				position.top += overTop;
4984			// too far down -> align with bottom edge
4985			} else if ( overBottom > 0 ) {
4986				position.top -= overBottom;
4987			// adjust based on position and margin
4988			} else {
4989				position.top = max( position.top - collisionPosTop, position.top );
4990			}
4991		}
4992	},
4993	flip: {
4994		left: function( position, data ) {
4995			var within = data.within,
4996				withinOffset = within.offset.left + within.scrollLeft,
4997				outerWidth = within.width,
4998				offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
4999				collisionPosLeft = position.left - data.collisionPosition.marginLeft,
5000				overLeft = collisionPosLeft - offsetLeft,
5001				overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
5002				myOffset = data.my[ 0 ] === "left" ?
5003					-data.elemWidth :
5004					data.my[ 0 ] === "right" ?
5005						data.elemWidth :
5006						0,
5007				atOffset = data.at[ 0 ] === "left" ?
5008					data.targetWidth :
5009					data.at[ 0 ] === "right" ?
5010						-data.targetWidth :
5011						0,
5012				offset = -2 * data.offset[ 0 ],
5013				newOverRight,
5014				newOverLeft;
5015
5016			if ( overLeft < 0 ) {
5017				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
5018				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
5019					position.left += myOffset + atOffset + offset;
5020				}
5021			}
5022			else if ( overRight > 0 ) {
5023				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
5024				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
5025					position.left += myOffset + atOffset + offset;
5026				}
5027			}
5028		},
5029		top: function( position, data ) {
5030			var within = data.within,
5031				withinOffset = within.offset.top + within.scrollTop,
5032				outerHeight = within.height,
5033				offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
5034				collisionPosTop = position.top - data.collisionPosition.marginTop,
5035				overTop = collisionPosTop - offsetTop,
5036				overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
5037				top = data.my[ 1 ] === "top",
5038				myOffset = top ?
5039					-data.elemHeight :
5040					data.my[ 1 ] === "bottom" ?
5041						data.elemHeight :
5042						0,
5043				atOffset = data.at[ 1 ] === "top" ?
5044					data.targetHeight :
5045					data.at[ 1 ] === "bottom" ?
5046						-data.targetHeight :
5047						0,
5048				offset = -2 * data.offset[ 1 ],
5049				newOverTop,
5050				newOverBottom;
5051			if ( overTop < 0 ) {
5052				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
5053				if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
5054					position.top += myOffset + atOffset + offset;
5055				}
5056			}
5057			else if ( overBottom > 0 ) {
5058				newOverTop = position.top -  data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
5059				if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
5060					position.top += myOffset + atOffset + offset;
5061				}
5062			}
5063		}
5064	},
5065	flipfit: {
5066		left: function() {
5067			$.ui.position.flip.left.apply( this, arguments );
5068			$.ui.position.fit.left.apply( this, arguments );
5069		},
5070		top: function() {
5071			$.ui.position.flip.top.apply( this, arguments );
5072			$.ui.position.fit.top.apply( this, arguments );
5073		}
5074	}
5075};
5076
5077// fraction support test
5078(function () {
5079	var testElement, testElementParent, testElementStyle, offsetLeft, i,
5080		body = document.getElementsByTagName( "body" )[ 0 ],
5081		div = document.createElement( "div" );
5082
5083	//Create a "fake body" for testing based on method used in jQuery.support
5084	testElement = document.createElement( body ? "div" : "body" );
5085	testElementStyle = {
5086		visibility: "hidden",
5087		width: 0,
5088		height: 0,
5089		border: 0,
5090		margin: 0,
5091		background: "none"
5092	};
5093	if ( body ) {
5094		$.extend( testElementStyle, {
5095			position: "absolute",
5096			left: "-1000px",
5097			top: "-1000px"
5098		});
5099	}
5100	for ( i in testElementStyle ) {
5101		testElement.style[ i ] = testElementStyle[ i ];
5102	}
5103	testElement.appendChild( div );
5104	testElementParent = body || document.documentElement;
5105	testElementParent.insertBefore( testElement, testElementParent.firstChild );
5106
5107	div.style.cssText = "position: absolute; left: 10.7432222px;";
5108
5109	offsetLeft = $( div ).offset().left;
5110	$.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
5111
5112	testElement.innerHTML = "";
5113	testElementParent.removeChild( testElement );
5114})();
5115
5116// DEPRECATED
5117if ( $.uiBackCompat !== false ) {
5118	// offset option
5119	(function( $ ) {
5120		var _position = $.fn.position;
5121		$.fn.position = function( options ) {
5122			if ( !options || !options.offset ) {
5123				return _position.call( this, options );
5124			}
5125			var offset = options.offset.split( " " ),
5126				at = options.at.split( " " );
5127			if ( offset.length === 1 ) {
5128				offset[ 1 ] = offset[ 0 ];
5129			}
5130			if ( /^\d/.test( offset[ 0 ] ) ) {
5131				offset[ 0 ] = "+" + offset[ 0 ];
5132			}
5133			if ( /^\d/.test( offset[ 1 ] ) ) {
5134				offset[ 1 ] = "+" + offset[ 1 ];
5135			}
5136			if ( at.length === 1 ) {
5137				if ( /left|center|right/.test( at[ 0 ] ) ) {
5138					at[ 1 ] = "center";
5139				} else {
5140					at[ 1 ] = at[ 0 ];
5141					at[ 0 ] = "center";
5142				}
5143			}
5144			return _position.call( this, $.extend( options, {
5145				at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ],
5146				offset: undefined
5147			} ) );
5148		};
5149	}( jQuery ) );
5150}
5151
5152}( jQuery ) );
5153(function( $, undefined ) {
5154
5155$.widget("ui.draggable", $.ui.mouse, {
5156	version: "1.9.2",
5157	widgetEventPrefix: "drag",
5158	options: {
5159		addClasses: true,
5160		appendTo: "parent",
5161		axis: false,
5162		connectToSortable: false,
5163		containment: false,
5164		cursor: "auto",
5165		cursorAt: false,
5166		grid: false,
5167		handle: false,
5168		helper: "original",
5169		iframeFix: false,
5170		opacity: false,
5171		refreshPositions: false,
5172		revert: false,
5173		revertDuration: 500,
5174		scope: "default",
5175		scroll: true,
5176		scrollSensitivity: 20,
5177		scrollSpeed: 20,
5178		snap: false,
5179		snapMode: "both",
5180		snapTolerance: 20,
5181		stack: false,
5182		zIndex: false
5183	},
5184	_create: function() {
5185
5186		if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
5187			this.element[0].style.position = 'relative';
5188
5189		(this.options.addClasses && this.element.addClass("ui-draggable"));
5190		(this.options.disabled && this.element.addClass("ui-draggable-disabled"));
5191
5192		this._mouseInit();
5193
5194	},
5195
5196	_destroy: function() {
5197		this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
5198		this._mouseDestroy();
5199	},
5200
5201	_mouseCapture: function(event) {
5202
5203		var o = this.options;
5204
5205		// among others, prevent a drag on a resizable-handle
5206		if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
5207			return false;
5208
5209		//Quit if we're not on a valid handle
5210		this.handle = this._getHandle(event);
5211		if (!this.handle)
5212			return false;
5213
5214		$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
5215			$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
5216			.css({
5217				width: this.offsetWidth+"px", height: this.offsetHeight+"px",
5218				position: "absolute", opacity: "0.001", zIndex: 1000
5219			})
5220			.css($(this).offset())
5221			.appendTo("body");
5222		});
5223
5224		return true;
5225
5226	},
5227
5228	_mouseStart: function(event) {
5229
5230		var o = this.options;
5231
5232		//Create and append the visible helper
5233		this.helper = this._createHelper(event);
5234
5235		this.helper.addClass("ui-draggable-dragging");
5236
5237		//Cache the helper size
5238		this._cacheHelperProportions();
5239
5240		//If ddmanager is used for droppables, set the global draggable
5241		if($.ui.ddmanager)
5242			$.ui.ddmanager.current = this;
5243
5244		/*
5245		 * - Position generation -
5246		 * This block generates everything position related - it's the core of draggables.
5247		 */
5248
5249		//Cache the margins of the original element
5250		this._cacheMargins();
5251
5252		//Store the helper's css position
5253		this.cssPosition = this.helper.css("position");
5254		this.scrollParent = this.helper.scrollParent();
5255
5256		//The element's absolute position on the page minus margins
5257		this.offset = this.positionAbs = this.element.offset();
5258		this.offset = {
5259			top: this.offset.top - this.margins.top,
5260			left: this.offset.left - this.margins.left
5261		};
5262
5263		$.extend(this.offset, {
5264			click: { //Where the click happened, relative to the element
5265				left: event.pageX - this.offset.left,
5266				top: event.pageY - this.offset.top
5267			},
5268			parent: this._getParentOffset(),
5269			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
5270		});
5271
5272		//Generate the original position
5273		this.originalPosition = this.position = this._generatePosition(event);
5274		this.originalPageX = event.pageX;
5275		this.originalPageY = event.pageY;
5276
5277		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
5278		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
5279
5280		//Set a containment if given in the options
5281		if(o.containment)
5282			this._setContainment();
5283
5284		//Trigger event + callbacks
5285		if(this._trigger("start", event) === false) {
5286			this._clear();
5287			return false;
5288		}
5289
5290		//Recache the helper size
5291		this._cacheHelperProportions();
5292
5293		//Prepare the droppable offsets
5294		if ($.ui.ddmanager && !o.dropBehaviour)
5295			$.ui.ddmanager.prepareOffsets(this, event);
5296
5297
5298		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
5299
5300		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
5301		if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);
5302
5303		return true;
5304	},
5305
5306	_mouseDrag: function(event, noPropagation) {
5307
5308		//Compute the helpers position
5309		this.position = this._generatePosition(event);
5310		this.positionAbs = this._convertPositionTo("absolute");
5311
5312		//Call plugins and callbacks and use the resulting position if something is returned
5313		if (!noPropagation) {
5314			var ui = this._uiHash();
5315			if(this._trigger('drag', event, ui) === false) {
5316				this._mouseUp({});
5317				return false;
5318			}
5319			this.position = ui.position;
5320		}
5321
5322		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
5323		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
5324		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
5325
5326		return false;
5327	},
5328
5329	_mouseStop: function(event) {
5330
5331		//If we are using droppables, inform the manager about the drop
5332		var dropped = false;
5333		if ($.ui.ddmanager && !this.options.dropBehaviour)
5334			dropped = $.ui.ddmanager.drop(this, event);
5335
5336		//if a drop comes from outside (a sortable)
5337		if(this.dropped) {
5338			dropped = this.dropped;
5339			this.dropped = false;
5340		}
5341
5342		//if the original element is no longer in the DOM don't bother to continue (see #8269)
5343		var element = this.element[0], elementInDom = false;
5344		while ( element && (element = element.parentNode) ) {
5345			if (element == document ) {
5346				elementInDom = true;
5347			}
5348		}
5349		if ( !elementInDom && this.options.helper === "original" )
5350			return false;
5351
5352		if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
5353			var that = this;
5354			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
5355				if(that._trigger("stop", event) !== false) {
5356					that._clear();
5357				}
5358			});
5359		} else {
5360			if(this._trigger("stop", event) !== false) {
5361				this._clear();
5362			}
5363		}
5364
5365		return false;
5366	},
5367
5368	_mouseUp: function(event) {
5369		//Remove frame helpers
5370		$("div.ui-draggable-iframeFix").each(function() {
5371			this.parentNode.removeChild(this);
5372		});
5373
5374		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
5375		if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);
5376
5377		return $.ui.mouse.prototype._mouseUp.call(this, event);
5378	},
5379
5380	cancel: function() {
5381
5382		if(this.helper.is(".ui-draggable-dragging")) {
5383			this._mouseUp({});
5384		} else {
5385			this._clear();
5386		}
5387
5388		return this;
5389
5390	},
5391
5392	_getHandle: function(event) {
5393
5394		var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
5395		$(this.options.handle, this.element)
5396			.find("*")
5397			.andSelf()
5398			.each(function() {
5399				if(this == event.target) handle = true;
5400			});
5401
5402		return handle;
5403
5404	},
5405
5406	_createHelper: function(event) {
5407
5408		var o = this.options;
5409		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);
5410
5411		if(!helper.parents('body').length)
5412			helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
5413
5414		if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
5415			helper.css("position", "absolute");
5416
5417		return helper;
5418
5419	},
5420
5421	_adjustOffsetFromHelper: function(obj) {
5422		if (typeof obj == 'string') {
5423			obj = obj.split(' ');
5424		}
5425		if ($.isArray(obj)) {
5426			obj = {left: +obj[0], top: +obj[1] || 0};
5427		}
5428		if ('left' in obj) {
5429			this.offset.click.left = obj.left + this.margins.left;
5430		}
5431		if ('right' in obj) {
5432			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
5433		}
5434		if ('top' in obj) {
5435			this.offset.click.top = obj.top + this.margins.top;
5436		}
5437		if ('bottom' in obj) {
5438			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
5439		}
5440	},
5441
5442	_getParentOffset: function() {
5443
5444		//Get the offsetParent and cache its position
5445		this.offsetParent = this.helper.offsetParent();
5446		var po = this.offsetParent.offset();
5447
5448		// This is a special case where we need to modify a offset calculated on start, since the following happened:
5449		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
5450		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
5451		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
5452		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
5453			po.left += this.scrollParent.scrollLeft();
5454			po.top += this.scrollParent.scrollTop();
5455		}
5456
5457		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
5458		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix
5459			po = { top: 0, left: 0 };
5460
5461		return {
5462			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),
546210) || 0),
5463			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
5464		};
5465
5466	},
5467
5468	_getRelativeOffset: function() {
5469
5470		if(this.cssPosition == "relative") {
5471			var p = this.element.position();
5472			return {
5473				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
5474				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
5475			};
5476		} else {
5477			return { top: 0, left: 0 };
5478		}
5479
5480	},
5481
5482	_cacheMargins: function() {
5483		this.margins = {
5484			left: (parseInt(this.element.css("marginLeft"),10) || 0),
5485			top: (parseInt(this.element.css("marginTop"),10) || 0),
5486			right: (parseInt(this.element.css("marginRight"),10) || 0),
5487			bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
5488		};
5489	},
5490
5491	_cacheHelperProportions: function() {
5492		this.helperProportions = {
5493			width: this.helper.outerWidth(),
5494			height: this.helper.outerHeight()
5495		};
5496	},
5497
5498	_setContainment: function() {
5499
5500		var o = this.options;
5501		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
5502		if(o.containment == 'document' || o.containment == 'window') this.containment = [
5503			o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
5504			o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
5505			(o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
5506			(o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
5507		];
5508
5509		if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
5510			var c = $(o.containment);
5511			var ce = c[0]; if(!ce) return;
5512			var co = c.offset();
5513			var over = ($(ce).css("overflow") != 'hidden');
5514
5515			this.containment = [
5516				(parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0),
5517				(parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0),
5518				(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right,
5519				(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top  - this.margins.bottom
5520			];
5521			this.relative_container = c;
5522
5523		} else if(o.containment.constructor == Array) {
5524			this.containment = o.containment;
5525		}
5526
5527	},
5528
5529	_convertPositionTo: function(d, pos) {
5530
5531		if(!pos) pos = this.position;
5532		var mod = d == "absolute" ? 1 : -1;
5533		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
5534
5535		return {
5536			top: (
5537				pos.top																	// The absolute mouse position
5538				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
5539				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
5540				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
5541			),
5542			left: (
5543				pos.left																// The absolute mouse position
5544				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
5545				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
5546				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
5547			)
5548		};
5549
5550	},
5551
5552	_generatePosition: function(event) {
5553
5554		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
5555		var pageX = event.pageX;
5556		var pageY = event.pageY;
5557
5558		/*
5559		 * - Position constraining -
5560		 * Constrain the position to a mix of grid, containment.
5561		 */
5562
5563		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
5564			var containment;
5565			if(this.containment) {
5566			if (this.relative_container){
5567				var co = this.relative_container.offset();
5568				containment = [ this.containment[0] + co.left,
5569					this.containment[1] + co.top,
5570					this.containment[2] + co.left,
5571					this.containment[3] + co.top ];
5572			}
5573			else {
5574				containment = this.containment;
5575			}
5576
5577				if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left;
5578				if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top;
5579				if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left;
5580				if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top;
5581			}
5582
5583			if(o.grid) {
5584				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
5585				var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
5586				pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
5587
5588				var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
5589				pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
5590			}
5591
5592		}
5593
5594		return {
5595			top: (
5596				pageY																// The absolute mouse position
5597				- this.offset.click.top													// Click offset (relative to the element)
5598				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
5599				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
5600				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
5601			),
5602			left: (
5603				pageX																// The absolute mouse position
5604				- this.offset.click.left												// Click offset (relative to the element)
5605				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
5606				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
5607				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
5608			)
5609		};
5610
5611	},
5612
5613	_clear: function() {
5614		this.helper.removeClass("ui-draggable-dragging");
5615		if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
5616		//if($.ui.ddmanager) $.ui.ddmanager.current = null;
5617		this.helper = null;
5618		this.cancelHelperRemoval = false;
5619	},
5620
5621	// From now on bulk stuff - mainly helpers
5622
5623	_trigger: function(type, event, ui) {
5624		ui = ui || this._uiHash();
5625		$.ui.plugin.call(this, type, [event, ui]);
5626		if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
5627		return $.Widget.prototype._trigger.call(this, type, event, ui);
5628	},
5629
5630	plugins: {},
5631
5632	_uiHash: function(event) {
5633		return {
5634			helper: this.helper,
5635			position: this.position,
5636			originalPosition: this.originalPosition,
5637			offset: this.positionAbs
5638		};
5639	}
5640
5641});
5642
5643$.ui.plugin.add("draggable", "connectToSortable", {
5644	start: function(event, ui) {
5645
5646		var inst = $(this).data("draggable"), o = inst.options,
5647			uiSortable = $.extend({}, ui, { item: inst.element });
5648		inst.sortables = [];
5649		$(o.connectToSortable).each(function() {
5650			var sortable = $.data(this, 'sortable');
5651			if (sortable && !sortable.options.disabled) {
5652				inst.sortables.push({
5653					instance: sortable,
5654					shouldRevert: sortable.options.revert
5655				});
5656				sortable.refreshPositions();	// Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
5657				sortable._trigger("activate", event, uiSortable);
5658			}
5659		});
5660
5661	},
5662	stop: function(event, ui) {
5663
5664		//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
5665		var inst = $(this).data("draggable"),
5666			uiSortable = $.extend({}, ui, { item: inst.element });
5667
5668		$.each(inst.sortables, function() {
5669			if(this.instance.isOver) {
5670
5671				this.instance.isOver = 0;
5672
5673				inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
5674				this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
5675
5676				//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
5677				if(this.shouldRevert) this.instance.options.revert = true;
5678
5679				//Trigger the stop of the sortable
5680				this.instance._mouseStop(event);
5681
5682				this.instance.options.helper = this.instance.options._helper;
5683
5684				//If the helper has been the original item, restore properties in the sortable
5685				if(inst.options.helper == 'original')
5686					this.instance.currentItem.css({ top: 'auto', left: 'auto' });
5687
5688			} else {
5689				this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
5690				this.instance._trigger("deactivate", event, uiSortable);
5691			}
5692
5693		});
5694
5695	},
5696	drag: function(event, ui) {
5697
5698		var inst = $(this).data("draggable"), that = this;
5699
5700		var checkPos = function(o) {
5701			var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
5702			var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
5703			var itemHeight = o.height, itemWidth = o.width;
5704			var itemTop = o.top, itemLeft = o.left;
5705
5706			return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
5707		};
5708
5709		$.each(inst.sortables, function(i) {
5710
5711			var innermostIntersecting = false;
5712			var thisSortable = this;
5713			//Copy over some variables to allow calling the sortable's native _intersectsWith
5714			this.instance.positionAbs = inst.positionAbs;
5715			this.instance.helperProportions = inst.helperProportions;
5716			this.instance.offset.click = inst.offset.click;
5717
5718			if(this.instance._intersectsWith(this.instance.containerCache)) {
5719				innermostIntersecting = true;
5720				$.each(inst.sortables, function () {
5721					this.instance.positionAbs = inst.positionAbs;
5722					this.instance.helperProportions = inst.helperProportions;
5723					this.instance.offset.click = inst.offset.click;
5724					if  (this != thisSortable
5725						&& this.instance._intersectsWith(this.instance.containerCache)
5726						&& $.ui.contains(thisSortable.instance.element[0], this.instance.element[0]))
5727						innermostIntersecting = false;
5728						return innermostIntersecting;
5729				});
5730			}
5731
5732
5733			if(innermostIntersecting) {
5734				//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
5735				if(!this.instance.isOver) {
5736
5737					this.instance.isOver = 1;
5738					//Now we fake the start of dragging for the sortable instance,
5739					//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
5740					//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
5741					this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);
5742					this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
5743					this.instance.options.helper = function() { return ui.helper[0]; };
5744
5745					event.target = this.instance.currentItem[0];
5746					this.instance._mouseCapture(event, true);
5747					this.instance._mouseStart(event, true, true);
5748
5749					//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
5750					this.instance.offset.click.top = inst.offset.click.top;
5751					this.instance.offset.click.left = inst.offset.click.left;
5752					this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
5753					this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
5754
5755					inst._trigger("toSortable", event);
5756					inst.dropped = this.instance.element; //draggable revert needs that
5757					//hack so receive/update callbacks work (mostly)
5758					inst.currentItem = inst.element;
5759					this.instance.fromOutside = inst;
5760
5761				}
5762
5763				//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
5764				if(this.instance.currentItem) this.instance._mouseDrag(event);
5765
5766			} else {
5767
5768				//If it doesn't intersect with the sortable, and it intersected before,
5769				//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
5770				if(this.instance.isOver) {
5771
5772					this.instance.isOver = 0;
5773					this.instance.cancelHelperRemoval = true;
5774
5775					//Prevent reverting on this forced stop
5776					this.instance.options.revert = false;
5777
5778					// The out event needs to be triggered independently
5779					this.instance._trigger('out', event, this.instance._uiHash(this.instance));
5780
5781					this.instance._mouseStop(event, true);
5782					this.instance.options.helper = this.instance.options._helper;
5783
5784					//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
5785					this.instance.currentItem.remove();
5786					if(this.instance.placeholder) this.instance.placeholder.remove();
5787
5788					inst._trigger("fromSortable", event);
5789					inst.dropped = false; //draggable revert needs that
5790				}
5791
5792			};
5793
5794		});
5795
5796	}
5797});
5798
5799$.ui.plugin.add("draggable", "cursor", {
5800	start: function(event, ui) {
5801		var t = $('body'), o = $(this).data('draggable').options;
5802		if (t.css("cursor")) o._cursor = t.css("cursor");
5803		t.css("cursor", o.cursor);
5804	},
5805	stop: function(event, ui) {
5806		var o = $(this).data('draggable').options;
5807		if (o._cursor) $('body').css("cursor", o._cursor);
5808	}
5809});
5810
5811$.ui.plugin.add("draggable", "opacity", {
5812	start: function(event, ui) {
5813		var t = $(ui.helper), o = $(this).data('draggable').options;
5814		if(t.css("opacity")) o._opacity = t.css("opacity");
5815		t.css('opacity', o.opacity);
5816	},
5817	stop: function(event, ui) {
5818		var o = $(this).data('draggable').options;
5819		if(o._opacity) $(ui.helper).css('opacity', o._opacity);
5820	}
5821});
5822
5823$.ui.plugin.add("draggable", "scroll", {
5824	start: function(event, ui) {
5825		var i = $(this).data("draggable");
5826		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
5827	},
5828	drag: function(event, ui) {
5829
5830		var i = $(this).data("draggable"), o = i.options, scrolled = false;
5831
5832		if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
5833
5834			if(!o.axis || o.axis != 'x') {
5835				if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
5836					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
5837				else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
5838					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
5839			}
5840
5841			if(!o.axis || o.axis != 'y') {
5842				if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
5843					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
5844				else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
5845					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
5846			}
5847
5848		} else {
5849
5850			if(!o.axis || o.axis != 'x') {
5851				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
5852					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
5853				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
5854					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
5855			}
5856
5857			if(!o.axis || o.axis != 'y') {
5858				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
5859					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
5860				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
5861					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
5862			}
5863
5864		}
5865
5866		if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
5867			$.ui.ddmanager.prepareOffsets(i, event);
5868
5869	}
5870});
5871
5872$.ui.plugin.add("draggable", "snap", {
5873	start: function(event, ui) {
5874
5875		var i = $(this).data("draggable"), o = i.options;
5876		i.snapElements = [];
5877
5878		$(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
5879			var $t = $(this); var $o = $t.offset();
5880			if(this != i.element[0]) i.snapElements.push({
5881				item: this,
5882				width: $t.outerWidth(), height: $t.outerHeight(),
5883				top: $o.top, left: $o.left
5884			});
5885		});
5886
5887	},
5888	drag: function(event, ui) {
5889
5890		var inst = $(this).data("draggable"), o = inst.options;
5891		var d = o.snapTolerance;
5892
5893		var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
5894			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
5895
5896		for (var i = inst.snapElements.length - 1; i >= 0; i--){
5897
5898			var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
5899				t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
5900
5901			//Yes, I know, this is insane ;)
5902			if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
5903				if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
5904				inst.snapElements[i].snapping = false;
5905				continue;
5906			}
5907
5908			if(o.snapMode != 'inner') {
5909				var ts = Math.abs(t - y2) <= d;
5910				var bs = Math.abs(b - y1) <= d;
5911				var ls = Math.abs(l - x2) <= d;
5912				var rs = Math.abs(r - x1) <= d;
5913				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
5914				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
5915				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
5916				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
5917			}
5918
5919			var first = (ts || bs || ls || rs);
5920
5921			if(o.snapMode != 'outer') {
5922				var ts = Math.abs(t - y1) <= d;
5923				var bs = Math.abs(b - y2) <= d;
5924				var ls = Math.abs(l - x1) <= d;
5925				var rs = Math.abs(r - x2) <= d;
5926				if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
5927				if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
5928				if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
5929				if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
5930			}
5931
5932			if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
5933				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
5934			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
5935
5936		};
5937
5938	}
5939});
5940
5941$.ui.plugin.add("draggable", "stack", {
5942	start: function(event, ui) {
5943
5944		var o = $(this).data("draggable").options;
5945
5946		var group = $.makeArray($(o.stack)).sort(function(a,b) {
5947			return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
5948		});
5949		if (!group.length) { return; }
5950
5951		var min = parseInt(group[0].style.zIndex) || 0;
5952		$(group).each(function(i) {
5953			this.style.zIndex = min + i;
5954		});
5955
5956		this[0].style.zIndex = min + group.length;
5957
5958	}
5959});
5960
5961$.ui.plugin.add("draggable", "zIndex", {
5962	start: function(event, ui) {
5963		var t = $(ui.helper), o = $(this).data("draggable").options;
5964		if(t.css("zIndex")) o._zIndex = t.css("zIndex");
5965		t.css('zIndex', o.zIndex);
5966	},
5967	stop: function(event, ui) {
5968		var o = $(this).data("draggable").options;
5969		if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
5970	}
5971});
5972
5973})(jQuery);
5974(function( $, undefined ) {
5975
5976$.widget("ui.droppable", {
5977	version: "1.9.2",
5978	widgetEventPrefix: "drop",
5979	options: {
5980		accept: '*',
5981		activeClass: false,
5982		addClasses: true,
5983		greedy: false,
5984		hoverClass: false,
5985		scope: 'default',
5986		tolerance: 'intersect'
5987	},
5988	_create: function() {
5989
5990		var o = this.options, accept = o.accept;
5991		this.isover = 0; this.isout = 1;
5992
5993		this.accept = $.isFunction(accept) ? accept : function(d) {
5994			return d.is(accept);
5995		};
5996
5997		//Store the droppable's proportions
5998		this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
5999
6000		// Add the reference and positions to the manager
6001		$.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];
6002		$.ui.ddmanager.droppables[o.scope].push(this);
6003
6004		(o.addClasses && this.element.addClass("ui-droppable"));
6005
6006	},
6007
6008	_destroy: function() {
6009		var drop = $.ui.ddmanager.droppables[this.options.scope];
6010		for ( var i = 0; i < drop.length; i++ )
6011			if ( drop[i] == this )
6012				drop.splice(i, 1);
6013
6014		this.element.removeClass("ui-droppable ui-droppable-disabled");
6015	},
6016
6017	_setOption: function(key, value) {
6018
6019		if(key == 'accept') {
6020			this.accept = $.isFunction(value) ? value : function(d) {
6021				return d.is(value);
6022			};
6023		}
6024		$.Widget.prototype._setOption.apply(this, arguments);
6025	},
6026
6027	_activate: function(event) {
6028		var draggable = $.ui.ddmanager.current;
6029		if(this.options.activeClass) this.element.addClass(this.options.activeClass);
6030		(draggable && this._trigger('activate', event, this.ui(draggable)));
6031	},
6032
6033	_deactivate: function(event) {
6034		var draggable = $.ui.ddmanager.current;
6035		if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
6036		(draggable && this._trigger('deactivate', event, this.ui(draggable)));
6037	},
6038
6039	_over: function(event) {
6040
6041		var draggable = $.ui.ddmanager.current;
6042		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
6043
6044		if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
6045			if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
6046			this._trigger('over', event, this.ui(draggable));
6047		}
6048
6049	},
6050
6051	_out: function(event) {
6052
6053		var draggable = $.ui.ddmanager.current;
6054		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
6055
6056		if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
6057			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
6058			this._trigger('out', event, this.ui(draggable));
6059		}
6060
6061	},
6062
6063	_drop: function(event,custom) {
6064
6065		var draggable = custom || $.ui.ddmanager.current;
6066		if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
6067
6068		var childrenIntersection = false;
6069		this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
6070			var inst = $.data(this, 'droppable');
6071			if(
6072				inst.options.greedy
6073				&& !inst.options.disabled
6074				&& inst.options.scope == draggable.options.scope
6075				&& inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))
6076				&& $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)
6077			) { childrenIntersection = true; return false; }
6078		});
6079		if(childrenIntersection) return false;
6080
6081		if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
6082			if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
6083			if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
6084			this._trigger('drop', event, this.ui(draggable));
6085			return this.element;
6086		}
6087
6088		return false;
6089
6090	},
6091
6092	ui: function(c) {
6093		return {
6094			draggable: (c.currentItem || c.element),
6095			helper: c.helper,
6096			position: c.position,
6097			offset: c.positionAbs
6098		};
6099	}
6100
6101});
6102
6103$.ui.intersect = function(draggable, droppable, toleranceMode) {
6104
6105	if (!droppable.offset) return false;
6106
6107	var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
6108		y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
6109	var l = droppable.offset.left, r = l + droppable.proportions.width,
6110		t = droppable.offset.top, b = t + droppable.proportions.height;
6111
6112	switch (toleranceMode) {
6113		case 'fit':
6114			return (l <= x1 && x2 <= r
6115				&& t <= y1 && y2 <= b);
6116			break;
6117		case 'intersect':
6118			return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
6119				&& x2 - (draggable.helperProportions.width / 2) < r // Left Half
6120				&& t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
6121				&& y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
6122			break;
6123		case 'pointer':
6124			var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
6125				draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
6126				isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
6127			return isOver;
6128			break;
6129		case 'touch':
6130			return (
6131					(y1 >= t && y1 <= b) ||	// Top edge touching
6132					(y2 >= t && y2 <= b) ||	// Bottom edge touching
6133					(y1 < t && y2 > b)		// Surrounded vertically
6134				) && (
6135					(x1 >= l && x1 <= r) ||	// Left edge touching
6136					(x2 >= l && x2 <= r) ||	// Right edge touching
6137					(x1 < l && x2 > r)		// Surrounded horizontally
6138				);
6139			break;
6140		default:
6141			return false;
6142			break;
6143		}
6144
6145};
6146
6147/*
6148	This manager tracks offsets of draggables and droppables
6149*/
6150$.ui.ddmanager = {
6151	current: null,
6152	droppables: { 'default': [] },
6153	prepareOffsets: function(t, event) {
6154
6155		var m = $.ui.ddmanager.droppables[t.options.scope] || [];
6156		var type = event ? event.type : null; // workaround for #2317
6157		var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
6158
6159		droppablesLoop: for (var i = 0; i < m.length; i++) {
6160
6161			if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue;	//No disabled and non-accepted
6162			for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
6163			m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; 									//If the element is not visible, continue
6164
6165			if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
6166
6167			m[i].offset = m[i].element.offset();
6168			m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
6169
6170		}
6171
6172	},
6173	drop: function(draggable, event) {
6174
6175		var dropped = false;
6176		$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
6177
6178			if(!this.options) return;
6179			if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
6180				dropped = this._drop.call(this, event) || dropped;
6181
6182			if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
6183				this.isout = 1; this.isover = 0;
6184				this._deactivate.call(this, event);
6185			}
6186
6187		});
6188		return dropped;
6189
6190	},
6191	dragStart: function( draggable, event ) {
6192		//Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
6193		draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
6194			if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );
6195		});
6196	},
6197	drag: function(draggable, event) {
6198
6199		//If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
6200		if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
6201
6202		//Run through all droppables and check their positions based on specific tolerance options
6203		$.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
6204
6205			if(this.options.disabled || this.greedyChild || !this.visible) return;
6206			var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
6207
6208			var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
6209			if(!c) return;
6210
6211			var parentInstance;
6212			if (this.options.greedy) {
6213				// find droppable parents with same scope
6214				var scope = this.options.scope;
6215				var parent = this.element.parents(':data(droppable)').filter(function () {
6216					return $.data(this, 'droppable').options.scope === scope;
6217				});
6218
6219				if (parent.length) {
6220					parentInstance = $.data(parent[0], 'droppable');
6221					parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
6222				}
6223			}
6224
6225			// we just moved into a greedy child
6226			if (parentInstance && c == 'isover') {
6227				parentInstance['isover'] = 0;
6228				parentInstance['isout'] = 1;
6229				parentInstance._out.call(parentInstance, event);
6230			}
6231
6232			this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
6233			this[c == "isover" ? "_over" : "_out"].call(this, event);
6234
6235			// we just moved out of a greedy child
6236			if (parentInstance && c == 'isout') {
6237				parentInstance['isout'] = 0;
6238				parentInstance['isover'] = 1;
6239				parentInstance._over.call(parentInstance, event);
6240			}
6241		});
6242
6243	},
6244	dragStop: function( draggable, event ) {
6245		draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
6246		//Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
6247		if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );
6248	}
6249};
6250
6251})(jQuery);
6252(function( $, undefined ) {
6253
6254$.widget("ui.resizable", $.ui.mouse, {
6255	version: "1.9.2",
6256	widgetEventPrefix: "resize",
6257	options: {
6258		alsoResize: false,
6259		animate: false,
6260		animateDuration: "slow",
6261		animateEasing: "swing",
6262		aspectRatio: false,
6263		autoHide: false,
6264		containment: false,
6265		ghost: false,
6266		grid: false,
6267		handles: "e,s,se",
6268		helper: false,
6269		maxHeight: null,
6270		maxWidth: null,
6271		minHeight: 10,
6272		minWidth: 10,
6273		zIndex: 1000
6274	},
6275	_create: function() {
6276
6277		var that = this, o = this.options;
6278		this.element.addClass("ui-resizable");
6279
6280		$.extend(this, {
6281			_aspectRatio: !!(o.aspectRatio),
6282			aspectRatio: o.aspectRatio,
6283			originalElement: this.element,
6284			_proportionallyResizeElements: [],
6285			_helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
6286		});
6287
6288		//Wrap the element if it cannot hold child nodes
6289		if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
6290
6291			//Create a wrapper element and set the wrapper to the new current internal element
6292			this.element.wrap(
6293				$('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
6294					position: this.element.css('position'),
6295					width: this.element.outerWidth(),
6296					height: this.element.outerHeight(),
6297					top: this.element.css('top'),
6298					left: this.element.css('left')
6299				})
6300			);
6301
6302			//Overwrite the original this.element
6303			this.element = this.element.parent().data(
6304				"resizable", this.element.data('resizable')
6305			);
6306
6307			this.elementIsWrapper = true;
6308
6309			//Move margins to the wrapper
6310			this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
6311			this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
6312
6313			//Prevent Safari textarea resize
6314			this.originalResizeStyle = this.originalElement.css('resize');
6315			this.originalElement.css('resize', 'none');
6316
6317			//Push the actual element to our proportionallyResize internal array
6318			this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
6319
6320			// avoid IE jump (hard set the margin)
6321			this.originalElement.css({ margin: this.originalElement.css('margin') });
6322
6323			// fix handlers offset
6324			this._proportionallyResize();
6325
6326		}
6327
6328		this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
6329		if(this.handles.constructor == String) {
6330
6331			if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
6332			var n = this.handles.split(","); this.handles = {};
6333
6334			for(var i = 0; i < n.length; i++) {
6335
6336				var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
6337				var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
6338
6339				// Apply zIndex to all handles - see #7960
6340				axis.css({ zIndex: o.zIndex });
6341
6342				//TODO : What's going on here?
6343				if ('se' == handle) {
6344					axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
6345				};
6346
6347				//Insert into internal handles object and append to element
6348				this.handles[handle] = '.ui-resizable-'+handle;
6349				this.element.append(axis);
6350			}
6351
6352		}
6353
6354		this._renderAxis = function(target) {
6355
6356			target = target || this.element;
6357
6358			for(var i in this.handles) {
6359
6360				if(this.handles[i].constructor == String)
6361					this.handles[i] = $(this.handles[i], this.element).show();
6362
6363				//Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
6364				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
6365
6366					var axis = $(this.handles[i], this.element), padWrapper = 0;
6367
6368					//Checking the correct pad and border
6369					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
6370
6371					//The padding type i have to apply...
6372					var padPos = [ 'padding',
6373						/ne|nw|n/.test(i) ? 'Top' :
6374						/se|sw|s/.test(i) ? 'Bottom' :
6375						/^e$/.test(i) ? 'Right' : 'Left' ].join("");
6376
6377					target.css(padPos, padWrapper);
6378
6379					this._proportionallyResize();
6380
6381				}
6382
6383				//TODO: What's that good for? There's not anything to be executed left
6384				if(!$(this.handles[i]).length)
6385					continue;
6386
6387			}
6388		};
6389
6390		//TODO: make renderAxis a prototype function
6391		this._renderAxis(this.element);
6392
6393		this._handles = $('.ui-resizable-handle', this.element)
6394			.disableSelection();
6395
6396		//Matching axis name
6397		this._handles.mouseover(function() {
6398			if (!that.resizing) {
6399				if (this.className)
6400					var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
6401				//Axis, default = se
6402				that.axis = axis && axis[1] ? axis[1] : 'se';
6403			}
6404		});
6405
6406		//If we want to auto hide the elements
6407		if (o.autoHide) {
6408			this._handles.hide();
6409			$(this.element)
6410				.addClass("ui-resizable-autohide")
6411				.mouseenter(function() {
6412					if (o.disabled) return;
6413					$(this).removeClass("ui-resizable-autohide");
6414					that._handles.show();
6415				})
6416				.mouseleave(function(){
6417					if (o.disabled) return;
6418					if (!that.resizing) {
6419						$(this).addClass("ui-resizable-autohide");
6420						that._handles.hide();
6421					}
6422				});
6423		}
6424
6425		//Initialize the mouse interaction
6426		this._mouseInit();
6427
6428	},
6429
6430	_destroy: function() {
6431
6432		this._mouseDestroy();
6433
6434		var _destroy = function(exp) {
6435			$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
6436				.removeData("resizable").removeData("ui-resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
6437		};
6438
6439		//TODO: Unwrap at same DOM position
6440		if (this.elementIsWrapper) {
6441			_destroy(this.element);
6442			var wrapper = this.element;
6443			this.originalElement.css({
6444				position: wrapper.css('position'),
6445				width: wrapper.outerWidth(),
6446				height: wrapper.outerHeight(),
6447				top: wrapper.css('top'),
6448				left: wrapper.css('left')
6449			}).insertAfter( wrapper );
6450			wrapper.remove();
6451		}
6452
6453		this.originalElement.css('resize', this.originalResizeStyle);
6454		_destroy(this.originalElement);
6455
6456		return this;
6457	},
6458
6459	_mouseCapture: function(event) {
6460		var handle = false;
6461		for (var i in this.handles) {
6462			if ($(this.handles[i])[0] == event.target) {
6463				handle = true;
6464			}
6465		}
6466
6467		return !this.options.disabled && handle;
6468	},
6469
6470	_mouseStart: function(event) {
6471
6472		var o = this.options, iniPos = this.element.position(), el = this.element;
6473
6474		this.resizing = true;
6475		this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
6476
6477		// bugfix for http://dev.jquery.com/ticket/1749
6478		if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
6479			el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
6480		}
6481
6482		this._renderProxy();
6483
6484		var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
6485
6486		if (o.containment) {
6487			curleft += $(o.containment).scrollLeft() || 0;
6488			curtop += $(o.containment).scrollTop() || 0;
6489		}
6490
6491		//Store needed variables
6492		this.offset = this.helper.offset();
6493		this.position = { left: curleft, top: curtop };
6494		this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
6495		this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
6496		this.originalPosition = { left: curleft, top: curtop };
6497		this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
6498		this.originalMousePosition = { left: event.pageX, top: event.pageY };
6499
6500		//Aspect Ratio
6501		this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
6502
6503		var cursor = $('.ui-resizable-' + this.axis).css('cursor');
6504		$('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
6505
6506		el.addClass("ui-resizable-resizing");
6507		this._propagate("start", event);
6508		return true;
6509	},
6510
6511	_mouseDrag: function(event) {
6512
6513		//Increase performance, avoid regex
6514		var el = this.helper, o = this.options, props = {},
6515			that = this, smp = this.originalMousePosition, a = this.axis;
6516
6517		var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
6518		var trigger = this._change[a];
6519		if (!trigger) return false;
6520
6521		// Calculate the attrs that will be change
6522		var data = trigger.apply(this, [event, dx, dy]);
6523
6524		// Put this in the mouseDrag handler since the user can start pressing shift while resizing
6525		this._updateVirtualBoundaries(event.shiftKey);
6526		if (this._aspectRatio || event.shiftKey)
6527			data = this._updateRatio(data, event);
6528
6529		data = this._respectSize(data, event);
6530
6531		// plugins callbacks need to be called first
6532		this._propagate("resize", event);
6533
6534		el.css({
6535			top: this.position.top + "px", left: this.position.left + "px",
6536			width: this.size.width + "px", height: this.size.height + "px"
6537		});
6538
6539		if (!this._helper && this._proportionallyResizeElements.length)
6540			this._proportionallyResize();
6541
6542		this._updateCache(data);
6543
6544		// calling the user callback at the end
6545		this._trigger('resize', event, this.ui());
6546
6547		return false;
6548	},
6549
6550	_mouseStop: function(event) {
6551
6552		this.resizing = false;
6553		var o = this.options, that = this;
6554
6555		if(this._helper) {
6556			var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
6557				soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height,
6558				soffsetw = ista ? 0 : that.sizeDiff.width;
6559
6560			var s = { width: (that.helper.width()  - soffsetw), height: (that.helper.height() - soffseth) },
6561				left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null,
6562				top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null;
6563
6564			if (!o.animate)
6565				this.element.css($.extend(s, { top: top, left: left }));
6566
6567			that.helper.height(that.size.height);
6568			that.helper.width(that.size.width);
6569
6570			if (this._helper && !o.animate) this._proportionallyResize();
6571		}
6572
6573		$('body').css('cursor', 'auto');
6574
6575		this.element.removeClass("ui-resizable-resizing");
6576
6577		this._propagate("stop", event);
6578
6579		if (this._helper) this.helper.remove();
6580		return false;
6581
6582	},
6583
6584	_updateVirtualBoundaries: function(forceAspectRatio) {
6585		var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;
6586
6587		b = {
6588			minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
6589			maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
6590			minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
6591			maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
6592		};
6593
6594		if(this._aspectRatio || forceAspectRatio) {
6595			// We want to create an enclosing box whose aspect ration is the requested one
6596			// First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
6597			pMinWidth = b.minHeight * this.aspectRatio;
6598			pMinHeight = b.minWidth / this.aspectRatio;
6599			pMaxWidth = b.maxHeight * this.aspectRatio;
6600			pMaxHeight = b.maxWidth / this.aspectRatio;
6601
6602			if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;
6603			if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;
6604			if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;
6605			if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;
6606		}
6607		this._vBoundaries = b;
6608	},
6609
6610	_updateCache: function(data) {
6611		var o = this.options;
6612		this.offset = this.helper.offset();
6613		if (isNumber(data.left)) this.position.left = data.left;
6614		if (isNumber(data.top)) this.position.top = data.top;
6615		if (isNumber(data.height)) this.size.height = data.height;
6616		if (isNumber(data.width)) this.size.width = data.width;
6617	},
6618
6619	_updateRatio: function(data, event) {
6620
6621		var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
6622
6623		if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);
6624		else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);
6625
6626		if (a == 'sw') {
6627			data.left = cpos.left + (csize.width - data.width);
6628			data.top = null;
6629		}
6630		if (a == 'nw') {
6631			data.top = cpos.top + (csize.height - data.height);
6632			data.left = cpos.left + (csize.width - data.width);
6633		}
6634
6635		return data;
6636	},
6637
6638	_respectSize: function(data, event) {
6639
6640		var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
6641				ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
6642					isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
6643
6644		if (isminw) data.width = o.minWidth;
6645		if (isminh) data.height = o.minHeight;
6646		if (ismaxw) data.width = o.maxWidth;
6647		if (ismaxh) data.height = o.maxHeight;
6648
6649		var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
6650		var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
6651
6652		if (isminw && cw) data.left = dw - o.minWidth;
6653		if (ismaxw && cw) data.left = dw - o.maxWidth;
6654		if (isminh && ch)	data.top = dh - o.minHeight;
6655		if (ismaxh && ch)	data.top = dh - o.maxHeight;
6656
6657		// fixing jump error on top/left - bug #2330
6658		var isNotwh = !data.width && !data.height;
6659		if (isNotwh && !data.left && data.top) data.top = null;
6660		else if (isNotwh && !data.top && data.left) data.left = null;
6661
6662		return data;
6663	},
6664
6665	_proportionallyResize: function() {
6666
6667		var o = this.options;
6668		if (!this._proportionallyResizeElements.length) return;
6669		var element = this.helper || this.element;
6670
6671		for (var i=0; i < this._proportionallyResizeElements.length; i++) {
6672
6673			var prel = this._proportionallyResizeElements[i];
6674
6675			if (!this.borderDif) {
6676				var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
6677					p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
6678
6679				this.borderDif = $.map(b, function(v, i) {
6680					var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
6681					return border + padding;
6682				});
6683			}
6684
6685			prel.css({
6686				height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
6687				width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
6688			});
6689
6690		};
6691
6692	},
6693
6694	_renderProxy: function() {
6695
6696		var el = this.element, o = this.options;
6697		this.elementOffset = el.offset();
6698
6699		if(this._helper) {
6700
6701			this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
6702
6703			// fix ie6 offset TODO: This seems broken
6704			var ie6offset = ($.ui.ie6 ? 1 : 0),
6705			pxyoffset = ( $.ui.ie6 ? 2 : -1 );
6706
6707			this.helper.addClass(this._helper).css({
6708				width: this.element.outerWidth() + pxyoffset,
6709				height: this.element.outerHeight() + pxyoffset,
6710				position: 'absolute',
6711				left: this.elementOffset.left - ie6offset +'px',
6712				top: this.elementOffset.top - ie6offset +'px',
6713				zIndex: ++o.zIndex //TODO: Don't modify option
6714			});
6715
6716			this.helper
6717				.appendTo("body")
6718				.disableSelection();
6719
6720		} else {
6721			this.helper = this.element;
6722		}
6723
6724	},
6725
6726	_change: {
6727		e: function(event, dx, dy) {
6728			return { width: this.originalSize.width + dx };
6729		},
6730		w: function(event, dx, dy) {
6731			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
6732			return { left: sp.left + dx, width: cs.width - dx };
6733		},
6734		n: function(event, dx, dy) {
6735			var o = this.options, cs = this.originalSize, sp = this.originalPosition;
6736			return { top: sp.top + dy, height: cs.height - dy };
6737		},
6738		s: function(event, dx, dy) {
6739			return { height: this.originalSize.height + dy };
6740		},
6741		se: function(event, dx, dy) {
6742			return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
6743		},
6744		sw: function(event, dx, dy) {
6745			return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
6746		},
6747		ne: function(event, dx, dy) {
6748			return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
6749		},
6750		nw: function(event, dx, dy) {
6751			return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
6752		}
6753	},
6754
6755	_propagate: function(n, event) {
6756		$.ui.plugin.call(this, n, [event, this.ui()]);
6757		(n != "resize" && this._trigger(n, event, this.ui()));
6758	},
6759
6760	plugins: {},
6761
6762	ui: function() {
6763		return {
6764			originalElement: this.originalElement,
6765			element: this.element,
6766			helper: this.helper,
6767			position: this.position,
6768			size: this.size,
6769			originalSize: this.originalSize,
6770			originalPosition: this.originalPosition
6771		};
6772	}
6773
6774});
6775
6776/*
6777 * Resizable Extensions
6778 */
6779
6780$.ui.plugin.add("resizable", "alsoResize", {
6781
6782	start: function (event, ui) {
6783		var that = $(this).data("resizable"), o = that.options;
6784
6785		var _store = function (exp) {
6786			$(exp).each(function() {
6787				var el = $(this);
6788				el.data("resizable-alsoresize", {
6789					width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
6790					left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10)
6791				});
6792			});
6793		};
6794
6795		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
6796			if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
6797			else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
6798		}else{
6799			_store(o.alsoResize);
6800		}
6801	},
6802
6803	resize: function (event, ui) {
6804		var that = $(this).data("resizable"), o = that.options, os = that.originalSize, op = that.originalPosition;
6805
6806		var delta = {
6807			height: (that.size.height - os.height) || 0, width: (that.size.width - os.width) || 0,
6808			top: (that.position.top - op.top) || 0, left: (that.position.left - op.left) || 0
6809		},
6810
6811		_alsoResize = function (exp, c) {
6812			$(exp).each(function() {
6813				var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},
6814					css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
6815
6816				$.each(css, function (i, prop) {
6817					var sum = (start[prop]||0) + (delta[prop]||0);
6818					if (sum && sum >= 0)
6819						style[prop] = sum || null;
6820				});
6821
6822				el.css(style);
6823			});
6824		};
6825
6826		if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
6827			$.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
6828		}else{
6829			_alsoResize(o.alsoResize);
6830		}
6831	},
6832
6833	stop: function (event, ui) {
6834		$(this).removeData("resizable-alsoresize");
6835	}
6836});
6837
6838$.ui.plugin.add("resizable", "animate", {
6839
6840	stop: function(event, ui) {
6841		var that = $(this).data("resizable"), o = that.options;
6842
6843		var pr = that._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
6844					soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : that.sizeDiff.height,
6845						soffsetw = ista ? 0 : that.sizeDiff.width;
6846
6847		var style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
6848					left = (parseInt(that.element.css('left'), 10) + (that.position.left - that.originalPosition.left)) || null,
6849						top = (parseInt(that.element.css('top'), 10) + (that.position.top - that.originalPosition.top)) || null;
6850
6851		that.element.animate(
6852			$.extend(style, top && left ? { top: top, left: left } : {}), {
6853				duration: o.animateDuration,
6854				easing: o.animateEasing,
6855				step: function() {
6856
6857					var data = {
6858						width: parseInt(that.element.css('width'), 10),
6859						height: parseInt(that.element.css('height'), 10),
6860						top: parseInt(that.element.css('top'), 10),
6861						left: parseInt(that.element.css('left'), 10)
6862					};
6863
6864					if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
6865
6866					// propagating resize, and updating values for each animation step
6867					that._updateCache(data);
6868					that._propagate("resize", event);
6869
6870				}
6871			}
6872		);
6873	}
6874
6875});
6876
6877$.ui.plugin.add("resizable", "containment", {
6878
6879	start: function(event, ui) {
6880		var that = $(this).data("resizable"), o = that.options, el = that.element;
6881		var oc = o.containment,	ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
6882		if (!ce) return;
6883
6884		that.containerElement = $(ce);
6885
6886		if (/document/.test(oc) || oc == document) {
6887			that.containerOffset = { left: 0, top: 0 };
6888			that.containerPosition = { left: 0, top: 0 };
6889
6890			that.parentData = {
6891				element: $(document), left: 0, top: 0,
6892				width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
6893			};
6894		}
6895
6896		// i'm a node, so compute top, left, right, bottom
6897		else {
6898			var element = $(ce), p = [];
6899			$([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
6900
6901			that.containerOffset = element.offset();
6902			that.containerPosition = element.position();
6903			that.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
6904
6905			var co = that.containerOffset, ch = that.containerSize.height,	cw = that.containerSize.width,
6906						width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
6907
6908			that.parentData = {
6909				element: ce, left: co.left, top: co.top, width: width, height: height
6910			};
6911		}
6912	},
6913
6914	resize: function(event, ui) {
6915		var that = $(this).data("resizable"), o = that.options,
6916				ps = that.containerSize, co = that.containerOffset, cs = that.size, cp = that.position,
6917				pRatio = that._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = that.containerElement;
6918
6919		if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
6920
6921		if (cp.left < (that._helper ? co.left : 0)) {
6922			that.size.width = that.size.width + (that._helper ? (that.position.left - co.left) : (that.position.left - cop.left));
6923			if (pRatio) that.size.height = that.size.width / that.aspectRatio;
6924			that.position.left = o.helper ? co.left : 0;
6925		}
6926
6927		if (cp.top < (that._helper ? co.top : 0)) {
6928			that.size.height = that.size.height + (that._helper ? (that.position.top - co.top) : that.position.top);
6929			if (pRatio) that.size.width = that.size.height * that.aspectRatio;
6930			that.position.top = that._helper ? co.top : 0;
6931		}
6932
6933		that.offset.left = that.parentData.left+that.position.left;
6934		that.offset.top = that.parentData.top+that.position.top;
6935
6936		var woset = Math.abs( (that._helper ? that.offset.left - cop.left : (that.offset.left - cop.left)) + that.sizeDiff.width ),
6937					hoset = Math.abs( (that._helper ? that.offset.top - cop.top : (that.offset.top - co.top)) + that.sizeDiff.height );
6938
6939		var isParent = that.containerElement.get(0) == that.element.parent().get(0),
6940			isOffsetRelative = /relative|absolute/.test(that.containerElement.css('position'));
6941
6942		if(isParent && isOffsetRelative) woset -= that.parentData.left;
6943
6944		if (woset + that.size.width >= that.parentData.width) {
6945			that.size.width = that.parentData.width - woset;
6946			if (pRatio) that.size.height = that.size.width / that.aspectRatio;
6947		}
6948
6949		if (hoset + that.size.height >= that.parentData.height) {
6950			that.size.height = that.parentData.height - hoset;
6951			if (pRatio) that.size.width = that.size.height * that.aspectRatio;
6952		}
6953	},
6954
6955	stop: function(event, ui){
6956		var that = $(this).data("resizable"), o = that.options, cp = that.position,
6957				co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement;
6958
6959		var helper = $(that.helper), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height;
6960
6961		if (that._helper && !o.animate && (/relative/).test(ce.css('position')))
6962			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
6963
6964		if (that._helper && !o.animate && (/static/).test(ce.css('position')))
6965			$(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
6966
6967	}
6968});
6969
6970$.ui.plugin.add("resizable", "ghost", {
6971
6972	start: function(event, ui) {
6973
6974		var that = $(this).data("resizable"), o = that.options, cs = that.size;
6975
6976		that.ghost = that.originalElement.clone();
6977		that.ghost
6978			.css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
6979			.addClass('ui-resizable-ghost')
6980			.addClass(typeof o.ghost == 'string' ? o.ghost : '');
6981
6982		that.ghost.appendTo(that.helper);
6983
6984	},
6985
6986	resize: function(event, ui){
6987		var that = $(this).data("resizable"), o = that.options;
6988		if (that.ghost) that.ghost.css({ position: 'relative', height: that.size.height, width: that.size.width });
6989	},
6990
6991	stop: function(event, ui){
6992		var that = $(this).data("resizable"), o = that.options;
6993		if (that.ghost && that.helper) that.helper.get(0).removeChild(that.ghost.get(0));
6994	}
6995
6996});
6997
6998$.ui.plugin.add("resizable", "grid", {
6999
7000	resize: function(event, ui) {
7001		var that = $(this).data("resizable"), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, ratio = o._aspectRatio || event.shiftKey;
7002		o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
7003		var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
7004
7005		if (/^(se|s|e)$/.test(a)) {
7006			that.size.width = os.width + ox;
7007			that.size.height = os.height + oy;
7008		}
7009		else if (/^(ne)$/.test(a)) {
7010			that.size.width = os.width + ox;
7011			that.size.height = os.height + oy;
7012			that.position.top = op.top - oy;
7013		}
7014		else if (/^(sw)$/.test(a)) {
7015			that.size.width = os.width + ox;
7016			that.size.height = os.height + oy;
7017			that.position.left = op.left - ox;
7018		}
7019		else {
7020			that.size.width = os.width + ox;
7021			that.size.height = os.height + oy;
7022			that.position.top = op.top - oy;
7023			that.position.left = op.left - ox;
7024		}
7025	}
7026
7027});
7028
7029var num = function(v) {
7030	return parseInt(v, 10) || 0;
7031};
7032
7033var isNumber = function(value) {
7034	return !isNaN(parseInt(value, 10));
7035};
7036
7037})(jQuery);
7038(function( $, undefined ) {
7039
7040$.widget("ui.selectable", $.ui.mouse, {
7041	version: "1.9.2",
7042	options: {
7043		appendTo: 'body',
7044		autoRefresh: true,
7045		distance: 0,
7046		filter: '*',
7047		tolerance: 'touch'
7048	},
7049	_create: function() {
7050		var that = this;
7051
7052		this.element.addClass("ui-selectable");
7053
7054		this.dragged = false;
7055
7056		// cache selectee children based on filter
7057		var selectees;
7058		this.refresh = function() {
7059			selectees = $(that.options.filter, that.element[0]);
7060			selectees.addClass("ui-selectee");
7061			selectees.each(function() {
7062				var $this = $(this);
7063				var pos = $this.offset();
7064				$.data(this, "selectable-item", {
7065					element: this,
7066					$element: $this,
7067					left: pos.left,
7068					top: pos.top,
7069					right: pos.left + $this.outerWidth(),
7070					bottom: pos.top + $this.outerHeight(),
7071					startselected: false,
7072					selected: $this.hasClass('ui-selected'),
7073					selecting: $this.hasClass('ui-selecting'),
7074					unselecting: $this.hasClass('ui-unselecting')
7075				});
7076			});
7077		};
7078		this.refresh();
7079
7080		this.selectees = selectees.addClass("ui-selectee");
7081
7082		this._mouseInit();
7083
7084		this.helper = $("<div class='ui-selectable-helper'></div>");
7085	},
7086
7087	_destroy: function() {
7088		this.selectees
7089			.removeClass("ui-selectee")
7090			.removeData("selectable-item");
7091		this.element
7092			.removeClass("ui-selectable ui-selectable-disabled");
7093		this._mouseDestroy();
7094	},
7095
7096	_mouseStart: function(event) {
7097		var that = this;
7098
7099		this.opos = [event.pageX, event.pageY];
7100
7101		if (this.options.disabled)
7102			return;
7103
7104		var options = this.options;
7105
7106		this.selectees = $(options.filter, this.element[0]);
7107
7108		this._trigger("start", event);
7109
7110		$(options.appendTo).append(this.helper);
7111		// position helper (lasso)
7112		this.helper.css({
7113			"left": event.clientX,
7114			"top": event.clientY,
7115			"width": 0,
7116			"height": 0
7117		});
7118
7119		if (options.autoRefresh) {
7120			this.refresh();
7121		}
7122
7123		this.selectees.filter('.ui-selected').each(function() {
7124			var selectee = $.data(this, "selectable-item");
7125			selectee.startselected = true;
7126			if (!event.metaKey && !event.ctrlKey) {
7127				selectee.$element.removeClass('ui-selected');
7128				selectee.selected = false;
7129				selectee.$element.addClass('ui-unselecting');
7130				selectee.unselecting = true;
7131				// selectable UNSELECTING callback
7132				that._trigger("unselecting", event, {
7133					unselecting: selectee.element
7134				});
7135			}
7136		});
7137
7138		$(event.target).parents().andSelf().each(function() {
7139			var selectee = $.data(this, "selectable-item");
7140			if (selectee) {
7141				var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
7142				selectee.$element
7143					.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
7144					.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
7145				selectee.unselecting = !doSelect;
7146				selectee.selecting = doSelect;
7147				selectee.selected = doSelect;
7148				// selectable (UN)SELECTING callback
7149				if (doSelect) {
7150					that._trigger("selecting", event, {
7151						selecting: selectee.element
7152					});
7153				} else {
7154					that._trigger("unselecting", event, {
7155						unselecting: selectee.element
7156					});
7157				}
7158				return false;
7159			}
7160		});
7161
7162	},
7163
7164	_mouseDrag: function(event) {
7165		var that = this;
7166		this.dragged = true;
7167
7168		if (this.options.disabled)
7169			return;
7170
7171		var options = this.options;
7172
7173		var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
7174		if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
7175		if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
7176		this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
7177
7178		this.selectees.each(function() {
7179			var selectee = $.data(this, "selectable-item");
7180			//prevent helper from being selected if appendTo: selectable
7181			if (!selectee || selectee.element == that.element[0])
7182				return;
7183			var hit = false;
7184			if (options.tolerance == 'touch') {
7185				hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
7186			} else if (options.tolerance == 'fit') {
7187				hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
7188			}
7189
7190			if (hit) {
7191				// SELECT
7192				if (selectee.selected) {
7193					selectee.$element.removeClass('ui-selected');
7194					selectee.selected = false;
7195				}
7196				if (selectee.unselecting) {
7197					selectee.$element.removeClass('ui-unselecting');
7198					selectee.unselecting = false;
7199				}
7200				if (!selectee.selecting) {
7201					selectee.$element.addClass('ui-selecting');
7202					selectee.selecting = true;
7203					// selectable SELECTING callback
7204					that._trigger("selecting", event, {
7205						selecting: selectee.element
7206					});
7207				}
7208			} else {
7209				// UNSELECT
7210				if (selectee.selecting) {
7211					if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
7212						selectee.$element.removeClass('ui-selecting');
7213						selectee.selecting = false;
7214						selectee.$element.addClass('ui-selected');
7215						selectee.selected = true;
7216					} else {
7217						selectee.$element.removeClass('ui-selecting');
7218						selectee.selecting = false;
7219						if (selectee.startselected) {
7220							selectee.$element.addClass('ui-unselecting');
7221							selectee.unselecting = true;
7222						}
7223						// selectable UNSELECTING callback
7224						that._trigger("unselecting", event, {
7225							unselecting: selectee.element
7226						});
7227					}
7228				}
7229				if (selectee.selected) {
7230					if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
7231						selectee.$element.removeClass('ui-selected');
7232						selectee.selected = false;
7233
7234						selectee.$element.addClass('ui-unselecting');
7235						selectee.unselecting = true;
7236						// selectable UNSELECTING callback
7237						that._trigger("unselecting", event, {
7238							unselecting: selectee.element
7239						});
7240					}
7241				}
7242			}
7243		});
7244
7245		return false;
7246	},
7247
7248	_mouseStop: function(event) {
7249		var that = this;
7250
7251		this.dragged = false;
7252
7253		var options = this.options;
7254
7255		$('.ui-unselecting', this.element[0]).each(function() {
7256			var selectee = $.data(this, "selectable-item");
7257			selectee.$element.removeClass('ui-unselecting');
7258			selectee.unselecting = false;
7259			selectee.startselected = false;
7260			that._trigger("unselected", event, {
7261				unselected: selectee.element
7262			});
7263		});
7264		$('.ui-selecting', this.element[0]).each(function() {
7265			var selectee = $.data(this, "selectable-item");
7266			selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
7267			selectee.selecting = false;
7268			selectee.selected = true;
7269			selectee.startselected = true;
7270			that._trigger("selected", event, {
7271				selected: selectee.element
7272			});
7273		});
7274		this._trigger("stop", event);
7275
7276		this.helper.remove();
7277
7278		return false;
7279	}
7280
7281});
7282
7283})(jQuery);
7284(function( $, undefined ) {
7285
7286$.widget("ui.sortable", $.ui.mouse, {
7287	version: "1.9.2",
7288	widgetEventPrefix: "sort",
7289	ready: false,
7290	options: {
7291		appendTo: "parent",
7292		axis: false,
7293		connectWith: false,
7294		containment: false,
7295		cursor: 'auto',
7296		cursorAt: false,
7297		dropOnEmpty: true,
7298		forcePlaceholderSize: false,
7299		forceHelperSize: false,
7300		grid: false,
7301		handle: false,
7302		helper: "original",
7303		items: '> *',
7304		opacity: false,
7305		placeholder: false,
7306		revert: false,
7307		scroll: true,
7308		scrollSensitivity: 20,
7309		scrollSpeed: 20,
7310		scope: "default",
7311		tolerance: "intersect",
7312		zIndex: 1000
7313	},
7314	_create: function() {
7315
7316		var o = this.options;
7317		this.containerCache = {};
7318		this.element.addClass("ui-sortable");
7319
7320		//Get the items
7321		this.refresh();
7322
7323		//Let's determine if the items are being displayed horizontally
7324		this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
7325
7326		//Let's determine the parent's offset
7327		this.offset = this.element.offset();
7328
7329		//Initialize mouse events for interaction
7330		this._mouseInit();
7331
7332		//We're ready to go
7333		this.ready = true
7334
7335	},
7336
7337	_destroy: function() {
7338		this.element
7339			.removeClass("ui-sortable ui-sortable-disabled");
7340		this._mouseDestroy();
7341
7342		for ( var i = this.items.length - 1; i >= 0; i-- )
7343			this.items[i].item.removeData(this.widgetName + "-item");
7344
7345		return this;
7346	},
7347
7348	_setOption: function(key, value){
7349		if ( key === "disabled" ) {
7350			this.options[ key ] = value;
7351
7352			this.widget().toggleClass( "ui-sortable-disabled", !!value );
7353		} else {
7354			// Don't call widget base _setOption for disable as it adds ui-state-disabled class
7355			$.Widget.prototype._setOption.apply(this, arguments);
7356		}
7357	},
7358
7359	_mouseCapture: function(event, overrideHandle) {
7360		var that = this;
7361
7362		if (this.reverting) {
7363			return false;
7364		}
7365
7366		if(this.options.disabled || this.options.type == 'static') return false;
7367
7368		//We have to refresh the items data once first
7369		this._refreshItems(event);
7370
7371		//Find out if the clicked node (or one of its parents) is a actual item in this.items
7372		var currentItem = null, nodes = $(event.target).parents().each(function() {
7373			if($.data(this, that.widgetName + '-item') == that) {
7374				currentItem = $(this);
7375				return false;
7376			}
7377		});
7378		if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);
7379
7380		if(!currentItem) return false;
7381		if(this.options.handle && !overrideHandle) {
7382			var validHandle = false;
7383
7384			$(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
7385			if(!validHandle) return false;
7386		}
7387
7388		this.currentItem = currentItem;
7389		this._removeCurrentsFromItems();
7390		return true;
7391
7392	},
7393
7394	_mouseStart: function(event, overrideHandle, noActivation) {
7395
7396		var o = this.options;
7397		this.currentContainer = this;
7398
7399		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
7400		this.refreshPositions();
7401
7402		//Create and append the visible helper
7403		this.helper = this._createHelper(event);
7404
7405		//Cache the helper size
7406		this._cacheHelperProportions();
7407
7408		/*
7409		 * - Position generation -
7410		 * This block generates everything position related - it's the core of draggables.
7411		 */
7412
7413		//Cache the margins of the original element
7414		this._cacheMargins();
7415
7416		//Get the next scrolling parent
7417		this.scrollParent = this.helper.scrollParent();
7418
7419		//The element's absolute position on the page minus margins
7420		this.offset = this.currentItem.offset();
7421		this.offset = {
7422			top: this.offset.top - this.margins.top,
7423			left: this.offset.left - this.margins.left
7424		};
7425
7426		$.extend(this.offset, {
7427			click: { //Where the click happened, relative to the element
7428				left: event.pageX - this.offset.left,
7429				top: event.pageY - this.offset.top
7430			},
7431			parent: this._getParentOffset(),
7432			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
7433		});
7434
7435		// Only after we got the offset, we can change the helper's position to absolute
7436		// TODO: Still need to figure out a way to make relative sorting possible
7437		this.helper.css("position", "absolute");
7438		this.cssPosition = this.helper.css("position");
7439
7440		//Generate the original position
7441		this.originalPosition = this._generatePosition(event);
7442		this.originalPageX = event.pageX;
7443		this.originalPageY = event.pageY;
7444
7445		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
7446		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
7447
7448		//Cache the former DOM position
7449		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
7450
7451		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
7452		if(this.helper[0] != this.currentItem[0]) {
7453			this.currentItem.hide();
7454		}
7455
7456		//Create the placeholder
7457		this._createPlaceholder();
7458
7459		//Set a containment if given in the options
7460		if(o.containment)
7461			this._setContainment();
7462
7463		if(o.cursor) { // cursor option
7464			if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
7465			$('body').css("cursor", o.cursor);
7466		}
7467
7468		if(o.opacity) { // opacity option
7469			if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
7470			this.helper.css("opacity", o.opacity);
7471		}
7472
7473		if(o.zIndex) { // zIndex option
7474			if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
7475			this.helper.css("zIndex", o.zIndex);
7476		}
7477
7478		//Prepare scrolling
7479		if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
7480			this.overflowOffset = this.scrollParent.offset();
7481
7482		//Call callbacks
7483		this._trigger("start", event, this._uiHash());
7484
7485		//Recache the helper size
7486		if(!this._preserveHelperProportions)
7487			this._cacheHelperProportions();
7488
7489
7490		//Post 'activate' events to possible containers
7491		if(!noActivation) {
7492			 for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); }
7493		}
7494
7495		//Prepare possible droppables
7496		if($.ui.ddmanager)
7497			$.ui.ddmanager.current = this;
7498
7499		if ($.ui.ddmanager && !o.dropBehaviour)
7500			$.ui.ddmanager.prepareOffsets(this, event);
7501
7502		this.dragging = true;
7503
7504		this.helper.addClass("ui-sortable-helper");
7505		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
7506		return true;
7507
7508	},
7509
7510	_mouseDrag: function(event) {
7511
7512		//Compute the helpers position
7513		this.position = this._generatePosition(event);
7514		this.positionAbs = this._convertPositionTo("absolute");
7515
7516		if (!this.lastPositionAbs) {
7517			this.lastPositionAbs = this.positionAbs;
7518		}
7519
7520		//Do scrolling
7521		if(this.options.scroll) {
7522			var o = this.options, scrolled = false;
7523			if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
7524
7525				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
7526					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
7527				else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
7528					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
7529
7530				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
7531					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
7532				else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
7533					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
7534
7535			} else {
7536
7537				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
7538					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
7539				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
7540					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
7541
7542				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
7543					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
7544				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
7545					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
7546
7547			}
7548
7549			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
7550				$.ui.ddmanager.prepareOffsets(this, event);
7551		}
7552
7553		//Regenerate the absolute position used for position checks
7554		this.positionAbs = this._convertPositionTo("absolute");
7555
7556		//Set the helper position
7557		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
7558		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
7559
7560		//Rearrange
7561		for (var i = this.items.length - 1; i >= 0; i--) {
7562
7563			//Cache variables and intersection, continue if no intersection
7564			var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
7565			if (!intersection) continue;
7566
7567			// Only put the placeholder inside the current Container, skip all
7568			// items form other containers. This works because when moving
7569			// an item from one container to another the
7570			// currentContainer is switched before the placeholder is moved.
7571			//
7572			// Without this moving items in "sub-sortables" can cause the placeholder to jitter
7573			// beetween the outer and inner container.
7574			if (item.instance !== this.currentContainer) continue;
7575
7576			if (itemElement != this.currentItem[0] //cannot intersect with itself
7577				&&	this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
7578				&&	!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
7579				&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
7580				//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
7581			) {
7582
7583				this.direction = intersection == 1 ? "down" : "up";
7584
7585				if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
7586					this._rearrange(event, item);
7587				} else {
7588					break;
7589				}
7590
7591				this._trigger("change", event, this._uiHash());
7592				break;
7593			}
7594		}
7595
7596		//Post events to containers
7597		this._contactContainers(event);
7598
7599		//Interconnect with droppables
7600		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
7601
7602		//Call callbacks
7603		this._trigger('sort', event, this._uiHash());
7604
7605		this.lastPositionAbs = this.positionAbs;
7606		return false;
7607
7608	},
7609
7610	_mouseStop: function(event, noPropagation) {
7611
7612		if(!event) return;
7613
7614		//If we are using droppables, inform the manager about the drop
7615		if ($.ui.ddmanager && !this.options.dropBehaviour)
7616			$.ui.ddmanager.drop(this, event);
7617
7618		if(this.options.revert) {
7619			var that = this;
7620			var cur = this.placeholder.offset();
7621
7622			this.reverting = true;
7623
7624			$(this.helper).animate({
7625				left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
7626				top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
7627			}, parseInt(this.options.revert, 10) || 500, function() {
7628				that._clear(event);
7629			});
7630		} else {
7631			this._clear(event, noPropagation);
7632		}
7633
7634		return false;
7635
7636	},
7637
7638	cancel: function() {
7639
7640		if(this.dragging) {
7641
7642			this._mouseUp({ target: null });
7643
7644			if(this.options.helper == "original")
7645				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
7646			else
7647				this.currentItem.show();
7648
7649			//Post deactivating events to containers
7650			for (var i = this.containers.length - 1; i >= 0; i--){
7651				this.containers[i]._trigger("deactivate", null, this._uiHash(this));
7652				if(this.containers[i].containerCache.over) {
7653					this.containers[i]._trigger("out", null, this._uiHash(this));
7654					this.containers[i].containerCache.over = 0;
7655				}
7656			}
7657
7658		}
7659
7660		if (this.placeholder) {
7661			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
7662			if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
7663			if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
7664
7665			$.extend(this, {
7666				helper: null,
7667				dragging: false,
7668				reverting: false,
7669				_noFinalSort: null
7670			});
7671
7672			if(this.domPosition.prev) {
7673				$(this.domPosition.prev).after(this.currentItem);
7674			} else {
7675				$(this.domPosition.parent).prepend(this.currentItem);
7676			}
7677		}
7678
7679		return this;
7680
7681	},
7682
7683	serialize: function(o) {
7684
7685		var items = this._getItemsAsjQuery(o && o.connected);
7686		var str = []; o = o || {};
7687
7688		$(items).each(function() {
7689			var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
7690			if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
7691		});
7692
7693		if(!str.length && o.key) {
7694			str.push(o.key + '=');
7695		}
7696
7697		return str.join('&');
7698
7699	},
7700
7701	toArray: function(o) {
7702
7703		var items = this._getItemsAsjQuery(o && o.connected);
7704		var ret = []; o = o || {};
7705
7706		items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
7707		return ret;
7708
7709	},
7710
7711	/* Be careful with the following core functions */
7712	_intersectsWith: function(item) {
7713
7714		var x1 = this.positionAbs.left,
7715			x2 = x1 + this.helperProportions.width,
7716			y1 = this.positionAbs.top,
7717			y2 = y1 + this.helperProportions.height;
7718
7719		var l = item.left,
7720			r = l + item.width,
7721			t = item.top,
7722			b = t + item.height;
7723
7724		var dyClick = this.offset.click.top,
7725			dxClick = this.offset.click.left;
7726
7727		var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
7728
7729		if(	   this.options.tolerance == "pointer"
7730			|| this.options.forcePointerForContainers
7731			|| (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
7732		) {
7733			return isOverElement;
7734		} else {
7735
7736			return (l < x1 + (this.helperProportions.width / 2) // Right Half
7737				&& x2 - (this.helperProportions.width / 2) < r // Left Half
7738				&& t < y1 + (this.helperProportions.height / 2) // Bottom Half
7739				&& y2 - (this.helperProportions.height / 2) < b ); // Top Half
7740
7741		}
7742	},
7743
7744	_intersectsWithPointer: function(item) {
7745
7746		var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
7747			isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
7748			isOverElement = isOverElementHeight && isOverElementWidth,
7749			verticalDirection = this._getDragVerticalDirection(),
7750			horizontalDirection = this._getDragHorizontalDirection();
7751
7752		if (!isOverElement)
7753			return false;
7754
7755		return this.floating ?
7756			( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
7757			: ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
7758
7759	},
7760
7761	_intersectsWithSides: function(item) {
7762
7763		var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
7764			isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
7765			verticalDirection = this._getDragVerticalDirection(),
7766			horizontalDirection = this._getDragHorizontalDirection();
7767
7768		if (this.floating && horizontalDirection) {
7769			return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
7770		} else {
7771			return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
7772		}
7773
7774	},
7775
7776	_getDragVerticalDirection: function() {
7777		var delta = this.positionAbs.top - this.lastPositionAbs.top;
7778		return delta != 0 && (delta > 0 ? "down" : "up");
7779	},
7780
7781	_getDragHorizontalDirection: function() {
7782		var delta = this.positionAbs.left - this.lastPositionAbs.left;
7783		return delta != 0 && (delta > 0 ? "right" : "left");
7784	},
7785
7786	refresh: function(event) {
7787		this._refreshItems(event);
7788		this.refreshPositions();
7789		return this;
7790	},
7791
7792	_connectWith: function() {
7793		var options = this.options;
7794		return options.connectWith.constructor == String
7795			? [options.connectWith]
7796			: options.connectWith;
7797	},
7798
7799	_getItemsAsjQuery: function(connected) {
7800
7801		var items = [];
7802		var queries = [];
7803		var connectWith = this._connectWith();
7804
7805		if(connectWith && connected) {
7806			for (var i = connectWith.length - 1; i >= 0; i--){
7807				var cur = $(connectWith[i]);
7808				for (var j = cur.length - 1; j >= 0; j--){
7809					var inst = $.data(cur[j], this.widgetName);
7810					if(inst && inst != this && !inst.options.disabled) {
7811						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]);
7812					}
7813				};
7814			};
7815		}
7816
7817		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]);
7818
7819		for (var i = queries.length - 1; i >= 0; i--){
7820			queries[i][0].each(function() {
7821				items.push(this);
7822			});
7823		};
7824
7825		return $(items);
7826
7827	},
7828
7829	_removeCurrentsFromItems: function() {
7830
7831		var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
7832
7833		this.items = $.grep(this.items, function (item) {
7834			for (var j=0; j < list.length; j++) {
7835				if(list[j] == item.item[0])
7836					return false;
7837			};
7838			return true;
7839		});
7840
7841	},
7842
7843	_refreshItems: function(event) {
7844
7845		this.items = [];
7846		this.containers = [this];
7847		var items = this.items;
7848		var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
7849		var connectWith = this._connectWith();
7850
7851		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
7852			for (var i = connectWith.length - 1; i >= 0; i--){
7853				var cur = $(connectWith[i]);
7854				for (var j = cur.length - 1; j >= 0; j--){
7855					var inst = $.data(cur[j], this.widgetName);
7856					if(inst && inst != this && !inst.options.disabled) {
7857						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
7858						this.containers.push(inst);
7859					}
7860				};
7861			};
7862		}
7863
7864		for (var i = queries.length - 1; i >= 0; i--) {
7865			var targetData = queries[i][1];
7866			var _queries = queries[i][0];
7867
7868			for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
7869				var item = $(_queries[j]);
7870
7871				item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)
7872
7873				items.push({
7874					item: item,
7875					instance: targetData,
7876					width: 0, height: 0,
7877					left: 0, top: 0
7878				});
7879			};
7880		};
7881
7882	},
7883
7884	refreshPositions: function(fast) {
7885
7886		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
7887		if(this.offsetParent && this.helper) {
7888			this.offset.parent = this._getParentOffset();
7889		}
7890
7891		for (var i = this.items.length - 1; i >= 0; i--){
7892			var item = this.items[i];
7893
7894			//We ignore calculating positions of all connected containers when we're not over them
7895			if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
7896				continue;
7897
7898			var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
7899
7900			if (!fast) {
7901				item.width = t.outerWidth();
7902				item.height = t.outerHeight();
7903			}
7904
7905			var p = t.offset();
7906			item.left = p.left;
7907			item.top = p.top;
7908		};
7909
7910		if(this.options.custom && this.options.custom.refreshContainers
7910) {
7911			this.options.custom.refreshContainers.call(this);
7912		} else {
7913			for (var i = this.containers.length - 1; i >= 0; i--){
7914				var p = this.containers[i].element.offset();
7915				this.containers[i].containerCache.left = p.left;
7916				this.containers[i].containerCache.top = p.top;
7917				this.containers[i].containerCache.width	= this.containers[i].element.outerWidth();
7918				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
7919			};
7920		}
7921
7922		return this;
7923	},
7924
7925	_createPlaceholder: function(that) {
7926		that = that || this;
7927		var o = that.options;
7928
7929		if(!o.placeholder || o.placeholder.constructor == String) {
7930			var className = o.placeholder;
7931			o.placeholder = {
7932				element: function() {
7933
7934					var el = $(document.createElement(that.currentItem[0].nodeName))
7935						.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
7936						.removeClass("ui-sortable-helper")[0];
7937
7938					if(!className)
7939						el.style.visibility = "hidden";
7940
7941					return el;
7942				},
7943				update: function(container, p) {
7944
7945					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
7946					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
7947					if(className && !o.forcePlaceholderSize) return;
7948
7949					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
7950					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };
7951					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };
7952				}
7953			};
7954		}
7955
7956		//Create the placeholder
7957		that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
7958
7959		//Append it after the actual current item
7960		that.currentItem.after(that.placeholder);
7961
7962		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
7963		o.placeholder.update(that, that.placeholder);
7964
7965	},
7966
7967	_contactContainers: function(event) {
7968
7969		// get innermost container that intersects with item
7970		var innermostContainer = null, innermostIndex = null;
7971
7972
7973		for (var i = this.containers.length - 1; i >= 0; i--){
7974
7975			// never consider a container that's located within the item itself
7976			if($.contains(this.currentItem[0], this.containers[i].element[0]))
7977				continue;
7978
7979			if(this._intersectsWith(this.containers[i].containerCache)) {
7980
7981				// if we've already found a container and it's more "inner" than this, then continue
7982				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))
7983					continue;
7984
7985				innermostContainer = this.containers[i];
7986				innermostIndex = i;
7987
7988			} else {
7989				// container doesn't intersect. trigger "out" event if necessary
7990				if(this.containers[i].containerCache.over) {
7991					this.containers[i]._trigger("out", event, this._uiHash(this));
7992					this.containers[i].containerCache.over = 0;
7993				}
7994			}
7995
7996		}
7997
7998		// if no intersecting containers found, return
7999		if(!innermostContainer) return;
8000
8001		// move the item into the container if it's not there already
8002		if(this.containers.length === 1) {
8003			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
8004			this.containers[innermostIndex].containerCache.over = 1;
8005		} else {
8006
8007			//When entering a new container, we will find the item with the least distance and append our item near it
8008			var dist = 10000; var itemWithLeastDistance = null;
8009			var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';
8010			var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';
8011			var base = this.positionAbs[posProperty] + this.offset.click[posProperty];
8012			for (var j = this.items.length - 1; j >= 0; j--) {
8013				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
8014				if(this.items[j].item[0] == this.currentItem[0]) continue;
8015				var cur = this.items[j].item.offset()[posProperty];
8016				var nearBottom = false;
8017				if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
8018					nearBottom = true;
8019					cur += this.items[j][sizeProperty];
8020				}
8021
8022				if(Math.abs(cur - base) < dist) {
8023					dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
8024					this.direction = nearBottom ? "up": "down";
8025				}
8026			}
8027
8028			if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
8029				return;
8030
8031			this.currentContainer = this.containers[innermostIndex];
8032			itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
8033			this._trigger("change", event, this._uiHash());
8034			this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
8035
8036			//Update the placeholder
8037			this.options.placeholder.update(this.currentContainer, this.placeholder);
8038
8039			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
8040			this.containers[innermostIndex].containerCache.over = 1;
8041		}
8042
8043
8044	},
8045
8046	_createHelper: function(event) {
8047
8048		var o = this.options;
8049		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
8050
8051		if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
8052			$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
8053
8054		if(helper[0] == this.currentItem[0])
8055			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left
8055: this.currentItem.css("left") };
8056
8057		if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
8058		if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
8059
8060		return helper;
8061
8062	},
8063
8064	_adjustOffsetFromHelper: function(obj) {
8065		if (typeof obj == 'string') {
8066			obj = obj.split(' ');
8067		}
8068		if ($.isArray(obj)) {
8069			obj = {left: +obj[0], top: +obj[1] || 0};
8070		}
8071		if ('left' in obj) {
8072			this.offset.click.left = obj.left + this.margins.left;
8073		}
8074		if ('right' in obj) {
8075			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
8076		}
8077		if ('top' in obj) {
8078			this.offset.click.top = obj.top + this.margins.top;
8079		}
8080		if ('bottom' in obj) {
8081			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
8082		}
8083	},
8084
8085	_getParentOffset: function() {
8086
8087
8088		//Get the offsetParent and cache its position
8089		this.offsetParent = this.helper.offsetParent();
8090		var po = this.offsetParent.offset();
8091
8092		// This is a special case where we need to modify a offset calculated on start, since the following happened:
8093		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
8094		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
8095		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
8096		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
8097			po.left += this.scrollParent.scrollLeft();
8098			po.top += this.scrollParent.scrollTop();
8099		}
8100
8101		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
8102		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix
8103			po = { top: 0, left: 0 };
8104
8105		return {
8106			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
8107			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
8108		};
8109
8110	},
8111
8112	_getRelativeOffset: function() {
8113
8114		if(this.cssPosition == "relative") {
8115			var p = this.currentItem.position();
8116			return {
8117				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
8118				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
8119			};
8120		} else {
8121			return { top: 0, left: 0 };
8122		}
8123
8124	},
8125
8126	_cacheMargins: function() {
8127		this.margins = {
8128			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
8129			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
8130		};
8131	},
8132
8133	_cacheHelperProportions: function() {
8134		this.helperProportions = {
8135			width: this.helper.outerWidth(),
8136			height: this.helper.outerHeight()
8137		};
8138	},
8139
8140	_setContainment: function() {
8141
8142		var o = this.options;
8143		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
8144		if(o.containment == 'document' || o.containment == 'window') this.containment = [
8145			0 - this.offset.relative.left - this.offset.parent.left,
8146			0 - this.offset.relative.top - this.offset.parent.top,
8147			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
8148			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
8149		];
8150
8151		if(!(/^(document|window|parent)$/).test(o.containment)) {
8152			var ce = $(o.containment)[0];
8153			var co = $(o.containment).offset();
8154			var over = ($(ce).css("overflow") != 'hidden');
8155
8156			this.containment = [
8157				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
8158				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
8159				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
8160				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),
816010) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
8161			];
8162		}
8163
8164	},
8165
8166	_convertPositionTo: function(d, pos) {
8167
8168		if(!pos) pos = this.position;
8169		var mod = d == "absolute" ? 1 : -1;
8170		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
8171
8172		return {
8173			top: (
8174				pos.top																	// The absolute mouse position
8175				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
8176				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
8177				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
8178			),
8179			left: (
8180				pos.left																// The absolute mouse position
8181				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
8182				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
8183				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
8184			)
8185		};
8186
8187	},
8188
8189	_generatePosition: function(event) {
8190
8191		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
8192
8193		// This is another very weird special case that only happens for relative elements:
8194		// 1. If the css position is relative
8195		// 2. and the scroll parent is the document or similar to the offset parent
8196		// we have to refresh the relative offset during the scroll so there are no jumps
8197		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
8198			this.offset.relative = this._getRelativeOffset();
8199		}
8200
8201		var pageX = event.pageX;
8202		var pageY = event.pageY;
8203
8204		/*
8205		 * - Position constraining -
8206		 * Constrain the position to a mix of grid, containment.
8207		 */
8208
8209		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
8210
8211			if(this.containment) {
8212				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
8213				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
8214				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
8215				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
8216			}
8217
8218			if(o.grid) {
8219				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
8220				pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
8221
8222				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
8223				pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
8224			}
8225
8226		}
8227
8228		return {
8229			top: (
8230				pageY																// The absolute mouse position
8231				- this.offset.click.top													// Click offset (relative to the element)
8232				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
8233				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
8234				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
8235			),
8236			left: (
8237				pageX																// The absolute mouse position
8238				- this.offset.click.left												// Click offset (relative to the element)
8239				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
8240				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
8241				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
8242			)
8243		};
8244
8245	},
8246
8247	_rearrange: function(event, i, a, hardRefresh) {
8248
8249		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));
8250
8251		//Various things done here to improve the performance:
8252		// 1. we create a setTimeout, that calls refreshPositions
8253		// 2. on the instance, we have a counter variable, that get's higher after every append
8254		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
8255		// 4. this lets only the last addition to the timeout stack through
8256		this.counter = this.counter ? ++this.counter : 1;
8257		var counter = this.counter;
8258
8259		this._delay(function() {
8260			if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
8261		});
8262
8263	},
8264
8265	_clear: function(event, noPropagation) {
8266
8267		this.reverting = false;
8268		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
8269		// everything else normalized again
8270		var delayedTriggers = [];
8271
8272		// We first have to update the dom position of the actual currentItem
8273		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
8274		if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
8275		this._noFinalSort = null;
8276
8277		if(this.helper[0] == this.currentItem[0]) {
8278			for(var i in this._storedCSS) {
8279				if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
8280			}
8281			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
8282		} else {
8283			this.currentItem.show();
8284		}
8285
8286		if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
8287		if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
8288
8289		// Check if the items Container has Changed and trigger appropriate
8290		// events.
8291		if (this !== this.currentContainer) {
8292			if(!noPropagation) {
8293				delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
8294				delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
8295				delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
8296			}
8297		}
8298
8299
8300		//Post events to containers
8301		for (var i = this.containers.length - 1; i >= 0; i--){
8302			if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
8303			if(this.containers[i].containerCache.over) {
8304				delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
8305				this.containers[i].containerCache.over = 0;
8306			}
8307		}
8308
8309		//Do what was originally in plugins
8310		if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
8311		if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity
8312		if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
8313
8314		this.dragging = false;
8315		if(this.cancelHelperRemoval) {
8316			if(!noPropagation) {
8317				this._trigger("beforeStop", event, this._uiHash());
8318				for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
8319				this._trigger("stop", event, this._uiHash());
8320			}
8321
8322			this.fromOutside = false;
8323			return false;
8324		}
8325
8326		if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
8327
8328		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
8329		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
8330
8331		if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
8332
8333		if(!noPropagation) {
8334			for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
8335			this._trigger("stop", event, this._uiHash());
8336		}
8337
8338		this.fromOutside = false;
8339		return true;
8340
8341	},
8342
8343	_trigger: function() {
8344		if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
8345			this.cancel();
8346		}
8347	},
8348
8349	_uiHash: function(_inst) {
8350		var inst = _inst || this;
8351		return {
8352			helper: inst.helper,
8353			placeholder: inst.placeholder || $([]),
8354			position: inst.position,
8355			originalPosition: inst.originalPosition,
8356			offset: inst.positionAbs,
8357			item: inst.currentItem,
8358			sender: _inst ? _inst.element : null
8359		};
8360	}
8361
8362});
8363
8364})(jQuery);
8365(function( $, undefined ) {
8366
8367$.extend($.ui, { datepicker: { version: "1.9.2" } });
8368
8369var PROP_NAME = 'datepicker';
8370var dpuuid = new Date().getTime();
8371var instActive;
8372
8373/* Date picker manager.
8374   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
8375   Settings for (groups of) date pickers are maintained in an instance object,
8376   allowing multiple different settings on the same page. */
8377
8378function Datepicker() {
8379	this.debug = false; // Change this to true to start debugging
8380	this._curInst = null; // The current instance in use
8381	this._keyEvent = false; // If the last event was a key event
8382	this._disabledInputs = []; // List of date picker inputs that have been disabled
8383	this._datepickerShowing = false; // True if the popup picker is showing , false if not
8384	this._inDialog = false; // True if showing within a "dialog", false if not
8385	this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
8386	this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
8387	this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
8388	this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
8389	this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
8390	this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
8391	this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
8392	this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
8393	this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
8394	this.regional = []; // Available regional settings, indexed by language code
8395	this.regional[''] = { // Default regional settings
8396		closeText: 'Done', // Display text for close link
8397		prevText: 'Prev', // Display text for previous month link
8398		nextText: 'Next', // Display text for next month link
8399		currentText: 'Today', // Display text for current month link
8400		monthNames: ['January','February','March','April','May','June',
8401			'July','August','September','October','November','December'], // Names of months for drop-down and formatting
8402		monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
8403		dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
8404		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
8405		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
8406		weekHeader: 'Wk', // Column header for week of the year
8407		dateFormat: 'mm/dd/yy', // See format options on parseDate
8408		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
8409		isRTL: false, // True if right-to-left language, false if left-to-right
8410		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
8411		yearSuffix: '' // Additional text to append to the year in the month headers
8412	};
8413	this._defaults = { // Global defaults for all the date picker instances
8414		showOn: 'focus', // 'focus' for popup on focus,
8415			// 'button' for trigger button, or 'both' for either
8416		showAnim: 'fadeIn', // Name of jQuery animation for popup
8417		showOptions: {}, // Options for enhanced animations
8418		defaultDate: null, // Used when field is blank: actual date,
8419			// +/-number for offset from today, null for today
8420		appendText: '', // Display text following the input box, e.g. showing the format
8421		buttonText: '...', // Text for trigger button
8422		buttonImage: '', // URL for trigger button image
8423		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
8424		hideIfNoPrevNext: false, // True to hide next/previous month links
8425			// if not applicable, false to just disable them
8426		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
8427		gotoCurrent: false, // True if today link goes back to current selection instead
8428		changeMonth: false, // True if month can be selected directly, false if only prev/next
8429		changeYear: false, // True if year can be selected directly, false if only prev/next
8430		yearRange: 'c-10:c+10', // Range of years to display in drop-down,
8431			// either relative to today's year (-nn:+nn), relative to currently displayed year
8432			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
8433		showOtherMonths: false, // True to show dates in other months, false to leave blank
8434		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
8435		showWeek: false, // True to show week of the year, false to not show it
8436		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
8437			// takes a Date and returns the number of the week for it
8438		shortYearCutoff: '+10', // Short year values < this are in the current century,
8439			// > this are in the previous century,
8440			// string value starting with '+' for current year + value
8441		minDate: null, // The earliest selectable date, or null for no limit
8442		maxDate: null, // The latest selectable date, or null for no limit
8443		duration: 'fast', // Duration of display/closure
8444		beforeShowDay: null, // Function that takes a date and returns an array with
8445			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
8446			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
8447		beforeShow: null, // Function that takes an input field and
8448			// returns a set of custom settings for the date picker
8449		onSelect: null, // Define a callback function when a date is selected
8450		onChangeMonthYear: null, // Define a callback function when the month or year is changed
8451		onClose: null, // Define a callback function when the datepicker is closed
8452		numberOfMonths: 1, // Number of months to show at a time
8453		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
8454		stepMonths: 1, // Number of months to step back/forward
8455		stepBigMonths: 12, // Number of months to step back/forward for the big links
8456		altField: '', // Selector for an alternate field to store selected dates into
8457		altFormat: '', // The date format to use for the alternate field
8458		constrainInput: true, // The input is constrained by the current date format
8459		showButtonPanel: false, // True to show button panel, false to not show it
8460		autoSize: false, // True to size the input for the date format, false to leave as is
8461		disabled: false // The initial disabled state
8462	};
8463	$.extend(this._defaults, this.regional['']);
8464	this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'));
8465}
8466
8467$.extend(Datepicker.prototype, {
8468	/* Class name added to elements to indicate already configured with a date picker. */
8469	markerClassName: 'hasDatepicker',
8470
8471	//Keep track of the maximum number of rows displayed (see #7043)
8472	maxRows: 4,
8473
8474	/* Debug logging (if enabled). */
8475	log: function () {
8476		if (this.debug)
8477			console.log.apply('', arguments);
8478	},
8479
8480	// TODO rename to "widget" when switching to widget factory
8481	_widgetDatepicker: function() {
8482		return this.dpDiv;
8483	},
8484
8485	/* Override the default settings for all instances of the date picker.
8486	   @param  settings  object - the new settings to use as defaults (anonymous object)
8487	   @return the manager object */
8488	setDefaults: function(settings) {
8489		extendRemove(this._defaults, settings || {});
8490		return this;
8491	},
8492
8493	/* Attach the date picker to a jQuery selection.
8494	   @param  target    element - the target input field or division or span
8495	   @param  settings  object - the new settings to use for this date picker instance (anonymous) */
8496	_attachDatepicker: function(target, settings) {
8497		// check for settings on the control itself - in namespace 'date:'
8498		var inlineSettings = null;
8499		for (var attrName in this._defaults) {
8500			var attrValue = target.getAttribute('date:' + attrName);
8501			if (attrValue) {
8502				inlineSettings = inlineSettings || {};
8503				try {
8504					inlineSettings[attrName] = eval(attrValue);
8505				} catch (err) {
8506					inlineSettings[attrName] = attrValue;
8507				}
8508			}
8509		}
8510		var nodeName = target.nodeName.toLowerCase();
8511		var inline = (nodeName == 'div' || nodeName == 'span');
8512		if (!target.id) {
8513			this.uuid += 1;
8514			target.id = 'dp' + this.uuid;
8515		}
8516		var inst = this._newInst($(target), inline);
8517		inst.settings = $.extend({}, settings || {}, inlineSettings || {});
8518		if (nodeName == 'input') {
8519			this._connectDatepicker(target, inst);
8520		} else if (inline) {
8521			this._inlineDatepicker(target, inst);
8522		}
8523	},
8524
8525	/* Create a new instance object. */
8526	_newInst: function(target, inline) {
8527		var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars
8528		return {id: id, input: target, // associated target
8529			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
8530			drawMonth: 0, drawYear: 0, // month being drawn
8531			inline: inline, // is datepicker inline or not
8532			dpDiv: (!inline ? this.dpDiv : // presentation div
8533			bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))};
8534	},
8535
8536	/* Attach the date picker to an input field. */
8537	_connectDatepicker: function(target, inst) {
8538		var input = $(target);
8539		inst.append = $([]);
8540		inst.trigger = $([]);
8541		if (input.hasClass(this.markerClassName))
8542			return;
8543		this._attachments(input, inst);
8544		input.addClass(this.markerClassName).keydown(this._doKeyDown).
8545			keypress(this._doKeyPress).keyup(this._doKeyUp).
8546			bind("setData.datepicker", function(event, key, value) {
8547				inst.settings[key] = value;
8548			}).bind("getData.datepicker", function(event, key) {
8549				return this._get(inst, key);
8550			});
8551		this._autoSize(inst);
8552		$.data(target, PROP_NAME, inst);
8553		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
8554		if( inst.settings.disabled ) {
8555			this._disableDatepicker( target );
8556		}
8557	},
8558
8559	/* Make attachments based on settings. */
8560	_attachments: function(input, inst) {
8561		var appendText = this._get(inst, 'appendText');
8562		var isRTL = this._get(inst, 'isRTL');
8563		if (inst.append)
8564			inst.append.remove();
8565		if (appendText) {
8566			inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
8567			input[isRTL ? 'before' : 'after'](inst.append);
8568		}
8569		input.unbind('focus', this._showDatepicker);
8570		if (inst.trigger)
8571			inst.trigger.remove();
8572		var showOn = this._get(inst, 'showOn');
8573		if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
8574			input.focus(this._showDatepicker);
8575		if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
8576			var buttonText = this._get(inst, 'buttonText');
8577			var buttonImage = this._get(inst, 'buttonImage');
8578			inst.trigger = $(this._get(inst, 'buttonImageOnly') ?
8579				$('<img/>').addClass(this._triggerClass).
8580					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
8581				$('<button type="button"></button>').addClass(this._triggerClass).
8582					html(buttonImage == '' ? buttonText : $('<img/>').attr(
8583					{ src:buttonImage, alt:buttonText, title:buttonText })));
8584			input[isRTL ? 'before' : 'after'](inst.trigger);
8585			inst.trigger.click(function() {
8586				if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])
8587					$.datepicker._hideDatepicker();
8588				else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) {
8589					$.datepicker._hideDatepicker();
8590					$.datepicker._showDatepicker(input[0]);
8591				} else
8592					$.datepicker._showDatepicker(input[0]);
8593				return false;
8594			});
8595		}
8596	},
8597
8598	/* Apply the maximum length for the date format. */
8599	_autoSize: function(inst) {
8600		if (this._get(inst, 'autoSize') && !inst.inline) {
8601			var date = new Date(2009, 12 - 1, 20); // Ensure double digits
8602			var dateFormat = this._get(inst, 'dateFormat');
8603			if (dateFormat.match(/[DM]/)) {
8604				var findMax = function(names) {
8605					var max = 0;
8606					var maxI = 0;
8607					for (var i = 0; i < names.length; i++) {
8608						if (names[i].length > max) {
8609							max = names[i].length;
8610							maxI = i;
8611						}
8612					}
8613					return maxI;
8614				};
8615				date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
8616					'monthNames' : 'monthNamesShort'))));
8617				date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
8618					'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());
8619			}
8620			inst.input.attr('size', this._formatDate(inst, date).length);
8621		}
8622	},
8623
8624	/* Attach an inline date picker to a div. */
8625	_inlineDatepicker: function(target, inst) {
8626		var divSpan = $(target);
8627		if (divSpan.hasClass(this.markerClassName))
8628			return;
8629		divSpan.addClass(this.markerClassName).append(inst.dpDiv).
8630			bind("setData.datepicker", function(event, key, value){
8631				inst.settings[key] = value;
8632			}).bind("getData.datepicker", function(event, key){
8633				return this._get(inst, key);
8634			});
8635		$.data(target, PROP_NAME, inst);
8636		this._setDate(inst, this._getDefaultDate(inst), true);
8637		this._updateDatepicker(inst);
8638		this._updateAlternate(inst);
8639		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
8640		if( inst.settings.disabled ) {
8641			this._disableDatepicker( target );
8642		}
8643		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
8644		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
8645		inst.dpDiv.css( "display", "block" );
8646	},
8647
8648	/* Pop-up the date picker in a "dialog" box.
8649	   @param  input     element - ignored
8650	   @param  date      string or Date - the initial date to display
8651	   @param  onSelect  function - the function to call when a date is selected
8652	   @param  settings  object - update the dialog date picker instance's settings (anonymous object)
8653	   @param  pos       int[2] - coordinates for the dialog's position within the screen or
8654	                     event - with x/y coordinates or
8655	                     leave empty for default (screen centre)
8656	   @return the manager object */
8657	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
8658		var inst = this._dialogInst; // internal instance
8659		if (!inst) {
8660			this.uuid += 1;
8661			var id = 'dp' + this.uuid;
8662			this._dialogInput = $('<input type="text" id="' + id +
8663				'" style="position: absolute; top: -100px; width: 0px;"/>');
8664			this._dialogInput.keydown(this._doKeyDown);
8665			$('body').append(this._dialogInput);
8666			inst = this._dialogInst = this._newInst(this._dialogInput, false);
8667			inst.settings = {};
8668			$.data(this._dialogInput[0], PROP_NAME, inst);
8669		}
8670		extendRemove(inst.settings, settings || {});
8671		date = (date && date.constructor == Date ? this._formatDate(inst, date) : date);
8672		this._dialogInput.val(date);
8673
8674		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
8675		if (!this._pos) {
8676			var browserWidth = document.documentElement.clientWidth;
8677			var browserHeight = document.documentElement.clientHeight;
8678			var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
8679			var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
8680			this._pos = // should use actual width/height below
8681				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
8682		}
8683
8684		// move input on screen for focus, but hidden behind dialog
8685		this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px');
8686		inst.settings.onSelect = onSelect;
8687		this._inDialog = true;
8688		this.dpDiv.addClass(this._dialogClass);
8689		this._showDatepicker(this._dialogInput[0]);
8690		if ($.blockUI)
8691			$.blockUI(this.dpDiv);
8692		$.data(this._dialogInput[0], PROP_NAME, inst);
8693		return this;
8694	},
8695
8696	/* Detach a datepicker from its control.
8697	   @param  target    element - the target input field or division or span */
8698	_destroyDatepicker: function(target) {
8699		var $target = $(target);
8700		var inst = $.data(target, PROP_NAME);
8701		if (!$target.hasClass(this.markerClassName)) {
8702			return;
8703		}
8704		var nodeName = target.nodeName.toLowerCase();
8705		$.removeData(target, PROP_NAME);
8706		if (nodeName == 'input') {
8707			inst.append.remove();
8708			inst.trigger.remove();
8709			$target.removeClass(this.markerClassName).
8710				unbind('focus', this._showDatepicker).
8711				unbind('keydown', this._doKeyDown).
8712				unbind('keypress', this._doKeyPress).
8713				unbind('keyup', this._doKeyUp);
8714		} else if (nodeName == 'div' || nodeName == 'span')
8715			$target.removeClass(this.markerClassName).empty();
8716	},
8717
8718	/* Enable the date picker to a jQuery selection.
8719	   @param  target    element - the target input field or division or span */
8720	_enableDatepicker: function(target) {
8721		var $target = $(target);
8722		var inst = $.data(target, PROP_NAME);
8723		if (!$target.hasClass(this.markerClassName)) {
8724			return;
8725		}
8726		var nodeName = target.nodeName.toLowerCase();
8727		if (nodeName == 'input') {
8728			target.disabled = false;
8729			inst.trigger.filter('button').
8730				each(function() { this.disabled = false; }).end().
8731				filter('img').css({opacity: '1.0', cursor: ''});
8732		}
8733		else if (nodeName == 'div' || nodeName == 'span') {
8734			var inline = $target.children('.' + this._inlineClass);
8735			inline.children().removeClass('ui-state-disabled');
8736			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
8737				prop("disabled", false);
8738		}
8739		this._disabledInputs = $.map(this._disabledInputs,
8740			function(value) { return (value == target ? null : value); }); // delete entry
8741	},
8742
8743	/* Disable the date picker to a jQuery selection.
8744	   @param  target    element - the target input field or division or span */
8745	_disableDatepicker: function(target) {
8746		var $target = $(target);
8747		var inst = $.data(target, PROP_NAME);
8748		if (!$target.hasClass(this.markerClassName)) {
8749			return;
8750		}
8751		var nodeName = target.nodeName.toLowerCase();
8752		if (nodeName == 'input') {
8753			target.disabled = true;
8754			inst.trigger.filter('button').
8755				each(function() { this.disabled = true; }).end().
8756				filter('img').css({opacity: '0.5', cursor: 'default'});
8757		}
8758		else if (nodeName == 'div' || nodeName == 'span') {
8759			var inline = $target.children('.' + this._inlineClass);
8760			inline.children().addClass('ui-state-disabled');
8761			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
8762				prop("disabled", true);
8763		}
8764		this._disabledInputs = $.map(this._disabledInputs,
8765			function(value) { return (value == target ? null : value); }); // delete entry
8766		this._disabledInputs[this._disabledInputs.length] = target;
8767	},
8768
8769	/* Is the first field in a jQuery collection disabled as a datepicker?
8770	   @param  target    element - the target input field or division or span
8771	   @return boolean - true if disabled, false if enabled */
8772	_isDisabledDatepicker: function(target) {
8773		if (!target) {
8774			return false;
8775		}
8776		for (var i = 0; i < this._disabledInputs.length; i++) {
8777			if (this._disabledInputs[i] == target)
8778				return true;
8779		}
8780		return false;
8781	},
8782
8783	/* Retrieve the instance data for the target control.
8784	   @param  target  element - the target input field or division or span
8785	   @return  object - the associated instance data
8786	   @throws  error if a jQuery problem getting data */
8787	_getInst: function(target) {
8788		try {
8789			return $.data(target, PROP_NAME);
8790		}
8791		catch (err) {
8792			throw 'Missing instance data for this datepicker';
8793		}
8794	},
8795
8796	/* Update or retrieve the settings for a date picker attached to an input field or division.
8797	   @param  target  element - the target input field or division or span
8798	   @param  name    object - the new settings to update or
8799	                   string - the name of the setting to change or retrieve,
8800	                   when retrieving also 'all' for all instance settings or
8801	                   'defaults' for all global defaults
8802	   @param  value   any - the new value for the setting
8803	                   (omit if above is an object or to retrieve a value) */
8804	_optionDatepicker: function(target, name, value) {
8805		var inst = this._getInst(target);
8806		if (arguments.length == 2 && typeof name == 'string') {
8807			return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :
8808				(inst ? (name == 'all' ? $.extend({}, inst.settings) :
8809				this._get(inst, name)) : null));
8810		}
8811		var settings = name || {};
8812		if (typeof name == 'string') {
8813			settings = {};
8814			settings[name] = value;
8815		}
8816		if (inst) {
8817			if (this._curInst == inst) {
8818				this._hideDatepicker();
8819			}
8820			var date = this._getDateDatepicker(target, true);
8821			var minDate = this._getMinMaxDate(inst, 'min');
8822			var maxDate = this._getMinMaxDate(inst, 'max');
8823			extendRemove(inst.settings, settings);
8824			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
8825			if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined)
8826				inst.settings.minDate = this._formatDate(inst, minDate);
8827			if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined)
8828				inst.settings.maxDate = this._formatDate(inst, maxDate);
8829			this._attachments($(target), inst);
8830			this._autoSize(inst);
8831			this._setDate(inst, date);
8832			this._updateAlternate(inst);
8833			this._updateDatepicker(inst);
8834		}
8835	},
8836
8837	// change method deprecated
8838	_changeDatepicker: function(target, name, value) {
8839		this._optionDatepicker(target, name, value);
8840	},
8841
8842	/* Redraw the date picker attached to an input field or division.
8843	   @param  target  element - the target input field or division or span */
8844	_refreshDatepicker: function(target) {
8845		var inst = this._getInst(target);
8846		if (inst) {
8847			this._updateDatepicker(inst);
8848		}
8849	},
8850
8851	/* Set the dates for a jQuery selection.
8852	   @param  target   element - the target input field or division or span
8853	   @param  date     Date - the new date */
8854	_setDateDatepicker: function(target, date) {
8855		var inst = this._getInst(target);
8856		if (inst) {
8857			this._setDate(inst, date);
8858			this._updateDatepicker(inst);
8859			this._updateAlternate(inst);
8860		}
8861	},
8862
8863	/* Get the date(s) for the first entry in a jQuery selection.
8864	   @param  target     element - the target input field or division or span
8865	   @param  noDefault  boolean - true if no default date is to be used
8866	   @return Date - the current date */
8867	_getDateDatepicker: function(target, noDefault) {
8868		var inst = this._getInst(target);
8869		if (inst && !inst.inline)
8870			this._setDateFromField(inst, noDefault);
8871		return (inst ? this._getDate(inst) : null);
8872	},
8873
8874	/* Handle keystrokes. */
8875	_doKeyDown: function(event) {
8876		var inst = $.datepicker._getInst(event.target);
8877		var handled = true;
8878		var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
8879		inst._keyEvent = true;
8880		if ($.datepicker._datepickerShowing)
8881			switch (event.keyCode) {
8882				case 9: $.datepicker._hideDatepicker();
8883						handled = false;
8884						break; // hide on tab out
8885				case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' +
8886									$.datepicker._currentClass + ')', inst.dpDiv);
8887						if (sel[0])
8888							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
8889							var onSelect = $.datepicker._get(inst, 'onSelect');
8890							if (onSelect) {
8891								var dateStr = $.datepicker._formatDate(inst);
8892
8893								// trigger custom callback
8894								onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
8895							}
8896						else
8897							$.datepicker._hideDatepicker();
8898						return false; // don't submit the form
8899						break; // select the value on enter
8900				case 27: $.datepicker._hideDatepicker();
8901						break; // hide on escape
8902				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
8903							-$.datepicker._get(inst, 'stepBigMonths') :
8904							-$.datepicker._get(inst, 'stepMonths')), 'M');
8905						break; // previous month/year on page up/+ ctrl
8906				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
8907							+$.datepicker._get(inst, 'stepBigMonths') :
8908							+$.datepicker._get(inst, 'stepMonths')), 'M');
8909						break; // next month/year on page down/+ ctrl
8910				case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
8911						handled = event.ctrlKey || event.metaKey;
8912						break; // clear on ctrl or command +end
8913				case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
8914						handled = event.ctrlKey || event.metaKey;
8915						break; // current on ctrl or command +home
8916				case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
8917						handled = event.ctrlKey || event.metaKey;
8918						// -1 day on ctrl or command +left
8919						if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
8920									-$.datepicker._get(inst, 'stepBigMonths') :
8921									-$.datepicker._get(inst, 'stepMonths')), 'M');
8922						// next month/year on alt +left on Mac
8923						break;
8924				case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
8925						handled = event.ctrlKey || event.metaKey;
8926						break; // -1 week on ctrl or command +up
8927				case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
8928						handled = event.ctrlKey || event.metaKey;
8929						// +1 day on ctrl or command +right
8930						if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
8931									+$.datepicker._get(inst, 'stepBigMonths') :
8932									+$.datepicker._get(inst, 'stepMonths')), 'M');
8933						// next month/year on alt +right
8934						break;
8935				case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
8936						handled = event.ctrlKey || event.metaKey;
8937						break; // +1 week on ctrl or command +down
8938				default: handled = false;
8939			}
8940		else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
8941			$.datepicker._showDatepicker(this);
8942		else {
8943			handled = false;
8944		}
8945		if (handled) {
8946			event.preventDefault();
8947			event.stopPropagation();
8948		}
8949	},
8950
8951	/* Filter entered characters - based on date format. */
8952	_doKeyPress: function(event) {
8953		var inst = $.datepicker._getInst(event.target);
8954		if ($.datepicker._get(inst, 'constrainInput')) {
8955			var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
8956			var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
8957			return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
8958		}
8959	},
8960
8961	/* Synchronise manual entry and field/alternate field. */
8962	_doKeyUp: function(event) {
8963		var inst = $.datepicker._getInst(event.target);
8964		if (inst.input.val() != inst.lastVal) {
8965			try {
8966				var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
8967					(inst.input ? inst.input.val() : null),
8968					$.datepicker._getFormatConfig(inst));
8969				if (date) { // only if valid
8970					$.datepicker._setDateFromField(inst);
8971					$.datepicker._updateAlternate(inst);
8972					$.datepicker._updateDatepicker(inst);
8973				}
8974			}
8975			catch (err) {
8976				$.datepicker.log(err);
8977			}
8978		}
8979		return true;
8980	},
8981
8982	/* Pop-up the date picker for a given input field.
8983	   If false returned from beforeShow event handler do not show.
8984	   @param  input  element - the input field attached to the date picker or
8985	                  event - if triggered by focus */
8986	_showDatepicker: function(input) {
8987		input = input.target || input;
8988		if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
8989			input = $('input', input.parentNode)[0];
8990		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
8991			return;
8992		var inst = $.datepicker._getInst(input);
8993		if ($.datepicker._curInst && $.datepicker._curInst != inst) {
8994			$.datepicker._curInst.dpDiv.stop(true, true);
8995			if ( inst && $.datepicker._datepickerShowing ) {
8996				$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
8997			}
8998		}
8999		var beforeShow = $.datepicker._get(inst, 'beforeShow');
9000		var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
9001		if(beforeShowSettings === false){
9002			//false
9003			return;
9004		}
9005		extendRemove(inst.settings, beforeShowSettings);
9006		inst.lastVal = null;
9007		$.datepicker._lastInput = input;
9008		$.datepicker._setDateFromField(inst);
9009		if ($.datepicker._inDialog) // hide cursor
9010			input.value = '';
9011		if (!$.datepicker._pos) { // position below input
9012			$.datepicker._pos = $.datepicker._findPos(input);
9013			$.datepicker._pos[1] += input.offsetHeight; // add the height
9014		}
9015		var isFixed = false;
9016		$(input).parents().each(function() {
9017			isFixed |= $(this).css('position') == 'fixed';
9018			return !isFixed;
9019		});
9020		var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
9021		$.datepicker._pos = null;
9022		//to avoid flashes on Firefox
9023		inst.dpDiv.empty();
9024		// determine sizing offscreen
9025		inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
9026		$.datepicker._updateDatepicker(inst);
9027		// fix width for dynamic number of date pickers
9028		// and adjust position before showing
9029		offset = $.datepicker._checkOffset(inst, offset, isFixed);
9030		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
9031			'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
9032			left: offset.left + 'px', top: offset.top + 'px'});
9033		if (!inst.inline) {
9034			var showAnim = $.datepicker._get(inst, 'showAnim');
9035			var duration = $.datepicker._get(inst, 'duration');
9036			var postProcess = function() {
9037				var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
9038				if( !! cover.length ){
9039					var borders = $.datepicker._getBorders(inst.dpDiv);
9040					cover.css({left: -borders[0], top: -borders[1],
9041						width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});
9042				}
9043			};
9044			inst.dpDiv.zIndex($(input).zIndex()+1);
9045			$.datepicker._datepickerShowing = true;
9046
9047			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
9048			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) )
9049				inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
9050			else
9051				inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);
9052			if (!showAnim || !duration)
9053				postProcess();
9054			if (inst.input.is(':visible') && !inst.input.is(':disabled'))
9055				inst.input.focus();
9056			$.datepicker._curInst = inst;
9057		}
9058	},
9059
9060	/* Generate the date picker content. */
9061	_updateDatepicker: function(inst) {
9062		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
9063		var borders = $.datepicker._getBorders(inst.dpDiv);
9064		instActive = inst; // for delegate hover events
9065		inst.dpDiv.empty().append(this._generateHTML(inst));
9066		this._attachHandlers(inst);
9067		var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
9068		if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6
9069			cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
9070		}
9071		inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();
9072		var numMonths = this._getNumberOfMonths(inst);
9073		var cols = numMonths[1];
9074		var width = 17;
9075		inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
9076		if (cols > 1)
9077			inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
9078		inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
9079			'Class']('ui-datepicker-multi');
9080		inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
9081			'Class']('ui-datepicker-rtl');
9082		if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
9083				// #6694 - don't focus the input if it's already focused
9084				// this breaks the change event in IE
9085				inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
9086			inst.input.focus();
9087		// deffered render of the years select (to avoid flashes on Firefox)
9088		if( inst.yearshtml ){
9089			var origyearshtml = inst.yearshtml;
9090			setTimeout(function(){
9091				//assure that inst.yearshtml didn't change.
9092				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
9093					inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);
9094				}
9095				origyearshtml = inst.yearshtml = null;
9096			}, 0);
9097		}
9098	},
9099
9100	/* Retrieve the size of left and top borders for an element.
9101	   @param  elem  (jQuery object) the element of interest
9102	   @return  (number[2]) the left and top borders */
9103	_getBorders: function(elem) {
9104		var convert = function(value) {
9105			return {thin: 1, medium: 2, thick: 3}[value] || value;
9106		};
9107		return [parseFloat(convert(elem.css('border-left-width'))),
9108			parseFloat(convert(elem.css('border-top-width')))];
9109	},
9110
9111	/* Check positioning to remain on screen. */
9112	_checkOffset: function(inst, offset, isFixed) {
9113		var dpWidth = inst.dpDiv.outerWidth();
9114		var dpHeight = inst.dpDiv.outerHeight();
9115		var inputWidth = inst.input ? inst.input.outerWidth() : 0;
9116		var inputHeight = inst.input ? inst.input.outerHeight() : 0;
9117		var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft());
9118		var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
9119
9120		offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
9121		offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
9122		offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
9123
9124		// now check if datepicker is showing outside window viewport - move to a better place if so.
9125		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
9126			Math.abs(offset.left + dpWidth - viewWidth) : 0);
9127		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
9128			Math.abs(dpHeight + inputHeight) : 0);
9129
9130		return offset;
9131	},
9132
9133	/* Find an object's position on the screen. */
9134	_findPos: function(obj) {
9135		var inst = this._getInst(obj);
9136		var isRTL = this._get(inst, 'isRTL');
9137		while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) {
9138			obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];
9139		}
9140		var position = $(obj).offset();
9141		return [position.left, position.top];
9142	},
9143
9144	/* Hide the date picker from view.
9145	   @param  input  element - the input field attached to the date picker */
9146	_hideDatepicker: function(input) {
9147		var inst = this._curInst;
9148		if (!inst || (input && inst != $.data(input, PROP_NAME)))
9149			return;
9150		if (this._datepickerShowing) {
9151			var showAnim = this._get(inst, 'showAnim');
9152			var duration = this._get(inst, 'duration');
9153			var postProcess = function() {
9154				$.datepicker._tidyDialog(inst);
9155			};
9156
9157			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
9158			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) )
9159				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
9160			else
9161				inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' :
9162					(showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
9163			if (!showAnim)
9164				postProcess();
9165			this._datepickerShowing = false;
9166			var onClose = this._get(inst, 'onClose');
9167			if (onClose)
9168				onClose.apply((inst.input ? inst.input[0] : null),
9169					[(inst.input ? inst.input.val() : ''), inst]);
9170			this._lastInput = null;
9171			if (this._inDialog) {
9172				this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
9173				if ($.blockUI) {
9174					$.unblockUI();
9175					$('body').append(this.dpDiv);
9176				}
9177			}
9178			this._inDialog = false;
9179		}
9180	},
9181
9182	/* Tidy up after a dialog display. */
9183	_tidyDialog: function(inst) {
9184		inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');
9185	},
9186
9187	/* Close date picker if clicked elsewhere. */
9188	_checkExternalClick: function(event) {
9189		if (!$.datepicker._curInst)
9190			return;
9191
9192		var $target = $(event.target),
9193			inst = $.datepicker._getInst($target[0]);
9194
9195		if ( ( ( $target[0].id != $.datepicker._mainDivId &&
9196				$target.parents('#' + $.datepicker._mainDivId).length == 0 &&
9197				!$target.hasClass($.datepicker.markerClassName) &&
9198				!$target.closest("." + $.datepicker._triggerClass).length &&
9199				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
9200			( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) )
9201			$.datepicker._hideDatepicker();
9202	},
9203
9204	/* Adjust one of the date sub-fields. */
9205	_adjustDate: function(id, offset, period) {
9206		var target = $(id);
9207		var inst = this._getInst(target[0]);
9208		if (this._isDisabledDatepicker(target[0])) {
9209			return;
9210		}
9211		this._adjustInstDate(inst, offset +
9212			(period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning
9213			period);
9214		this._updateDatepicker(inst);
9215	},
9216
9217	/* Action for current link. */
9218	_gotoToday: function(id) {
9219		var target = $(id);
9220		var inst = this._getInst(target[0]);
9221		if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
9222			inst.selectedDay = inst.currentDay;
9223			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
9224			inst.drawYear = inst.selectedYear = inst.currentYear;
9225		}
9226		else {
9227			var date = new Date();
9228			inst.selectedDay = date.getDate();
9229			inst.drawMonth = inst.selectedMonth = date.getMonth();
9230			inst.drawYear = inst.selectedYear = date.getFullYear();
9231		}
9232		this._notifyChange(inst);
9233		this._adjustDate(target);
9234	},
9235
9236	/* Action for selecting a new month/year. */
9237	_selectMonthYear: function(id, select, period) {
9238		var target = $(id);
9239		var inst = this._getInst(target[0]);
9240		inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
9241		inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
9242			parseInt(select.options[select.selectedIndex].value,10);
9243		this._notifyChange(inst);
9244		this._adjustDate(target);
9245	},
9246
9247	/* Action for selecting a day. */
9248	_selectDay: function(id, month, year, td) {
9249		var target = $(id);
9250		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
9251			return;
9252		}
9253		var inst = this._getInst(target[0]);
9254		inst.selectedDay = inst.currentDay = $('a', td).html();
9255		inst.selectedMonth = inst.currentMonth = month;
9256		inst.selectedYear = inst.currentYear = year;
9257		this._selectDate(id, this._formatDate(inst,
9258			inst.currentDay, inst.currentMonth, inst.currentYear));
9259	},
9260
9261	/* Erase the input field and hide the date picker. */
9262	_clearDate: function(id) {
9263		var target = $(id);
9264		var inst = this._getInst(target[0]);
9265		this._selectDate(target, '');
9266	},
9267
9268	/* Update the input field with the selected date. */
9269	_selectDate: function(id, dateStr) {
9270		var target = $(id);
9271		var inst = this._getInst(target[0]);
9272		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
9273		if (inst.input)
9274			inst.input.val(dateStr);
9275		this._updateAlternate(inst);
9276		var onSelect = this._get(inst, 'onSelect');
9277		if (onSelect)
9278			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
9279		else if (inst.input)
9280			inst.input.trigger('change'); // fire the change event
9281		if (inst.inline)
9282			this._updateDatepicker(inst);
9283		else {
9284			this._hideDatepicker();
9285			this._lastInput = inst.input[0];
9286			if (typeof(inst.input[0]) != 'object')
9287				inst.input.focus(); // restore focus
9288			this._lastInput = null;
9289		}
9290	},
9291
9292	/* Update any alternate field to synchronise with the main field. */
9293	_updateAlternate: function(inst) {
9294		var altField = this._get(inst, 'altField');
9295		if (altField) { // update alternate field too
9296			var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
9297			var date = this._getDate(inst);
9298			var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
9299			$(altField).each(function() { $(this).val(dateStr); });
9300		}
9301	},
9302
9303	/* Set as beforeShowDay function to prevent selection of weekends.
9304	   @param  date  Date - the date to customise
9305	   @return [boolean, string] - is this date selectable?, what is its CSS class? */
9306	noWeekends: function(date) {
9307		var day = date.getDay();
9308		return [(day > 0 && day < 6), ''];
9309	},
9310
9311	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
9312	   @param  date  Date - the date to get the week for
9313	   @return  number - the number of the week within the year that contains this date */
9314	iso8601Week: function(date) {
9315		var checkDate = new Date(date.getTime());
9316		// Find Thursday of this week starting on Monday
9317		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
9318		var time = checkDate.getTime();
9319		checkDate.setMonth(0); // Compare with Jan 1
9320		checkDate.setDate(1);
9321		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
9322	},
9323
9324	/* Parse a string value into a date object.
9325	   See formatDate below for the possible formats.
9326
9327	   @param  format    string - the expected format of the date
9328	   @param  value     string - the date in the above format
9329	   @param  settings  Object - attributes include:
9330	                     shortYearCutoff  number - the cutoff year for determining the century (optional)
9331	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
9332	                     dayNames         string[7] - names of the days from Sunday (optional)
9333	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
9334	                     monthNames       string[12] - names of the months (optional)
9335	   @return  Date - the extracted date value or null if value is blank */
9336	parseDate: function (format, value, settings) {
9337		if (format == null || value == null)
9338			throw 'Invalid arguments';
9339		value = (typeof value == 'object' ? value.toString() : value + '');
9340		if (value == '')
9341			return null;
9342		var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
9343		shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
9344				new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
9345		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
9346		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
9347		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
9348		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
9349		var year = -1;
9350		var month = -1;
9351		var day = -1;
9352		var doy = -1;
9353		var literal = false;
9354		// Check whether a format character is doubled
9355		var lookAhead = function(match) {
9356			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
9357			if (matches)
9358				iFormat++;
9359			return matches;
9360		};
9361		// Extract a number from the string value
9362		var getNumber = function(match) {
9363			var isDoubled = lookAhead(match);
9364			var size = (match == '@' ? 14 : (match == '!' ? 20 :
9365				(match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));
9366			var digits = new RegExp('^\\d{1,' + size + '}');
9367			var num = value.substring(iValue).match(digits);
9368			if (!num)
9369				throw 'Missing number at position ' + iValue;
9370			iValue += num[0].length;
9371			return parseInt(num[0], 10);
9372		};
9373		// Extract a name from the string value and convert to an index
9374		var getName = function(match, shortNames, longNames) {
9375			var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
9376				return [ [k, v] ];
9377			}).sort(function (a, b) {
9378				return -(a[1].length - b[1].length);
9379			});
9380			var index = -1;
9381			$.each(names, function (i, pair) {
9382				var name = pair[1];
9383				if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {
9384					index = pair[0];
9385					iValue += name.length;
9386					return false;
9387				}
9388			});
9389			if (index != -1)
9390				return index + 1;
9391			else
9392				throw 'Unknown name at position ' + iValue;
9393		};
9394		// Confirm that a literal character matches the string value
9395		var checkLiteral = function() {
9396			if (value.charAt(iValue) != format.charAt(iFormat))
9397				throw 'Unexpected literal at position ' + iValue;
9398			iValue++;
9399		};
9400		var iValue = 0;
9401		for (var iFormat = 0; iFormat < format.length; iFormat++) {
9402			if (literal)
9403				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
9404					literal = false;
9405				else
9406					checkLiteral();
9407			else
9408				switch (format.charAt(iFormat)) {
9409					case 'd':
9410						day = getNumber('d');
9411						break;
9412					case 'D':
9413						getName('D', dayNamesShort, dayNames);
9414						break;
9415					case 'o':
9416						doy = getNumber('o');
9417						break;
9418					case 'm':
9419						month = getNumber('m');
9420						break;
9421					case 'M':
9422						month = getName('M', monthNamesShort, monthNames);
9423						break;
9424					case 'y':
9425						year = getNumber('y');
9426						break;
9427					case '@':
9428						var date = new Date(getNumber('@'));
9429						year = date.getFullYear();
9430						month = date.getMonth() + 1;
9431						day = date.getDate();
9432						break;
9433					case '!':
9434						var date = new Date((getNumber('!') - this._ticksTo1970) / 10000);
9435						year = date.getFullYear();
9436						month = date.getMonth() + 1;
9437						day = date.getDate();
9438						break;
9439					case "'":
9440						if (lookAhead("'"))
9441							checkLiteral();
9442						else
9443							literal = true;
9444						break;
9445					default:
9446						checkLiteral();
9447				}
9448		}
9449		if (iValue < value.length){
9450			var extra = value.substr(iValue);
9451			if (!/^\s+/.test(extra)) {
9452				throw "Extra/unparsed characters found in date: " + extra;
9453			}
9454		}
9455		if (year == -1)
9456			year = new Date().getFullYear();
9457		else if (year < 100)
9458			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
9459				(year <= shortYearCutoff ? 0 : -100);
9460		if (doy > -1) {
9461			month = 1;
9462			day = doy;
9463			do {
9464				var dim = this._getDaysInMonth(year, month - 1);
9465				if (day <= dim)
9466					break;
9467				month++;
9468				day -= dim;
9469			} while (true);
9470		}
9471		var date = this._daylightSavingAdjust(new Date(year, month - 1, day));
9472		if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
9473			throw 'Invalid date'; // E.g. 31/02/00
9474		return date;
9475	},
9476
9477	/* Standard date formats. */
9478	ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
9479	COOKIE: 'D, dd M yy',
9480	ISO_8601: 'yy-mm-dd',
9481	RFC_822: 'D, d M y',
9482	RFC_850: 'DD, dd-M-y',
9483	RFC_1036: 'D, d M y',
9484	RFC_1123: 'D, d M yy',
9485	RFC_2822: 'D, d M yy',
9486	RSS: 'D, d M y', // RFC 822
9487	TICKS: '!',
9488	TIMESTAMP: '@',
9489	W3C: 'yy-mm-dd', // ISO 8601
9490
9491	_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
9492		Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
9493
9494	/* Format a date object into a string value.
9495	   The format can be combinations of the following:
9496	   d  - day of month (no leading zero)
9497	   dd - day of month (two digit)
9498	   o  - day of year (no leading zeros)
9499	   oo - day of year (three digit)
9500	   D  - day name short
9501	   DD - day name long
9502	   m  - month of year (no leading zero)
9503	   mm - month of year (two digit)
9504	   M  - month name short
9505	   MM - month name long
9506	   y  - year (two digit)
9507	   yy - year (four digit)
9508	   @ - Unix timestamp (ms since 01/01/1970)
9509	   ! - Windows ticks (100ns since 01/01/0001)
9510	   '...' - literal text
9511	   '' - single quote
9512
9513	   @param  format    string - the desired format of the date
9514	   @param  date      Date - the date value to format
9515	   @param  settings  Object - attributes include:
9516	                     dayNamesShort    string[7] - abbreviated names of the days from Sunday (optional)
9517	                     dayNames         string[7] - names of the days from Sunday (optional)
9518	                     monthNamesShort  string[12] - abbreviated names of the months (optional)
9519	                     monthNames       string[12] - names of the months (optional)
9520	   @return  string - the date in the above format */
9521	formatDate: function (format, date, settings) {
9522		if (!date)
9523			return '';
9524		var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
9525		var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
9526		var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
9527		var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
9528		// Check whether a format character is doubled
9529		var lookAhead = function(match) {
9530			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
9531			if (matches)
9532				iFormat++;
9533			return matches;
9534		};
9535		// Format a number, with leading zero if necessary
9536		var formatNumber = function(match, value, len) {
9537			var num = '' + value;
9538			if (lookAhead(match))
9539				while (num.length < len)
9540					num = '0' + num;
9541			return num;
9542		};
9543		// Format a name, short or long as requested
9544		var formatName = function(match, value, shortNames, longNames) {
9545			return (lookAhead(match) ? longNames[value] : shortNames[value]);
9546		};
9547		var output = '';
9548		var literal = false;
9549		if (date)
9550			for (var iFormat = 0; iFormat < format.length; iFormat++) {
9551				if (literal)
9552					if (format.charAt(iFormat) == "'" && !lookAhead("'"))
9553						literal = false;
9554					else
9555						output += format.charAt(iFormat);
9556				else
9557					switch (format.charAt(iFormat)) {
9558						case 'd':
9559							output += formatNumber('d', date.getDate(), 2);
9560							break;
9561						case 'D':
9562							output += formatName('D', date.getDay(), dayNamesShort, dayNames);
9563							break;
9564						case 'o':
9565							output += formatNumber('o',
9566								Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
9567							break;
9568						case 'm':
9569							output += formatNumber('m', date.getMonth() + 1, 2);
9570							break;
9571						case 'M':
9572							output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
9573							break;
9574						case 'y':
9575							output += (lookAhead('y') ? date.getFullYear() :
9576								(date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
9577							break;
9578						case '@':
9579							output += date.getTime();
9580							break;
9581						case '!':
9582							output += date.getTime() * 10000 + this._ticksTo1970;
9583							break;
9584						case "'":
9585							if (lookAhead("'"))
9586								output += "'";
9587							else
9588								literal = true;
9589							break;
9590						default:
9591							output += format.charAt(iFormat);
9592					}
9593			}
9594		return output;
9595	},
9596
9597	/* Extract all possible characters from the date format. */
9598	_possibleChars: function (format) {
9599		var chars = '';
9600		var literal = false;
9601		// Check whether a format character is doubled
9602		var lookAhead = function(match) {
9603			var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
9604			if (matches)
9605				iFormat++;
9606			return matches;
9607		};
9608		for (var iFormat = 0; iFormat < format.length; iFormat++)
9609			if (literal)
9610				if (format.charAt(iFormat) == "'" && !lookAhead("'"))
9611					literal = false;
9612				else
9613					chars += format.charAt(iFormat);
9614			else
9615				switch (format.charAt(iFormat)) {
9616					case 'd': case 'm': case 'y': case '@':
9617						chars += '0123456789';
9618						break;
9619					case 'D': case 'M':
9620						return null; // Accept anything
9621					case "'":
9622						if (lookAhead("'"))
9623							chars += "'";
9624						else
9625							literal = true;
9626						break;
9627					default:
9628						chars += format.charAt(iFormat);
9629				}
9630		return chars;
9631	},
9632
9633	/* Get a setting value, defaulting if necessary. */
9634	_get: function(inst, name) {
9635		return inst.settings[name] !== undefined ?
9636			inst.settings[name] : this._defaults[name];
9637	},
9638
9639	/* Parse existing date and initialise date picker. */
9640	_setDateFromField: function(inst, noDefault) {
9641		if (inst.input.val() == inst.lastVal) {
9642			return;
9643		}
9644		var dateFormat = this._get(inst, 'dateFormat');
9645		var dates = inst.lastVal = inst.input ? inst.input.val() : null;
9646		var date, defaultDate;
9647		date = defaultDate = this._getDefaultDate(inst);
9648		var settings = this._getFormatConfig(inst);
9649		try {
9650			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
9651		} catch (event) {
9652			this.log(event);
9653			dates = (noDefault ? '' : dates);
9654		}
9655		inst.selectedDay = date.getDate();
9656		inst.drawMonth = inst.selectedMonth = date.getMonth();
9657		inst.drawYear = inst.selectedYear = date.getFullYear();
9658		inst.currentDay = (dates ? date.getDate() : 0);
9659		inst.currentMonth = (dates ? date.getMonth() : 0);
9660		inst.currentYear = (dates ? date.getFullYear() : 0);
9661		this._adjustInstDate(inst);
9662	},
9663
9664	/* Retrieve the default date shown on opening. */
9665	_getDefaultDate: function(inst) {
9666		return this._restrictMinMax(inst,
9667			this._determineDate(inst, this._get(inst, 'defaultDate'), new Date()));
9668	},
9669
9670	/* A date may be specified as an exact value or a relative one. */
9671	_determineDate: function(inst, date, defaultDate) {
9672		var offsetNumeric = function(offset) {
9673			var date = new Date();
9674			date.setDate(date.getDate() + offset);
9675			return date;
9676		};
9677		var offsetString = function(offset) {
9678			try {
9679				return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
9680					offset, $.datepicker._getFormatConfig(inst));
9681			}
9682			catch (e) {
9683				// Ignore
9684			}
9685			var date = (offset.toLowerCase().match(/^c/) ?
9686				$.datepicker._getDate(inst) : null) || new Date();
9687			var year = date.getFullYear();
9688			var month = date.getMonth();
9689			var day = date.getDate();
9690			var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
9691			var matches = pattern.exec(offset);
9692			while (matches) {
9693				switch (matches[2] || 'd') {
9694					case 'd' : case 'D' :
9695						day += parseInt(matches[1],10); break;
9696					case 'w' : case 'W' :
9697						day += parseInt(matches[1],10) * 7; break;
9698					case 'm' : case 'M' :
9699						month += parseInt(matches[1],10);
9700						day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
9701						break;
9702					case 'y': case 'Y' :
9703						year += parseInt(matches[1],10);
9704						day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
9705						break;
9706				}
9707				matches = pattern.exec(offset);
9708			}
9709			return new Date(year, month, day);
9710		};
9711		var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) :
9712			(typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
9713		newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate);
9714		if (newDate) {
9715			newDate.setHours(0);
9716			newDate.setMinutes(0);
9717			newDate.setSeconds(0);
9718			newDate.setMilliseconds(0);
9719		}
9720		return this._daylightSavingAdjust(newDate);
9721	},
9722
9723	/* Handle switch to/from daylight saving.
9724	   Hours may be non-zero on daylight saving cut-over:
9725	   > 12 when midnight changeover, but then cannot generate
9726	   midnight datetime, so jump to 1AM, otherwise reset.
9727	   @param  date  (Date) the date to check
9728	   @return  (Date) the corrected date */
9729	_daylightSavingAdjust: function(date) {
9730		if (!date) return null;
9731		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
9732		return date;
9733	},
9734
9735	/* Set the date(s) directly. */
9736	_setDate: function(inst, date, noChange) {
9737		var clear = !date;
9738		var origMonth = inst.selectedMonth;
9739		var origYear = inst.selectedYear;
9740		var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
9741		inst.selectedDay = inst.currentDay = newDate.getDate();
9742		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
9743		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
9744		if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)
9745			this._notifyChange(inst);
9746		this._adjustInstDate(inst);
9747		if (inst.input) {
9748			inst.input.val(clear ? '' : this._formatDate(inst));
9749		}
9750	},
9751
9752	/* Retrieve the date(s) directly. */
9753	_getDate: function(inst) {
9754		var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
9755			this._daylightSavingAdjust(new Date(
9756			inst.currentYear, inst.currentMonth, inst.currentDay)));
9757			return startDate;
9758	},
9759
9760	/* Attach the onxxx handlers.  These are declared statically so
9761	 * they work with static code transformers like Caja.
9762	 */
9763	_attachHandlers: function(inst) {
9764		var stepMonths = this._get(inst, 'stepMonths');
9765		var id = '#' + inst.id.replace( /\\\\/g, "\\" );
9766		inst.dpDiv.find('[data-handler]').map(function () {
9767			var handler = {
9768				prev: function () {
9769					window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, -stepMonths, 'M');
9770				},
9771				next: function () {
9772					window['DP_jQuery_' + dpuuid].datepicker._adjustDate(id, +stepMonths, 'M');
9773				},
9774				hide: function () {
9775					window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker();
9776				},
9777				today: function () {
9778					window['DP_jQuery_' + dpuuid].datepicker._gotoToday(id);
9779				},
9780				selectDay: function () {
9781					window['DP_jQuery_' + dpuuid].datepicker._selectDay(id, +this.getAttribute('data-month'), +this.getAttribute('data-year'), this);
9782					return false;
9783				},
9784				selectMonth: function () {
9785					window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'M');
9786					return false;
9787				},
9788				selectYear: function () {
9789					window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear(id, this, 'Y');
9790					return false;
9791				}
9792			};
9793			$(this).bind(this.getAttribute('data-event'), handler[this.getAttribute('data-handler')]);
9794		});
9795	},
9796
9797	/* Generate the HTML for the current state of the date picker. */
9798	_generateHTML: function(inst) {
9799		var today = new Date();
9800		today = this._daylightSavingAdjust(
9801			new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
9802		var isRTL = this._get(inst, 'isRTL');
9803		var showButtonPanel = this._get(inst, 'showButtonPanel');
9804		var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
9805		var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
9806		var numMonths = this._getNumberOfMonths(inst);
9807		var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
9808		var stepMonths = this._get(inst, 'stepMonths');
9809		var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
9810		var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
9811			new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
9812		var minDate = this._getMinMaxDate(inst, 'min');
9813		var maxDate = this._getMinMaxDate(inst, 'max');
9814		var drawMonth = inst.drawMonth - showCurrentAtPos;
9815		var drawYear = inst.drawYear;
9816		if (drawMonth < 0) {
9817			drawMonth += 12;
9818			drawYear--;
9819		}
9820		if (maxDate) {
9821			var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
9822				maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
9823			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
9824			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
9825				drawMonth--;
9826				if (drawMonth < 0) {
9827					drawMonth = 11;
9828					drawYear--;
9829				}
9830			}
9831		}
9832		inst.drawMonth = drawMonth;
9833		inst.drawYear = drawYear;
9834		var prevText = this._get(inst, 'prevText');
9835		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
9836			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
9837			this._getFormatConfig(inst)));
9838		var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
9839			'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click"' +
9840			' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
9841			(hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));
9842		var nextText = this._get(inst, 'nextText');
9843		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
9844			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
9845			this._getFormatConfig(inst)));
9846		var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
9847			'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click"' +
9848			' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
9849			(hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));
9850		var currentText = this._get(inst, 'currentText');
9851		var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
9852		currentText = (!navigationAsDateFormat ? currentText :
9853			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
9854		var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">' +
9855			this._get(inst, 'closeText') + '</button>' : '');
9856		var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
9857			(this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click"' +
9858			'>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
9859		var firstDay = parseInt(this._get(inst, 'firstDay'),10);
9860		firstDay = (isNaN(firstDay) ? 0 : firstDay);
9861		var showWeek = this._get(inst, 'showWeek');
9862		var dayNames = this._get(inst, 'dayNames');
9863		var dayNamesShort = this._get(inst, 'dayNamesShort');
9864		var dayNamesMin = this._get(inst, 'dayNamesMin');
9865		var monthNames = this._get(inst, 'monthNames');
9866		var monthNamesShort = this._get(inst, 'monthNamesShort');
9867		var beforeShowDay = this._get(inst, 'beforeShowDay');
9868		var showOtherMonths = this._get(inst, 'showOtherMonths');
9869		var selectOtherMonths = this._get(inst, 'selectOtherMonths');
9870		var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
9871		var defaultDate = this._getDefaultDate(inst);
9872		var html = '';
9873		for (var row = 0; row < numMonths[0]; row++) {
9874			var group = '';
9875			this.maxRows = 4;
9876			for (var col = 0; col < numMonths[1]; col++) {
9877				var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
9878				var cornerClass = ' ui-corner-all';
9879				var calender = '';
9880				if (isMultiMonth) {
9881					calender += '<div class="ui-datepicker-group';
9882					if (numMonths[1] > 1)
9883						switch (col) {
9884							case 0: calender += ' ui-datepicker-group-first';
9885								cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
9886							case numMonths[1]-1: calender += ' ui-datepicker-group-last';
9887								cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
9888							default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break;
9889						}
9890					calender += '">';
9891				}
9892				calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
9893					(/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
9894					(/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
9895					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
9896					row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
9897					'</div><table class="ui-datepicker-calendar"><thead>' +
9898					'<tr>';
9899				var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : '');
9900				for (var dow = 0; dow < 7; dow++) { // days of the week
9901					var day = (dow + firstDay) % 7;
9902					thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>
9902' +
9903						'<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';
9904				}
9905				calender += thead + '</tr></thead><tbody>';
9906				var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
9907				if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
9908					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
9909				var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
9910				var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
9911				var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
9912				this.maxRows = numRows;
9913				var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
9914				for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
9915					calender += '<tr>';
9916					var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' +
9917						this._get(inst, 'calculateWeek')(printDate) + '</td>');
9918					for (var dow = 0; dow < 7; dow++) { // create date picker days
9919						var daySettings = (beforeShowDay ?
9920							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
9921						var otherMonth = (printDate.getMonth() != drawMonth);
9922						var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
9923							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
9924						tbody += '<td class="' +
9925							((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
9926							(otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
9927							((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key
9928							(defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?
9929							// or defaultDate is current printedDate and defaultDate is selectedDate
9930							' ' + this._dayOverClass : '') + // highlight selected day
9931							(unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') +  // highlight unselectable days
9932							(otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
9933							(printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day
9934							(printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
9935							((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
9936							(unselectable ? '' : ' data-handler="selectDay" data-event="click" data-month="' + printDate.getMonth() + '" data-year="' + printDate.getFullYear() + '"') + '>' + // actions
9937							(otherMonth && !showOtherMonths ? '&#xa0;' : // display for other months
9938							(unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
9939							(printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
9940							(printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
9941							(otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months
9942							'" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date
9943						printDate.setDate(printDate.getDate() + 1);
9944						printDate = this._daylightSavingAdjust(printDate);
9945					}
9946					calender += tbody + '</tr>';
9947				}
9948				drawMonth++;
9949				if (drawMonth > 11) {
9950					drawMonth = 0;
9951					drawYear++;
9952				}
9953				calender += '</tbody></table>' + (isMultiMonth ? '</div>' +
9954							((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : '');
9955				group += calender;
9956			}
9957			html += group;
9958		}
9959		html += buttonPanel + ($.ui.ie6 && !inst.inline ?
9960			'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
9961		inst._keyEvent = false;
9962		return html;
9963	},
9964
9965	/* Generate the month and year header. */
9966	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
9967			secondary, monthNames, monthNamesShort) {
9968		var changeMonth = this._get(inst, 'changeMonth');
9969		var changeYear = this._get(inst, 'changeYear');
9970		var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
9971		var html = '<div class="ui-datepicker-title">';
9972		var monthHtml = '';
9973		// month selection
9974		if (secondary || !changeMonth)
9975			monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>';
9976		else {
9977			var inMinYear = (minDate && minDate.getFullYear() == drawYear);
9978			var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
9979			monthHtml += '<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';
9980			for (var month = 0; month < 12; month++) {
9981				if ((!inMinYear || month >= minDate.getMonth()) &&
9982						(!inMaxYear || month <= maxDate.getMonth()))
9983					monthHtml += '<option value="' + month + '"' +
9984						(month == drawMonth ? ' selected="selected"' : '') +
9985						'>' + monthNamesShort[month] + '</option>';
9986			}
9987			monthHtml += '</select>';
9988		}
9989		if (!showMonthAfterYear)
9990			html += monthHtml + (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '');
9991		// year selection
9992		if ( !inst.yearshtml ) {
9993			inst.yearshtml = '';
9994			if (secondary || !changeYear)
9995				html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
9996			else {
9997				// determine range of years to display
9998				var years = this._get(inst, 'yearRange').split(':');
9999				var thisYear = new Date().getFullYear();
10000				var determineYear = function(value) {
10001					var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :
10002						(value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :
10003						parseInt(value, 10)));
10004					return (isNaN(year) ? thisYear : year);
10005				};
10006				var year = determineYear(years[0]);
10007				var endYear = Math.max(year, determineYear(years[1] || ''));
10008				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
10009				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
10010				inst.yearshtml += '<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';
10011				for (; year <= endYear; year++) {
10012					inst.yearshtml += '<option value="' + year + '"' +
10013						(year == drawYear ? ' selected="selected"' : '') +
10014						'>' + year + '</option>';
10015				}
10016				inst.yearshtml += '</select>';
10017
10018				html += inst.yearshtml;
10019				inst.yearshtml = null;
10020			}
10021		}
10022		html += this._get(inst, 'yearSuffix');
10023		if (showMonthAfterYear)
10024			html += (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '') + monthHtml;
10025		html += '</div>'; // Close datepicker_header
10026		return html;
10027	},
10028
10029	/* Adjust one of the date sub-fields. */
10030	_adjustInstDate: function(inst, offset, period) {
10031		var year = inst.drawYear + (period == 'Y' ? offset : 0);
10032		var month = inst.drawMonth + (period == 'M' ? offset : 0);
10033		var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
10034			(period == 'D' ? offset : 0);
10035		var date = this._restrictMinMax(inst,
10036			this._daylightSavingAdjust(new Date(year, month, day)));
10037		inst.selectedDay = date.getDate();
10038		inst.drawMonth = inst.selectedMonth = date.getMonth();
10039		inst.drawYear = inst.selectedYear = date.getFullYear();
10040		if (period == 'M' || period == 'Y')
10041			this._notifyChange(inst);
10042	},
10043
10044	/* Ensure a date is within any min/max bounds. */
10045	_restrictMinMax: function(inst, date) {
10046		var minDate = this._getMinMaxDate(inst, 'min');
10047		var maxDate = this._getMinMaxDate(inst, 'max');
10048		var newDate = (minDate && date < minDate ? minDate : date);
10049		newDate = (maxDate && newDate > maxDate ? maxDate : newDate);
10050		return newDate;
10051	},
10052
10053	/* Notify change of month/year. */
10054	_notifyChange: function(inst) {
10055		var onChange = this._get(inst, 'onChangeMonthYear');
10056		if (onChange)
10057			onChange.apply((inst.input ? inst.input[0] : null),
10058				[inst.selectedYear, inst.selectedMonth + 1, inst]);
10059	},
10060
10061	/* Determine the number of months to show. */
10062	_getNumberOfMonths: function(inst) {
10063		var numMonths = this._get(inst, 'numberOfMonths');
10064		return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
10065	},
10066
10067	/* Determine the current maximum date - ensure no time components are set. */
10068	_getMinMaxDate: function(inst, minMax) {
10069		return this._determineDate(inst, this._get(inst, minMax + 'Date'), null);
10070	},
10071
10072	/* Find the number of days in a given month. */
10073	_getDaysInMonth: function(year, month) {
10074		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
10075	},
10076
10077	/* Find the day of the week of the first of a month. */
10078	_getFirstDayOfMonth: function(year, month) {
10079		return new Date(year, month, 1).getDay();
10080	},
10081
10082	/* Determines if we should allow a "next/prev" month display change. */
10083	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
10084		var numMonths = this._getNumberOfMonths(inst);
10085		var date = this._daylightSavingAdjust(new Date(curYear,
10086			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
10087		if (offset < 0)
10088			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
10089		return this._isInRange(inst, date);
10090	},
10091
10092	/* Is the given date in the accepted range? */
10093	_isInRange: function(inst, date) {
10094		var minDate = this._getMinMaxDate(inst, 'min');
10095		var maxDate = this._getMinMaxDate(inst, 'max');
10096		return ((!minDate || date.getTime() >= minDate.getTime()) &&
10097			(!maxDate || date.getTime() <= maxDate.getTime()));
10098	},
10099
10100	/* Provide the configuration settings for formatting/parsing. */
10101	_getFormatConfig: function(inst) {
10102		var shortYearCutoff = this._get(inst, 'shortYearCutoff');
10103		shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
10104			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
10105		return {shortYearCutoff: shortYearCutoff,
10106			dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
10107			monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
10108	},
10109
10110	/* Format the given date for display. */
10111	_formatDate: function(inst, day, month, year) {
10112		if (!day) {
10113			inst.currentDay = inst.selectedDay;
10114			inst.currentMonth = inst.selectedMonth;
10115			inst.currentYear = inst.selectedYear;
10116		}
10117		var date = (day ? (typeof day == 'object' ? day :
10118			this._daylightSavingAdjust(new Date(year, month, day))) :
10119			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
10120		return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
10121	}
10122});
10123
10124/*
10125 * Bind hover events for datepicker elements.
10126 * Done via delegate so the binding only occurs once in the lifetime of the parent div.
10127 * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
10128 */
10129function bindHover(dpDiv) {
10130	var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';
10131	return dpDiv.delegate(selector, 'mouseout', function() {
10132			$(this).removeClass('ui-state-hover');
10133			if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover');
10134			if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover');
10135		})
10136		.delegate(selector, 'mouseover', function(){
10137			if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) {
10138				$(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
10139				$(this).addClass('ui-state-hover');
10140				if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover');
10141				if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover');
10142			}
10143		});
10144}
10145
10146/* jQuery extend now ignores nulls! */
10147function extendRemove(target, props) {
10148	$.extend(target, props);
10149	for (var name in props)
10150		if (props[name] == null || props[name] == undefined)
10151			target[name] = props[name];
10152	return target;
10153};
10154
10155/* Invoke the datepicker functionality.
10156   @param  options  string - a command, optionally followed by additional parameters or
10157	                Object - settings for attaching new datepicker functionality
10158   @return  jQuery object */
10159$.fn.datepicker = function(options){
10160
10161	/* Verify an empty collection wasn't passed - Fixes #6976 */
10162	if ( !this.length ) {
10163		return this;
10164	}
10165
10166	/* Initialise the date picker. */
10167	if (!$.datepicker.initialized) {
10168		$(document).mousedown($.datepicker._checkExternalClick).
10169			find(document.body).append($.datepicker.dpDiv);
10170		$.datepicker.initialized = true;
10171	}
10172
10173	var otherArgs = Array.prototype.slice.call(arguments, 1);
10174	if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))
10175		return $.datepicker['_' + options + 'Datepicker'].
10176			apply($.datepicker, [this[0]].concat(otherArgs));
10177	if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
10178		return $.datepicker['_' + options + 'Datepicker'].
10179			apply($.datepicker, [this[0]].concat(otherArgs));
10180	return this.each(function() {
10181		typeof options == 'string' ?
10182			$.datepicker['_' + options + 'Datepicker'].
10183				apply($.datepicker, [this].concat(otherArgs)) :
10184			$.datepicker._attachDatepicker(this, options);
10185	});
10186};
10187
10188$.datepicker = new Datepicker(); // singleton instance
10189$.datepicker.initialized = false;
vendor: 45,702 bytes, lines 10190-10229
10190$.datepicker.uuid = new Date().getTime();
10191$.datepicker.version = "1.9.2";
10192
10193// Workaround for #4055
10194// Add another global to avoid noConflict issues with inline event handlers
10195window['DP_jQuery_' + dpuuid] = $;
10196
10197})(jQuery);
10198
10199/* End */
10200;
10201; /* Start:"a:4:{s:4:"full";s:79:"/bitrix/templates/aura-flowers-new/js/jquery.ui.datepicker-ru.js?17156286341117";s:6:"source";s:64:"/bitrix/templates/aura-flowers-new/js/jquery.ui.datepicker-ru.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
10202/* Russian (UTF-8) initialisation for the jQuery UI date picker plugin. */
10203/* Written by Andrew Stromnov ([email protected]). */
10204jQuery(function($){
10205	$.datepicker.regional['ru'] = {
10206		closeText: 'Закрыть',
10207		prevText: '&#x3C;Пред',
10208		nextText: 'След&#x3E;',
10209		currentText: 'Сегодня',
10210		monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь',
10211		'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
10212		monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
10213		'Июл','Авг','Сен','Окт','Ноя','Дек'],
10214		dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
10215		dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
10216		dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'],
10217		weekHeader: 'Нед',
10218		dateFormat: 'dd.mm.yy',
10219		firstDay: 1,
10220		isRTL: false,
10221		showMonthAfterYear: false,
10222		yearSuffix: ''};
10223	$.datepicker.setDefaults($.datepicker.regional['ru']);
10224});
10225
10226/* End */
10227;
10228; /* Start:"a:4:{s:4:"full";s:90:"/bitrix/templates/aura-flowers-new/vendor/air-datepicker/air-datepicker.js?179084563047792";s:6:"source";s:74:"/bitrix/templates/aura-flowers-new/vendor/air-datepicker/air-datepicker.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
10229!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AirDatepicker=t():e.AirDatepicker=t()}(this,(function(){return function(){"use strict";var e={d:function(t,i){for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return B}});var i={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},s={classes:"",inline:!1,locale:{days:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],daysShort:["Вос","Пон","Вто","Сре","Чет","Пят","Суб"],daysMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthsShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],today:"Сегодня",clear:"Очистить",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:i.days,minView:i.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return"string"==typeof e?t.querySelector(e):e}function n(){let{tagName:e="div",className:t="",innerHtml:i="",id:s="",attrs:a={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=document.createElement(e);return t&&n.classList.add(...t.split(" ")),s&&(n.id=s),i&&(n.innerHTML=i),a&&r(n,a),n}function r(e,t){for(let[i,s]of Object.entries(t))void 0!==s&&e.setAttribute(i,s);return e}function h(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}function o(e){let t=e.getHours(),{hours:i,dayPeriod:s}=l(t);return{year:e.getFullYear(),month:e.getMonth(),fullMonth:e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,date:e.getDate(),fullDate:e.getDate()<10?"0"+e.getDate():e.getDate(),day:e.getDay(),hours:t,fullHours:d(t),hours12:i,dayPeriod:s,fullHours12:d(i),minutes:e.getMinutes(),fullMinutes:e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}}function l(e){return{dayPeriod:e>11?"pm":"am",hours:e%12==0?12:e%12}}function d(e){return e<10?"0"+e:e}function c(e){let t=10*Math.floor(e.getFullYear()/10);return[t,t+9]}function u(){let e=[];for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];return i.forEach((t=>{if("object"==typeof t)for(let i in t)t[i]&&e.push(i);else t&&e.push(t)})),e.join(" ")}function p(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.days;if(!e||!t)return!1;let a=o(e),n=o(t);return{[i.days]:a.date===n.date&&a.month===n.month&&a.year===n.year,[i.months]:a.month===n.month&&a.year===n.year,[i.years]:a.year===n.year}[s]}function m(e,t,i){let s=g(e,!1).getTime(),a=g(t,!1).getTime();return i?s>=a:s>a}function v(e,t){return!m(e,t,!0)}function g(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=new Date(e.getTime());return"boolean"!=typeof t||t||function(e){e.setHours(0,0,0,0)}(i),i}function D(e,t,i){e.length?e.forEach((e=>{e.addEventListener(t,i)})):e.addEventListener(t,i)}function y(e,t){return!(!e||e===document||e instanceof DocumentFragment)&&(e.matches(t)?e:y(e.parentNode,t))}function f(e,t,i){return e>i?i:e<t?t:e}function w(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return i.filter((e=>e)).forEach((t=>{for(let[i,s]of Object.entries(t))if(void 0!==s&&"[object Object]"===s.toString()){let t=void 0!==e[i]?e[i].toString():void 0,a=s.toString(),n=Array.isArray(s)?[]:{};e[i]=e[i]?t!==a?n:e[i]:n,w(e[i],s)}else e[i]=s})),e}function b(e){let t=e;return e instanceof Date||(t=new Date(e)),isNaN(t.getTime())&&(console.log(`Unable to convert value "${e}" to Date object`),t=!1),t}function k(e){let t="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+t+")("+e+")($|<|"+t+")","g")}function $(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class C{constructor(){let{type:e,date:t,dp:i,opts:s,body:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(this,"focus",(()=>{this.$cell.classList.add("-focus-"),this.focused=!0})),$(this,"removeFocus",(()=>{this.$cell.classList.remove("-focus-"),this.focused=!1})),$(this,"select",(()=>{this.$cell.classList.add("-selected-"),this.selected=!0})),$(this,"removeSelect",(()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1})),$(this,"onChangeSelectedDate",(()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())})),$(this,"onChangeFocusDate",(e=>{if(!e)return void(this.focused&&this.removeFocus());let t=p(e,this.date,this.type);t?this.focus():!t&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()})),$(this,"render",(()=>(this.$cell.innerHTML=this._getHtml(),this.$cell.adpCell=this,this.$cell))),this.type=e,this.singleType=this.type.slice(0,-1),this.date=t,this.dp=i,this.opts=s,this.body=a,this.customData=!1,this.init()}init(){let{range:e,onRenderCell:t}=this.opts;t&&(this.customData=t({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),e&&this._handleRangeStatus())}_bindDatepickerEvents(){this.dp.on(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(i.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(i.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var e;let{year:t,month:i,date:s}=o(this.date),a=(null===(e=this.customData)||void 0===e?void 0:e.attrs)||{};this.$cell=n({className:this._getClassName(),attrs:{"data-year":t,"data-month":i,"data-date":s,...a}})}_getClassName(){var e,t;let s=new Date,{selectOtherMonths:a,selectOtherYears:n}=this.opts,{minDate:r,maxDate:h}=this.dp,{day:l}=o(this.date),d=this._isOutOfMinMaxRange(),c=null===(e=this.customData)||void 0===e?void 0:e.disabled,m=u("air-datepicker-cell",`-${this.singleType}-`,{"-current-":p(s,this.date,this.type),"-min-date-":r&&p(r,this.date,this.type),"-max-date-":h&&p(h,this.date,this.type)}),v="";switch(this.type){case i.days:v=u({"-weekend-":this.dp.isWeekend(l),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!a||d||c});break;case i.months:v=u({"-disabled-":d||c});break;case i.years:v=u({"-other-decade-":this.isOtherDecade,"-disabled-":d||this.isOtherDecade&&!n||c})}return u(m,v,null===(t=this.customData)||void 0===t?void 0:t.classes)}_getHtml(){var e;let{year:t,month:s,date:a}=o(this.date),{showOtherMonths:n,showOtherYears:r}=this.opts;if(null!==(e=this.customData)&&void 0!==e&&e.html)return this.customData.html;switch(this.type){case i.days:return!n&&this.isOtherMonth?"":a;case i.months:return this.dp.locale[this.opts.monthsField][s];case i.years:return!r&&this.isOtherDecade?"":t}}_isOutOfMinMaxRange(){let{minDate:e,maxDate:t}=this.dp,{type:s,date:a}=this,{month:n,year:r,date:h}=o(a),l=s===i.days,d=s===i.years,c=!!e&&new Date(r,d?e.getMonth():n,l?h:e.getDate()),u=!!t&&new Date(r,d?t.getMonth():n,l?h:t.getDate());return e&&t?v(c,e)||m(u,t):e?v(c,e):t?m(u,t):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){let{rangeDateFrom:e,rangeDateTo:t}=this.dp,i=u({"-in-range-":e&&t&&(s=this.date,a=e,n=t,m(s,a)&&v(s,n)),"-range-from-":e&&p(this.date,e,this.type),"-range-to-":t&&p(this.date,t,this.type)});var s,a,n;this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),i&&this.$cell.classList.add(...i.split(" "))}_handleSelectedStatus(){let e=this.dp._checkIfDateIsSelected(this.date,this.type);e?this.select():!e&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){p(this.dp.focusDate,this.date,this.type)&&this.focus()}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function _(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}let M={[i.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${i.days}-"></div>`,[i.months]:`<div class="air-datepicker-body--cells -${i.months}-"></div>`,[i.years]:`<div class="air-datepicker-body--cells -${i.years}-"></div>`};const S=".air-datepicker-cell";class T{constructor(e){let{dp:t,type:s,opts:a}=e;_(this,"handleClick",(e=>{let t=e.target.closest(S).adpCell;if(t.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let i=this.dp._checkIfDateIsSelected(t.date,t.type);i?this.dp._handleAlreadySelectedDates(i,t.date):this.dp.selectDate(t.date)})),_(this,"handleDayNameClick",(e=>{let t=e.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(t),datepicker:this.dp})})),_(this,"onChangeCurrentView",(e=>{e!==this.type?this.hide():(this.show(),this.render())})),_(this,"onMouseOverCell",(e=>{let t=y(e.target,S);this.dp.setFocusDate(!!t&&t.adpCell.date)})),_(this,"onMouseOutCell",(()=>{this.dp.setFocusDate(!1)})),_(this,"onClickBody",(e=>{let{onClickDayName:t}=this.opts,i=e.target;i.closest(S)&&this.handleClick(e),t&&i.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(e)})),_(this,"onMouseDown",(e=>{this.pressed=!0;let t=y(e.target,S),i=t&&t.adpCell;p(i.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),p(i.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)})),_(this,"onMouseMove",(e=>{if(!this.pressed||!this.dp.isMinViewReached)return;e.preventDefault();let t=y(e.target,S),i=t&&t.adpCell,{selectedDates:s,rangeDateTo:a,rangeDateFrom:n}=this.dp;if(!i||i.isDisabled)return;let{date:r}=i;if(2===s.length){if(this.rangeFromFocused&&!m(r,a)){let{hours:e,minutes:t}=o(n);r.setHours(e),r.setMinutes(t),this.dp.rangeDateFrom=r,this.dp.replaceDate(n,r)}if(this.rangeToFocused&&!v(r,n)){let{hours:e,minutes:t}=o(a);r.setHours(e),r.setMinutes(t),this.dp.rangeDateTo=r,this.dp.replaceDate(a,r)}}})),_(this,"onMouseUp",(()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1})),_(this,"onChangeViewDate",((e,t)=>{if(!this.isVisible)return;let s=c(e),a=c(t);switch(this.dp.currentView){case i.days:if(p(e,t,i.months))return;break;case i.months:if(p(e,t,i.years))return;break;case i.years:if(s[0]===a[0]&&s[1]===a[1])return}this.render()})),_(this,"render",(()=>{this.destroyCells(),this._generateCells(),this.cells.forEach((e=>{this.$cells.appendChild(e.render())}))})),this.dp=t,this.type=s,this.opts=a,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===i.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:e,dynamicRange:t}=this.opts;D(this.$el,"mouseover",this.onMouseOverCell),D(this.$el,"mouseout",this.onMouseOutCell),D(this.$el,"click",this.onClickBody),e&&t&&(D(this.$el,"mousedown",this.onMouseDown),D(this.$el,"mousemove",this.onMouseMove),D(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(i.eventChangeViewDate,this.onChangeViewDate),this.dp.on(i.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=n({className:`air-datepicker-body -${this.type}-`,innerHtml:M[this.type]}),this.$names=a(".air-datepicker-body--day-names",this.$el),this.$cells=a(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dp.locale.firstDay,t="",s=this.dp.isWeekend,{onClickDayName:a}=this.opts,n=e,r=0;for(;r<7;){let e=n%7;t+=`<div class="${u("air-datepicker-body--day-name",{[i.cssClassWeekend]:s(e),"-clickable-":!!a})}" data-day-index='${e}'>${this.dp.locale.daysMin[e]}</div>`,r++,n++}return t}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(e){let{type:t,dp:i,opts:s}=this;return new C({type:t,dp:i,opts:s,date:e,body:this})}_generateCells(){T.getDatesFunction(this.type)(this.dp,(e=>{this.cells.push(this._generateCell(e))}))}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach((e=>e.destroy())),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(i.eventChangeViewDate,this.onChangeViewDate),this.dp.off(i.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(e,t){let{viewDate:i,locale:{firstDay:s}}=e,a=h(i),{year:n,month:r}=o(i),l=new Date(n,r,1),d=new Date(n,r,a),c=l.getDay()-s,u=6-d.getDay()+s;c=c<0?c+7:c,u=u>6?u-7:u;let p=function(e,t){let{year:i,month:s,date:a}=o(e);return new Date(i,s,a-t)}(l,c),m=a+c+u,v=p.getDate(),{year:g,month:D}=o(p),y=0;const f=[];for(;y<m;){let e=new Date(g,D,v+y);t&&t(e),f.push(e),y++}return f}static getMonthsDates(e,t){let{year:i}=e.parsedViewDate,s=0,a=[];for(;s<12;){const e=new Date(i,s);a.push(e),t&&t(e),s++}return a}static getYearsDates(e,t){let i=c(e.viewDate),s=i[0]-1,a=i[1]+1,n=s,r=[];for(;n<=a;){const e=new Date(n,0);r.push(e),t&&t(e),n++}return r}static getDatesFunction(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.days;return{[i.days]:T.getDaysDates,[i.months]:T.getMonthsDates,[i.years]:T.getYearsDates}[e]}}function F(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class V{constructor(e){let{dp:t,opts:i}=e;F(this,"onClickNav",(e=>{let t=y(e.target,".air-datepicker-nav--action");if(!t)return;let i=t.dataset.action;this.dp[i]()})),F(this,"onChangeViewDate",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),F(this,"onChangeCurrentView",(()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()})),F(this,"onClickNavTitle",(()=>{this.dp.isFinalView||this.dp.up()})),F(this,"update",(()=>{let{prevHtml:e,nextHtml:t}=this.opts;this.$prev.innerHTML=e,this.$next.innerHTML=t,this._resetNavStatus(),this.render(),this.handleNavStatus()})),F(this,"renderDelay",(()=>{setTimeout(this.render)})),F(this,"render",(()=>{this.$title.innerHTML=this._getTitle(),function(e,t){for(let i in t)t[i]?e.classList.add(i):e.classList.remove(i)}(this.$title,{"-disabled-":this.dp.isFinalView})})),this.dp=t,this.opts=i,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=a(".air-datepicker-nav--title",this.$el),this.$prev=a('[data-action="prev"]',this.$el),this.$next=a('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(i.eventChangeViewDate,this.onChangeViewDate),this.dp.on(i.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(i.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(i.eventChangeTime,this.render))}destroy(){this.dp.off(i.eventChangeViewDate,this.onChangeViewDate),this.dp.off(i.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(i.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(i.eventChangeTime,this.render))}_createElement(){this.$el=n({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:e,opts:t}=this,i=t.navTitles[e.currentView];return"function"==typeof i?i(e):e.formatDate(e.viewDate,i)}handleNavStatus(){let{disableNavWhenOutOfRange:e}=this.opts,{minDate:t,maxDate:s}=this.dp;if(!t&&!s||!e)return;let{year:a,month:n}=this.dp.parsedViewDate,r=!!t&&o(t),h=!!s&&o(s);switch(this.dp.currentView){case i.days:t&&r.month>=n&&r.year>=a&&this._disableNav("prev"),s&&h.month<=n&&h.year<=a&&this._disableNav("next");break;case i.months:t&&r.year>=a&&this._disableNav("prev"),s&&h.year<=a&&this._disableNav("next");break;case i.years:{let e=c(this.dp.viewDate);t&&r.year>=e[0]&&this._disableNav("prev"),s&&h.year<=e[1]&&this._disableNav("next");break}}}_disableNav(e){a('[data-action="'+e+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){!function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];e.length?e.forEach((e=>{e.classList.remove(...i)})):e.classList.remove(...i)}(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:e,nextHtml:t}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${e}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${t}</div>`}get isNavIsFunction(){let{navTitles:e}=this.opts;return Object.keys(e).find((t=>"function"==typeof e[t]))}}var x={today:{content:e=>e.locale.today,onClick:e=>e.setViewDate(new Date)},clear:{content:e=>e.locale.clear,onClick:e=>e.clear()}};class H{constructor(e){let{dp:t,opts:i}=e;this.dp=t,this.opts=i,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=n({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:e}=this.opts;Array.isArray(e)||(e=[e]),e.forEach((e=>{let t=e;"string"==typeof e&&x[e]&&(t=x[e]);let i=this.createButton(t);t.onClick&&this.attachEventToButton(i,t.onClick),this.$el.appendChild(i)}))}attachEventToButton(e,t){e.addEventListener("click",(()=>{t(this.dp)}))}createButton(e){let{content:t,className:i,tagName:s="button",attrs:a={}}=e;return n({tagName:s,innerHtml:`<span tabindex='-1'>${"function"==typeof t?t(this.dp):t}</span>`,className:u("air-datepicker-button",i),attrs:a})}render(){this.generateButtons()}}function E(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class L{constructor(){let{opts:e,dp:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};E(this,"toggleTimepickerIsActive",(e=>{this.dp.timepickerIsActive=e})),E(this,"onChangeSelectedDate",(e=>{let{date:t,updateTime:i=!1}=e;t&&(this.setMinMaxTime(t),this.setCurrentTime(!!i&&t),this.addTimeToDate(t))})),E(this,"onChangeLastSelectedDate",(e=>{e&&(this.setTime(e),this.render())})),E(this,"onChangeInputRange",(e=>{let t=e.target;this[t.getAttribute("name")]=t.value,this.updateText(),this.dp.trigger(i.eventChangeTime,{hours:this.hours,minutes:this.minutes})})),E(this,"onMouseEnterLeave",(e=>{let t=e.target.getAttribute("name"),i=this.$minutesText;"hours"===t&&(i=this.$hoursText),i.classList.toggle("-focus-")})),E(this,"onFocus",(()=>{this.toggleTimepickerIsActive(!0)})),E(this,"onBlur",(()=>{this.toggleTimepickerIsActive(!1)})),this.opts=e,this.dp=t;let{timeFormat:s}=this.dp.locale;s&&(s.match(k("h"))||s.match(k("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(i.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let e="input";navigator.userAgent.match(/trident/gi)&&(e="change"),D(this.$ranges,e,this.onChangeInputRange),D(this.$ranges,"mouseenter",this.onMouseEnterLeave),D(this.$ranges,"mouseleave",this.onMouseEnterLeave),D(this.$ranges,"focus",this.onFocus),D(this.$ranges,"mousedown",this.onFocus),D(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=n({className:u("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(i.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(i.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:e,hours:t,displayHours:i,minutes:s,minHours:a,minMinutes:n,maxHours:r,maxMinutes:h,dayPeriod:o,opts:{hoursStep:l,minutesStep:c}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current">   <span class="air-datepicker-time--current-hours">${d(i)}</span>   <span class="air-datepicker-time--current-colon">:</span>   <span class="air-datepicker-time--current-minutes">${d(s)}</span>   `+(e?`<span class='air-datepicker-time--current-ampm'>${o}</span>`:"")+'</div><div class="air-datepicker-time--sliders">   <div class="air-datepicker-time--row">'+`      <input type="range" name="hours" value="${t}" min="${a}" max="${r}" step="${l}"/>   </div>   <div class="air-datepicker-time--row">`+`      <input type="range" name="minutes" value="${s}" min="${n}" max="${h}" step="${c}"/>   </div></div>`}defineDOM(){let e=e=>a(e,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=e('[name="hours"]'),this.$minutes=e('[name="minutes"]'),this.$hoursText=e(".air-datepicker-time--current-hours"),this.$minutesText=e(".air-datepicker-time--current-minutes"),this.$ampm=e(".air-datepicker-time--current-ampm")}setTime(e){this.setMinMaxTime(e),this.setCurrentTime(e)}addTimeToDate(e){e&&(e.setHours(this.hours),e.setMinutes(this.minutes))}setMinMaxTime(e){if(this.setMinMaxTimeFromOptions(),e){let{minDate:t,maxDate:i}=this.dp;t&&p(e,t)&&this.setMinTimeFromMinDate(t),i&&p(e,i)&&this.setMaxTimeFromMaxDate(i)}}setCurrentTime(e){let{hours:t,minutes:i}=e?o(e):this;this.hours=f(t,this.minHours,this.maxHours),this.minutes=f(i,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:e,minMinutes:t,maxHours:i,maxMinutes:s}=this.opts;this.minHours=f(e,0,23),this.minMinutes=f(t,0,59),this.maxHours=f(i,0,23),this.maxMinutes=f(s,0,59)}setMinTimeFromMinDate(e){let{lastSelectedDate:t}=this.dp;this.minHours=e.getHours(),t&&t.getHours()>e.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=e.getMinutes()}setMaxTimeFromMaxDate(e){let{lastSelectedDate:t}=this.dp;this.maxHours=e.getHours(),t&&t.getHours()<e.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=e.getMinutes()}updateSliders(){r(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,r(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=d(this.displayHours),this.$minutesText.innerHTML=d(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(e){this._hours=e;let{hours:t,dayPeriod:i}=l(e);this.displayHours=this.ampm?t:e,this.dayPeriod=i}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function O(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class A{constructor(e){let{dp:t,opts:i}=e;O(this,"pressedKeys",new Set),O(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],e=>e.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],e=>e.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],e=>e.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],e=>e.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],e=>e.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],e=>e.year-=10],[["Control","Shift","ArrowUp"],(e,t)=>t.up()]])),O(this,"handleHotKey",(e=>{let t=this.hotKeys.get(e),i=o(this.getInitialFocusDate());t(i,this.dp);let{year:s,month:a,date:n}=i,r=h(new Date(s,a));r<n&&(n=r);let l=this.dp.getClampedDate(new Date(s,a,n));this.dp.setFocusDate(l,{viewDateTransition:!0})})),O(this,"isHotKeyPressed",(()=>{let e=!1,t=this.pressedKeys.size,i=e=>this.pressedKeys.has(e);for(let[s]of this.hotKeys){if(e)break;if(Array.isArray(s[0]))s.forEach((a=>{e||t!==a.length||(e=a.every(i)&&s)}));else{if(t!==s.length)continue;e=s.every(i)&&s}}return e})),O(this,"isArrow",(e=>e>=37&&e<=40)),O(this,"onKeyDown",(e=>{let{key:t,which:i}=e,{dp:s,dp:{focusDate:a},opts:n}=this;this.registerKey(t);let r=this.isHotKeyPressed();if(r)return e.preventDefault(),void this.handleHotKey(r);if(this.isArrow(i))return e.preventDefault(),void this.focusNextCell(t);if("Enter"===t){if(s.currentView!==n.minView)return void s.down();if(a){let e=s._checkIfDateIsSelected(a);return void(e?s._handleAlreadySelectedDates(e,a):s.selectDate(a))}}"Escape"===t&&this.dp.hide()})),O(this,"onKeyUp",(e=>{this.removeKey(e.key)})),this.dp=t,this.opts=i,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:e}=this.dp;e.addEventListener("keydown",this.onKeyDown),e.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:e}=this.dp;e.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:e,currentView:t,selectedDates:s,parsedViewDate:{year:a,month:n}}=this.dp,r=e||s[s.length-1];if(!r)switch(t){case i.days:r=new Date(a,n,(new Date).getDate());break;case i.months:r=new Date(a,n,1);break;case i.years:r=new Date(a,0,1)}return r}focusNextCell(e){let t=this.getInitialFocusDate(),{currentView:s}=this.dp,{days:a,months:n,years:r}=i,h=o(t),l=h.year,d=h.month,c=h.date;switch(e){case"ArrowLeft":s===a&&(c-=1),s===n&&(d-=1),s===r&&(l-=1);break;case"ArrowUp":s===a&&(c-=7),s===n&&(d-=3),s===r&&(l-=4);break;case"ArrowRight":s===a&&(c+=1),s===n&&(d+=1),s===r&&(l+=1);break;case"ArrowDown":s===a&&(c+=7),s===n&&(d+=3),s===r&&(l+=4)}let u=this.dp.getClampedDate(new Date(l,d,c));this.dp.setFocusDate(u,{viewDateTransition:!0})}registerKey(e){this.pressedKeys.add(e)}removeKey(e){this.pressedKeys.delete(e)}}let N={on(e,t){this.__events||(this.__events={}),this.__events[e]?this.__events[e].push(t):this.__events[e]=[t]},off(e,t){this.__events&&this.__events[e]&&(this.__events[e]=this.__events[e].filter((e=>e!==t)))},removeAllEvents(){this.__events={}},trigger(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];this.__events&&this.__events[e]&&this.__events[e].forEach((e=>{e(...i)}))}};function I(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}let P="",j="",R=!1;class B{static buildGlobalContainer(e){R=!0,P=n({className:e,id:e}),a("body").appendChild(P)}constructor(e,t){var r=this;if(I(this,"viewIndexes",[i.days,i.months,i.years]),I(this,"next",(()=>{let{year:e,month:t}=this.parsedViewDate;switch(this.currentView){case i.days:this.setViewDate(new Date(e,t+1,1));break;case i.months:this.setViewDate(new Date(e+1,t,1));break;case i.years:this.setViewDate(new Date(e+10,0,1))}})),I(this,"prev",(()=>{let{year:e,month:t}=this.parsedViewDate;switch(this.currentView){case i.days:this.setViewDate(new Date(e,t-1,1));break;case i.months:this.setViewDate(new Date(e-1,t,1));break;case i.years:this.setViewDate(new Date(e-10,0,1))}})),I(this,"_finishHide",(()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)})),I(this,"setPosition",(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("function"==typeof(e=e||r.opts.position))return void(r.customHide=e({$datepicker:r.$datepicker,$target:r.$el,$pointer:r.$pointer,isViewChange:t,done:r._finishHide}));let i,s,{isMobile:a}=r.opts,n=r.$el.getBoundingClientRect(),h=r.$el.getBoundingClientRect(),o=r.$datepicker.offsetParent,l=r.$el.offsetParent,d=r.$datepicker.getBoundingClientRect(),c=e.split(" "),u=window.scrollY,p=window.scrollX,m=r.opts.offset,v=c[0],g=c[1];if(a)r.$datepicker.style.cssText="left: 50%; top: 50%";else{if(o===l&&o!==document.body&&(h={top:r.$el.offsetTop,left:r.$el.offsetLeft,width:n.width,height:r.$el.offsetHeight},u=0,p=0),o!==l&&o!==document.body){let e=o.getBoundingClientRect();h={top:n.top-e.top,left:n.left-e.left,width:n.width,height:n.height},u=0,p=0}switch(v){case"top":i=h.top-d.height-m;break;case"right":s=h.left+h.width+m;break;case"bottom":i=h.top+h.height+m;break;case"left":s=h.left-d.width-m}switch(g){case"top":i=h.top;break;case"right":s=h.left+h.width-d.width;break;case"bottom":i=h.top+h.height-d.height;break;case"left":s=h.left;break;case"center":/left|right/.test(v)?i=h.top+h.height/2-d.height/2:s=h.left+h.width/2-d.width/2}r.$datepicker.style.cssText=`left: ${s+p}px; top: ${i+u}px`}})),I(this,"_setInputValue",(()=>{let{opts:e,$altField:t,locale:{dateFormat:i}}=this,{altFieldDateFormat:s,altField:a}=e;a&&t&&(t.value=this._getInputValue(s)),this.$el.value=this._getInputValue(i)})),I(this,"_getInputValue",(e=>{let{selectedDates:t,opts:i}=this,{multipleDates:s,multipleDatesSeparator:a}=i;if(!t.length)return"";let n="function"==typeof e,r=n?e(s?t:t[0]):t.map((t=>this.formatDate(t,e)));return r=n?r:r.join(a),r})),I(this,"_checkIfDateIsSelected",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.days,s=!1;return r.selectedDates.some((i=>{let a=p(e,i,t);return s=a&&i,a})),s})),I(this,"_scheduleCallAfterTransition",(e=>{this._cancelScheduledCall(),e&&e(!1),this._onTransitionEnd=()=>{e&&e(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})})),I(this,"_cancelScheduledCall",(()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)})),I(this,"setViewDate",(e=>{if(!((e=b(e))instanceof Date))return;if(p(e,this.viewDate))return;let t=this.viewDate;this.viewDate=e;let{onChangeViewDate:s}=this.opts;if(s){let{month:e,year:t}=this.parsedViewDate;s({month:e,year:t,decade:this.curDecade})}this.trigger(i.eventChangeViewDate,e,t)})),I(this,"setFocusDate",(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!e||(e=b(e))instanceof Date)&&(r.focusDate=e,r.opts.range&&e&&r._handleRangeOnFocus(),r.trigger(i.eventChangeFocusDate,e,t))})),I(this,"setCurrentView",(e=>{if(this.viewIndexes.includes(e)){if(this.currentView=e,this.elIsInput&&this.visible&&this.setPosition(void 0,!0),this.trigger(i.eventChangeCurrentView,e),!this.views[e]){let t=this.views[e]=new T({dp:this,opts:this.opts,type:e});this.shouldUpdateDOM&&this.$content.appendChild(t.$el)}this.opts.onChangeView&&this.opts.onChangeView(e)}})),I(this,"_updateLastSelectedDate",(e=>{this.lastSelectedDate=e,this.trigger(i.eventChangeLastSelectedDate,e)})),I(this,"destroy",(()=>{let{showEvent:e,isMobile:t}=this.opts,i=this.$datepicker.parentNode;i&&i.removeChild(this.$datepicker),this.$el.removeEventListener(e,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),t&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts=null,this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=null,this.rangeDateFrom=null,this.rangeDateTo=null})),I(this,"update",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=w({},r.opts);w(r.opts,e);let{timepicker:s,buttons:a,range:n,selectedDates:h,isMobile:o}=r.opts,l=r.visible||r.treatAsInline;r._createMinMaxDates(),r._limitViewDateByMaxMinDates(),r._handleLocale(),!t.selectedDates&&h&&r.selectDate(h),e.view&&r.setCurrentView(e.view),r._setInputValue(),t.range&&!n?(r.rangeDateTo=!1,r.rangeDateFrom=!1):!t.range&&n&&r.selectedDates.length&&(r.rangeDateFrom=r.selectedDates[0],r.rangeDateTo=r.selectedDates[1]),t.timepicker&&!s?(l&&r.timepicker.destroy(),r.timepicker=!1,r.$timepicker.parentNode.removeChild(r.$timepicker)):!t.timepicker&&s&&r._addTimepicker(),!t.buttons&&a?r._addButtons():t.buttons&&!a?(r.buttons.destroy(),r.$buttons.parentNode.removeChild(r.$buttons)):l&&t.buttons&&a&&r.buttons.clearHtml().render(),!t.isMobile&&o?(r.treatAsInline||j||r._createMobileOverlay(),r._addMobileAttributes(),r.visible&&r._showMobileOverlay()):t.isMobile&&!o&&(r._removeMobileAttributes(),r.visible&&(j.classList.remove("-active-"),"function"!=typeof r.opts.position&&r.setPosition())),l&&(r.nav.update(),r.views[r.currentView].render(),r.currentView===i.days&&r.views[r.currentView].renderDayNames())})),I(this,"isOtherMonth",(e=>{let{month:t}=o(e);return t!==this.parsedViewDate.month})),I(this,"isOtherYear",(e=>{let{year:t}=o(e);return t!==this.parsedViewDate.year})),I(this,"isOtherDecade",(e=>{let{year:t}=o(e),[i,s]=c(this.viewDate);return t<i||t>s})),I(this,"_onChangeSelectedDate",(e=>{let{silent:t}=e;setTimeout((()=>{this._setInputValue(),this.opts.onSelect&&!t&&this._triggerOnSelect()}))})),I(this,"_onChangeFocusedDate",(function(e){let{viewDateTransition:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return;let i=!1;t&&(i=r.isOtherMonth(e)||r.isOtherYear(e)||r.isOtherDecade(e)),i&&r.setViewDate(e),r.opts.onFocus&&r.opts.onFocus({datepicker:r,date:e})})),I(this,"_onChangeTime",(e=>{let{hours:t,minutes:i}=e,s=new Date,{lastSelectedDate:a,opts:{onSelect:n}}=this,r=a;a||(r=s);let h=this.getCell(r,this.currentViewSingular),o=h&&h.adpCell;o&&o.isDisabled||(r.setHours(t),r.setMinutes(i),a?(this._setInputValue(),n&&this._triggerOnSelect()):this.selectDate(r))})),I(this,"_onFocus",(e=>{this.visible||this.show()})),I(this,"_onBlur",(e=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()})),I(this,"_onMouseDown",(e=>{this.inFocus=!0})),I(this,"_onMouseUp",(e=>{this.inFocus=!1,this.$el.focus()})),I(this,"_onResize",(()=>{this.visible&&"function"!=typeof this.opts.position&&this.setPosition()})),I(this,"_onClickOverlay",(()=>{this.visible&&this.hide()})),I(this,"getViewDates",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.days;return T.getDatesFunction(e)(r)})),I(this,"isWeekend",(e=>this.opts.weekends.includes(e))),I(this,"getClampedDate",(e=>{let{minDate:t,maxDate:i}=this,s=e;return i&&m(e,i)?s=i:t&&v(e,t)&&(s=t),s})),this.$el=a(e),!this.$el)return;this.$datepicker=n({className:"air-datepicker"}),this.opts=w({},s,t),this.$customContainer=!!this.opts.container&&a(this.opts.container),this.$altField=a(this.opts.altField||!1);let{view:h,startDate:l}=this.opts;l||(this.opts.startDate=new Date),"INPUT"===this.$el.nodeName&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=b(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=h,this.selectedDates=[],this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:e,treatAsInline:t,opts:{inline:i,isMobile:s,selectedDates:n,keyboardNav:r,onlyTimepicker:h}}=this,o=a("body");(!R||R&&P&&!o.contains(P))&&!i&&this.elIsInput&&!this.$customContainer&&B.buildGlobalContainer(B.defaultGlobalContainerId),!s||j||t||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(i||this._bindEvents(),r&&!h&&(this.keyboardNav=new A({dp:this,opts:e}))),n&&this.selectDate(n,{silent:!0}),this.opts.visible&&!t&&this.show(),s&&!t&&this.$el.setAttribute("readonly",!0),t&&this._createComponents()}_createMobileOverlay(){j=n({className:"air-datepicker-overlay"}),P.appendChild(j)}_createComponents(){let{opts:e,treatAsInline:t,opts:{inline:i,buttons:s,timepicker:a,position:n,classes:r,onlyTimepicker:h,isMobile:o}}=this;this._buildBaseHtml(),this.elIsInput&&(i||this._setPositionClasses(n)),!i&&this.elIsInput||this.$datepicker.classList.add("-inline-"),r&&this.$datepicker.classList.add(...r.split(" ")),h&&this.$datepicker.classList.add("-only-timepicker-"),o&&!t&&this._addMobileAttributes(),this.views[this.currentView]=new T({dp:this,type:this.currentView,opts:e}),this.nav=new V({dp:this,opts:e}),a&&this._addTimepicker(),s&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let e in this.views)this.views[e].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){j.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){j.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||""===this.initialReadonly||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:e,maxDate:t}=this.opts;this.minDate=!!e&&b(e),this.maxDate=!!t&&b(t)}_addTimepicker(){this.$timepicker=n({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new L({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=n({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new H({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(i.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(i.eventChangeFocusDate,this._onChangeFocusedDate),this.on(i.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:e}=this.opts;var t,i;this.elIsInput?e?(t=this.$datepicker,(i=this.$el).parentNode.insertBefore(t,i.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=a(".air-datepicker--content",this.$datepicker),this.$pointer=a(".air-datepicker--pointer",this.$datepicker),this.$nav=a(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:e,dateFormat:t,firstDay:i,timepicker:s,onlyTimepicker:a,timeFormat:n,dateTimeSeparator:r}=this.opts;var h;this.locale=(h=e,JSON.parse(JSON.stringify(h))),t&&(this.locale.dateFormat=t),void 0!==n&&""!==n&&(this.locale.timeFormat=n);let{timeFormat:o}=this.locale;if(""!==i&&(this.locale.firstDay=i),s&&"function"!=typeof t){let e=o?r:"";this.locale.dateFormat=[this.locale.dateFormat,o||""].join(e)}a&&"function"!=typeof t&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(e){if("function"==typeof e)return void this.$datepicker.classList.add("-custom-position-");let t=(e=e.split(" "))[0],i=`air-datepicker -${t}-${e[1]}- -from-${t}-`;this.$datepicker.classList.add(...i.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:e,minDate:t,maxDate:i}=this;i&&m(e,i)&&this.setViewDate(i),t&&v(e,t)&&this.setViewDate(t)}formatDate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewDate,t=arguments.length>1?arguments[1]:void 0;if(e=b(e),!(e instanceof Date))return;let i=t,s=this.locale,a=o(e),n=a.dayPeriod,r=c(e),h=B.replacer,l={T:e.getTime(),m:a.minutes,mm:a.fullMinutes,h:a.hours12,hh:a.fullHours12,H:a.hours,HH:a.fullHours,aa:n,AA:n.toUpperCase(),E:s.daysShort[a.day],EEEE:s.days[a.day],d:a.date,dd:a.fullDate,M:a.month+1,MM:a.fullMonth,MMM:s.monthsShort[a.month],MMMM:s.months[a.month],yy:a.year.toString().slice(-2),yyyy:a.year,yyyy1:r[0],yyyy2:r[1]};for(let[e,t]of Object.entries(l))i=h(i,k(e),t);return i}down(e){this._handleUpDownActions(e,"down")}up(e){this._handleUpDownActions(e,"up")}selectDate(e){let t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{currentView:a,parsedViewDate:n,selectedDates:r}=this,{updateTime:h}=s,{moveToOtherMonthsOnSelect:o,moveToOtherYearsOnSelect:l,multipleDates:d,range:c,autoClose:u,onBeforeSelect:p}=this.opts,v=r.length;if(Array.isArray(e))return e.forEach((e=>{this.selectDate(e,s)})),new Promise((e=>{setTimeout(e)}));if((e=b(e))instanceof Date){if(p&&!p({date:e,datepicker:this}))return Promise.resolve();if(a===i.days&&e.getMonth()!==n.month&&o&&(t=new Date(e.getFullYear(),e.getMonth(),1)),a===i.years&&e.getFullYear()!==n.year&&l&&(t=new Date(e.getFullYear(),0,1)),t&&this.setViewDate(t),d&&!c){if(v===d)return;this._checkIfDateIsSelected(e)||r.push(e)}else if(c)switch(v){case 1:r.push(e),this.rangeDateTo||(this.rangeDateTo=e),m(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=e),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[e],this.rangeDateFrom=e,this.rangeDateTo="";break;default:this.selectedDates=[e],this.rangeDateFrom=e}else this.selectedDates=[e];return this.trigger(i.eventChangeSelectedDate,{action:i.actionSelectDate,silent:null==s?void 0:s.silent,date:e,updateTime:h}),this._updateLastSelectedDate(e),u&&!this.timepickerIsActive&&this.visible&&(d||c?c&&1===v&&this.hide():this.hide()),new Promise((e=>{setTimeout(e)}))}}unselectDate(e){let t=this.selectedDates,s=this;
10229if((e=b(e))instanceof Date)return t.some(((a,n)=>{if(p(a,e))return t.splice(n,1),s.selectedDates.length?s._updateLastSelectedDate(s.selectedDates[s.selectedDates.length-1]):(s.rangeDateFrom="",s.rangeDateTo="",s._updateLastSelectedDate(!1)),this.trigger(i.eventChangeSelectedDate,{action:i.actionUnselectDate,date:e}),!0}))}replaceDate(e,t){let s=this.selectedDates.find((t=>p(t,e,this.currentView))),a=this.selectedDates.indexOf(s);a<0||p(this.selectedDates[a],t,this.currentView)||(this.selectedDates[a]=t,this.trigger(i.eventChangeSelectedDate,{action:i.actionSelectDate,date:t,updateTime:!0}),this._updateLastSelectedDate(t))}clear(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(i.eventChangeSelectedDate,{action:i.actionUnselectDate,silent:e.silent}),new Promise((e=>{setTimeout(e)}))}show(){let{onShow:e,isMobile:t}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,e&&this._scheduleCallAfterTransition(e),t&&this._showMobileOverlay()}hide(){let{onHide:e,isMobile:t}=this.opts,i=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition((t=>{!this.customHide&&(t&&i||!t&&!i)&&this._finishHide(),e&&e(t)})),t&&j.classList.remove("-active-")}_triggerOnSelect(){let e=[],t=[],{selectedDates:i,locale:s,opts:{onSelect:a,multipleDates:n,range:r}}=this,h=n||r,o="function"==typeof s.dateFormat;i.length&&(e=i.map(g),t=o?n?s.dateFormat(e):e.map((e=>s.dateFormat(e))):e.map((e=>this.formatDate(e,s.dateFormat)))),a({date:h?e:e[0],formattedDate:h?t:t[0],datepicker:this})}_handleAlreadySelectedDates(e,t){const{range:i,toggleSelected:s}=this.opts;let a="function"==typeof s?s({datepicker:this,date:t}):s;i&&(a||2!==this.selectedDates.length&&this.selectDate(t)),a?this.unselectDate(t):this._updateLastSelectedDate(e)}_handleUpDownActions(e,t){if(!((e=b(e||this.focusDate||this.viewDate))instanceof Date))return;let i="up"===t?this.viewIndex+1:this.viewIndex-1;i>2&&(i=2),i<0&&(i=0),this.setViewDate(new Date(e.getFullYear(),e.getMonth(),1)),this.setCurrentView(this.viewIndexes[i])}_handleRangeOnFocus(){1===this.selectedDates.length&&(m(this.selectedDates[0],this.focusDate)?(this.rangeDateTo=this.selectedDates[0],this.rangeDateFrom=this.focusDate):(this.rangeDateTo=this.focusDate,this.rangeDateFrom=this.selectedDates[0]))}getCell(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.day;if(!((e=b(e))instanceof Date))return;let{year:s,month:a,date:n}=o(e),r=`[data-year="${s}"]`,h=`[data-month="${a}"]`,l={[i.day]:`${r}${h}[data-date="${n}"]`,[i.month]:`${r}${h}`,[i.year]:`${r}`};return this.views[this.currentView].$el.querySelector(l[t])}_showMobileOverlay(){j.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce(((e,t)=>parseFloat(t)+e),0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return o(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return c(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===i.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===i.days}get $container(){return this.$customContainer||P}static replacer(e,t,i){return e.replace(t,(function(e,t,s,a){return t+i+a}))}}var K;return I(B,"defaults",s),I(B,"version","3.4.0"),I(B,"defaultGlobalContainerId","air-datepicker-global-container"),K=B.prototype,Object.assign(K,N),t.default}()}));
10230/* End */
10231;
10232; /* Start:"a:4:{s:4:"full";s:63:"/bitrix/templates/aura-flowers-new/js/buy/buy.js?17729544175575";s:6:"source";s:48:"/bitrix/templates/aura-flowers-new/js/buy/buy.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
10233function retail_basket(){
10234    console.log("start_retail");
10235    var url = document.location.href;
10236    
10237    $.post(url, {}, function(result){
10238        try {
10239            var $parsed = $($.parseHTML(result));
10240            var component_resultation = $parsed.find(".top-user-basket");
10241            
10242            if (component_resultation.length) {
10243                $(".top-user-basket").html(component_resultation.html());
10244                
10245                // Обновляем мобильную корзин
10245у
10246                var $cartValue = $parsed.find(".new-cart__content-value").first();
10247                var $cartPrice = $parsed.find(".basket-price");
10248                
10249                if ($cartValue.length) $(".new-cart__content-value").text($cartValue.text());
10250                if ($cartPrice.length) $(".new-cart__content-value").last().text($cartPrice.text());
10251            }
10252        } catch(e) {
10253            console.error('Ошибка обновления корзины:', e);
10254            location.reload();
10255        }
10256    }, 'html');
10257    
10258    console.log("find_retail");
10259}
10260
10261//function retail_basket(){
10262//    console.log("start_retail");
10263//    var url = document.location.href;
10264//    $.post(url, {}, function(result){
10265//        var component_resultation = $(result).find(".top-user-basket");
10266//        $(".top-user-basket").html($(component_resultation).html());
10267
10268//    });
10269//    console.log("find_retail");
10270//}
10271function ajaxBuy(id, quantity, decorEnable, isFormCard, dopId, prices = null) {
10272    BX.showWait();
10273    var params = {};
10274    params.id = id;
10275    params.quantity = quantity;
10276    params.action= "ADD2BASKET";
10277    if(decorEnable){
10278        params.dopId=dopId;
10279    }
10280
10281    var cost = $("#price_" + id).html()
10282
10283    if(typeof cost === 'undefined'){
10284        cost = $("#allPrice").html()
10285    }
10286
10287	console.log(params);
10288
10289    $.getJSON('/ajax/buy.php',params, function (data) {
10290        $.each(data, function (key, val) {
10291            console.log('dd');
10292            console.log(isFormCard);
10293            console.log('dd');
10294            $("#orderNum").html(val.result);
10295            $("#cardName").html(val.name);
10296            $("#cardArticle").html($(".articul").html());
10297            $("#cardPrice").html(quantity+" шт. "+val.cost_+" руб.");
10298            // $("#cardPrice").html(quantity+" шт."+ summ);
10299            $("#cardFotoImg").attr("src",val.img);
10300            $("#cardFotoImg").attr("alt",val.name);
10301
10302            if (isFormCard) {
10303							var targetContainer = $('.order__wrap');         //  Контейнер, в котором хранятся элементы
10304                // var   url =  'https://auraf.ru/personal/order/make/';    //  URL, из которого будем брать элементы
10305                //
10306                // if (url !== undefined) {
10307                //     $.ajax({
10308                //         type: 'GET',
10309                //         url: url,
10310                //         dataType: 'html',
10311                //         success: function(data){
10312                //             //  Удаляем старую навигацию
10313                //             $('.summary').remove();
10314                //
10315                //             var elements = $(data).find('.summary')  //  Ищем элементы
10316                //             console.log($(data).html())
10317                //             targetContainer.append(elements);
10318                //
10319                //         }
10320                //     })
10321                // }
10322
10323                var url = window.location.href.split('?')[0];
10324                BX.ajax({
10325                    url: url,
10326                    method: 'POST',
10327                    data: {'SCODER_AJAX':'Y'},
10328                    onsuccess: function(data){
10329                        $('.summary').remove();
10330
10331                                    // var elements = $(data).find('.summary')  //  Ищем элементы
10332                                    // console.log($(data).html())
10333                                    // targetContainer.append(elements);
10334                        //console.log($(data).find('.summary'))
10335                        targetContainer.prepend($(data).find('.summary'));
10336                    },
10337                });
10338
10339            }
10340
10341            else {
10342                $.fancybox({
10343                    padding: 0,
10344                    'speedIn':500,
10345                    'speedOut':300,
10346                    'href':'#order',
10347                    helpers:{
10348                        overlay:{
10349                            locked:false
10350                        }
10351                    }
10352                });
10353               
10354            }
10355            BX.closeWait();
10356        });
10357    });
10358}
10359
10360function sayHi() {
10361    retail_basket();
10362  }
10363function buyItem(id, offer, prices=null) {
10364
10365    var idElement = id;
10366
10367    var quantity = $("#quantity_" + id).html();
10368    if(typeof quantity === 'undefined'){
10369        quantity = 1;
10370    }
10371    if(offer){
10372        idElement=$("input[name='offer']:checked").val();
10373    }
10374    var dopId=[];
10375    $("input[name='dop']:checked").each(function() {
10376        dopId.push($(this).val());
10377    });
10378    var decorEnable=false;
10379
10380    if((dopId.length)>0){
10381        decorEnable=true;
10382    }
10383    if(typeof idElement === 'undefined'){
10384      idElement = id;
10385    }
10386    ajaxBuy(idElement, quantity, decorEnable, false,dopId, prices);
10387    setTimeout(sayHi, 1500);
10388    
10389 
10390
10391}
10392
10393function buyItemFormCard(id) {
10394    ajaxBuy(id, 1, false, true,null);
10395    //BX.onCustomEvent('OnBasketChange');
10396   
10397}
10398
10399function delItem(id) {
10400    $.get('/ajax/del.php?action=DEL&id=' + id, function (data) {
10401        location.reload();
10402    });
10403}
10404/* End */
10405;
10406; /* Start:"a:4:{s:4:"full";s:68:"/bitrix/templates/aura-flowers-new/js/buy/speedBuy.js?17156286341437";s:6:"source";s:53:"/bitrix/templates/aura-flowers-new/js/buy/speedBuy.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
10407function showResponse(responseText, statusText, xhr, $form) {
10408    obj = jQuery.parseJSON(responseText);
10409    if (obj.result == 0) {
10410        $('#speedForm').html("<div class='ok'>Запрос успешно отправлен !</div> ");
10411
10412    } else {
10413
10414        var str = "Ошибки:<br />";
10415        var length = obj.data.length;
10416        for (var i = 0; i < length; i++) {
10417            str = str + obj.data[i] + "<br />";
10418        }
10419        $("#errorsContainter").html(str);
10420    }
10421}
10422
10423function sendform() {
10424    $('#errorsContainter').html('<img src="<?=SITE_TEMPLATE_PATH;?>/resources/img/fancybox_loading.gif');
10425    $("#orderForm").ajaxForm({
10426        success:showResponse
10427    }).submit();
10428}
10429
10430
10431$(document).ready(function () {
10432
10433    $('#speedForm input').keypress(function (e) {
10434        if (e.which == 13) {
10435            sendform();
10436        }
10437    });
10438
10439    $('#speedForm #buttonSubmit').click(function () {
10440        sendform();
10441    });
10442
10443    $(".fancyboxAjax").fancybox(
10444        {
10445            type:"ajax",
10446            padding:0,
10447            'speedIn':500,
10448            'speedOut':300
10449        }
10450    )
10451
10452    //Указывается параметры заказа для popup
10453    productPrice = $("#product-data").attr('data-price');
10454    productImg = $("#product-data").attr('data-img-url');
10455    $('#cardProductPrice').html(productPrice);
10456    $('#cardProductImg img').attr('src', productImg);
10457    console.log('productPrice: ' + productPrice);
10458});
10459
10460
10461/* End */
10462;
10463; /* Start:"a:4:{s:4:"full";s:68:"/bitrix/templates/aura-flowers-new/js/jquery.form.js?171562863441094";s:6:"source";s:52:"/bitrix/templates/aura-flowers-new/js/jquery.form.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
10464/*!
10465 * jQuery Form Plugin
10466 * version: 3.32.0-2013.04.09
10467 * @requires jQuery v1.5 or later
10468 * Copyright (c) 2013 M. Alsup
10469 * Examples and documentation at: http://malsup.com/jquery/form/
10470 * Project repository: https://github.com/malsup/form
10471 * Dual licensed under the MIT and GPL licenses.
10472 * https://github.com/malsup/form#copyright-and-license
10473 */
10474/*global ActiveXObject */
10475;(function($) {
10476"use strict";
10477
10478/*
10479    Usage Note:
10480    -----------
10481    Do not use both ajaxSubmit and ajaxForm on the same form.  These
10482    functions are mutually exclusive.  Use ajaxSubmit if you want
10483    to bind your own submit handler to the form.  For example,
10484
10485    $(document).ready(function() {
10486        $('#myForm').on('submit', function(e) {
10487            e.preventDefault(); // <-- important
10488            $(this).ajaxSubmit({
10489                target: '#output'
10490            });
10491        });
10492    });
10493
10494    Use ajaxForm when you want the plugin to manage all the event binding
10495    for you.  For example,
10496
10497    $(document).ready(function() {
10498        $('#myForm').ajaxForm({
10499            target: '#output'
10500        });
10501    });
10502
10503    You can also use ajaxForm with delegation (requires jQuery v1.7+), so the
10504    form does not have to exist when you invoke ajaxForm:
10505
10506    $('#myForm').ajaxForm({
10507        delegation: true,
10508        target: '#output'
10509    });
10510
10511    When using ajaxForm, the ajaxSubmit function will be invoked for you
10512    at the appropriate time.
10513*/
10514
10515/**
10516 * Feature detection
10517 */
10518var feature = {};
10519feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
10520feature.formdata = window.FormData !== undefined;
10521
10522var hasProp = !!$.fn.prop;
10523
10524// attr2 uses prop when it can but checks the return type for
10525// an expected string.  this accounts for the case where a form 
10526// contains inputs with names like "action" or "method"; in those
10527// cases "prop" returns the element
10528$.fn.attr2 = function() {
10529    if ( ! hasProp )
10530        return this.attr.apply(this, arguments);
10531    var val = this.prop.apply(this, arguments);
10532    if ( ( val && val.jquery ) || typeof val === 'string' )
10533        return val;
10534    return this.attr.apply(this, arguments);
10535};
10536
10537/**
10538 * ajaxSubmit() provides a mechanism for immediately submitting
10539 * an HTML form using AJAX.
10540 */
10541$.fn.ajaxSubmit = function(options) {
10542    /*jshint scripturl:true */
10543
10544    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
10545    if (!this.length) {
10546        log('ajaxSubmit: skipping submit process - no element selected');
10547        return this;
10548    }
10549
10550    var method, action, url, $form = this;
10551
10552    if (typeof options == 'function') {
10553        options = { success: options };
10554    }
10555
10556    method = this.attr2('method');
10557    action = this.attr2('action');
10558
10559    url = (typeof action === 'string') ? $.trim(action) : '';
10560    url = url || window.location.href || '';
10561    if (url) {
10562        // clean url (don't include hash vaue)
10563        url = (url.match(/^([^#]+)/)||[])[1];
10564    }
10565
10566    options = $.extend(true, {
10567        url:  url,
10568        success: $.ajaxSettings.success,
10569        type: method || 'GET',
10570        iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank'
10571    }, options);
10572
10573    // hook for manipulating the form data before it is extracted;
10574    // convenient for use with rich editors like tinyMCE or FCKEditor
10575    var veto = {};
10576    this.trigger('form-pre-serialize', [this, options, veto]);
10577    if (veto.veto) {
10578        log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
10579        return this;
10580    }
10581
10582    // provide opportunity to alter form data before it is serialized
10583    if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
10584        log('ajaxSubmit: submit aborted via beforeSerialize callback');
10585        return this;
10586    }
10587
10588    var traditional = options.traditional;
10589    if ( traditional === undefined ) {
10590        traditional = $.ajaxSettings.traditional;
10591    }
10592
10593    var elements = [];
10594    var qx, a = this.formToArray(options.semantic, elements);
10595    if (options.data) {
10596        options.extraData = options.data;
10597        qx = $.param(options.data, traditional);
10598    }
10599
10600    // give pre-submit callback an opportunity to abort the submit
10601    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
10602        log('ajaxSubmit: submit aborted via beforeSubmit callback');
10603        return this;
10604    }
10605
10606    // fire vetoable 'validate' event
10607    this.trigger('form-submit-validate', [a, this, options, veto]);
10608    if (veto.veto) {
10609        log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
10610        return this;
10611    }
10612
10613    var q = $.param(a, traditional);
10614    if (qx) {
10615        q = ( q ? (q + '&' + qx) : qx );
10616    }
10617    if (options.type.toUpperCase() == 'GET') {
10618        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
10619        options.data = null;  // data is null for 'get'
10620    }
10621    else {
10622        options.data = q; // data is the query string for 'post'
10623    }
10624
10625    var callbacks = [];
10626    if (options.resetForm) {
10627        callbacks.push(function() { $form.resetForm(); });
10628    }
10629    if (options.clearForm) {
10630        callbacks.push(function() { $form.clearForm(options.includeHidden); });
10631    }
10632
10633    // perform a load on the target only if dataType is not provided
10634    if (!options.dataType && options.target) {
10635        var oldSuccess = options.success || function(){};
10636        callbacks.push(function(data) {
10637            var fn = options.replaceTarget ? 'replaceWith' : 'html';
10638            $(options.target)[fn](data).each(oldSuccess, arguments);
10639        });
10640    }
10641    else if (options.success) {
10642        callbacks.push(options.success);
10643    }
10644
10645    options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
10646        var context = options.context || this ;    // jQuery 1.4+ supports scope context
10647        for (var i=0, max=callbacks.length; i < max; i++) {
10648            callbacks[i].apply(context, [data, status, xhr || $form, $form]);
10649        }
10650    };
10651
10652    // are there files to upload?
10653
10654    // [value] (issue #113), also see comment:
10655    // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219
10656    var fileInputs = $('input[type=file]:enabled[value!=""]', this);
10657
10658    var hasFileInputs = fileInputs.length > 0;
10659    var mp = 'multipart/form-data';
10660    var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp);
10661
10662    var fileAPI = feature.fileapi && feature.formdata;
10663    log("fileAPI :" + fileAPI);
10664    var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
10665
10666    var jqxhr;
10667
10668    // options.iframe allows user to force iframe mode
10669    // 06-NOV-09: now defaulting to iframe mode if file input is detected
10670    if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
10671        // hack to fix Safari hang (thanks to Tim Molendijk for this)
10672        // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
10673        if (options.closeKeepAlive) {
10674            $.get(options.closeKeepAlive, function() {
10675                jqxhr = fileUploadIframe(a);
10676            });
10677        }
10678        else {
10679            jqxhr = fileUploadIframe(a);
10680        }
10681    }
10682    else if ((hasFileInputs || multipart) && fileAPI) {
10683        jqxhr = fileUploadXhr(a);
10684    }
10685    else {
10686        jqxhr = $.ajax(options);
10687    }
10688
10689    $form.removeData('jqxhr').data('jqxhr', jqxhr);
10690
10691    // clear element array
10692    for (var k=0; k < elements.length; k++)
10693        elements[k] = null;
10694
10695    // fire 'notify' event
10696    this.trigger('form-submit-notify', [this, options]);
10697    return this;
10698
10699    // utility fn for deep serialization
10700    function deepSerialize(extraData){
10701        var serialized = $.param(extraData).split('&');
10702        var len = serialized.length;
10703        var result = [];
10704        var i, part;
10705        for (i=0; i < len; i++) {
10706            // #252; undo param space replacement
10707            serialized[i] = serialized[i].replace(/\+/g,' ');
10708            part = serialized[i].split('=');
10709            // #278; use array instead of object storage, favoring array serializations
10710            result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]);
10711        }
10712        return result;
10713    }
10714
10715     // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz)
10716    function fileUploadXhr(a) {
10717        var formdata = new FormData();
10718
10719        for (var i=0; i < a.length; i++) {
10720            formdata.append(a[i].name, a[i].value);
10721        }
10722
10723        if (options.extraData) {
10724            var serializedData = deepSerialize(options.extraData);
10725            for (i=0; i < serializedData.length; i++)
10726                if (serializedData[i])
10727                    formdata.append(serializedData[i][0], serializedData[i][1]);
10728        }
10729
10730        options.data = null;
10731
10732        var s = $.extend(true, {}, $.ajaxSettings, options, {
10733            contentType: false,
10734            processData: false,
10735            cache: false,
10736            type: method || 'POST'
10737        });
10738
10739        if (options.uploadProgress) {
10740            // workaround because jqXHR does not expose upload property
10741            s.xhr = function() {
10742                var xhr = jQuery.ajaxSettings.xhr();
10743                if (xhr.upload) {
10744                    xhr.upload.addEventListener('progress', function(event) {
10745                        var percent = 0;
10746                        var position = event.loaded || event.position; /*event.position is deprecated*/
10747                        var total = event.total;
10748                        if (event.lengthComputable) {
10749                            percent = Math.ceil(position / total * 100);
10750                        }
10751                        options.uploadProgress(event, position, total, percent);
10752                    }, false);
10753                }
10754                return xhr;
10755            };
10756        }
10757
10758        s.data = null;
10759            var beforeSend = s.beforeSend;
10760            s.beforeSend = function(xhr, o) {
10761                o.data = formdata;
10762                if(beforeSend)
10763                    beforeSend.call(this, xhr, o);
10764        };
10765        return $.ajax(s);
10766    }
10767
10768    // private function for handling file uploads (hat tip to YAHOO!)
10769    function fileUploadIframe(a) {
10770        var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
10771        var deferred = $.Deferred();
10772
10773        if (a) {
10774            // ensure that every serialized input is still enabled
10775            for (i=0; i < elements.length; i++) {
10776                el = $(elements[i]);
10777                if ( hasProp )
10778                    el.prop('disabled', false);
10779                else
10780                    el.removeAttr('disabled');
10781            }
10782        }
10783
10784        s = $.extend(true, {}, $.ajaxSettings, options);
10785        s.context = s.context || s;
10786        id = 'jqFormIO' + (new Date().getTime());
10787        if (s.iframeTarget) {
10788            $io = $(s.iframeTarget);
10789            n = $io.attr2('name');
10790            if (!n)
10791                 $io.attr2('name', id);
10792            else
10793                id = n;
10794        }
10795        else {
10796            $io = $('<iframe name="' + id + '" src="'+ s.iframeSrc +'" />');
10797            $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });
10798        }
10799        io = $io[0];
10800
10801
10802        xhr = { // mock object
10803            aborted: 0,
10804            responseText: null,
10805            responseXML: null,
10806            status: 0,
10807            statusText: 'n/a',
10808            getAllResponseHeaders: function() {},
10809            getResponseHeader: function() {},
10810            setRequestHeader: function() {},
10811            abort: function(status) {
10812                var e = (status === 'timeout' ? 'timeout' : 'aborted');
10813                log('aborting upload... ' + e);
10814                this.aborted = 1;
10815
10816                try { // #214, #257
10817                    if (io.contentWindow.document.execCommand) {
10818                        io.contentWindow.document.execCommand('Stop');
10819                    }
10820                }
10821                catch(ignore) {}
10822
10823                $io.attr('src', s.iframeSrc); // abort op in progress
10824                xhr.error = e;
10825                if (s.error)
10826                    s.error.call(s.context, xhr, e, status);
10827                if (g)
10828                    $.event.trigger("ajaxError", [xhr, s, e]);
10829                if (s.complete)
10830                    s.complete.call(s.context, xhr, e);
10831            }
10832        };
10833
10834        g = s.global;
10835        // trigger ajax global events so that activity/block indicators work like normal
10836        if (g && 0 === $.active++) {
10837            $.event.trigger("ajaxStart");
10838        }
10839        if (g) {
10840            $.event.trigger("ajaxSend", [xhr, s]);
10841        }
10842
10843        if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
10844            if (s.global) {
10845                $.active--;
10846            }
10847            deferred.reject();
10848            return deferred;
10849        }
10850        if (xhr.aborted) {
10851            deferred.reject();
10852            return deferred;
10853        }
10854
10855        // add submitting element to data if we know it
10856        sub = form.clk;
10857        if (sub) {
10858            n = sub.name;
10859            if (n && !sub.disabled) {
10860                s.extraData = s.extraData || {};
10861                s.extraData[n] = sub.value;
10862                if (sub.type == "image") {
10863                    s.extraData[n+'.x'] = form.clk_x;
10864                    s.extraData[n+'.y'] = form.clk_y;
10865                }
10866            }
10867        }
10868
10869        var CLIENT_TIMEOUT_ABORT = 1;
10870        var SERVER_ABORT = 2;
10871                
10872        function getDoc(frame) {
10873            /* it looks like contentWindow or contentDocument do not
10874             * carry the protocol property in ie8, when running under ssl
10875             * frame.document is the only valid response document, since
10876             * the protocol is know but not on the other two objects. strange?
10877             * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy
10878             */
10879            
10880            var doc = null;
10881            
10882            // IE8 cascading access check
10883            try {
10884                if (frame.contentWindow) {
10885                    doc = frame.contentWindow.document;
10886                }
10887            } catch(err) {
10888                // IE8 access denied under ssl & missing protocol
10889                log('cannot get iframe.contentWindow document: ' + err);
10890            }
10891
10892            if (doc) { // successful getting content
10893                return doc;
10894            }
10895
10896            try { // simply checking may throw in ie8 under ssl or mismatched protocol
10897                doc = frame.contentDocument ? frame.contentDocument : frame.document;
10898            } catch(err) {
10899                // last attempt
10900                log('cannot get iframe.contentDocument: ' + err);
10901                doc = frame.document;
10902            }
10903            return doc;
10904        }
10905
10906        // Rails CSRF hack (thanks to Yvan Barthelemy)
10907        var csrf_token = $('meta[name=csrf-token]').attr('content');
10908        var csrf_param = $('meta[name=csrf-param]').attr('content');
10909        if (csrf_param && csrf_token) {
10910            s.extraData = s.extraData || {};
10911            s.extraData[csrf_param] = csrf_token;
10912        }
10913
10914        // take a breath so that pending repaints get some cpu time before the upload starts
10915        function doSubmit() {
10916            // make sure form attrs are set
10917            var t = $form.attr2('target'), a = $form.attr2('action');
10918
10919            // update form attrs in IE friendly way
10920            form.setAttribute('target',id);
10921            if (!method) {
10922                form.setAttribute('method', 'POST');
10923            }
10924            if (a != s.url) {
10925                form.setAttribute('action', s.url);
10926            }
10927
10928            // ie borks in some cases when setting encoding
10929            if (! s.skipEncodingOverride && (!method || /post/i.test(method))) {
10930                $form.attr({
10931                    encoding: 'multipart/form-data',
10932                    enctype:  'multipart/form-data'
10933                });
10934            }
10935
10936            // support timout
10937            if (s.timeout) {
10938                timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout);
10939            }
10940
10941            // look for server aborts
10942            function checkState() {
10943                try {
10944                    var state = getDoc(io).readyState;
10945                    log('state = ' + state);
10946                    if (state && state.toLowerCase() == 'uninitialized')
10947                        setTimeout(checkState,50);
10948                }
10949                catch(e) {
10950                    log('Server abort: ' , e, ' (', e.name, ')');
10951                    cb(SERVER_ABORT);
10952                    if (timeoutHandle)
10953                        clearTimeout(timeoutHandle);
10954                    timeoutHandle = undefined;
10955                }
10956            }
10957
10958            // add "extra" data to form if provided in options
10959            var extraInputs = [];
10960            try {
10961                if (s.extraData) {
10962                    for (var n in s.extraData) {
10963                        if (s.extraData.hasOwnProperty(n)) {
10964                           // if using the $.param format that allows for multiple values with the same name
10965                           if($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) {
10966                               extraInputs.push(
10967                               $('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value)
10968                                   .appendTo(form)[0]);
10969                           } else {
10970                               extraInputs.push(
10971                               $('<input type="hidden" name="'+n+'">').val(s.extraData[n])
10972                                   .appendTo(form)[0]);
10973                           }
10974                        }
10975                    }
10976                }
10977
10978                if (!s.iframeTarget) {
10979                    // add iframe to doc and submit the form
10980                    $io.appendTo('body');
10981                    if (io.attachEvent)
10982                        io.attachEvent('onload', cb);
10983                    else
10984                        io.addEventListener('load', cb, false);
10985                }
10986                setTimeout(checkState,15);
10987
10988                try {
10989                    form.submit();
10990                } catch(err) {
10991                    // just in case form has element with name/id of 'submit'
10992                    var submitFn = document.createElement('form').submit;
10993                    submitFn.apply(form);
10994                }
10995            }
10996            finally {
10997                // reset attrs and remove "extra" input elements
10998                form.setAttribute('action',a);
10999                if(t) {
11000                    form.setAttribute('target', t);
11001                } else {
11002                    $form.removeAttr('target');
11003                }
11004                $(extraInputs).remove();
11005            }
11006        }
11007
11008        if (s.forceSync) {
11009            doSubmit();
11010        }
11011        else {
11012            setTimeout(doSubmit, 10); // this lets dom updates render
11013        }
11014
11015        var data, doc, domCheckCount = 50, callbackProcessed;
11016
11017        function cb(e) {
11018            if (xhr.aborted || callbackProcessed) {
11019                return;
11020            }
11021            
11022            doc = getDoc(io);
11023            if(!doc) {
11024                log('cannot access response document');
11025                e = SERVER_ABORT;
11026            }
11027            if (e === CLIENT_TIMEOUT_ABORT && xhr) {
11028                xhr.abort('timeout');
11029                deferred.reject(xhr, 'timeout');
11030                return;
11031            }
11032            else if (e == SERVER_ABORT && xhr) {
11033                xhr.abort('server abort');
11034                deferred.reject(xhr, 'error', 'server abort');
11035                return;
11036            }
11037
11038            if (!doc || doc.location.href == s.iframeSrc) {
11039                // response not received yet
11040                if (!timedOut)
11041                    return;
11042            }
11043            if (io.detachEvent)
11044                io.detachEvent('onload', cb);
11045            else
11046                io.removeEventListener('load', cb, false);
11047
11048            var status = 'success', errMsg;
11049            try {
11050                if (timedOut) {
11051                    throw 'timeout';
11052                }
11053
11054                var isXml = s.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc);
11055                log('isXml='+isXml);
11056                if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
11057                    if (--domCheckCount) {
11058                        // in some browsers (Opera) the iframe DOM is not always traversable when
11059                        // the onload callback fires, so we loop a bit to accommodate
11060                        log('requeing onLoad callback, DOM not available');
11061                        setTimeout(cb, 250);
11062                        return;
11063                    }
11064                    // let this fall through because server response could be an empty document
11065                    //log('Could not access iframe DOM after mutiple tries.');
11066                    //throw 'DOMException: not available';
11067                }
11068
11069                //log('response detected');
11070                var docRoot = doc.body ? doc.body : doc.documentElement;
11071                xhr.responseText = docRoot ? docRoot.innerHTML : null;
11072                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
11073                if (isXml)
11074                    s.dataType = 'xml';
11075                xhr.getResponseHeader = function(header){
11076                    var headers = {'content-type': s.dataType};
11077                    return headers[header];
11078                };
11079                // support for XHR 'status' & 'statusText' emulation :
11080                if (docRoot) {
11081                    xhr.status = Number( docRoot.getAttribute('status') ) || xhr.status;
11082                    xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText;
11083                }
11084
11085                var dt = (s.dataType || '').toLowerCase();
11086                var scr = /(json|script|text)/.test(dt);
11087                if (scr || s.textarea) {
11088                    // see if user embedded response in textarea
11089                    var ta = doc.getElementsByTagName('textarea')[0];
11090                    if (ta) {
11091                        xhr.responseText = ta.value;
11092                        // support for XHR 'status' & 'statusText' emulation :
11093                        xhr.status = Number( ta.getAttribute('status') ) || xhr.status;
11094                        xhr.statusText = ta.getAttribute('statusText') || xhr.statusText;
11095                    }
11096                    else if (scr) {
11097                        // account for browsers injecting pre around json response
11098                        var pre = doc.getElementsByTagName('pre')[0];
11099                        var b = doc.getElementsByTagName('body')[0];
11100                        if (pre) {
11101                            xhr.responseText = pre.textContent ? pre.textContent : pre.innerText;
11102                        }
11103                        else if (b) {
11104                            xhr.responseText = b.textContent ? b.textContent : b.innerText;
11105                        }
11106                    }
11107                }
11108                else if (dt == 'xml' && !xhr.responseXML && xhr.responseText) {
11109                    xhr.responseXML = toXml(xhr.responseText);
11110                }
11111
11112                try {
11113                    data = httpData(xhr, dt, s);
11114                }
11115                catch (err) {
11116                    status = 'parsererror';
11117                    xhr.error = errMsg = (err || status);
11118                }
11119            }
11120            catch (err) {
11121                log('error caught: ',err);
11122                status = 'error';
11123                xhr.error = errMsg = (err || status);
11124            }
11125
11126            if (xhr.aborted) {
11127                log('upload aborted');
11128                status = null;
11129            }
11130
11131            if (xhr.status) { // we've set xhr.status
11132                status = (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) ? 'success' : 'error';
11133            }
11134
11135            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
11136            if (status === 'success') {
11137                if (s.success)
11138                    s.success.call(s.context, data, 'success', xhr);
11139                deferred.resolve(xhr.responseText, 'success', xhr);
11140                if (g)
11141                    $.event.trigger("ajaxSuccess", [xhr, s]);
11142            }
11143            else if (status) {
11144                if (errMsg === undefined)
11145                    errMsg = xhr.statusText;
11146                if (s.error)
11147                    s.error.call(s.context, xhr, status, errMsg);
11148                deferred.reject(xhr, 'error', errMsg);
11149                if (g)
11150                    $.event.trigger("ajaxError", [xhr, s, errMsg]);
11151            }
11152
11153            if (g)
11154                $.event.trigger("ajaxComplete", [xhr, s]);
11155
11156            if (g && ! --$.active) {
11157                $.event.trigger("ajaxStop");
11158            }
11159
11160            if (s.complete)
11161                s.complete.call(s.context, xhr, status);
11162
11163            callbackProcessed = true;
11164            if (s.timeout)
11165                clearTimeout(timeoutHandle);
11166
11167            // clean up
11168            setTimeout(function() {
11169                if (!s.iframeTarget)
11170                    $io.remove();
11171                xhr.responseXML = null;
11172            }, 100);
11173        }
11174
11175        var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+)
11176            if (window.ActiveXObject) {
11177                doc = new ActiveXObject('Microsoft.XMLDOM');
11178                doc.async = 'false';
11179                doc.loadXML(s);
11180            }
11181            else {
11182                doc = (new DOMParser()).parseFromString(s, 'text/xml');
11183            }
11184            return (doc && doc.documentElement && doc.documentElement.nodeName != 'parsererror') ? doc : null;
11185        };
11186        var parseJSON = $.parseJSON || function(s) {
11187            /*jslint evil:true */
11188            return window['eval']('(' + s + ')');
11189        };
11190
11191        var httpData = function( xhr, type, s ) { // mostly lifted from jq1.4.4
11192
11193            var ct = xhr.getResponseHeader('content-type') || '',
11194                xml = type === 'xml' || !type && ct.indexOf('xml') >= 0,
11195                data = xml ? xhr.responseXML : xhr.responseText;
11196
11197            if (xml && data.documentElement.nodeName === 'parsererror') {
11198                if ($.error)
11199                    $.error('parsererror');
11200            }
11201            if (s && s.dataFilter) {
11202                data = s.dataFilter(data, type);
11203            }
11204            if (typeof data === 'string') {
11205                if (type === 'json' || !type && ct.indexOf('json') >= 0) {
11206                    data = parseJSON(data);
11207                } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
11208                    $.globalEval(data);
11209                }
11210            }
11211            return data;
11212        };
11213
11214        return deferred;
11215    }
11216};
11217
11218/**
11219 * ajaxForm() provides a mechanism for fully automating form submission.
11220 *
11221 * The advantages of using this method instead of ajaxSubmit() are:
11222 *
11223 * 1: This method will include coordinates for <input type="image" /> elements (if the element
11224 *    is used to submit the form).
11225 * 2. This method will include the submit element's name/value data (for the element that was
11226 *    used to submit the form).
11227 * 3. This method binds the submit() method to the form for you.
11228 *
11229 * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
11230 * passes the options argument along after properly binding events for submit elements and
11231 * the form itself.
11232 */
11233$.fn.ajaxForm = function(options) {
11234    options = options || {};
11235    options.delegation = options.delegation && $.isFunction($.fn.on);
11236
11237    // in jQuery 1.3+ we can fix mistakes with the ready state
11238    if (!options.delegation && this.length === 0) {
11239        var o = { s: this.selector, c: this.context };
11240        if (!$.isReady && o.s) {
11241            log('DOM not ready, queuing ajaxForm');
11242            $(function() {
11243                $(o.s,o.c).ajaxForm(options);
11244            });
11245            return this;
11246        }
11247        // is your DOM ready?  http://docs.jquery.com/Tutorials:Introducing_$(document).ready()
11248        log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)'));
11249        return this;
11250    }
11251
11252    if ( options.delegation ) {
11253        $(document)
11254            .off('submit.form-plugin', this.selector, doAjaxSubmit)
11255            .off('click.form-plugin', this.selector, captureSubmittingElement)
11256            .on('submit.form-plugin', this.selector, options, doAjaxSubmit)
11257            .on('click.form-plugin', this.selector, options, captureSubmittingElement);
11258        return this;
11259    }
11260
11261    return this.ajaxFormUnbind()
11262        .bind('submit.form-plugin', options, doAjaxSubmit)
11263        .bind('click.form-plugin', options, captureSubmittingElement);
11264};
11265
11266// private event handlers
11267function doAjaxSubmit(e) {
11268    /*jshint validthis:true */
11269    var options = e.data;
11270    if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed
11271        e.preventDefault();
11272        $(this).ajaxSubmit(options);
11273    }
11274}
11275
11276function captureSubmittingElement(e) {
11277    /*jshint validthis:true */
11278    var target = e.target;
11279    var $el = $(target);
11280    if (!($el.is("[type=submit],[type=image]"))) {
11281        // is this a child element of the submit el?  (ex: a span within a button)
11282        var t = $el.closest('[type=submit]');
11283        if (t.length === 0) {
11284            return;
11285        }
11286        target = t[0];
11287    }
11288    var form = this;
11289    form.clk = target;
11290    if (target.type == 'image') {
11291        if (e.offsetX !== undefined) {
11292            form.clk_x = e.offsetX;
11293            form.clk_y = e.offsetY;
11294        } else if (typeof $.fn.offset == 'function') {
11295            var offset = $el.offset();
11296            form.clk_x = e.pageX - offset.left;
11297            form.clk_y = e.pageY - offset.top;
11298        } else {
11299            form.clk_x = e.pageX - target.offsetLeft;
11300            form.clk_y = e.pageY - target.offsetTop;
11301        }
11302    }
11303    // clear form vars
11304    setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100);
11305}
11306
11307
11308// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
11309$.fn.ajaxFormUnbind = function() {
11310    return this.unbind('submit.form-plugin click.form-plugin');
11311};
11312
11313/**
11314 * formToArray() gathers form element data into an array of objects that can
11315 * be passed to any of the following ajax functions: $.get, $.post, or load.
11316 * Each object in the array has both a 'name' and 'value' property.  An example of
11317 * an array for a simple login form might be:
11318 *
11319 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
11320 *
11321 * It is this array that is passed to pre-submit callback functions provided to the
11322 * ajaxSubmit() and ajaxForm() methods.
11323 */
11324$.fn.formToArray = function(semantic, elements) {
11325    var a = [];
11326    if (this.length === 0) {
11327        return a;
11328    }
11329
11330    var form = this[0];
11331    var els = semantic ? form.getElementsByTagName('*') : form.elements;
11332    if (!els) {
11333        return a;
11334    }
11335
11336    var i,j,n,v,el,max,jmax;
11337    for(i=0, max=els.length; i < max; i++) {
11338        el = els[i];
11339        n = el.name;
11340        if (!n || el.disabled) {
11341            continue;
11342        }
11343
11344        if (semantic && form.clk && el.type == "image") {
11345            // handle image inputs on the fly when semantic == true
11346            if(form.clk == el) {
11347                a.push({name: n, value: $(el).val(), type: el.type });
11348                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
11349            }
11350            continue;
11351        }
11352
11353        v = $.fieldValue(el, true);
11354        if (v && v.constructor == Array) {
11355            if (elements)
11356                elements.push(el);
11357            for(j=0, jmax=v.length; j < jmax; j++) {
11358                a.push({name: n, value: v[j]});
11359            }
11360        }
11361        else if (feature.fileapi && el.type == 'file') {
11362            if (elements)
11363                elements.push(el);
11364            var files = el.files;
11365            if (files.length) {
11366                for (j=0; j < files.length; j++) {
11367                    a.push({name: n, value: files[j], type: el.type});
11368                }
11369            }
11370            else {
11371                // #180
11372                a.push({ name: n, value: '', type: el.type });
11373            }
11374        }
11375        else if (v !== null && typeof v != 'undefined') {
11376            if (elements)
11377                elements.push(el);
11378            a.push({name: n, value: v, type: el.type, required: el.required});
11379        }
11380    }
11381
11382    if (!semantic && form.clk) {
11383        // input type=='image' are not found in elements array! handle it here
11384        var $input = $(form.clk), input = $input[0];
11385        n = input.name;
11386        if (n && !input.disabled && input.type == 'image') {
11387            a.push({name: n, value: $input.val()});
11388            a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
11389        }
11390    }
11391    return a;
11392};
11393
11394/**
11395 * Serializes form data into a 'submittable' string. This method will return a string
11396 * in the format: name1=value1&amp;name2=value2
11397 */
11398$.fn.formSerialize = function(semantic) {
11399    //hand off to jQuery.param for proper encoding
11400    return $.param(this.formToArray(semantic));
11401};
11402
11403/**
11404 * Serializes all field elements in the jQuery object into a query string.
11405 * This method will return a string in the format: name1=value1&amp;name2=value2
11406 */
11407$.fn.fieldSerialize = function(successful) {
11408    var a = [];
11409    this.each(function() {
11410        var n = this.name;
11411        if (!n) {
11412            return;
11413        }
11414        var v = $.fieldValue(this, successful);
11415        if (v && v.constructor == Array) {
11416            for (var i=0,max=v.length; i < max; i++) {
11417                a.push({name: n, value: v[i]});
11418            }
11419        }
11420        else if (v !== null && typeof v != 'undefined') {
11421            a.push({name: this.name, value: v});
11422        }
11423    });
11424    //hand off to jQuery.param for proper encoding
11425    return $.param(a);
11426};
11427
11428/**
11429 * Returns the value(s) of the element in the matched set.  For example, consider the following form:
11430 *
11431 *  <form><fieldset>
11432 *      <input name="A" type="text" />
11433 *      <input name="A" type="text" />
11434 *      <input name="B" type="checkbox" value="B1" />
11435 *      <input name="B" type="checkbox" value="B2"/>
11436 *      <input name="C" type="radio" value="C1" />
11437 *      <input name="C" type="radio" value="C2" />
11438 *  </fieldset></form>
11439 *
11440 *  var v = $('input[type=text]').fieldValue();
11441 *  // if no values are entered into the text inputs
11442 *  v == ['','']
11443 *  // if values entered into the text inputs are 'foo' and 'bar'
11444 *  v == ['foo','bar']
11445 *
11446 *  var v = $('input[type=checkbox]').fieldValue();
11447 *  // if neither checkbox is checked
11448 *  v === undefined
11449 *  // if both checkboxes are checked
11450 *  v == ['B1', 'B2']
11451 *
11452 *  var v = $('input[type=radio]').fieldValue();
11453 *  // if neither radio is checked
11454 *  v === undefined
11455 *  // if first radio is checked
11456 *  v == ['C1']
11457 *
11458 * The successful argument controls whether or not the field element must be 'successful'
11459 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
11460 * The default value of the successful argument is true.  If this value is false the value(s)
11461 * for each element is returned.
11462 *
11463 * Note: This method *always* returns an array.  If no valid value can be determined the
11464 *    array will be empty, otherwise it will contain one or more values.
11465 */
11466$.fn.fieldValue = function(successful) {
11467    for (var val=[], i=0, max=this.length; i < max; i++) {
11468        var el = this[i];
11469        var v = $.fieldValue(el, successful);
11470        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) {
11471            continue;
11472        }
11473        if (v.constructor == Array)
11474            $.merge(val, v);
11475        else
11476            val.push(v);
11477    }
11478    return val;
11479};
11480
11481/**
11482 * Returns the value of the field element.
11483 */
11484$.fieldValue = function(el, successful) {
11485    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
11486    if (successful === undefined) {
11487        successful = true;
11488    }
11489
11490    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
11491        (t == 'checkbox' || t == 'radio') && !el.checked ||
11492        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
11493        tag == 'select' && el.selectedIndex == -1)) {
11494            return null;
11495    }
11496
11497    if (tag == 'select') {
11498        var index = el.selectedIndex;
11499        if (index < 0) {
11500            return null;
11501        }
11502        var a = [], ops = el.options;
11503        var one = (t == 'select-one');
11504        var max = (one ? index+1 : ops.length);
11505        for(var i=(one ? index : 0); i < max; i++) {
11506            var op = ops[i];
11507            if (op.selected) {
11508                var v = op.value;
11509                if (!v) { // extra pain for IE...
11510                    v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value;
11511                }
11512                if (one) {
11513                    return v;
11514                }
11515                a.push(v);
11516            }
11517        }
11518        return a;
11519    }
11520    return $(el).val();
11521};
11522
11523/**
11524 * Clears the form data.  Takes the following actions on the form's input fields:
11525 *  - input text fields will have their 'value' property set to the empty string
11526 *  - select elements will have their 'selectedIndex' property set to -1
11527 *  - checkbox and radio inputs will have their 'checked' property set to false
11528 *  - inputs of type submit, button, reset, and hidden will *not* be effected
11529 *  - button elements will *not* be effected
11530 */
11531$.fn.clearForm = function(includeHidden) {
11532    return this.each(function() {
11533        $('input,select,textarea', this).clearFields(includeHidden);
11534    });
11535};
11536
11537/**
11538 * Clears the selected form elements.
11539 */
11540$.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
11541    var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list
11542    return this.each(function() {
11543        var t = this.type, tag = this.tagName.toLowerCase();
11544        if (re.test(t) || tag == 'textarea') {
11545            this.value = '';
11546        }
11547        else if (t == 'checkbox' || t == 'radio') {
11548            this.checked = false;
11549        }
11550        else if (tag == 'select') {
11551            this.selectedIndex = -1;
11552        }
11553		else if (t == "file") {
11554			if (/MSIE/.test(navigator.userAgent)) {
11555				$(this).replaceWith($(this).clone(true));
11556			} else {
11557				$(this).val('');
11558			}
11559		}
11560        else if (includeHidden) {
11561            // includeHidden can be the value true, or it can be a selector string
11562            // indicating a special test; for example:
11563            //  $('#myForm').clearForm('.special:hidden')
11564            // the above would clean hidden inputs that have the class of 'special'
11565            if ( (includeHidden === true && /hidden/.test(t)) ||
11566                 (typeof includeHidden == 'string' && $(this).is(includeHidden)) )
11567                this.value = '';
11568        }
11569    });
11570};
11571
11572/**
11573 * Resets the form data.  Causes all form elements to be reset to their original value.
11574 */
11575$.fn.resetForm = function() {
11576    return this.each(function() {
11577        // guard against an input with the name of 'reset'
11578        // note that IE reports the reset function as an 'object'
11579        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) {
11580            this.reset();
11581        }
11582    });
11583};
11584
11585/**
11586 * Enables or disables any matching elements.
11587 */
11588$.fn.enable = function(b) {
11589    if (b === undefined) {
11590        b = true;
11591    }
11592    return this.each(function() {
11593        this.disabled = !b;
11594    });
11595};
11596
11597/**
11598 * Checks/unchecks any matching checkboxes or radio buttons and
11599 * selects/deselects and matching option elements.
11600 */
11601$.fn.selected = function(select) {
11602    if (select === undefined) {
11603        select = true;
11604    }
11605    return this.each(function() {
11606        var t = this.type;
11607        if (t == 'checkbox' || t == 'radio') {
11608            this.checked = select;
11609        }
11610        else if (this.tagName.toLowerCase() == 'option') {
11611            var $sel = $(this).parent('select');
11612            if (select && $sel[0] && $sel[0].type == 'select-one') {
11613                // deselect all other options
11614                $sel.find('option').selected(false);
11615            }
11616            this.selected = select;
11617        }
11618    });
11619};
11620
11621// expose debug var
11622$.fn.ajaxSubmit.debug = false;
11623
11624// helper fn for console logging
11625function log() {
11626    if (!$.fn.ajaxSubmit.debug)
11627        return;
11628    var msg = '[jquery.form] ' + Array.prototype.join.call(arguments,'');
11629    if (window.console && window.console.log) {
11630        window.console.log(msg);
11631    }
11632    else if (window.opera && window.opera.postError) {
11633        window.opera.postError(msg);
11634    }
11635}
11636
11637})(jQuery);
11638/* End */
11639;
11640; /* Start:"a:4:{s:4:"full";s:62:"/bitrix/templates/aura-flowers-new/js/script.js?17897398719013";s:6:"source";s:47:"/bitrix/templates/aura-flowers-new/js/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
11641$('[data-fancybox]').fancybox();
11642function changeCardQuantity(id, count) {
11643    $.getJSON('/ajax/ChangeQuantity.php?id=' + id + "&quantity=" + count+"&mode=0", function (data) {
11644        if(data.error=="0"){
11645            var priceElememnt = $("#price_"+id);
11646            priceElememnt.html(data.price);
11647            reCalculateItogo();
11648        }
11649        else{
11650            alert("Error connect, please contact administrator");
11651        }
11652
11653    });
11654}
11655
11656function reCalculateItogo(){
11657    var  itogoPrice = 0;
11658    $( ".itemPrice" ).each(function( index ) {
11659        itogoPrice = itogoPrice+parseInt($(this).html());
11660    });
11661    $("#itogoPrice").html(itogoPrice);
11662    if (itogoPrice < 700) {
11663        $('#basketOrderButton2').hide();
11664        $(".total-price-info").show();
11665    } else {
11666        $('#basketOrderButton2').show();
11667        $(".total-price-info").hide();
11668    }
11669    
11670}
11671
11672function reAllPrice(val){
11673    $("#product-data").attr('data-price', val);
11674    productPrice = $("#product-data").data('price');
11675    $('#cardProductPrice').html(productPrice);
11676}
11677function rePrice(val){
11678    $(".quantity").html("1");
11679    $("#allPrice").html(val);
11680    reAllPrice(val);
11681}
11682$(document).ready(function(){
11683
11684    $(".fancybox-gall").fancybox();
11685    $('.rightmenumobiletoggle').click(function() {
11686      $('#right_menu').slideToggle();
11687    });
11688
11689    $('.mobilemenutoggle').click(function() {
11690      $('#top_menu').slideToggle();
11691    });
11692    $('#top_menu li:has(ul)').doubleTapToGo();
11693
11694    jQuery("input[name='offer']").click(function () {
11695        var newPrice = parseInt($(this).parent().next().html());
11696
11697        if(parseInt($("input[name='dop']:checked").attr("price"))>0){
11698            var dopPrice=0;
11699            $("input[name='dop']:checked").each(function() {
11700                dopPrice+=parseInt($(this).attr("price"));
11701            });
11702            newPrice=newPrice+dopPrice;
11703        }
11704
11705        rePrice(newPrice);
11706
11707
11708    });
11709
11710
11711    jQuery("input[name='dop']").click(function () {
11712        var priceCount = parseInt($("input[name='offer']:checked").attr("price"));
11713        var quantityElememnt = $(".quantity");
11714        priceCount = parseInt(priceCount)*parseInt(quantityElememnt.html());
11715        var dopPrice=0;
11716        $("input[name='dop']:checked").each(function() {
11717            dopPrice+=parseInt($(this).attr("price"));
11718        });
11719        priceCount=priceCount+dopPrice;
11720
11721         $("#allPrice").html(priceCount);
11722         reAllPrice(priceCount);
11723    });
11724
11725    // card recalculate
11726    jQuery(".basket .plus").click(function () {
11727        var idElement = $(this).attr("id");
11728        idElement=idElement.substr(idElement.indexOf("_")+1,idElement.length);
11729        var quantityElememnt = $("#quantity_"+idElement);
11730        quantityElememnt.html(parseInt(quantityElememnt.html())+1);
11731        changeCardQuantity(idElement,parseInt(1));
11732    });
11733
11734    jQuery(".basket .minus").click(function () {
11735        var idElement = $(this).attr("id");
11736        idElement=idElement.substr(idElement.indexOf("_")+1,idElement.length);
11737        var quantityElememnt = $("#quantity_"+idElement);
11738        var quantityElememntInt = parseInt(quantityElememnt.html());
11739        if (quantityElememntInt != 1){
11740            quantityElememnt.html(parseInt(quantityElememnt.html())-1);
11741            changeCardQuantity(idElement,parseInt(-1));
11742        }
11743    });
11744
11745
11746    jQuery(".count .plus").click(function () {
11747		console.log('that');
11748        var idElement = $(this).attr("id");
11749        idElement=idElement.substr(idElement.indexOf("_")+1,idElement.length);
11750        var quantityElememnt = $("#quantity_"+idElement);
11751        quantityElememnt.html(parseInt(quantityElememnt.html())+1);
11752        var priceCount = parseInt($("input[name='offer']:checked").attr("price"));     
11753        priceCount = parseInt(priceCount)*parseInt(quantityElememnt.html());
11754		console.log(priceCount);
11755        var dopPrice=parseInt($("input[name='dop']:checked").attr("price"));
11756        if (dopPrice) priceCount = priceCount + dopPrice;
11757        $("#allPrice").html(priceCount);
11758        reAllPrice(priceCount);
11759    });
11760
11761    jQuery(".count .minus").click(function () {
11762        var idElement = $(this).attr("id");
11763        idElement=idElement.substr(idElement.indexOf("_")+1,idElement.length);
11764        var quantityElememnt = $("#quantity_"+idElement);
11765        var quantityElememntInt = parseInt(quantityElememnt.html());
11766        if (quantityElememntInt != 1){
11767            quantityElememnt.html(parseInt(quantityElememnt.html())-1);
11768            var priceCount = parseInt($("input[name='offer']:checked").attr("price"));
11769            priceCount = parseInt(priceCount)*parseInt(quantityElememnt.html());
11770            var dopPrice=parseInt($("input[name='dop']:checked").attr("price"));
11771            if (dopPrice) priceCount = priceCount + dopPrice;
11772            $("#allPrice").html(priceCount);
11773            reAllPrice(priceCount);
11774        }
11775    });
11776
11777});
11778
11779
11780function map_resize(){
11781    var list_map = document.querySelectorAll("ymaps");
11782   
11783    var css_main = "display: block;";
11784    if(list_map != null){
11785        Array.prototype.forEach.call(list_map, function(li){
11786            console.log(li.classList.length);
11787            if(li.classList.length == 0){
11788                li.style.cssText= css_main;
11789                li.classList.add("Glav_map");
11790            }
11791        });
11792    }
11793}
11794$(window).on("load", function(){
11795    map_resize();
11796});
11797
11798
11799
11800
11801
11802function retail_basket(){
11803    console.log("start_retail");
11804    var url = document.location.href;
11805    
11806    $.post(url, {}, function(result){
11807        try {
11808            var $parsed = $($.parseHTML(result));
11809            var component_resultation = $parsed.find(".top-user-basket");
11810            
11811            if (component_resultation.length) {
11812                $(".top-user-basket").html(component_resultation.html());
11813                
11814                // Обновляем цену корзины, если есть
11815                var $price = $parsed.find(".basket-price");
11816                if ($price.length) {
11817                    $(".basket-price").text($price.text());
11818                }
11819                
11820                // Обновляем мобильную корзину, если есть
11821                var $cartValue = $parsed.find(".new-cart__content-value").first();
11822                if ($cartValue.length) {
11823                    $(".new-cart__content-value").text($cartValue.text());
11824                }
11825            }
11826        } catch(e) {
11827            console.error('Ошибка обновления корзины:', e);
11828            // Фолбэк: перезагрузка страницы для отображения актуальной корзины
11829            location.reload();
11830        }
11831    }, 'html');
11832    
11833    console.log("find_retail");
11834}
11835//function retail_basket(){
11836//    console.log("start_retail");
11837//    var url = document.location.href;
11838//    $.post(url, {}, function(result){
11839//        var component_resultation = $(result).find(".top-user-basket");
11840//        $(".top-user-basket").html($(component_resultation).html());
11841
11842//    });
11843//    console.log("find_retail");
11844//}
11845
11846
11847$(document).ready(function(){
11848$('.owl-analog').owlCarousel({
11849    loop:true,
11850    margin:10,
11851    nav:true,
11852    responsive:{
11853        0:{
11854            items:1.5,
11855						margin:20,
11856						
11857        },
11858        575: {
11859            items:2
11860        },
11861        756:{
11862            items:3
11863        },
11864        1000:{
11865            items:3
11866        }
11867    }
11868})
11869$('.owl-flowers1').owlCarousel({
11870    loop:true,
11871    margin:10,
11872    nav:true,
11873    responsive:{
11874        0:{
11875            items:1
11876        },
11877        575: {
11878            items:2
11879        },
11880        756:{
11881            items:3
11882        },
11883        1000:{
11884            items:3
11885        }
11886    }
11887})
11888$('.owl-flowers2').owlCarousel({
11889    loop:true,
11890    margin:10,
11891    nav:true,
11892    responsive:{
11893        0:{
11894            items:1
11895        },
11896        575: {
11897            items:2
11898        },
11899        756:{
11900            items:3
11901        },
11902        1000:{
11903            items:3
11904        }
11905    }
11906})
11907$('.mainpage-slider').owlCarousel({
11908	items:1,
11909loop:true,
11910margin:10,
11911	dots: true,
11912	autoplay: true,
11913	autoplayHoverPause:true
11914})
11915	  $('.cart-new__gifts-tab').on('click', function(){
11916      $('.cart-new__gifts-tab').removeClass('active')
11917      $('.cart-new__gifts-block').removeClass('active')
11918      $(this).addClass('active')
11919      $('.cart-new__gifts-block[data-id="'+ $(this).data('id') +'"]').addClass('active')
11920  })
11921
11922  var gifts = new Swiper(".gifts-slider", {
11923      slidesPerView: 1.8,
11924      spaceBetween: 30,
11925      navigation: {
11926        nextEl: ".gifts-slider .swiper-button-next",
11927        prevEl: ".gifts-slider .swiper-button-prev",
11928      },
11929      breakpoints: {
11930          640: {
11931            slidesPerView: 2.5,
11932            spaceBetween: 20,
11933          },
11934          768: {
11935            slidesPerView: 3.8,
11936            spaceBetween: 40,
11937          },
11938          1024: {
11939            slidesPerView: 5,
11940            spaceBetween: 50,
11941          },
11942      },
11943  });
11944
11945  $(".gifts-slider__item-add").click(function(){
11946    setTimeout(function(){
11947      window.location.reload();
11948    }, 500);
11949  });
11950})
11951/* End */
11952;
11953; /* Start:"a:4:{s:4:"full";s:66:"/bitrix/templates/aura-flowers-new/new-js/script.js?17728021114417";s:6:"source";s:51:"/bitrix/templates/aura-flowers-new/new-js/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
11954// puretabs
11955//https://github.com/andrew--r/puretabs/blob/master/puretabs.min.js
11956!function (e) { function a(e, a) { var s = new RegExp("(^|\\s)" + a + "(\\s|$)", "g"); s.test(e.className) || (e.className = (e.className + " " + a).replace(/\s+/g, " ").replace(/(^ | $)/g, "")) } function s(e, a) { var s = new RegExp("(^|\\s)" + a + "(\\s|$)", "g"); e.className = e.className.replace(s, "$1").replace(/\s+/g, " ").replace(/(^ | $)/g, "") } function t(e, a) { var s = new RegExp("(^|\\s)" + a + "(\\s|$)", "g"); return s.test(e.className) ? !0 : !1 } var r = document.querySelectorAll.bind(document); e.pureTabs = { toggle: function (e) { var t = this.activeClassName, c = r("[data-puretabs]")[0], l = r(e.currentTarget.hash)[0]; s(r(t)[0], t.substr(1)), a(e.currentTarget, t.substr(1)), c.style.display = "none", c.removeAttribute("data-puretabs"), l.style.display = "block", l.setAttribute("data-puretabs", "") }, init: function (e, a) { var s = this; s.className = "." + e || ".puretabs", s.activeClassName = "." + a || ".puretabs--active"; var c = [].slice.call(r(s.className)); c.forEach(function (e) { t(e, s.activeClassName.substr(1)) ? r(e.hash)[0].setAttribute("data-puretabs", "") : r(e.hash)[0].style.display = "none", e.addEventListener("click", function (e) { e.preventDefault(), s.toggle.call(s, e) }) }) } } }(window);
11957
11958$(function () {
11959    $('.cookies-alert-btn').on('click', function () {
11960        $('.cookies-alert').remove();
11961        document.cookie = "BX_COOKIE_ALERT=Y;max-age=31556926;path=/";
11962    })
11963});
11964
11965// $(function () {
11966//     $("#ORDER_CONFIRM_BUTTON").click(function (evt) {
11967//         if (!document.getElementById("privacy").checked || !document.getElementById("offer").checked) {
11968//             evt.preventDefault();
11969//             alert("Примите соглашение");
11970//             return false;
11971//         } else {
11972//             $("#ORDER_CONFIRM_BUTTON").click();
11973//         }
11974//     });
11975// });
11976$(function () {
11977    $('#new-hamburger').click(function () {
11978        $('#new-hamburger-menu').show(300);
11979        $('#new-overlay').show(300);
11980    });
11981
11982    $('#new-overlay, #new-close, #new-phones-close').click(function () {
11983        $('#new-hamburger-menu').hide(300);
11984        $('#new-overlay').hide(300);
11985        $('#new-phones').hide(300);
11986    });
11987
11988    $('#new-cart').click(function () {
11989        $("#cart-content").toggle(300);
11990    });
11991
11992    $('#new-callorder').click(function () {
11993        $('#new-phones').show(300);
11994        $('#new-overlay').show(300);
11995    });
11996
11997    $('#new-sort').click(function () {
11998        $('#new-sort-list').toggle(300);
11999    });
12000    $('.arrowww').click(function () {
12001        let menu = $(this).next();
12002        console.log(this);
12003        $(menu).toggle();
12004    });
12005
12006    if (document.querySelectorAll(".accordion")) {
12007        const accordions = document.querySelectorAll(".accordion");
12008
12009        const openAccordion = (accordion) => {
12010            const content = accordion.querySelector(".accordion__content");
12011
12012            const clickTel = accordion.querySelector(".click_tel");
12013
12014            $(clickTel).click(function (e) {
12015                e.stopPropagation();
12016            });
12017
12018            accordion.classList.add("accordion__active");
12019            content.style.maxHeight = content.scrollHeight + "px";
12020        };
12021
12022        const closeAccordion = (accordion) => {
12023            const content = accordion.querySelector(".accordion__content");
12024            accordion.classList.remove("accordion__active");
12025            content.style.maxHeight = null;
12026        };
12027
12028        accordions.forEach((accordion) => {
12029            const intro = accordion.querySelector(".accordion__intro");
12030            const content = accordion.querySelector(".accordion__content");
12031            // const clickTel = accordion.querySelector(".click_tel");
12032
12033            intro.onclick = () => {
12034                if (content.style.maxHeight) {
12035                    closeAccordion(accordion);
12036                } else {
12037                    accordions.forEach((accordion) => closeAccordion(accordion));
12038
12039                    openAccordion(accordion);
12040                    /*                    $(intro).click(function () {
12041                                        });
12042                                        $(clickTel).click(function (e) {
12043                                            e.stopPropagation();
12044                                        });*/
12045
12046
12047
12048
12049                }
12050            };
12051        });
12052    }
12053
12054});
12055/* End */
12056;
12057; /* Start:"a:4:{s:4:"full";
12057s:111:"/bitrix/templates/aura-flowers-new/components/bitrix/sale.basket.basket.small/.default/script.js?17729551991456";s:6:"source";s:96:"/bitrix/templates/aura-flowers-new/components/bitrix/sale.basket.basket.small/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
12058console.log("reatil");
12059
12060function retail_basket(){
12061    console.log("start_retail");
12062    var url = document.location.href;
12063    
12064    $.post(url, {}, function(result){
12065        try {
12066            // ✅ Правильный парсинг HTML-строки
12067            var $parsed = $($.parseHTML(result));
12068            var component_resultation = $parsed.find(".top-user-basket");
12069            
12070            if (component_resultation.length) {
12071                $(".top-user-basket").html(component_resultation.html());
12072                
12073                // Обновляем цену корзины
12074                var $price = $parsed.find(".basket-price");
12075                if ($price.length) {
12076                    $(".basket-price").text($price.text());
12077                }
12078                
12079                // Обновляем мобильную корзину
12080                var $cartValue = $parsed.find(".new-cart__content-value").first();
12081                if ($cartValue.length) {
12082                    $(".new-cart__content-value").text($cartValue.text());
12083                }
12084            }
12085        } catch(e) {
12086            console.error('Ошибка обновления корзины:', e);
12087            location.reload();
12088        }
12089    }, 'html'); // ✅ Явно указываем тип данных
12090    
12091    console.log("find_retail");
12092}
12093// $("body").on("click", ".to_basket", function(){
12094//     console.
12095//     retail_basket();
12096// });
12097// retail_basket();
12098/* End */
12099;; /* /bitrix/templates/aura-flowers-new/js/jquery-1.9.0.min.js?171562863493068*/
12100; /* /bitrix/templates/aura-flowers-new/js/swiper/swiper-bundle.min.js?1715628634148471*/
12101; /* /bitrix/templates/aura-flowers-new/js/jquery.fancybox.pack.js?171562863423135*/
12102; /* /bitrix/templates/aura-flowers-new/js/owl-carousel-2/owl.carousel.min.js?171562863479152*/
12103; /* /bitrix/templates/aura-flowers-new/js/doubletaptogo.min.js?1715628634585*/
12104; /* /bitrix/templates/aura-flowers-new/js/jquery.maskedinput.js?17156286347437*/
12105; /* /bitrix/templates/aura-flowers-new/js/jquery.cookie.js?17156286343121*/
12106; /* /bitrix/templates/aura-flowers-new/js/jquery-ui-1.9.2.custom.js?1715628634235068*/
12107; /* /bitrix/templates/aura-flowers-new/js/jquery.ui.datepicker-ru.js?17156286341117*/
12108; /* /bitrix/templates/aura-flowers-new/vendor/air-datepicker/air-datepicker.js?179084563047792*/
12109; /* /bitrix/templates/aura-flowers-new/js/buy/buy.js?17729544175575*/
12110; /* /bitrix/templates/aura-flowers-new/js/buy/speedBuy.js?17156286341437*/
12111; /* /bitrix/templates/aura-flowers-new/js/jquery.form.js?171562863441094*/
12112; /* /bitrix/templates/aura-flowers-new/js/script.js?17897398719013*/
12113; /* /bitrix/templates/aura-flowers-new/new-js/script.js?17728021114417*/
12114; /* /bitrix/templates/aura-flowers-new/components/bitrix/sale.basket.basket.small/.default/script.js?17729551991456*/
12115
12116//# sourceMappingURL=template_b871e34a7de0b65a259d188b6c110c12.map.js

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.