diff --git a/.eslintrc b/.eslintrc index 21663ff..c038cae 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,6 +11,9 @@ "env": { "browser": true }, + "plugins": [ + "react" + ], "rules": { "no-console": 0, "semi": 2, @@ -72,6 +75,30 @@ { "max": 4 } - ] // max depth of nesting in general + ], // max depth of nesting in general + // React rules + "react/jsx-uses-react": 2, + "react/react-in-jsx-scope": 2, + "react/require-render-return": 2, + "react/no-unknown-property": 2, + "react/prefer-stateless-function": 1, + "react/wrap-multilines": 2, + "react/no-danger": 2, + "react/jsx-uses-vars": 2, + "react/jsx-no-undef": 2, + "react/jsx-no-duplicate-props": 2, + "react/no-direct-mutation-state": 2, + "react/no-did-update-set-state": 2, // use componentWillUpdate instead + "react/no-did-mount-set-state": 2, // use componentWillMount instead + "react/no-deprecated": 2, + "react/prop-types": 2, + "react/jsx-no-bind": 1, // refactoring to prototype functions is more efficient + "react/jsx-indent": [2, "tab"], + "react/jsx-indent-props": [2, "tab"], + "react/jsx-max-props-per-line": [2, { "maximum": 2 }], + "react/jsx-equals-spacing": [2, "never"], + "react/jsx-space-before-closing": 2, + "react/jsx-boolean-value": [2, "never"], + "react/no-comment-textnodes": 2 } } \ No newline at end of file diff --git a/build b/build index 32ae0fc..2fc8e21 100755 --- a/build +++ b/build @@ -12,12 +12,12 @@ set -o errexit mkdir ./python/static/js # Build static assets -echo "Building static assets." -uglifycss ./client/css/* > ./python/static/css/bundle.min.css echo "Minifying JS bundle and inserting it into HTML template" webpack +echo "Building static assets." +uglifycss ./client/css/* > ./python/static/css/bundle.min.css # I can't figure out how to both generate correct paths in the HTML template # of webpack, and have the resulting index.html be put in the right folders. # Yes, it's an ugly hack, but it works - Job -mv python/index.html python/static/index.html +mv ./python/index.html ./python/static/index.html \ No newline at end of file diff --git a/client/actions/actionTypes.js b/client/actions/actionTypes.js new file mode 100644 index 0000000..0f0ba9a --- /dev/null +++ b/client/actions/actionTypes.js @@ -0,0 +1,17 @@ +export const REQUEST_PROJECTS = 'REQUEST_PROJECTS'; +export const REQUEST_PROJECTS_FAILED = 'REQUEST_PROJECTS_FAILED'; +export const RECEIVE_PROJECTS = 'RECEIVE_PROJECTS'; + +export const REQUEST_DATASET = 'REQUEST_DATASET'; +export const REQUEST_DATASET_FAILED = 'REQUEST_DATASET_FAILED'; +export const RECEIVE_DATASET = 'RECEIVE_DATASET'; + +export const REQUEST_GENE = 'REQUEST_GENE'; +export const REQUEST_GENE_FAILED = 'REQUEST_GENE_FAILED'; +export const RECEIVE_GENE = 'RECEIVE_GENE'; + +export const SET_HEATMAP_PROPS = 'SET_HEATMAP_PROPS'; +export const SET_GENESCAPE_PROPS = 'SET_GENESCAPE_PROPS'; +export const SET_LANDSCAPE_PROPS = 'SET_LANDSCAPE_PROPS'; +export const SET_SPARKLINE_PROPS = 'SET_SPARKLINE_PROPS'; +export const SET_VIEW_PROPS = 'SET_VIEW_PROPS'; \ No newline at end of file diff --git a/client/actions/actions.js b/client/actions/actions.js index f3f8d75..fb2e592 100644 --- a/client/actions/actions.js +++ b/client/actions/actions.js @@ -1,5 +1,18 @@ import 'whatwg-fetch'; -import * as _ from 'lodash'; + +import { + REQUEST_PROJECTS, + REQUEST_PROJECTS_FAILED, + RECEIVE_PROJECTS, + REQUEST_DATASET, + REQUEST_DATASET_FAILED, + RECEIVE_DATASET, + REQUEST_GENE, + REQUEST_GENE_FAILED, + RECEIVE_GENE, +} from './actionTypes'; + +import { groupBy } from 'lodash'; /////////////////////////////////////////////////////////////////////////////////////////// @@ -11,19 +24,19 @@ import * as _ from 'lodash'; function requestProjects() { return { - type: 'REQUEST_PROJECTS', + type: REQUEST_PROJECTS, }; } function requestProjectsFailed() { return { - type: 'REQUEST_PROJECTS_FAILED', + type: REQUEST_PROJECTS_FAILED, }; } function receiveProjects(projects) { return { - type: 'RECEIVE_PROJECTS', + type: RECEIVE_PROJECTS, projects: projects, }; } @@ -32,51 +45,59 @@ function receiveProjects(projects) { // Though its insides are different, you would use it just like any other action creator: // store.dispatch(fetchgene(...)) -export function fetchProjects() { +export function fetchProjects(projects) { return (dispatch) => { // First, make known the fact that the request has been started dispatch(requestProjects()); - // Second, perform the request (async) - return fetch(`/loom`) - .then((response) => { return response.json();}) - .then((json) => { - // Third, once the response comes in, dispatch an action to provide the data - // Group by project - const projs = _.groupBy(json, (item) => { return item.project; }); - dispatch(receiveProjects(projs)); - }) - // Or, if it failed, dispatch an action to set the error flag - .catch((err) => { - console.log(err); - dispatch(requestProjectsFailed()); - }); + // Second, check if projects already exists in the store. + // If not, perform a fetch request (async) + if (projects === undefined) { + return ( + fetch(`/loom`) + .then((response) => { return response.json(); }) + .then((json) => { + // Grouping by project must be done here, instead of in + // the reducer, because if it is already in the store we + // want to pass it back unmodified (see else branch below) + const fetchedProjects = groupBy(json, (item) => { return item.project; }); + dispatch(receiveProjects(fetchedProjects)); + }) + // Or, if it failed, dispatch an action to set the error flag + .catch((err) => { + console.log(err); + dispatch(requestProjectsFailed()); + }) + ); + } else { + return dispatch(receiveProjects(projects)); + } }; } /////////////////////////////////////////////////////////////////////////////////////////// // -// Fetch metadata for a dataset +// Fetch metadata for a dataSet // /////////////////////////////////////////////////////////////////////////////////////////// -function requestDataset(dataset) { +function requestDataSet(dataSet) { return { - type: 'REQUEST_DATASET', - dataset: dataset, + type: REQUEST_DATASET, + dataSet: dataSet, }; } -function requestDatasetFailed() { +function requestDataSetFailed() { return { - type: 'REQUEST_DATASET_FAILED', + type: REQUEST_DATASET_FAILED, }; } -function receiveDataset(dataset) { +function receiveDataSet(receivedDataSet) { return { - type: 'RECEIVE_DATASET', - dataset: dataset, + type: RECEIVE_DATASET, + receivedDataSet, }; } @@ -84,28 +105,39 @@ function receiveDataset(dataset) { // Though its insides are different, you would use it just like any other action creator: // store.dispatch(fetchgene(...)) -export function fetchDataset(dataset) { +export function fetchDataSet(data) { + const { dataSetName, dataSets } = data; return (dispatch) => { // First, make known the fact that the request has been started - dispatch(requestDataset(dataset)); - // Second, perform the request (async) - return fetch(`/loom/${dataset}/fileinfo.json`) - .then((response) => { return response.json(); }) - .then((ds) => { - // Third, once the response comes in, dispatch an action to provide the data - // Also, dispatch some actions to set required properties on the subviews - const ra = ds.rowAttrs[0]; - const ca = ds.colAttrs[0]; - dispatch({ type: 'SET_GENESCAPE_PROPS', xCoordinate: ra, yCoordinate: ra, colorAttr: ra }); - dispatch({ type: 'SET_HEATMAP_PROPS', rowAttr: ra, colAttr: ca }); - dispatch(receiveDataset(ds)); // This goes last, to ensure the above defaults are set when the views are rendered - dispatch({ type: "SET_VIEW_PROPS", view: "Landscape" }); - }) - // Or, if it failed, dispatch an action to set the error flag - .catch((err) => { - console.log(err); - dispatch(requestDatasetFailed(dataset)); - }); + dispatch(requestDataSet(dataSetName)); + // Second, see if the dataset already exists in the store + // If not, perform the request (async) + return dataSets[dataSetName] === undefined ? ( + fetch(`/loom/${dataSetName}/fileinfo.json`) + .then((response) => { return response.json(); }) + .then((ds) => { + // Once the response comes in, dispatch an action to provide the data + // Also, dispatch some actions to set required properties on the subviews + // TODO: move to react-router state and + // replace with necessary router.push() logic + const ra = ds.rowAttrs[0]; + const ca = ds.colAttrs[0]; + dispatch({ type: 'SET_GENESCAPE_PROPS', xCoordinate: ra, yCoordinate: ra, colorAttr: ra }); + dispatch({ type: 'SET_HEATMAP_PROPS', rowAttr: ra, colAttr: ca }); + + // This goes last, to ensure the above defaults are set when the views are rendered + let receivedDataSet = {}; + receivedDataSet[dataSetName] = ds; + dispatch(receiveDataSet(receivedDataSet)); + }) + // Or, if it failed, dispatch an action to set the error flag + .catch((err) => { + console.log(err); + dispatch(requestDataSetFailed(dataSetName)); + }) + ) : dispatch(receiveDataSet( + { dataSet: dataSets[dataSetName], dataSetName: dataSetName } + )); }; } @@ -119,20 +151,20 @@ export function fetchDataset(dataset) { function requestGene(gene) { return { - type: 'REQUEST_GENE', + type: REQUEST_GENE, gene: gene, }; } function requestGeneFailed() { return { - type: 'REQUEST_GENE_FAILED', + type: REQUEST_GENE_FAILED, }; } function receiveGene(gene, list) { return { - type: 'RECEIVE_GENE', + type: RECEIVE_GENE, gene: gene, data: list, receivedAt: Date.now(), @@ -143,8 +175,8 @@ function receiveGene(gene, list) { // Though its insides are different, you would use it just like any other action creator: // store.dispatch(fetchgene(...)) -export function fetchGene(dataset, gene, cache) { - const rowAttrs = dataset.rowAttrs; +export function fetchGene(dataSet, gene, cache) { + const rowAttrs = dataSet.rowAttrs; return (dispatch) => { if (!rowAttrs.hasOwnProperty("GeneName")) { return; @@ -156,7 +188,7 @@ export function fetchGene(dataset, gene, cache) { // First, make known the fact that the request has been started dispatch(requestGene(gene)); // Second, perform the request (async) - return fetch(`/loom/${dataset.name}/row/${row}`) + return fetch(`/loom/${dataSet.name}/row/${row}`) .then((response) => { return response.json(); }) .then((json) => { // Third, once the response comes in, dispatch an action to provide the data diff --git a/client/components/canvas.js b/client/components/canvas.js new file mode 100644 index 0000000..c8955d5 --- /dev/null +++ b/client/components/canvas.js @@ -0,0 +1,69 @@ +import React, {PropTypes} from 'react'; + +// A simple helper component, wrapping retina logic for canvas. +// Expects a "painter" function that takes a "context" to draw on. +// This will draw on the canvas whenever the component updates. +export class Canvas extends React.Component { + constructor(props) { + super(props); + + this.fitToZoomAndPixelRatio = this.fitToZoomAndPixelRatio.bind(this); + this.draw = this.draw.bind(this); + } + + // Make sure we get a sharp canvas on Retina displays + // as well as adjust the canvas on zoomed browsers + fitToZoomAndPixelRatio() { + let el = this.refs.canvas; + if (el) { + let context = el.getContext('2d'); + const ratio = window.devicePixelRatio || 1; + el.width = el.parentNode.clientWidth * ratio; + el.height = el.parentNode.clientHeight * ratio; + context.mozImageSmoothingEnabled = false; + context.webkitImageSmoothingEnabled = false; + context.msImageSmoothingEnabled = false; + context.imageSmoothingEnabled = false; + context.scale(ratio, ratio); + context.clearRect(0, 0, el.width, el.height); + } + } + + draw() { + let el = this.refs.canvas; + if (el) { + this.fitToZoomAndPixelRatio(); + let context = el.getContext('2d'); + this.props.paint(context, el.clientWidth, el.clientHeight); + } + } + + componentDidMount() { + this.draw(); + window.addEventListener("resize", this.draw); + } + + componentDidUpdate() { + this.draw(); + } + + render() { + return ( +
+ +
+ ); + } +} + +Canvas.propTypes = { + paint: PropTypes.func.isRequired, +}; diff --git a/client/components/dataset-view.js b/client/components/dataset-view.js index 1f6ac39..22ddfa8 100644 --- a/client/components/dataset-view.js +++ b/client/components/dataset-view.js @@ -1,751 +1,154 @@ import React, { Component, PropTypes } from 'react'; -import { fetchDataset } from '../actions/actions.js'; -import Select from 'react-select'; -import * as _ from 'lodash'; - -export class DatasetView extends Component { - - render() { - // unused at the moment: this.props.viewState - const { dispatch, dataState } = this.props; - - const panels = Object.keys(dataState.projects).map((proj) => { - const datasets = dataState.projects[proj].map((state) => { - return ( - - ); - }); - return ( -
-
- {proj} -
- - { - dataState.projects[proj].length.toString() + - ' dataset' + - (dataState.projects[proj].length > 1 ? 's' : '') - } - -
-
-
- {datasets} -
-
- ); - }); - +import { LinkContainer } from 'react-router-bootstrap'; +import { + Grid, Col, Row, + ListGroup, ListGroupItem, + Panel, PanelGroup, + ButtonGroup, Button, +} from 'react-bootstrap'; +import { fetchProjects } from '../actions/actions'; + + +const DataSetListItem = function (props) { + const { dataset, message } = props.dataSetMetaData; + const views = ['heatmap', 'sparkline', 'landscape', 'genescape']; + + const links = views.map((view) => { + const path = 'view/' + view + '/' + props.dataSetPath; + const disabled = props.dataSetMetaData.status !== 'created'; return ( -
-
-
-
-

Linnarsson lab single-cell data repository

-
-

Available datasets

-
- { panels.length === 0 ? -
-
- Downloading list of available datasets... -
-
- : - panels - } -
-
- -
-
-
+ + + ); - } -} + }); + + return ( + +

{dataset + '. ' + message}

+ + {links} + +
+ ); +}; -DatasetView.propTypes = { - viewState: PropTypes.object.isRequired, - dataState: PropTypes.object.isRequired, - dispatch: PropTypes.func.isRequired, + +DataSetListItem.propTypes = { + dataSetPath: PropTypes.string.isRequired, + dataSetMetaData: PropTypes.object.isRequired, }; +const DataSetList = function (props) { -class DataSetListItem extends Component { - render() { - const { key, isCurrent, state, proj, dispatch } = this.props; - return ( -
- { - const ds = state.transcriptome + '__' + proj + '__' + state.dataset; - dispatch(fetchDataset(ds)); - } - }> - {state.dataset} - - {' ' + state.message} -
- Delete / Duplicate / Edit -
-
- ); - } -} + const { project, projectState } = props; + const totalDatasets = projectState.length.toString() + ' dataset' + (projectState.length !== 1 ? 's' : ''); + const datasets = projectState.map((dataSetMetaData) => { + // Takes the metadata of the dataset + // and returns a DataSetListItem + const { transcriptome, project, dataset} = dataSetMetaData; + const dataSetPath = transcriptome + '/' + + project + '/' + + dataset; -class CreateDataset extends Component { - render() { return ( -
-

Create a new dataset

-

Instructions

-

To generate a dataset, the user must supply the names of:

- -

Furthermore, the pipeline also needs:

- -

Before uploading these CSV files a minimal check will be applied, hopefully catching the most likely - scenarios.If the CSV file contains semi-colons instead of commas (most likely the result of regional - settings in whatever tool was used to generate the file), they will automatically be replace - before submitting.Please double-check if the result is correct in that case.

-

Note: you can still submit a file with a wrong file extension or (what appears to be) - malformed content, as validation might turn up false positives.We assume you know what you are doing, - just be careful!

-

Finally, the pipeline requires the following parameters:

- -
- -
+ ); - } -} - - -class CreateDatasetForm extends Component { - - constructor(props, context) { - super(props, context); - this.state = { - n_features: 100, - cluster_method: '', - transcriptome: '', - }; - - this.handleFormChange = this.handleFormChange.bind(this); - this.formIsFilled = this.formIsFilled.bind(this); - this.sendDate = this.sendData.bind(this); - } - - handleFormChange(idx, val) { - let newState = {}; - newState[idx] = val; - this.setState(newState); - } + }); + return ( + + + {datasets} + + + ); +}; - formIsFilled() { - let filledForm = true; - //row_attrs is optional, the rest is not - const formData = [ - 'transcriptome', - 'project', - 'dataset', - 'col_attrs', - 'n_features', - 'cluster_method', - 'regression_label', - ]; - formData.forEach((element) => { - // if an element is missing, we cannot submit - if (!this.state[element]) { - filledForm = false; - } - }); - return filledForm; - } - // See ../docs/loom_server_API.md - sendData() { - let FD = new FormData(); +DataSetList.propTypes = { + project: PropTypes.string.isRequired, + projectState: PropTypes.array.isRequired, +}; - if (this.formIsFilled()) { - FD.append('col_attrs', this.state.col_attrs); - if (this.state.row_attrs) { - FD.append('row_attrs', this.state.row_attrs); +// Generates a list of projects, each with a list +// of datasets associated with the project. +const ProjectList = function (props) { + const { projects } = props; + if (projects) { + const panels = Object.keys(projects).map( + (project) => { + return ( + + ); } + ); - let config = JSON.stringify({ - transcriptome: this.state.transcriptome, - project: this.state.project, - dataset: this.state.dataset, - n_features: this.state.n_features > 100 ? this.state.n_features : 100, - cluster_method: this.state.cluster_method, - regression_label: this.state.regression_label, - }); - - FD.append('config', config); - - let XHR = new XMLHttpRequest(); - //TODO: display server response in the UI - XHR.addEventListener('load', (event) => { console.log(event); }); - XHR.addEventListener('error', (event) => { console.log(event); }); - - let urlString = '/loom/' + this.state.transcriptome + - '__' + this.state.project + - '__' + this.state.dataset; - XHR.open('PUT', urlString); - XHR.send(FD); - - } - } - - render() { - //TODO: fetch this from the server instead of relying on manual inlining - const transcriptomeOptions = [ - { value: 'mm10_sUCSC', label: 'mm10_sUCSC' }, - { value: 'mm10.2_sUCSC', label: 'mm10.2_sUCSC' }, - { value: 'hg19_sUCSC', label: 'hg19_sUCSC' }, - { value: 'mm10a_sUCSC', label: 'mm10a_sUCSC' }, - { value: 'mm10a_aUCSC', label: 'mm10a_aUCSC' }, - ]; - - const clusterMethodOptions = [ - { value: 'BackSPIN', label: 'BackSPIN' }, - { value: 'AP', label: 'Affinity Propagation' }, - ]; - + return
{panels}
; + } else { return ( -
-
-
-
- -
- { this.handleFormChange('n_features', e.target.value); } } - onBlur={ - () => { - this.state.n_features < 100 ? this.handleFormChange('n_features', 100) : null; - } - } - id='input_n_features' /> -
-
-
- -
- { this.handleChange(event); } } - onBlur={ () => { this.fixTextInput(this.state.value); } } - /> -
-
+ + + +

Linnarsson Lab single-cell data repository

+
+

Available datasets

+ + + + +
+
); } } -LoomTextEntry.propTypes = { - trimUnderscores: PropTypes.bool, - trimLeadingUnderscores: PropTypes.bool, - trimTrailingUnderscores: PropTypes.bool, - defaultValue: PropTypes.string.isRequired, - onChange: PropTypes.func.isRequired, +DataSetViewComponent.propTypes = { + dispatch: PropTypes.func.isRequired, + projects: PropTypes.object, }; +//connect DataSetViewComponent to store +import { connect } from 'react-redux'; -// A file chooser for CSV files -// - rudimentary validation (extension name, commas or semicolons, size) -// - accepts files via drag & drop, for ease of used -class CSVFileChooser extends Component { - constructor(props, context) { - super(props, context); - - this.state = { - // NOTE: we distinguish between false and undefined for validation! - draggedOver: false, - droppedFile: undefined, - fileName: ' -', - fileIsCSV: undefined, - fileSize: undefined, - fileSizeString: ' -', - filePreview: null, - validContent: undefined, - fileContentString: undefined, - contentInfo: [], - fileReader: this.CSVFileReader(), - dragStyle: undefined, - }; - - this.handleClick = this.handleClick.bind(this); - this.handleDrop = this.handleDrop.bind(this); - this.handleDragEnter = this.handleDragEnter.bind(this); - this.handleDragOver = this.handleDragOver.bind(this); - this.handleDragLeave = this.handleDragLeave.bind(this); - this.CSVFileReader = this.CSVFileReader.bind(this); - this.semicolonsToCommas = this.semicolonsToCommas.bind(this); - } - - componentDidMount() { - this.enterCounter = 0; - } - - handleClick() { - this.open(); - } - - handleDrop(ev) { - ev.preventDefault(); - ev.stopPropagation(); - this.enterCounter = 0; - const file = ev.dataTransfer ? ev.dataTransfer.files[0] : ev.target ? ev.target.files[0] : undefined; - if (file) { - let newState = { - droppedFile: file, - fileName: file.name, - fileIsCSV: file.type === 'text/csv', - fileSize: file.size, - fileSizeString: this.bytesToString(file.size), - filePreview: null, - validContent: file.size > 0 ? undefined : null, - fileContentString: undefined, - contentInfo: [], - dragStyle: undefined, - }; - this.setState(newState); - - if (file.size > 0) { - this.state.fileReader.readAsText(file); - } - } - } - - handleDragEnter(ev) { - ev.preventDefault(); - ev.stopPropagation(); - ++this.enterCounter; - this.setState({ draggedOver: true, dragStyle: { backgroundColor: '#CCFFCC' } }); - } - - handleDragOver(ev) { - ev.preventDefault(); - ev.stopPropagation(); - return false; - } - - handleDragLeave(ev) { - ev.preventDefault(); - ev.stopPropagation(); - if (--this.enterCounter > 0) { - return false; - } - this.setState({ draggedOver: false, dragStyle: undefined }); - } - - open() { - this.fileInputEl.value = null; - this.fileInputEl.click(); - return false; - } - - // Create a FileReader to re-use, which performs a rudimentary - // check if the provided CSV file is a proper CSV file. - CSVFileReader() { - let reader = new FileReader(); - - // Handle abort and error cases - reader.onabort = (event) => { - let newState = { - contentInfo: this.state.contentInfo, - validContent: false, - }; - newState.contentInfo.push('File reading aborted before validation\n', event); - this.setState(newState); - }; - reader.onerror = (event) => { - let newState = { - contentInfo: this.state.contentInfo, - validContent: false, - }; - newState.contentInfo.push('Error while reading file\n', event); - this.setState(newState); - }; - - // Rudimentary check if file was successfully loaded. Checks for: - // - file size (greater than zero?) - // - extension name (ends with .csv?) - // - commas and semicolons (presence and absence, respectively) - // This catches the (hopefully) most common mistakes of selecting - // the wrong file, or bad formatting due to regional settings. - reader.onload = () => { - let newState = { - filePreview: this.makePreviewString(reader.result), - contentInfo: this.state.contentInfo, - }; - - if (!this.state.fileIsCSV) { - newState.contentInfo.push('Incorrect file extension, check if content is a CSV'); - } - - - let noCommasFound = reader.result.indexOf(',') === -1; - let semiColonsFound = reader.result.indexOf(';') !== -1; - if (noCommasFound) { - newState.validContent = false; - if (semiColonsFound) { - newState.contentInfo.push('Only semicolons found, replacing with commas. Please double-check if results make sense'); - } else { - newState.contentInfo.push('Unlikely to be a properly formatted CSV: no commas found!'); - } - } else if (semiColonsFound) { - newState.validContent = false; - newState.contentInfo.push('Unlikely to be a properly formatted CSV: mix of commas and semicolons found!'); - } else { - // The check found no errors in the content, use file content string as is - newState.fileContentString = reader.result; - // However, if extension is wrong we warn the user! - newState.validContent = this.state.fileIsCSV; - } - - this.setState(newState); - - if (semiColonsFound && noCommasFound) { - // Try replacing semicolons with commas if and only if no other - // commas are present, something will certainly break if they are. - this.semicolonsToCommas(reader.result); - } - }; - - return reader; - } - - // Takes a string (consisting of the content of a file), - // replaces all of its semicolons with commas. - // Updates filePreview to show (part of) the result, - // so the user can verify the result. - semicolonsToCommas(filePreviewString) { - const fileContentString = filePreviewString.replace(/\;/gi, ','); - - const commaBlob = new Blob([fileContentString], { type: 'text/csv' }); - let filePreview = this.makePreviewString(fileContentString); - this.setState({ droppedFile: commaBlob, fileContentString, filePreview }); - } - - bytesToString(bytes) { - let displaybytes = bytes; - let magnitude = 0; - const scale = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; - while (displaybytes > 512 && magnitude < scale.length) { - magnitude++; - displaybytes /= 1024; - } - return displaybytes.toFixed(magnitude > 0 ? 2 : 0) + ' ' + scale[magnitude]; - } - - makePreviewString(txt) { - let subStrIdx = -1; - // Display up to the first eight lines to the user - for (let i = 0; i < 8; i++) { - let nextIdx = txt.indexOf('\n', subStrIdx + 1); - if (nextIdx === -1) { - break; - } else { - subStrIdx = nextIdx; - } - } - // subStrIdx === -1 if and only if there were no \n characters, - // in which case we look at the whole string. - if (subStrIdx === -1) { subStrIdx = txt.length; } - // cap at 1000 characters - subStrIdx = subStrIdx < 1000 ? subStrIdx : 1000; - return txt.substr(0, subStrIdx); - } - - shouldComponentUpdate(nextProps, nextState) { - // risky: we assume that props never change here - return !(_.isEqual(this.state, nextState)); - } - - componentDidUpdate() { - this.props.onChange(this.state.fileContentString); - } - - render() { - - const inputAttributes = { - type: 'file', - multiple: false, - style: { display: 'none' }, - ref: (el) => { this.fileInputEl = el; }, - onChange: this.handleDrop, - }; - - const state = this.state; - const warnIf = (x) => { - let style = { margin: 5, padding: 5, textAlign: 'left' }; - if (x) { - style.backgroundColor = '#f66'; - style.color = '#fff'; - } - return style; - }; - - return ( -
{ this.handleDrop(ev); } } - onDragEnter={ (ev) => { this.handleDragEnter(ev); } } - onDragOver={ (ev) => { this.handleDragOver(ev); } } - onDragLeave={ (ev) => { this.handleDragLeave(ev); } } - > - -
- (or drag and drop it on this cell) -
- { state.fileIsCSV ? '☑ ' : '☐ '} - file extension: - { state.droppedFile ? - state.fileIsCSV ? - {state.fileName + ' - '} has CSV extension - : - {state.fileName + ' - '} does not have a CSV file extension! - : - null - } -
-
- { state.fileSize > 0 ? '☑ ' : '☐ '} - size: {state.fileSizeString}  - { state.fileSize === 0 ? Empty file!Did you drop a folder? : null } -
-
- { state.validContent ? '☑ ' : '☐ ' } - content preview: (first thousand characters or eight lines, whichever is shorter) - { state.filePreview ?
{state.filePreview}
: null } - { state.contentInfo.length ? state.contentInfo.map((info, i) => { return (

{info}

); }) : null } -
-
- -
- ); - } -} \ No newline at end of file +const mapStateToProps = (state) => { + return { projects: state.data.projects }; +}; +export const DataSetView = connect(mapStateToProps)(DataSetViewComponent); \ No newline at end of file diff --git a/client/components/dropdown.js b/client/components/dropdown.js index 041a826..134f2c1 100644 --- a/client/components/dropdown.js +++ b/client/components/dropdown.js @@ -1,50 +1,42 @@ -import React, { Component, PropTypes } from 'react'; +import React, { PropTypes } from 'react'; +import { FormGroup, ControlLabel } from 'react-bootstrap'; +import Select from 'react-select'; -export class DropdownMenu extends Component { +export const DropdownMenu = function (props) { - render() { + const { + buttonLabel, buttonName, + attributes, attrType, attrName, + dispatch, clearable, + } = props; - const { - buttonLabel, buttonName, - attributes, attrType, attrName, - dispatch, - } = this.props; - - const options = attributes.map((name) => { - let dispatchParam = { type: attrType }; - dispatchParam[attrName] = name; - return ( - - ); - }); - - return ( -
- { buttonLabel ? : null } -
- - { options } -
-
- ); + let options = new Array(attributes.length); + for (let i = 0; i < attributes.length; i++) { + options[i] = { value: i, label: attributes[i] }; } -} + const dispatchOnChange = (val) => { + let dispatchParam = { type: attrType }; + dispatchParam[attrName] = attributes[val]; + dispatch(dispatchParam); + }; + + return ( + + { buttonLabel ? {buttonLabel} : null } + { - dispatch({ type: 'SET_HEATMAP_PROPS', colGene: event.target.value }); - dispatch(fetchGene(dataState.currentDataset, event.target.value, dataState.genes)); - } - }/> - : - - } -
+
+
+ {heatmapState.colAttr === "(gene)" ? + { + dispatch({ type: 'SET_HEATMAP_PROPS', colGene: event.target.value }); + dispatch(fetchGene(dataSet, event.target.value, genes)); + } + } /> + : + + }
+
- - { - (heatmapState.rowAttr === '(gene positions)') ? -
-
- -
+
+ + +
-
-
- -
    - {optionsForGenes} -
+
+
+ +
    + {optionsForGenes} +
+
-
- +
-
- ); - } -} +
+ ); +}; SparklineSidepanel.propTypes = { sparklineState: PropTypes.object.isRequired, - dataState: PropTypes.object.isRequired, - dispatch: PropTypes.func.isRequired -} \ No newline at end of file + dataSet: PropTypes.object.isRequired, + genes: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, +}; \ No newline at end of file diff --git a/client/components/sparkline-view.js b/client/components/sparkline-view.js index 4aa7880..632b2ca 100644 --- a/client/components/sparkline-view.js +++ b/client/components/sparkline-view.js @@ -3,106 +3,169 @@ import { Heatmap } from './heatmap'; import { SparklineSidepanel } from './sparkline-sidepanel'; import { Sparkline } from './sparkline'; import * as _ from 'lodash'; +import { fetchDataSet } from '../actions/actions'; +const SparklineViewComponent = function (props) { + const { sparklineState, dataSet, genes, viewState, dispatch } = props; -export class SparklineView extends Component { - render() { - var ss = this.props.sparklineState; - var ds = this.props.dataState; - var vs = this.props.viewState; - var dispatch = this.props.dispatch; - - var colData = ds.currentDataset.colAttrs[ss.colAttr]; - // Figure out the ordering - var indices = new Array(colData.length); - for (var i = 0; i < colData.length; ++i) indices[i] = i; - if (ss.orderByAttr != "(none)") { - var orderBy = null; - if (ss.orderByAttr == "(gene)") { - if (ds.genes.hasOwnProperty(ss.orderByGene)) { - orderBy = ds.genes[ss.orderByGene]; - } - } else { - orderBy = ds.currentDataset.colAttrs[ss.orderByAttr]; - } - if (orderBy != null) { - indices.sort(function (a, b) { return orderBy[a] < orderBy[b] ? -1 : orderBy[a] > orderBy[b] ? 1 : 0; }); + let colData = dataSet.colAttrs[sparklineState.colAttr]; + // Figure out the ordering + let indices = new Array(colData.length); + for (let i = 0; i < colData.length; ++i) { + indices[i] = i; + } + if (sparklineState.orderByAttr !== "(none)") { + let orderBy = null; + if (sparklineState.orderByAttr === "(gene)") { + if (genes.hasOwnProperty(sparklineState.orderByGene)) { + orderBy = genes[sparklineState.orderByGene]; } + } else { + orderBy = dataSet.colAttrs[sparklineState.orderByAttr]; } + if (orderBy !== null) { + indices.sort((a, b) => { return orderBy[a] < orderBy[b] ? -1 : orderBy[a] > orderBy[b] ? 1 : 0; }); + } + } - // Order the column attribute values - var temp = new Array(colData.length); - for (var i = 0; i < colData.length; ++i) temp[i] = colData[indices[i]]; - colData = temp; - - var genes = _.uniq(ss.genes.trim().split(/[ ,\r\n]+/)); - if (genes.length > 0 && genes[0] != "") { - var geneSparklines = _.map(genes, (gene) => { - if (ds.genes.hasOwnProperty(gene)) { - var geneData = new Array(colData.length); - for (var i = 0; i < geneData.length; ++i) geneData[i] = ds.genes[gene][indices[i]]; + // Order the column attribute values + let temp = new Array(colData.length); + for (let i = 0; i < colData.length; ++i) { temp[i] = colData[indices[i]]; } + colData = temp; - return ( -
- - {gene} -
- ); - } else { - return
; + const uniqueGenes = _.uniq(sparklineState.genes.trim().split(/[ ,\r\n]+/)); + const geneSparklines = (uniqueGenes.length === 0 || uniqueGenes[0] === "") ?
: ( + _.map(uniqueGenes, (gene) => { + if (uniqueGenes.hasOwnProperty(gene)) { + let geneData = new Array(colData.length); + for (let i = 0; i < geneData.length; ++i) { + geneData[i] = uniqueGenes[gene][indices[i]]; } - }); - } else { - var geneSparklines =
; - } - return ( -
-
- -
-
- {/* Borrowing the Leaflet zoom buttons -
-
- + - - + return ( +
+ + {gene}
-
*/} - - {ss.colAttr} -
- {geneSparklines} + ); + } else { + return
; + } + }) + ); + + + return ( +
+
+ +
+
+ { + /* Borrowing the Leaflet zoom buttons + + */ + } + + + {sparklineState.colAttr} + +
+ {geneSparklines}
- ) - } -} +
+ ); +}; -SparklineView.propTypes = { +SparklineViewComponent.propTypes = { viewState: PropTypes.object.isRequired, - dataState: PropTypes.object.isRequired, + dataSet: PropTypes.object.isRequired, + genes: PropTypes.object.isRequired, sparklineState: PropTypes.object.isRequired, - dispatch: PropTypes.func.isRequired + dispatch: PropTypes.func.isRequired, +}; + +class SparklineViewContainer extends Component { + componentDidMount() { + const { dispatch, data, params } = this.props; + const { transcriptome, project, dataset } = params; + const dataSetName = transcriptome + '__' + project + '__' + dataset; + dispatch(fetchDataSet({ dataSets: data.dataSets, dataSetName: dataSetName })); + } + + render() { + const { dispatch, data, sparklineState, viewState, params } = this.props; + const { transcriptome, project, dataset } = params; + const fetchDatasetString = transcriptome + '__' + project + '__' + dataset; + const dataSet = data.dataSets[fetchDatasetString]; + const genes = data.genes; + return (dataSet ? + + : +
Fetching dataset...
+ ); + } } + +SparklineViewContainer.propTypes = { + // Passed down by react-router-redux + params: PropTypes.object.isRequired, + // Passed down by react-redux + data: PropTypes.object.isRequired, + sparklineState: PropTypes.object.isRequired, + viewState: PropTypes.object.isRequired, + dispatch: PropTypes.func.isRequired, +}; + +//connect SparklineViewContainer to store +import { connect } from 'react-redux'; + +// react-router-redux passes URL parameters +// through ownProps.params. See also: +// https://github.com/reactjs/react-router-redux#how-do-i-access-router-state-in-a-container-component +const mapStateToProps = (state, ownProps) => { + return { + params: ownProps.params, + sparklineState: state.sparklineState, + viewState: state.viewState, + data: state.data, + }; +}; + +export const SparklineView = connect(mapStateToProps)(SparklineViewContainer); \ No newline at end of file diff --git a/client/components/sparkline.js b/client/components/sparkline.js index d5ef126..fee966f 100644 --- a/client/components/sparkline.js +++ b/client/components/sparkline.js @@ -1,8 +1,8 @@ import React, {PropTypes} from 'react'; -import { render, findDOMNode } from 'react-dom'; import { nMostFrequent } from '../js/util'; import * as _ from 'lodash'; import * as colors from '../js/colors'; +import { Canvas } from './canvas'; class CategoriesPainter { @@ -11,52 +11,53 @@ class CategoriesPainter { } paint(context, width, height, pixelsPer, yoffset, groupedData) { - var cwidth = Math.min(width, 20); - var fontArgs = context.font.split(' '); + const cwidth = Math.min(width, 20); + const fontArgs = context.font.split(' '); context.font = (cwidth - 1) + 'px ' + fontArgs[fontArgs.length - 1]; - var y = 0; + let y = 0; groupedData.forEach((group) => { - var commonest = nMostFrequent(group, 1)[0]; - var color = this.categories.indexOf(commonest) + 1; + const commonest = nMostFrequent(group, 1)[0]; + const color = this.categories.indexOf(commonest) + 1; context.fillStyle = colors.category20[color]; context.fillRect(0, yoffset + y, cwidth, pixelsPer); y += pixelsPer; }); } } + class BarPainter { paint(context, width, height, pixelsPer, yoffset, groupedData) { - var max = Number.MIN_VALUE; - var min = Number.MAX_VALUE; - var fontArgs = context.font.split(' '); + let max = Number.MIN_VALUE; + let min = Number.MAX_VALUE; + const fontArgs = context.font.split(' '); context.font = '8px ' + fontArgs[fontArgs.length - 1]; - var means = groupedData.map((group) => { - var mean = 0; - for (var i = 0; i < group.length; i++) { + const means = groupedData.map((group) => { + let mean = 0; + for (let i = 0; i < group.length; i++) { mean += group[i]; } mean /= group.length; - if(mean > max) { + if (mean > max) { max = mean; } - if(mean < min) { + if (mean < min) { min = mean; } return mean; }); - if (min >= 0 && min < 0.5*max) { + if (min >= 0 && min < 0.5 * max) { min = 0; } context.fillStyle = "grey"; - means.forEach((m)=>{ - context.fillRect(0, yoffset, (m-min)/(max-min)*width, pixelsPer); + means.forEach((m) => { + context.fillRect(0, yoffset, (m - min) / (max - min) * width, pixelsPer); yoffset += pixelsPer; }); - context.save(); - context.rotate(90*Math.PI/180); + context.save(); + context.rotate(90 * Math.PI / 180); context.fillStyle = "blue"; context.fillText(Number(min.toPrecision(3)), 0, -2); - context.fillText(Number(max.toPrecision(3)), 0, -width+2+10); + context.fillText(Number(max.toPrecision(3)), 0, -width + 2 + 10); context.restore(); } } @@ -64,27 +65,29 @@ class BarPainter { class QuantitativePainter { paint(context, width, height, pixelsPer, yoffset, groupedData) { - var max = Number.MIN_VALUE; - var min = Number.MAX_VALUE; - var means = groupedData.map((group) => { - var mean = 0; - for (var i = 0; i < group.length; i++) { + let max = Number.MIN_VALUE; + let min = Number.MAX_VALUE; + const means = groupedData.map((group) => { + let mean = 0; + for (let i = 0; i < group.length; i++) { mean += group[i]; } mean /= group.length; - if(mean > max) { + if (mean > max) { max = mean; } - if(mean < min) { + if (mean < min) { min = mean; } return mean; }); - if (min >= 0 && min < 0.5*max) { + if (min >= 0 && min < 0.5 * max) { min = 0; } - var color = means.map(x => colors.solar9[Math.round((x - min)/(max - min)*colors.solar9.length)]); - for(var ix = 0; ix < means.length; ix++) { + const color = means.map((x) => { + return colors.solar9[Math.round((x - min) / (max - min) * colors.solar9.length)]; + }); + for (let ix = 0; ix < means.length; ix++) { context.fillStyle = color[ix]; context.fillRect(0, yoffset, width, pixelsPer); yoffset += pixelsPer; @@ -94,28 +97,29 @@ class QuantitativePainter { class TextPainter { paint(context, width, height, pixelsPer, yoffset, groupedData) { - if(pixelsPer < 4) { + if (pixelsPer < 4) { return; } groupedData.forEach((group) => { - var text = group[0]; // We only draw text if zoomed in so there's a single element per group - var fontArgs = context.font.split(' '); - var fontSize = Math.min(pixelsPer, 12); + const text = group[0]; // We only draw text if zoomed in so there's a single element per group + const fontArgs = context.font.split(' '); + const fontSize = Math.min(pixelsPer, 12); context.font = fontSize + 'px ' + fontArgs[fontArgs.length - 1]; - context.fillText(text, 1, yoffset + pixelsPer/2 + fontSize/2 - 1); + context.fillText(text, 1, yoffset + pixelsPer / 2 + fontSize / 2 - 1); yoffset += pixelsPer; }); } } + class TextAlwaysPainter { paint(context, width, height, pixelsPer, yoffset, groupedData) { groupedData.forEach((group) => { - var text = _.find(group, (s) => s != ''); - if(text != undefined) { - var fontArgs = context.font.split(' '); - var fontSize = 10; + const text = _.find(group, (s) => { return s !== ''; }); + if (text !== undefined) { + const fontArgs = context.font.split(' '); + const fontSize = 10; context.font = fontSize + 'px ' + fontArgs[fontArgs.length - 1]; - context.fillText(text, 1, yoffset + pixelsPer/2 + fontSize/2 - 1); + context.fillText(text, 1, yoffset + pixelsPer / 2 + fontSize / 2 - 1); } yoffset += pixelsPer; }); @@ -124,103 +128,93 @@ class TextAlwaysPainter { export class Sparkline extends React.Component { constructor(props) { - super(props); + super(props); + + this.paint = this.paint.bind(this); } componentDidMount() { - var el = findDOMNode(this); - this.retina_scale(el); // Make sure we get a sharp canvas on Retina displays - var context = el.getContext('2d'); - this.paint(context); + this.paint(); } componentDidUpdate() { - var el = findDOMNode(this); - this.retina_scale(el); // Make sure we get a sharp canvas on Retina displays - var context = el.getContext('2d'); - context.clearRect(0, 0, this.props.width, this.props.height); - this.paint(context); - } - - componentWillUnmount() { - } - - retina_scale(el) { - var context = el.getContext('2d'); - var ratio = window.devicePixelRatio || 1; - el.style.width = this.props.width + "px"; - el.style.height = this.props.height + "px"; - el.width = this.props.width * ratio; - el.height = this.props.height * ratio; - context.scale(ratio, ratio); + this.paint(); } - paint(context) { - - if(this.props.data == undefined) { + paint(context, width, height) { + if (this.props.data === undefined) { return; } - context.save(); - // Width is the narrow dimension even if rotated - var width = this.props.width; - var height = this.props.height; - if(this.props.orientation == 'horizontal') { + + if (this.props.orientation === 'horizontal') { context.translate(0, this.props.height); - context.rotate(-90*Math.PI/180); - width = this.props.height; - height = this.props.width; + context.rotate(-90 * Math.PI / 180); + let t = width; + width = height; + height = t; } - var fractionalPixel = this.props.dataRange[0] % 1; - var pixelsPer = (this.props.screenRange[1] - this.props.screenRange[0])/(this.props.dataRange[1] - this.props.dataRange[0]); - var yoffset = this.props.screenRange[0] - fractionalPixel*pixelsPer; + + context.save(); + const fractionalPixel = this.props.dataRange[0] % 1; + const pixelsPer = width / (this.props.dataRange[1] - this.props.dataRange[0]); + const yoffset =- fractionalPixel * pixelsPer; // Group the data - var data = []; - for(var ix = 0; ix < this.props.dataRange[1] - this.props.dataRange[0]; ix++) { - var pixel = Math.round(ix*pixelsPer); - if(data[pixel] == undefined) { + const data = []; + for (let ix = 0; ix < this.props.dataRange[1] - this.props.dataRange[0]; ix++) { + const pixel = Math.round(ix * pixelsPer); + if (data[pixel] === undefined) { data[pixel] = []; } data[pixel].push(this.props.data[Math.floor(ix + this.props.dataRange[0])]); } // Which painter should we use? - var painter = new TextPainter(); - if(this.props.mode == 'TextAlways') { - painter = new TextAlwaysPainter(); - } - if(this.props.mode == 'Categorical') { - painter = new CategoriesPainter(this.props.data); + let painter = null; + switch (this.props.mode) { + case 'TextAlways': + painter = new TextAlwaysPainter(); + break; + case 'Categorical': + painter = new CategoriesPainter(this.props.data); + break; + case 'Bars': + painter = new BarPainter(); + break; + case 'Heatmap': + painter = new QuantitativePainter(); + break; + default: + painter = new TextPainter(); } - if(this.props.mode == 'Bars') { - painter = new BarPainter(this.props.data); + if (painter){ + painter.paint(context, width, height, Math.max(Math.floor(pixelsPer), 1), yoffset, data); } - if(this.props.mode == 'Heatmap') { - painter = new QuantitativePainter(); - } - painter.paint(context, width, height, Math.max(Math.floor(pixelsPer), 1), yoffset, data); context.restore(); } - render() { - if(this.props.orientation == "vertical") { - return ( - - ); - } + render() { return ( - +
+ +
); } } Sparkline.propTypes = { - orientation: PropTypes.string.isRequired, - mode: PropTypes.string.isRequired, - width: PropTypes.number.isRequired, - height: PropTypes.number.isRequired, - data: PropTypes.array, - dataRange: PropTypes.arrayOf(PropTypes.number).isRequired, - screenRange: PropTypes.arrayOf(PropTypes.number).isRequired - }; + orientation: PropTypes.string.isRequired, + mode: PropTypes.string.isRequired, + width: PropTypes.number, + height: PropTypes.number, + data: PropTypes.array, + dataRange: PropTypes.arrayOf(PropTypes.number).isRequired, + //screenRange: PropTypes.arrayOf(PropTypes.number).isRequired, +}; diff --git a/client/css/react-select.css b/client/css/react-select.css deleted file mode 100644 index fe06750..0000000 --- a/client/css/react-select.css +++ /dev/null @@ -1,353 +0,0 @@ -/** - * React Select - * ============ - * Created by Jed Watson and Joss Mackison for KeystoneJS, http://www.keystonejs.com/ - * https://twitter.com/jedwatson https://twitter.com/jossmackison https://twitter.com/keystonejs - * MIT License: https://github.com/keystonejs/react-select -*/ -.Select { - position: relative; -} -.Select, -.Select div, -.Select input, -.Select span { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.Select.is-disabled > .Select-control { - background-color: #f9f9f9; -} -.Select.is-disabled > .Select-control:hover { - box-shadow: none; -} -.Select.is-disabled .Select-arrow-zone { - cursor: default; - pointer-events: none; -} -.Select-control { - background-color: #fff; - border-color: #d9d9d9 #ccc #b3b3b3; - border-radius: 4px; - border: 1px solid #ccc; - color: #333; - cursor: default; - display: table; - height: 36px; - outline: none; - overflow: hidden; - position: relative; - width: 100%; -} -.Select-control:hover { - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); -} -.is-searchable.is-open > .Select-control { - cursor: text; -} -.is-open > .Select-control { - border-bottom-right-radius: 0; - border-bottom-left-radius: 0; - background: #fff; - border-color: #b3b3b3 #ccc #d9d9d9; -} -.is-open > .Select-control > .Select-arrow { - border-color: transparent transparent #999; - border-width: 0 5px 5px; -} -.is-searchable.is-focused:not(.is-open) > .Select-control { - cursor: text; -} -.is-focused:not(.is-open) > .Select-control { - border-color: #007eff; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 3px rgba(0, 126, 255, 0.1); -} -.Select-placeholder, -.Select--single > .Select-control .Select-value { - bottom: 0; - color: #aaa; - left: 0; - line-height: 34px; - padding-left: 10px; - padding-right: 10px; - position: absolute; - right: 0; - top: 0; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.has-value.Select--single > .Select-control > .Select-value .Select-value-label, -.has-value.is-pseudo-focused.Select--single > .Select-control > .Select-value .Select-value-label { - color: #333; -} -.has-value.Select--single > .Select-control > .Select-value a.Select-value-label, -.has-value.is-pseudo-focused.Select--single > .Select-control > .Select-value a.Select-value-label { - cursor: pointer; - text-decoration: none; -} -.has-value.Select--single > .Select-control > .Select-value a.Select-value-label:hover, -.has-value.is-pseudo-focused.Select--single > .Select-control > .Select-value a.Select-value-label:hover, -.has-value.Select--single > .Select-control > .Select-value a.Select-value-label:focus, -.has-value.is-pseudo-focused.Select--single > .Select-control > .Select-value a.Select-value-label:focus { - color: #007eff; - outline: none; - text-decoration: underline; -} -.Select-input { - height: 34px; - padding-left: 10px; - padding-right: 10px; - vertical-align: middle; -} -.Select-input > input { - width: 100%; - background: none transparent; - border: 0 none; - box-shadow: none; - cursor: default; - display: inline-block; - font-family: inherit; - font-size: inherit; - margin: 0; - outline: none; - line-height: 14px; - /* For IE 8 compatibility */ - padding: 8px 0 12px; - /* For IE 8 compatibility */ - -webkit-appearance: none; -} -.is-focused .Select-input > input { - cursor: text; -} -.has-value.is-pseudo-focused .Select-input { - opacity: 0; -} -.Select-control:not(.is-searchable) > .Select-input { - outline: none; -} -.Select-loading-zone { - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 16px; -} -.Select-loading { - -webkit-animation: Select-animation-spin 400ms infinite linear; - -o-animation: Select-animation-spin 400ms infinite linear; - animation: Select-animation-spin 400ms infinite linear; - width: 16px; - height: 16px; - box-sizing: border-box; - border-radius: 50%; - border: 2px solid #ccc; - border-right-color: #333; - display: inline-block; - position: relative; - vertical-align: middle; -} -.Select-clear-zone { - -webkit-animation: Select-animation-fadeIn 200ms; - -o-animation: Select-animation-fadeIn 200ms; - animation: Select-animation-fadeIn 200ms; - color: #999; - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 17px; -} -.Select-clear-zone:hover { - color: #D0021B; -} -.Select-clear { - display: inline-block; - font-size: 18px; - line-height: 1; -} -.Select--multi .Select-clear-zone { - width: 17px; -} -.Select-arrow-zone { - cursor: pointer; - display: table-cell; - position: relative; - text-align: center; - vertical-align: middle; - width: 25px; - padding-right: 5px; -} -.Select-arrow { - border-color: #999 transparent transparent; - border-style: solid; - border-width: 5px 5px 2.5px; - display: inline-block; - height: 0; - width: 0; -} -.is-open .Select-arrow, -.Select-arrow-zone:hover > .Select-arrow { - border-top-color: #666; -} -@-webkit-keyframes Select-animation-fadeIn { - from { - opacity: 0; - } - to { - opacity: 1; - } -} -@keyframes Select-animation-fadeIn { - from { - opacity: 0; - } - to { - opacity: 1; - } -} -.Select-menu-outer { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; - background-color: #fff; - border: 1px solid #ccc; - border-top-color: #e6e6e6; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); - box-sizing: border-box; - margin-top: -1px; - max-height: 200px; - position: absolute; - top: 100%; - width: 100%; - z-index: 1; - -webkit-overflow-scrolling: touch; -} -.Select-menu { - max-height: 198px; - overflow-y: auto; -} -.Select-option { - box-sizing: border-box; - background-color: #fff; - color: #666666; - cursor: pointer; - display: block; - padding: 8px 10px; -} -.Select-option:last-child { - border-bottom-right-radius: 4px; - border-bottom-left-radius: 4px; -} -.Select-option.is-selected { - background-color: #f5faff; - /* Fallback color for IE 8 */ - background-color: rgba(0, 126, 255, 0.04); - color: #333; -} -.Select-option.is-focused { - background-color: #ebf5ff; - /* Fallback color for IE 8 */ - background-color: rgba(0, 126, 255, 0.08); - color: #333; -} -.Select-option.is-disabled { - color: #cccccc; - cursor: default; -} -.Select-noresults { - box-sizing: border-box; - color: #999999; - cursor: default; - display: block; - padding: 8px 10px; -} -.Select--multi .Select-input { - vertical-align: middle; - margin-left: 10px; - padding: 0; -} -.Select--multi.has-value .Select-input { - margin-left: 5px; -} -.Select--multi .Select-value { - background-color: #ebf5ff; - /* Fallback color for IE 8 */ - background-color: rgba(0, 126, 255, 0.08); - border-radius: 2px; - border: 1px solid rgba(0, 126, 255, 0.24); - color: #007eff; - display: inline-block; - font-size: 0.9em; - line-height: 1.4; - margin-left: 5px; - margin-top: 5px; - vertical-align: top; -} -.Select--multi .Select-value-icon, -.Select--multi .Select-value-label { - display: inline-block; - vertical-align: middle; -} -.Select--multi .Select-value-label { - border-bottom-right-radius: 2px; - border-top-right-radius: 2px; - cursor: default; - padding: 2px 5px; -} -.Select--multi a.Select-value-label { - color: #007eff; - cursor: pointer; - text-decoration: none; -} -.Select--multi a.Select-value-label:hover { - text-decoration: underline; -} -.Select--multi .Select-value-icon { - cursor: pointer; - border-bottom-left-radius: 2px; - border-top-left-radius: 2px; - border-right: 1px solid #c2e0ff; - /* Fallback color for IE 8 */ - border-right: 1px solid rgba(0, 126, 255, 0.24); - padding: 1px 5px 3px; -} -.Select--multi .Select-value-icon:hover, -.Select--multi .Select-value-icon:focus { - background-color: #d8eafd; - /* Fallback color for IE 8 */ - background-color: rgba(0, 113, 230, 0.08); - color: #0071e6; -} -.Select--multi .Select-value-icon:active { - background-color: #c2e0ff; - /* Fallback color for IE 8 */ - background-color: rgba(0, 126, 255, 0.24); -} -.Select--multi.is-disabled .Select-value { - background-color: #fcfcfc; - border: 1px solid #e3e3e3; - color: #333; -} -.Select--multi.is-disabled .Select-value-icon { - cursor: not-allowed; - border-right: 1px solid #e3e3e3; -} -.Select--multi.is-disabled .Select-value-icon:hover, -.Select--multi.is-disabled .Select-value-icon:focus, -.Select--multi.is-disabled .Select-value-icon:active { - background-color: #fcfcfc; -} -@keyframes Select-animation-spin { - to { - transform: rotate(1turn); - } -} -@-webkit-keyframes Select-animation-spin { - to { - -webkit-transform: rotate(1turn); - } -} diff --git a/client/css/react-select.min.css b/client/css/react-select.min.css new file mode 100644 index 0000000..8fac97f --- /dev/null +++ b/client/css/react-select.min.css @@ -0,0 +1 @@ +.Select,.Select-control{position:relative}.Select,.Select div,.Select input,.Select span{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.Select.is-disabled>.Select-control{background-color:#f6f6f6}.Select.is-disabled .Select-arrow-zone{cursor:default;pointer-events:none}.Select-control{background-color:#fff;border-radius:4px;border:1px solid #ccc;color:#333;cursor:default;display:table;height:36px;outline:0;overflow:hidden;width:100%}.is-searchable.is-focused:not(.is-open)>.Select-control,.is-searchable.is-open>.Select-control{cursor:text}.Select-placeholder,.Select-value{left:0;position:absolute;top:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Select-control:hover{box-shadow:0 1px 0 rgba(0,0,0,.06)}.is-open>.Select-control{border-bottom-right-radius:0;border-bottom-left-radius:0;background:#fff;border-color:#b3b3b3 #ccc #d9d9d9}.is-open>.Select-control>.Select-arrow{border-color:transparent transparent #999;border-width:0 5px 5px}.is-focused:not(.is-open)>.Select-control{border-color:#08c #0099e6 #0099e6;box-shadow:inset 0 1px 2px rgba(0,0,0,.1),0 0 5px -1px rgba(0,136,204,.5)}.Select-placeholder{bottom:0;color:#aaa;line-height:34px;padding-left:10px;padding-right:10px;right:0}.has-value>.Select-control>.Select-placeholder{color:#333}.Select-value{color:#aaa;padding:8px 52px 8px 10px;right:-15px}.Select-arrow-zone,.Select-clear-zone,.Select-loading,.Select-loading-zone{position:relative;vertical-align:middle}.has-value>.Select-control>.Select-value{color:#333}.Select-input{height:34px;padding-left:10px;padding-right:10px;vertical-align:middle}.Select-input>input{background:none;border:0;box-shadow:none;cursor:default;display:inline-block;font-family:inherit;font-size:inherit;height:34px;margin:0;outline:0;padding:0;-webkit-appearance:none}.is-focused .Select-input>input{cursor:text}.Select-control:not(.is-searchable)>.Select-input{outline:0}.Select-loading-zone{cursor:pointer;display:table-cell;text-align:center;width:16px}.Select-loading{-webkit-animation:Select-animation-spin .4s infinite linear;-o-animation:Select-animation-spin .4s infinite linear;animation:Select-animation-spin .4s infinite linear;width:16px;height:16px;box-sizing:border-box;border-radius:50%;border:2px solid #ccc;border-right-color:#333;display:inline-block}.Select-clear-zone{-webkit-animation:Select-animation-fadeIn .2s;-o-animation:Select-animation-fadeIn .2s;animation:Select-animation-fadeIn .2s;color:#999;cursor:pointer;display:table-cell;text-align:center;width:17px}.Select-clear-zone:hover{color:#D0021B}.Select-clear{display:inline-block;font-size:18px;line-height:1}.Select--multi .Select-clear-zone{width:17px}.Select-arrow-zone{cursor:pointer;display:table-cell;text-align:center;width:25px;padding-right:5px}.Select-arrow{border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 2.5px;display:inline-block;height:0;width:0}.Select-arrow-zone:hover>.Select-arrow,.is-open .Select-arrow{border-top-color:#666}@-webkit-keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}@keyframes Select-animation-fadeIn{from{opacity:0}to{opacity:1}}.Select-menu-outer{border-bottom-right-radius:4px;border-bottom-left-radius:4px;background-color:#fff;border:1px solid #ccc;border-top-color:#e6e6e6;box-shadow:0 1px 0 rgba(0,0,0,.06);box-sizing:border-box;margin-top:-1px;max-height:200px;position:absolute;top:100%;width:100%;z-index:1000;-webkit-overflow-scrolling:touch}.Select-menu{max-height:198px;overflow-y:auto}.Select-option{box-sizing:border-box;color:#666;cursor:pointer;display:block;padding:8px 10px}.Select-option:last-child{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.Select-option.is-focused{background-color:#f2f9fc;color:#333}.Select-option.is-disabled{color:#ccc;cursor:not-allowed}.Select-noresults,.Select-search-prompt,.Select-searching{box-sizing:border-box;color:#999;cursor:default;display:block;padding:8px 10px}.Select--multi .Select-input{vertical-align:middle;margin-left:10px;padding:0}.Select--multi.has-value .Select-input,.Select-item{margin-left:5px}.Select-item{background-color:#f2f9fc;border-radius:2px;border:1px solid #c9e6f2;color:#08c;display:inline-block;font-size:.9em;margin-top:5px;vertical-align:top}.Select-item-icon,.Select-item-label{display:inline-block;vertical-align:middle}.Select-item-label{border-bottom-right-radius:2px;border-top-right-radius:2px;cursor:default;padding:2px 5px}.Select-item-label .Select-item-label__a{color:#08c;cursor:pointer}.Select-item-icon{cursor:pointer;border-bottom-left-radius:2px;border-top-left-radius:2px;border-right:1px solid #c9e6f2;padding:1px 5px 3px}.Select-item-icon:focus,.Select-item-icon:hover{background-color:#ddeff7;color:#0077b3}.Select-item-icon:active{background-color:#c9e6f2}.Select--multi.is-disabled .Select-item{background-color:#f2f2f2;border:1px solid #d9d9d9;color:#888}.Select--multi.is-disabled .Select-item-icon{cursor:not-allowed;border-right:1px solid #d9d9d9}.Select--multi.is-disabled .Select-item-icon:active,.Select--multi.is-disabled .Select-item-icon:focus,.Select--multi.is-disabled .Select-item-icon:hover{background-color:#f2f2f2}@keyframes Select-animation-spin{to{transform:rotate(1turn)}}@-webkit-keyframes Select-animation-spin{to{-webkit-transform:rotate(1turn)}} \ No newline at end of file diff --git a/client/index.html b/client/index.html index a42b905..c9f9ada 100644 --- a/client/index.html +++ b/client/index.html @@ -9,10 +9,8 @@ - -
-
-
+ +
diff --git a/client/js/bootstrap.min.js b/client/js/bootstrap.min.js deleted file mode 100644 index e79c065..0000000 --- a/client/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.6 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>2)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.6",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.6",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.6",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.6",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.6",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.6",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.6",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.6",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/client/js/jquery.min.js b/client/js/jquery.min.js deleted file mode 100644 index fc356ee..0000000 --- a/client/js/jquery.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ -return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("