diff --git a/application/admin/command/Addon.php b/application/admin/command/Addon.php index aaba93a843378d0a2b04def04ba40bb44ef5d669..e60d5b6c328bfa64389ca1fad1fb881c935d1d49 100644 --- a/application/admin/command/Addon.php +++ b/application/admin/command/Addon.php @@ -95,6 +95,7 @@ class Addon extends Command ]; $this->writeToFile("addon", $data, $addonDir . ucfirst($name) . '.php'); $this->writeToFile("config", $data, $addonDir . 'config.php'); + $this->writeToFile("configHtml", $data, $addonDir . 'config.html'); $this->writeToFile("info", $data, $addonDir . 'info.ini'); $this->writeToFile("controller", $data, $addonDir . 'controller' . DS . 'Index.php'); if ($createTableSql) { diff --git a/application/admin/command/Addon/stubs/addon.stub b/application/admin/command/Addon/stubs/addon.stub index 824e02c1c42f6f6de1d40dd16808676edb7fe2ae..c033d7917bda0dda9f5f193ae9388dec9f4c3535 100644 --- a/application/admin/command/Addon/stubs/addon.stub +++ b/application/admin/command/Addon/stubs/addon.stub @@ -10,6 +10,8 @@ use think\Addons; */ class {%addonClassName%} extends Addons { + // 启用自定义插件配置页 + public $configView = false; /** * 插件安装方法 diff --git a/application/admin/command/Addon/stubs/configHtml.stub b/application/admin/command/Addon/stubs/configHtml.stub new file mode 100644 index 0000000000000000000000000000000000000000..aa134d05d5d00ca092819eec6a2a1790ab7ed2fa --- /dev/null +++ b/application/admin/command/Addon/stubs/configHtml.stub @@ -0,0 +1,22 @@ + + +
+ +{%name%}自定义配置页面
+ + + \ No newline at end of file diff --git a/application/admin/command/Addon/stubs/controller.stub b/application/admin/command/Addon/stubs/controller.stub index d79476f2578778a1e22159c2c1da053458022165..f1a5f80646c1b327b7ded126c0be4e6c04ccfe60 100644 --- a/application/admin/command/Addon/stubs/controller.stub +++ b/application/admin/command/Addon/stubs/controller.stub @@ -3,13 +3,39 @@ namespace addons\{%addon%}\controller; use think\addons\Controller; +use think\Lang; class Index extends Controller { + protected function _initialize() + { + parent::_initialize(); + + $this->view->assign('info', get_addon_info($this->addon)); + $this->view->assign('lang', strip_tags($this->request->langset())); + } + + public function lang() + { + header('Content-Type: application/javascript'); + header("Cache-Control: public"); + header("Pragma: cache"); + + $offset = 30 * 60 * 60 * 24; // 缓存一个月 + header("Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"); + + //默认只加载了控制器对应的语言名,你还根据控制器名来加载额外的语言包 + return jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); + } public function index() { $this->error("当前插件暂无前台页面"); } + public function config() + { + return $this->view->fetch(ADDON_PATH . $this->addon . DS . 'config.html'); + } + } diff --git a/application/admin/command/Min.php b/application/admin/command/Min.php index afc81646aea0fd121422ec4f135d7b0b30b992a9..dd8603123a47e642f1c0cfcadd0d3e665a552a16 100644 --- a/application/admin/command/Min.php +++ b/application/admin/command/Min.php @@ -25,7 +25,7 @@ class Min extends Command { $this ->setName('min') - ->addOption('module', 'm', Option::VALUE_REQUIRED, 'module name(frontend or backend),use \'all\' when build all modules', null) + ->addOption('module', 'm', Option::VALUE_REQUIRED, 'module name(frontend or backend or addons),use \'all\' when build all modules', null) ->addOption('resource', 'r', Option::VALUE_REQUIRED, 'resource name(js or css),use \'all\' when build all resources', null) ->addOption('optimize', 'o', Option::VALUE_OPTIONAL, 'optimize type(uglify|closure|none)', 'none') ->setDescription('Compress js and css file'); @@ -37,14 +37,14 @@ class Min extends Command $resource = $input->getOption('resource') ?: ''; $optimize = $input->getOption('optimize') ?: 'none'; - if (!$module || !in_array($module, ['frontend', 'backend', 'all'])) { + if (!$module || !in_array($module, ['frontend', 'backend', 'addons', 'all'])) { throw new Exception('Please input correct module name'); } if (!$resource || !in_array($resource, ['js', 'css', 'all'])) { throw new Exception('Please input correct resource name'); } - $moduleArr = $module == 'all' ? ['frontend', 'backend'] : [$module]; + $moduleArr = $module == 'all' ? ['frontend', 'backend', 'addons'] : [$module]; $resourceArr = $resource == 'all' ? ['js', 'css'] : [$resource]; $minPath = __DIR__ . DS . 'Min' . DS; diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index a0bc0562cb09eb16ea4945c92998cba0b0d66bd9..b52c42ef1c9b3bc11942f648cfd0c018bc9625e1 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -90,6 +90,10 @@ class Addon extends Backend } $this->error(__('Parameter %s can not be empty', '')); } + $instance = get_addon_instance($name); + if ($instance->configView) { + $this->redirect('/addons/' . $name . '/index/config'); + } $tips = []; foreach ($config as $index => &$item) { if ($item['name'] == '__tips__') { @@ -98,8 +102,6 @@ class Addon extends Backend } } $this->view->assign("addon", ['info' => $info, 'config' => $config, 'tips' => $tips]); - $configFile = ADDON_PATH . $name . DS . 'config.html'; - $viewFile = is_file($configFile) ? $configFile : ''; return $this->view->fetch($viewFile); } diff --git a/public/assets/js/require-addons.js b/public/assets/js/require-addons.js new file mode 100644 index 0000000000000000000000000000000000000000..15e42b2fde4703b8a2944af16874841d0756b6bc --- /dev/null +++ b/public/assets/js/require-addons.js @@ -0,0 +1,137 @@ +require.config({ + urlArgs: "v=" + requirejs.s.contexts._.config.config.info.version, + packages: [{ + name: 'moment', + location: '../libs/moment', + main: 'moment' + }], + paths: { + 'lang': "empty:", + 'form': 'require-form', + 'table': 'require-table', + 'upload': 'require-upload', + 'drag': 'jquery.drag.min', + 'drop': 'jquery.drop.min', + 'dropzone': 'dropzone.min', + 'echarts': 'echarts.min', + 'echarts-theme': 'echarts-theme', + 'adminlte': 'adminlte', + 'bootstrap-table-commonsearch': 'bootstrap-table-commonsearch', + 'bootstrap-table-template': 'bootstrap-table-template', + // + // 以下的包从bower的libs目录加载 + 'jquery': '../libs/jquery/dist/jquery.min', + 'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min', + 'bootstrap-datetimepicker': '../libs/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min', + 'bootstrap-daterangepicker': '../libs/bootstrap-daterangepicker/daterangepicker', + 'bootstrap-select': '../libs/bootstrap-select/dist/js/bootstrap-select.min', + 'bootstrap-select-lang': '../libs/bootstrap-select/dist/js/i18n/defaults-zh_CN', + 'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min', + 'bootstrap-table-export': '../libs/bootstrap-table/dist/extensions/export/bootstrap-table-export.min', + 'bootstrap-table-fixed-columns': '../libs/bootstrap-table/dist/extensions/fixed-columns/bootstrap-table-fixed-columns', + 'bootstrap-table-mobile': '../libs/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile', + 'bootstrap-table-lang': '../libs/bootstrap-table/dist/locale/bootstrap-table-zh-CN', + 'bootstrap-table-jumpto': '../libs/bootstrap-table/dist/extensions/page-jumpto/bootstrap-table-jumpto', + 'bootstrap-slider': '../libs/bootstrap-slider/bootstrap-slider', + 'tableexport': '../libs/tableExport.jquery.plugin/tableExport.min', + 'dragsort': '../libs/fastadmin-dragsort/jquery.dragsort', + 'sortable': '../libs/Sortable/Sortable.min', + 'addtabs': '../libs/fastadmin-addtabs/jquery.addtabs', + 'slimscroll': '../libs/jquery-slimscroll/jquery.slimscroll', + 'validator': '../libs/nice-validator/dist/jquery.validator', + 'validator-lang': '../libs/nice-validator/dist/local/zh-CN', + 'toastr': '../libs/toastr/toastr', + 'jstree': '../libs/jstree/dist/jstree.min', + 'layer': '../libs/fastadmin-layer/dist/layer', + 'cookie': '../libs/jquery.cookie/jquery.cookie', + 'cxselect': '../libs/fastadmin-cxselect/js/jquery.cxselect', + 'template': '../libs/art-template/dist/template-native', + 'selectpage': '../libs/fastadmin-selectpage/selectpage', + 'citypicker': '../libs/fastadmin-citypicker/dist/js/city-picker.min', + 'citypicker-data': '../libs/fastadmin-citypicker/dist/js/city-picker.data', + }, + // shim依赖配置 + shim: { + 'addons': ['backend'], + 'bootstrap': ['jquery'], + 'bootstrap-table': { + deps: ['bootstrap'], + exports: '$.fn.bootstrapTable' + }, + 'bootstrap-table-lang': { + deps: ['bootstrap-table'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'bootstrap-table-export': { + deps: ['bootstrap-table', 'tableexport'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'bootstrap-table-fixed-columns': { + deps: ['bootstrap-table'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'bootstrap-table-mobile': { + deps: ['bootstrap-table'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'bootstrap-table-advancedsearch': { + deps: ['bootstrap-table'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'bootstrap-table-commonsearch': { + deps: ['bootstrap-table'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'bootstrap-table-template': { + deps: ['bootstrap-table', 'template'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'bootstrap-table-jumpto': { + deps: ['bootstrap-table'], + exports: '$.fn.bootstrapTable.defaults' + }, + 'tableexport': { + deps: ['jquery'], + exports: '$.fn.extend' + }, + 'slimscroll': { + deps: ['jquery'], + exports: '$.fn.extend' + }, + 'adminlte': { + deps: ['bootstrap', 'slimscroll'], + exports: '$.AdminLTE' + }, + 'bootstrap-daterangepicker': [ + 'moment/locale/zh-cn' + ], + 'bootstrap-datetimepicker': [ + 'moment/locale/zh-cn', + ], + 'bootstrap-select-lang': ['bootstrap-select'], + 'jstree': ['css!../libs/jstree/dist/themes/default/style.css'], + 'validator-lang': ['validator'], + 'citypicker': ['citypicker-data', 'css!../libs/fastadmin-citypicker/dist/css/city-picker.css'] + }, + baseUrl: requirejs.s.contexts._.config.config.site.cdnurl + '/assets/js/', //资源基础路径 + waitSeconds: 30, + charset: 'utf-8' // 文件编码 +}); + +require(['jquery', 'bootstrap'], function ($) { + //初始配置 + var Config = requirejs.s.contexts._.config.config; + //将Config渲染到全局 + window.Config = Config; + // 配置语言包的路径 + var paths = {}; + paths['lang'] = '/addons/' + Config.info.name + '/index/lang?callback=define&lang=' + Config.lang; + // 避免目录冲突 + paths['backend/'] = 'backend/'; + require.config({paths: paths}); + + // 初始化 + $(function () { + require(['fast']); + }); +}); diff --git a/public/assets/js/require-addons.min.js b/public/assets/js/require-addons.min.js new file mode 100644 index 0000000000000000000000000000000000000000..7c3c2fbc614fb0ddf4fe675ff669b1b36c487796 --- /dev/null +++ b/public/assets/js/require-addons.min.js @@ -0,0 +1,5 @@ +if(!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=!!t&&"length"in t&&t.length,n=rt.type(t);return"function"!==n&&!rt.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function i(t,e,n){if(rt.isFunction(e))return rt.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return rt.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(gt.test(e))return rt.filter(e,t,n);e=rt.filter(e,t)}return rt.grep(t,function(t){return Z.call(e,t)>-1!==n})}function o(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function r(t){var e={};return rt.each(t.match(wt)||[],function(t,n){e[n]=!0}),e}function s(){Y.removeEventListener("DOMContentLoaded",s),t.removeEventListener("load",s),rt.ready()}function a(){this.expando=rt.expando+a.uid++}function l(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(Nt,"-$&").toLowerCase(),n=t.getAttribute(i),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:St.test(n)?rt.parseJSON(n):n)}catch(t){}$t.set(t,e,n)}else n=void 0;return n}function u(t,e,n,i){var o,r=1,s=20,a=i?function(){return i.cur()}:function(){return rt.css(t,e,"")},l=a(),u=n&&n[3]||(rt.cssNumber[e]?"":"px"),c=(rt.cssNumber[e]||"px"!==u&&+l)&&jt.exec(rt.css(t,e));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do r=r||".5",c/=r,rt.style(t,e,c+u);while(r!==(r=a()/l)&&1!==r&&--s)}return n&&(c=+c||+l||0,o=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=c,i.end=o)),o}function c(t,e){var n="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&rt.nodeName(t,e)?rt.merge([t],n):n}function p(t,e){for(var n=0,i=t.length;i>n;n++)Et.set(t[n],"globalEval",!e||Et.get(e[n],"globalEval"))}function d(t,e,n,i,o){for(var r,s,a,l,u,d,f=e.createDocumentFragment(),h=[],g=0,m=t.length;m>g;g++)if(r=t[g],r||0===r)if("object"===rt.type(r))rt.merge(h,r.nodeType?[r]:r);else if(Ht.test(r)){for(s=s||f.appendChild(e.createElement("div")),a=(It.exec(r)||["",""])[1].toLowerCase(),l=Rt[a]||Rt._default,s.innerHTML=l[1]+rt.htmlPrefilter(r)+l[2],d=l[0];d--;)s=s.lastChild;rt.merge(h,s.childNodes),s=f.firstChild,s.textContent=""}else h.push(e.createTextNode(r));for(f.textContent="",g=0;r=h[g++];)if(i&&rt.inArray(r,i)>-1)o&&o.push(r);else if(u=rt.contains(r.ownerDocument,r),s=c(f.appendChild(r),"script"),u&&p(s),n)for(d=0;r=s[d++];)Lt.test(r.type||"")&&n.push(r);return f}function f(){return!0}function h(){return!1}function g(){try{return Y.activeElement}catch(t){}}function m(t,e,n,i,o,r){var s,a;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=void 0);for(a in e)m(t,a,n,i,e[a],r);return t}if(null==i&&null==o?(o=n,i=n=void 0):null==o&&("string"==typeof n?(o=i,i=void 0):(o=i,i=n,n=void 0)),o===!1)o=h;else if(!o)return t;return 1===r&&(s=o,o=function(t){return rt().off(t),s.apply(this,arguments)},o.guid=s.guid||(s.guid=rt.guid++)),t.each(function(){rt.event.add(this,e,o,i,n)})}function v(t,e){return rt.nodeName(t,"table")&&rt.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function y(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function b(t){var e=Ut.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function x(t,e){var n,i,o,r,s,a,l,u;if(1===e.nodeType){if(Et.hasData(t)&&(r=Et.access(t),s=Et.set(e,r),u=r.events)){delete s.handle,s.events={};for(o in u)for(n=0,i=u[o].length;i>n;n++)rt.event.add(e,o,u[o][n])}$t.hasData(t)&&(a=$t.access(t),l=rt.extend({},a),$t.set(e,l))}}function w(t,e){var n=e.nodeName.toLowerCase();"input"===n&&qt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function T(t,e,n,i){e=J.apply([],e);var o,r,s,a,l,u,p=0,f=t.length,h=f-1,g=e[0],m=rt.isFunction(g);if(m||f>1&&"string"==typeof g&&!it.checkClone&&_t.test(g))return t.each(function(o){var r=t.eq(o);m&&(e[0]=g.call(this,o,r.html())),T(r,e,n,i)});if(f&&(o=d(e,t[0].ownerDocument,!1,t,i),r=o.firstChild,1===o.childNodes.length&&(o=r),r||i)){for(s=rt.map(c(o,"script"),y),a=s.length;f>p;p++)l=o,p!==h&&(l=rt.clone(l,!0,!0),a&&rt.merge(s,c(l,"script"))),n.call(t[p],l,p);if(a)for(u=s[s.length-1].ownerDocument,rt.map(s,b),p=0;a>p;p++)l=s[p],Lt.test(l.type||"")&&!Et.access(l,"globalEval")&&rt.contains(u,l)&&(l.src?rt._evalUrl&&rt._evalUrl(l.src):rt.globalEval(l.textContent.replace(zt,"")))}return t}function C(t,e,n){for(var i,o=e?rt.filter(e,t):t,r=0;null!=(i=o[r]);r++)n||1!==i.nodeType||rt.cleanData(c(i)),i.parentNode&&(n&&rt.contains(i.ownerDocument,i)&&p(c(i,"script")),i.parentNode.removeChild(i));return t}function k(t,e){var n=rt(e.createElement(t)).appendTo(e.body),i=rt.css(n[0],"display");return n.detach(),i}function E(t){var e=Y,n=Xt[t];return n||(n=k(t,e),"none"!==n&&n||(Vt=(Vt||rt("")).appendTo(e.documentElement),e=Vt[0].contentDocument,e.write(),e.close(),n=k(t,e),Vt.detach()),Xt[t]=n),n}function $(t,e,n){var i,o,r,s,a=t.style;return n=n||Gt(t),s=n?n.getPropertyValue(e)||n[e]:void 0,""!==s&&void 0!==s||rt.contains(t.ownerDocument,t)||(s=rt.style(t,e)),n&&!it.pixelMarginRight()&&Yt.test(s)&&Qt.test(e)&&(i=a.width,o=a.minWidth,r=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=o,a.maxWidth=r),void 0!==s?s+"":s}function S(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function N(t){if(t in ie)return t;for(var e=t[0].toUpperCase()+t.slice(1),n=ne.length;n--;)if(t=ne[n]+e,t in ie)return t}function D(t,e,n){var i=jt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function j(t,e,n,i,o){for(var r=n===(i?"border":"content")?4:"width"===e?1:0,s=0;4>r;r+=2)"margin"===n&&(s+=rt.css(t,n+At[r],!0,o)),i?("content"===n&&(s-=rt.css(t,"padding"+At[r],!0,o)),"margin"!==n&&(s-=rt.css(t,"border"+At[r]+"Width",!0,o))):(s+=rt.css(t,"padding"+At[r],!0,o),"padding"!==n&&(s+=rt.css(t,"border"+At[r]+"Width",!0,o)));return s}function A(t,e,n){var i=!0,o="width"===e?t.offsetWidth:t.offsetHeight,r=Gt(t),s="border-box"===rt.css(t,"boxSizing",!1,r);if(0>=o||null==o){if(o=$(t,e,r),(0>o||null==o)&&(o=t.style[e]),Yt.test(o))return o;i=s&&(it.boxSizingReliable()||o===t.style[e]),o=parseFloat(o)||0}return o+j(t,e,n||(s?"border":"content"),i,r)+"px"}function O(t,e){for(var n,i,o,r=[],s=0,a=t.length;a>s;s++)i=t[s],i.style&&(r[s]=Et.get(i,"olddisplay"),n=i.style.display,e?(r[s]||"none"!==n||(i.style.display=""),""===i.style.display&&Ot(i)&&(r[s]=Et.access(i,"olddisplay",E(i.nodeName)))):(o=Ot(i),"none"===n&&o||Et.set(i,"olddisplay",o?n:rt.css(i,"display"))));for(s=0;a>s;s++)i=t[s],i.style&&(e&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=e?r[s]||"":"none"));return t}function q(t,e,n,i,o){return new q.prototype.init(t,e,n,i,o)}function I(){return t.setTimeout(function(){oe=void 0}),oe=rt.now()}function L(t,e){var n,i=0,o={height:t};for(e=e?1:0;4>i;i+=2-e)n=At[i],o["margin"+n]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function R(t,e,n){for(var i,o=(F.tweeners[e]||[]).concat(F.tweeners["*"]),r=0,s=o.length;s>r;r++)if(i=o[r].call(n,e,t))return i}function H(t,e,n){var i,o,r,s,a,l,u,c,p=this,d={},f=t.style,h=t.nodeType&&Ot(t),g=Et.get(t,"fxshow");n.queue||(a=rt._queueHooks(t,"fx"),null==a.unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,rt.queue(t,"fx").length||a.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[f.overflow,f.overflowX,f.overflowY],u=rt.css(t,"display"),c="none"===u?Et.get(t,"olddisplay")||E(t.nodeName):u,"inline"===c&&"none"===rt.css(t,"float")&&(f.display="inline-block")),n.overflow&&(f.overflow="hidden",p.always(function(){f.overflow=n.overflow[0],f.overflowX=n.overflow[1],f.overflowY=n.overflow[2]}));for(i in e)if(o=e[i],se.exec(o)){if(delete e[i],r=r||"toggle"===o,o===(h?"hide":"show")){if("show"!==o||!g||void 0===g[i])continue;h=!0}d[i]=g&&g[i]||rt.style(t,i)}else u=void 0;if(rt.isEmptyObject(d))"inline"===("none"===u?E(t.nodeName):u)&&(f.display=u);else{g?"hidden"in g&&(h=g.hidden):g=Et.access(t,"fxshow",{}),r&&(g.hidden=!h),h?rt(t).show():p.done(function(){rt(t).hide()}),p.done(function(){var e;Et.remove(t,"fxshow");for(e in d)rt.style(t,e,d[e])});for(i in d)s=R(h?g[i]:0,i,p),i in g||(g[i]=s.start,h&&(s.end=s.start,s.start="width"===i||"height"===i?1:0))}}function P(t,e){var n,i,o,r,s;for(n in t)if(i=rt.camelCase(n),o=e[i],r=t[n],rt.isArray(r)&&(o=r[1],r=t[n]=r[0]),n!==i&&(t[i]=r,delete t[n]),s=rt.cssHooks[i],s&&"expand"in s){r=s.expand(r),delete t[i];for(n in r)n in t||(t[n]=r[n],e[n]=o)}else e[i]=o}function F(t,e,n){var i,o,r=0,s=F.prefilters.length,a=rt.Deferred().always(function(){delete l.elem}),l=function(){if(o)return!1;for(var e=oe||I(),n=Math.max(0,u.startTime+u.duration-e),i=n/u.duration||0,r=1-i,s=0,l=u.tweens.length;l>s;s++)u.tweens[s].run(r);return a.notifyWith(t,[u,r,n]),1>r&&l?n:(a.resolveWith(t,[u]),!1)},u=a.promise({elem:t,props:rt.extend({},e),opts:rt.extend(!0,{specialEasing:{},easing:rt.easing._default},n),originalProperties:e,originalOptions:n,startTime:oe||I(),duration:n.duration,tweens:[],createTween:function(e,n){var i=rt.Tween(t,u.opts,e,n,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(i),i},stop:function(e){var n=0,i=e?u.tweens.length:0;if(o)return this;for(o=!0;i>n;n++)u.tweens[n].run(1);return e?(a.notifyWith(t,[u,1,0]),a.resolveWith(t,[u,e])):a.rejectWith(t,[u,e]),this}}),c=u.props;for(P(c,u.opts.specialEasing);s>r;r++)if(i=F.prefilters[r].call(u,t,c,u.opts))return rt.isFunction(i.stop)&&(rt._queueHooks(u.elem,u.opts.queue).stop=rt.proxy(i.stop,i)),i;return rt.map(c,R,u),rt.isFunction(u.opts.start)&&u.opts.start.call(t,u),rt.fx.timer(rt.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function W(t){return t.getAttribute&&t.getAttribute("class")||""}function M(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,o=0,r=e.toLowerCase().match(wt)||[];if(rt.isFunction(n))for(;i=r[o++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function B(t,e,n,i){function o(a){var l;return r[a]=!0,rt.each(t[a]||[],function(t,a){var u=a(e,n,i);return"string"!=typeof u||s||r[u]?s?!(l=u):void 0:(e.dataTypes.unshift(u),o(u),!1)}),l}var r={},s=t===$e;return o(e.dataTypes[0])||!r["*"]&&o("*")}function _(t,e){var n,i,o=rt.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:i||(i={}))[n]=e[n]);return i&&rt.extend(!0,t,i),t}function U(t,e,n){for(var i,o,r,s,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(o in a)if(a[o]&&a[o].test(i)){l.unshift(o);break}if(l[0]in n)r=l[0];else{for(o in n){if(!l[0]||t.converters[o+" "+l[0]]){r=o;break}s||(s=o)}r=r||s}return r?(r!==l[0]&&l.unshift(r),n[r]):void 0}function z(t,e,n,i){var o,r,s,a,l,u={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(r=c.shift();r;)if(t.responseFields[r]&&(n[t.responseFields[r]]=e),!l&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=r,r=c.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(s=u[l+" "+r]||u["* "+r],!s)for(o in u)if(a=o.split(" "),a[1]===r&&(s=u[l+" "+a[0]]||u["* "+a[0]])){s===!0?s=u[o]:u[o]!==!0&&(r=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+l+" to "+r}}}return{state:"success",data:e}}function V(t,e,n,i){var o;if(rt.isArray(e))rt.each(e,function(e,o){n||je.test(t)?i(t,o):V(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,n,i)});else if(n||"object"!==rt.type(e))i(t,e);else for(o in e)V(t+"["+o+"]",e[o],n,i)}function X(t){return rt.isWindow(t)?t:9===t.nodeType&&t.defaultView}var Q=[],Y=t.document,G=Q.slice,J=Q.concat,K=Q.push,Z=Q.indexOf,tt={},et=tt.toString,nt=tt.hasOwnProperty,it={},ot="2.2.4",rt=function(t,e){return new rt.fn.init(t,e)},st=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,at=/^-ms-/,lt=/-([\da-z])/gi,ut=function(t,e){return e.toUpperCase()};rt.fn=rt.prototype={jquery:ot,constructor:rt,selector:"",length:0,toArray:function(){return G.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:G.call(this)},pushStack:function(t){var e=rt.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t){return rt.each(this,t)},map:function(t){return this.pushStack(rt.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(G.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:K,sort:Q.sort,splice:Q.splice},rt.extend=rt.fn.extend=function(){var t,e,n,i,o,r,s=arguments[0]||{},a=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[a]||{},a++),"object"==typeof s||rt.isFunction(s)||(s={}),a===l&&(s=this,a--);l>a;a++)if(null!=(t=arguments[a]))for(e in t)n=s[e],i=t[e],s!==i&&(u&&i&&(rt.isPlainObject(i)||(o=rt.isArray(i)))?(o?(o=!1,r=n&&rt.isArray(n)?n:[]):r=n&&rt.isPlainObject(n)?n:{},s[e]=rt.extend(u,r,i)):void 0!==i&&(s[e]=i));return s},rt.extend({expando:"jQuery"+(ot+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===rt.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){var e=t&&t.toString();return!rt.isArray(t)&&e-parseFloat(e)+1>=0},isPlainObject:function(t){var e;if("object"!==rt.type(t)||t.nodeType||rt.isWindow(t))return!1;if(t.constructor&&!nt.call(t,"constructor")&&!nt.call(t.constructor.prototype||{},"isPrototypeOf"))return!1;for(e in t);return void 0===e||nt.call(t,e)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?tt[et.call(t)]||"object":typeof t},globalEval:function(t){var e,n=eval;t=rt.trim(t),t&&(1===t.indexOf("use strict")?(e=Y.createElement("script"),e.text=t,Y.head.appendChild(e).parentNode.removeChild(e)):n(t))},camelCase:function(t){return t.replace(at,"ms-").replace(lt,ut)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var i,o=0;if(n(t))for(i=t.length;i>o&&e.call(t[o],o,t[o])!==!1;o++);else for(o in t)if(e.call(t[o],o,t[o])===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(st,"")},makeArray:function(t,e){var i=e||[];return null!=t&&(n(Object(t))?rt.merge(i,"string"==typeof t?[t]:t):K.call(i,t)),i},inArray:function(t,e,n){return null==e?-1:Z.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,o=t.length;n>i;i++)t[o++]=e[i];return t.length=o,t},grep:function(t,e,n){for(var i,o=[],r=0,s=t.length,a=!n;s>r;r++)i=!e(t[r],r),i!==a&&o.push(t[r]);return o},map:function(t,e,i){var o,r,s=0,a=[];if(n(t))for(o=t.length;o>s;s++)r=e(t[s],s,i),null!=r&&a.push(r);else for(s in t)r=e(t[s],s,i),null!=r&&a.push(r);return J.apply([],a)},guid:1,proxy:function(t,e){var n,i,o;return"string"==typeof e&&(n=t[e],e=t,t=n),rt.isFunction(t)?(i=G.call(arguments,2),o=function(){return t.apply(e||this,i.concat(G.call(arguments)))},o.guid=t.guid=t.guid||rt.guid++,o):void 0},now:Date.now,support:it}),"function"==typeof Symbol&&(rt.fn[Symbol.iterator]=Q[Symbol.iterator]),rt.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){tt["[object "+e+"]"]=e.toLowerCase()});var ct=function(t){function e(t,e,n,i){var o,r,s,a,l,u,p,f,h=e&&e.ownerDocument,g=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==g&&9!==g&&11!==g)return n;if(!i&&((e?e.ownerDocument||e:W)!==O&&A(e),e=e||O,I)){if(11!==g&&(u=vt.exec(t)))if(o=u[1]){if(9===g){if(!(s=e.getElementById(o)))return n;if(s.id===o)return n.push(s),n}else if(h&&(s=h.getElementById(o))&&P(e,s)&&s.id===o)return n.push(s),n}else{if(u[2])return K.apply(n,e.getElementsByTagName(t)),n;if((o=u[3])&&w.getElementsByClassName&&e.getElementsByClassName)return K.apply(n,e.getElementsByClassName(o)),n}if(w.qsa&&!z[t+" "]&&(!L||!L.test(t))){if(1!==g)h=e,f=t;else if("object"!==e.nodeName.toLowerCase()){for((a=e.getAttribute("id"))?a=a.replace(bt,"\\$&"):e.setAttribute("id",a=F),p=E(t),r=p.length,l=dt.test(a)?"#"+a:"[id='"+a+"']";r--;)p[r]=l+" "+d(p[r]);f=p.join(","),h=yt.test(t)&&c(e.parentNode)||e}if(f)try{return K.apply(n,h.querySelectorAll(f)),n}catch(t){}finally{a===F&&e.removeAttribute("id")}}}return S(t.replace(at,"$1"),e,n,i)}function n(){function t(n,i){return e.push(n+" ")>T.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function i(t){return t[F]=!0,t}function o(t){var e=O.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function r(t,e){for(var n=t.split("|"),i=n.length;i--;)T.attrHandle[n[i]]=e}function s(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||X)-(~t.sourceIndex||X);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function a(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function l(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function u(t){return i(function(e){return e=+e,i(function(n,i){for(var o,r=t([],n.length,e),s=r.length;s--;)n[o=r[s]]&&(n[o]=!(i[o]=n[o]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function p(){}function d(t){for(var e=0,n=t.length,i="";n>e;e++)i+=t[e].value;return i}function f(t,e,n){var i=e.dir,o=n&&"parentNode"===i,r=B++;return e.first?function(e,n,r){for(;e=e[i];)if(1===e.nodeType||o)return t(e,n,r)}:function(e,n,s){var a,l,u,c=[M,r];if(s){for(;e=e[i];)if((1===e.nodeType||o)&&t(e,n,s))return!0}else for(;e=e[i];)if(1===e.nodeType||o){if(u=e[F]||(e[F]={}),l=u[e.uniqueID]||(u[e.uniqueID]={}),(a=l[i])&&a[0]===M&&a[1]===r)return c[2]=a[2];if(l[i]=c,c[2]=t(e,n,s))return!0}}}function h(t){return t.length>1?function(e,n,i){for(var o=t.length;o--;)if(!t[o](e,n,i))return!1;return!0}:t[0]}function g(t,n,i){for(var o=0,r=n.length;r>o;o++)e(t,n[o],i);return i}function m(t,e,n,i,o){for(var r,s=[],a=0,l=t.length,u=null!=e;l>a;a++)(r=t[a])&&(n&&!n(r,i,o)||(s.push(r),u&&e.push(a)));return s}function v(t,e,n,o,r,s){return o&&!o[F]&&(o=v(o)),r&&!r[F]&&(r=v(r,s)),i(function(i,s,a,l){var u,c,p,d=[],f=[],h=s.length,v=i||g(e||"*",a.nodeType?[a]:a,[]),y=!t||!i&&e?v:m(v,d,t,a,l),b=n?r||(i?t:h||o)?[]:s:y;if(n&&n(y,b,a,l),o)for(u=m(b,f),o(u,[],a,l),c=u.length;c--;)(p=u[c])&&(b[f[c]]=!(y[f[c]]=p));if(i){if(r||t){if(r){for(u=[],c=b.length;c--;)(p=b[c])&&u.push(y[c]=p);r(null,b=[],u,l)}for(c=b.length;c--;)(p=b[c])&&(u=r?tt(i,p):d[c])>-1&&(i[u]=!(s[u]=p))}}else b=m(b===s?b.splice(h,b.length):b),r?r(null,s,b,l):K.apply(s,b)})}function y(t){for(var e,n,i,o=t.length,r=T.relative[t[0].type],s=r||T.relative[" "],a=r?1:0,l=f(function(t){return t===e},s,!0),u=f(function(t){return tt(e,t)>-1},s,!0),c=[function(t,n,i){var o=!r&&(i||n!==N)||((e=n).nodeType?l(t,n,i):u(t,n,i));return e=null,o}];o>a;a++)if(n=T.relative[t[a].type])c=[f(h(c),n)];else{if(n=T.filter[t[a].type].apply(null,t[a].matches),n[F]){for(i=++a;o>i&&!T.relative[t[i].type];i++);return v(a>1&&h(c),a>1&&d(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(at,"$1"),n,i>a&&y(t.slice(a,i)),o>i&&y(t=t.slice(i)),o>i&&d(t))}c.push(n)}return h(c)}function b(t,n){var o=n.length>0,r=t.length>0,s=function(i,s,a,l,u){var c,p,d,f=0,h="0",g=i&&[],v=[],y=N,b=i||r&&T.find.TAG("*",u),x=M+=null==y?1:Math.random()||.1,w=b.length;for(u&&(N=s===O||s||u);h!==w&&null!=(c=b[h]);h++){if(r&&c){for(p=0,s||c.ownerDocument===O||(A(c),a=!I);d=t[p++];)if(d(c,s||O,a)){l.push(c);break}u&&(M=x)}o&&((c=!d&&c)&&f--,i&&g.push(c))}if(f+=h,o&&h!==f){for(p=0;d=n[p++];)d(g,v,s,a);if(i){if(f>0)for(;h--;)g[h]||v[h]||(v[h]=G.call(l));v=m(v)}K.apply(l,v),u&&!i&&v.length>0&&f+n.length>1&&e.uniqueSort(l)}return u&&(M=x,N=y),g};return o?i(s):s}var x,w,T,C,k,E,$,S,N,D,j,A,O,q,I,L,R,H,P,F="sizzle"+1*new Date,W=t.document,M=0,B=0,_=n(),U=n(),z=n(),V=function(t,e){return t===e&&(j=!0),0},X=1<<31,Q={}.hasOwnProperty,Y=[],G=Y.pop,J=Y.push,K=Y.push,Z=Y.slice,tt=function(t,e){for(var n=0,i=t.length;i>n;n++)if(t[n]===e)return n;return-1},et="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",nt="[\\x20\\t\\r\\n\\f]",it="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot="\\["+nt+"*("+it+")(?:"+nt+"*([*^$|!~]?=)"+nt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+nt+"*\\]",rt=":("+it+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ot+")*)|.*)\\)|)",st=new RegExp(nt+"+","g"),at=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),lt=new RegExp("^"+nt+"*,"+nt+"*"),ut=new RegExp("^"+nt+"*([>+~]|"+nt+")"+nt+"*"),ct=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),pt=new RegExp(rt),dt=new RegExp("^"+it+"$"),ft={ID:new RegExp("^#("+it+")"),CLASS:new RegExp("^\\.("+it+")"),TAG:new RegExp("^("+it+"|[*])"),ATTR:new RegExp("^"+ot),PSEUDO:new RegExp("^"+rt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},ht=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,mt=/^[^{]+\{\s*\[native \w/,vt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,bt=/'|\\/g,xt=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),wt=function(t,e,n){var i="0x"+e-65536;return i!==i||n?e:0>i?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},Tt=function(){A()};try{K.apply(Y=Z.call(W.childNodes),W.childNodes),Y[W.childNodes.length].nodeType}catch(t){K={apply:Y.length?function(t,e){J.apply(t,Z.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}w=e.support={},k=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},A=e.setDocument=function(t){var e,n,i=t?t.ownerDocument||t:W;return i!==O&&9===i.nodeType&&i.documentElement?(O=i,q=O.documentElement,I=!k(O),(n=O.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Tt,!1):n.attachEvent&&n.attachEvent("onunload",Tt)),w.attributes=o(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=o(function(t){return t.appendChild(O.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=mt.test(O.getElementsByClassName),w.getById=o(function(t){return q.appendChild(t).id=F,!O.getElementsByName||!O.getElementsByName(F).length}),w.getById?(T.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&I){var n=e.getElementById(t);return n?[n]:[]}},T.filter.ID=function(t){var e=t.replace(xt,wt);return function(t){return t.getAttribute("id")===e}}):(delete T.find.ID,T.filter.ID=function(t){var e=t.replace(xt,wt);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),T.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],o=0,r=e.getElementsByTagName(t);if("*"===t){for(;n=r[o++];)1===n.nodeType&&i.push(n);return i}return r},T.find.CLASS=w.getElementsByClassName&&function(t,e){return"undefined"!=typeof e.getElementsByClassName&&I?e.getElementsByClassName(t):void 0},R=[],L=[],(w.qsa=mt.test(O.querySelectorAll))&&(o(function(t){q.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&L.push("[*^$]="+nt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||L.push("\\["+nt+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+F+"-]").length||L.push("~="),t.querySelectorAll(":checked").length||L.push(":checked"),t.querySelectorAll("a#"+F+"+*").length||L.push(".#.+[+~]")}),o(function(t){var e=O.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&L.push("name"+nt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||L.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),L.push(",.*:")})),(w.matchesSelector=mt.test(H=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&o(function(t){w.disconnectedMatch=H.call(t,"div"),H.call(t,"[s!='']:x"),R.push("!=",rt)}),L=L.length&&new RegExp(L.join("|")),R=R.length&&new RegExp(R.join("|")),e=mt.test(q.compareDocumentPosition),P=e||mt.test(q.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},V=e?function(t,e){if(t===e)return j=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===O||t.ownerDocument===W&&P(W,t)?-1:e===O||e.ownerDocument===W&&P(W,e)?1:D?tt(D,t)-tt(D,e):0:4&n?-1:1)}:function(t,e){if(t===e)return j=!0,0;var n,i=0,o=t.parentNode,r=e.parentNode,a=[t],l=[e];if(!o||!r)return t===O?-1:e===O?1:o?-1:r?1:D?tt(D,t)-tt(D,e):0;if(o===r)return s(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;a[i]===l[i];)i++;return i?s(a[i],l[i]):a[i]===W?-1:l[i]===W?1:0},O):O},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==O&&A(t),n=n.replace(ct,"='$1']"),w.matchesSelector&&I&&!z[n+" "]&&(!R||!R.test(n))&&(!L||!L.test(n)))try{var i=H.call(t,n);if(i||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return e(n,O,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==O&&A(t),P(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==O&&A(t);var n=T.attrHandle[e.toLowerCase()],i=n&&Q.call(T.attrHandle,e.toLowerCase())?n(t,e,!I):void 0;return void 0!==i?i:w.attributes||!I?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],i=0,o=0;if(j=!w.detectDuplicates,D=!w.sortStable&&t.slice(0),t.sort(V),j){for(;e=t[o++];)e===t[o]&&(i=n.push(o));for(;i--;)t.splice(n[i],1)}return D=null,t},C=e.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=C(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=C(e);return n},T=e.selectors={cacheLength:50,createPseudo:i,match:ft,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(xt,wt),t[3]=(t[3]||t[4]||t[5]||"").replace(xt,wt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ft.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&pt.test(n)&&(e=E(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(xt,wt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=_[t+" "];return e||(e=new RegExp("(^|"+nt+")"+t+"("+nt+"|$)"))&&_(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,i){return function(o){var r=e.attr(o,t);return null==r?"!="===n:!n||(r+="","="===n?r===i:"!="===n?r!==i:"^="===n?i&&0===r.indexOf(i):"*="===n?i&&r.indexOf(i)>-1:"$="===n?i&&r.slice(-i.length)===i:"~="===n?(" "+r.replace(st," ")+" ").indexOf(i)>-1:"|="===n&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i,o){var r="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===o?function(t){return!!t.parentNode}:function(e,n,l){var u,c,p,d,f,h,g=r!==s?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(m){if(r){for(;g;){for(d=e;d=d[g];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=g="only"===t&&!h&&"nextSibling"}return!0}if(h=[s?m.firstChild:m.lastChild],s&&y){for(d=m,p=d[F]||(d[F]={}),c=p[d.uniqueID]||(p[d.uniqueID]={}),u=c[t]||[],f=u[0]===M&&u[1],b=f&&u[2],d=f&&m.childNodes[f];d=++f&&d&&d[g]||(b=f=0)||h.pop();)if(1===d.nodeType&&++b&&d===e){c[t]=[M,f,b];break}}else if(y&&(d=e,p=d[F]||(d[F]={}),c=p[d.uniqueID]||(p[d.uniqueID]={}),u=c[t]||[],f=u[0]===M&&u[1],b=f),b===!1)for(;(d=++f&&d&&d[g]||(b=f=0)||h.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++b||(y&&(p=d[F]||(d[F]={}),c=p[d.uniqueID]||(p[d.uniqueID]={}),c[t]=[M,b]),d!==e)););return b-=o,b===i||b%i===0&&b/i>=0}}},PSEUDO:function(t,n){var o,r=T.pseudos[t]||T.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return r[F]?r(n):r.length>1?(o=[t,t,"",n],T.setFilters.hasOwnProperty(t.toLowerCase())?i(function(t,e){for(var i,o=r(t,n),s=o.length;s--;)i=tt(t,o[s]),t[i]=!(e[i]=o[s])}):function(t){return r(t,0,o)}):r}},pseudos:{not:i(function(t){var e=[],n=[],o=$(t.replace(at,"$1"));return o[F]?i(function(t,e,n,i){for(var r,s=o(t,null,i,[]),a=t.length;a--;)(r=s[a])&&(t[a]=!(e[a]=r))}):function(t,i,r){return e[0]=t,o(e,null,r,n),e[0]=null,!n.pop()}}),has:i(function(t){return function(n){return e(t,n).length>0}}),contains:i(function(t){return t=t.replace(xt,wt),function(e){return(e.textContent||e.innerText||C(e)).indexOf(t)>-1}}),lang:i(function(t){return dt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(xt,wt).toLowerCase(),function(e){var n;do if(n=I?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===q},focus:function(t){return t===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!T.pseudos.empty(t)},header:function(t){return gt.test(t.nodeName)},input:function(t){return ht.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:u(function(){return[0]}),last:u(function(t,e){return[e-1]}),eq:u(function(t,e,n){return[0>n?n+e:n]}),even:u(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:u(function(t,e){ +for(var n=1;e>n;n+=2)t.push(n);return t}),lt:u(function(t,e,n){for(var i=0>n?n+e:n;--i>=0;)t.push(i);return t}),gt:u(function(t,e,n){for(var i=0>n?n+e:n;++i